Releases of the packages contained in this monorepo follow the SemVer convention.
![NOTE] The
contractsandbindingsare independently versioned withX.Y.ZandA.B.C, respectively. Both versions can include release candidates (suffixed with-rc.?).
We distinguish between three release cases:
-
Deploying a new ERC20 forwarder version to multiple new chains resulting in a new
contracts/X.Y.Zversionbindings/A.0.0version
-
Deploying an existing ERC20 forwarder version to multiple new chains resulting in a new
bindings/A.B.0version
-
Maintaining the bindings resulting in a new
bindings/A.B.Cversion
-
Visit https://www.soliditylang.org/ and check that Solidity compiler version used in
contracts/foundry.tomlhas no known vulnerabilities. -
Install the dependencies with
just contracts-deps
-
Check that the dependencies are up-to-date and have no known vulnerabilities in the dependencies
-
Check that the deployer wallet is funded and add it to
castwithcast wallet import deployer --private-key <PRIVATE_KEY>
or
cast wallet import deployer --mnemonic <MNEMONICC>
-
Set
IS_TEST_DEPLOYMENTtofalseto deterministically deploy the ERC20 forwarder.export IS_TEST_DEPLOYMENT=false -
Check that the emergency committee address is set up correctly and export it with
export EMERGENCY_COMMITTEE=<ADDRESS>
-
Set the Alchemy RPC provider by exporting
export ALCHEMY_API_KEY=<KEY>
-
Set the Etherscan key
export ETHERSCAN_API_KEY=<KEY>
-
Bump the
_ERC20_FORWARDER_VERSIONconstant in./contracts/src/libs/Versioning.solto the new version number following SemVer. -
Remove all chain name and address pairs in the
pub fn erc20_forwarder_deployments_map() -> HashMap<NamedChain, Address>
function in
./bindings/src/addresses.rs.
-
Run
just contracts-build -
Run the test suite with
just contracts-test
For each chain, you want to deploy to, do the following:
-
Simulate the deployment by running
just contracts-simulate <TOKEN_TRANSFER_CIRCUIT_ID> <CHAIN_NAME> <PROTOCOL_ADAPTER_ADDRESS>
where
<TOKEN_TRANSFER_CIRCUIT_ID>can be found in theanoma/anomapay-backendtransfer_libraryand<PROTOCOL_ADAPTER_ADDRESS>can be found inanoma/pa-evmbindings. Make sure that you are using the right versions, respectively! -
After successful simulation, deploy the contract by running
just contracts-deploy deployer <TOKEN_TRANSFER_CIRCUIT_ID> <CHAIN_NAME> <PROTOCOL_ADAPTER_ADDRESS>
-
Export the address of the newly deployed ERC20 forwarder contract with
export FWD_ADDRESS=<ADDRESS>
-
Verify the contract on
-
sourcify
just contracts-verify-sourcify <FWD_ADDRESS> <CHAIN>
-
Etherscan
just contracts-verify-etherscan <FWD_ADDRESS> <CHAIN>
and check that the verification worked (e.g., on https://sourcify.dev/#/lookup).
-
-
Add the new address and chain name pairs in the
pub fn erc20_forwarder_deployments_map() -> HashMap<NamedChain, Address>
function in
./bindings/src/addresses.rs. -
Change the
bindingspackage version number in the./bindings/Cargo.tomlfile toA.0.0, whereAis the lastMAJORversion number incremented by 1. -
Clean the bindings build with
just bindings-clean. -
Regenerate the bindings with
just contracts-gen-bindings. -
Run
just bindings-buildand check that theCargo.lockfile reflects the version number change. -
Run the tests with
just bindings-test. -
After merging, create new tags for:
-
contracts/X.Y.ZwhereX.Y.Zmust match the ERC20 forwarder version number and -
bindings/A.0.0tag, whereAis the lastMAJORversion incremented by 1.
-
-
Create new GH releases for both packages.
-
Publish the
contractspackage on https://soldeer.xyz/ withjust contracts-publish <X.Y.Z> --dry-run
where
<X.Y.Z>is the_ERC20_FORWARDER_VERSIONnumber and check the resultingcontracts.zipfile. If everything is correct, remove the--dry-runflag and publish the package.
-
Publish the
anomapay-erc20-forwarder-bindingspackage on https://crates.io/ withjust bindings-publish --dry-run
and check the result. If everything is correct, remove the
--dry-runflag and publish the package.
-
Visit https://www.soliditylang.org/ and check that Solidity compiler version used in
contracts/foundry.tomlhas no known vulnerabilities. -
Install the dependencies with
just contracts-deps
-
Check that the dependencies are up-to-date and have no known vulnerabilities in the dependencies
-
Check that the bindings are up-to-date with
just bindings-check
-
Checkout a new git branch branching off from
main. -
Check that there are no staged or unstaged changes by running
git status. -
Check that the deployer wallet is funded and add it to
castwithcast wallet import deployer --private-key <PRIVATE_KEY>
or
cast wallet import deployer --mnemonic <MNEMONICC>
-
Set
IS_TEST_DEPLOYMENTtofalseto deterministically deploy the ERC20 forwarder.export IS_TEST_DEPLOYMENT=false -
Check that the emergency committee address is set up correctly and export it with
export EMERGENCY_COMMITTEE=<ADDRESS>
-
Set the Alchemy RPC provider by exporting
export ALCHEMY_API_KEY=<KEY>
-
Set the Etherscan key
export ETHERSCAN_API_KEY=<KEY>
-
Run
just contracts-build -
Run the test suite with
just contracts-test
For each new chain, you want to deploy to, do the following:
-
Simulate the deployment by running
just contracts-simulate <TOKEN_TRANSFER_CIRCUIT_ID> <CHAIN_NAME> <PROTOCOL_ADAPTER_ADDRESS>
where
<TOKEN_TRANSFER_CIRCUIT_ID>can be found in theanoma/anomapay-backendtransfer_libraryand<PROTOCOL_ADAPTER_ADDRESS>can be found inanoma/pa-evmbindings. Make sure that you are using the right versions, respectively! -
After successful simulation, deploy the contract by running
just contracts-deploy deployer <TOKEN_TRANSFER_CIRCUIT_ID> <CHAIN_NAME> <PROTOCOL_ADAPTER_ADDRESS>
-
Export the address of the newly deployed ERC20 forwarder contract with
export FWD_ADDRESS=<ADDRESS>
-
Verify the contract on
-
sourcify
just contracts-verify-sourcify <FWD_ADDRESS> <CHAIN>
-
Etherscan
just contracts-verify-etherscan <FWD_ADDRESS> <CHAIN>
and check that the verification worked (e.g., on https://sourcify.dev/#/lookup).
-
-
Add the new address and chain name pairs in the
pub fn protocol_adapter_deployments_map() -> HashMap<NamedChain, Address>
function in
./bindings/src/addresses.rs. -
Change the
bindingspackage version number in the./bindings/Cargo.tomlfile toA.B.0, whereAis the lastMAJORversion andBis the lastMINORversion number incremented by 1. -
Run
just bindings-buildand check that theCargo.lockfile reflects the version number change. -
Run the tests with
just bindings-test. -
After merging, create a new
bindings/A.B.0tag, whereAis the lastMAJORversion andBis the lastMINORversion number incremented by 1. -
Create a new GH release.
-
Publish the
anomapay-erc20-forwarder-bindingspackage on https://crates.io/ withjust bindings-publish --dry-run
and check the result. If everything is correct, remove the
--dry-runflag and publish the package.
-
Check that the bindings are up-to-date with
just bindings-check
-
Checkout a new git branch branching off from
main. -
Check that there are no staged or unstaged changes by running
git status.
-
Change the
bindingspackage version number in the./bindings/Cargo.tomlfile toA.B.C, whereAandBare the lastMAJORandMINORversion numbers andCis the lastPATCHversion number incremented by 1. -
Run
just bindings-buildand check that theCargo.lockfile reflects the version number change. -
Run the tests with
just bindings-test. -
After merging, create a new
bindings/A.B.Ctag, whereAandBare the lastMAJORandMINORversion numbers, respectively, andCis the lastPATCHversion number incremented by 1. -
Create a new GH release.
-
Publish the
anomapay-erc20-forwarder-bindingspackage on https://crates.io/ withjust bindings-publish --dry-run
and check the result. If everything is correct, remove the
--dry-runflag and publish the package.