Welcome to this comprehensive guide that outlines the deployment process for InterchainProposalExecutor
and (optionally) InterchainProposalSender
contracts. We aim to ensure a seamless and reliable deployment experience.
Our deployment script adopts the CREATE3
approach, an innovative strategy that ensures the deployed contract address remains consistent across varying EVM chains.
This methodology enhances consistency and synchronization across chains, streamlining the deployment process and reducing the complexity of contract management.
Let's dive into the steps required.
Before we begin, ensure the following steps are complete:
- Install the necessary packages using the command:
yarn install
. - Set up config variables. This can be done by creating a
/info/keys.json
file based on the provided/info/keys.example.json
.
Here are the steps to deploy the contracts:
- To deploy the
InterchainProposalExecutor
contract exclusively, use the following command:
yarn deploy --tags InterchainProposalExecutor --network {chainName}
- To deploy both
InterchainProposalExecutor
andInterchainProposalSender
contracts, use the following command:
yarn deploy --network {chainName}
To verify your contract, run the following command:
yarn deploy --tags Verify --network {chainName}
You may need to whitelist certain contracts for your InterchainProposalExecutor
contract. Here's how you can do that:
- To whitelist the
InterchainProposalSender
contract, use the following command:
Replace {sourceChain}
, {sourceSenderAddress}
, and {chainName}
with your respective chain name, sender address, and network name.
yarn task whitelistSender {sourceChain} {sourceSenderAddress} --network {chainName}
Note: The {sourceSenderAddress} is optional. If not specified, it defaults to the InterchainProposalSender
contract address found in deployed.json.
- To whitelist the caller that calls the
InterchainProposalSender
contract (usually aTimelock
contract), use the following command:
Replace {sourceChain}
, {sourceCallerAddress}
, and {chainName}
with your respective chain name, caller address, and network name.
yarn task whitelistCaller {sourceChain} {sourceCallerAddress} --network {chainName}
Note:
- The chain name is case-sensitive, you must use the following doc as a reference:
- Please note that the
sourceSenderAddress
should be provided in a checksummed format, adhering to the EIP-55 standard. This means the address should be in the following format: "0x440e65EAAb7A23be8b1a61108643B2cff2E5A967" with the correct capitalization, rather than "0x440e65eaab7a23be8b1a61108643b2cff2e5a967". If you are utilizing ethers.js, acquiring a checksummed address is straightforward; simply usewallet.address
or call the getAddress function. If ethers.js is not in use, the checksummed address can be obtained from your Metamask wallet or by navigating to https://etherscan.io/address/{your_address} and copying the loaded address.
- testnet: https://docs.axelar.dev/dev/reference/testnet-chain-names
- mainnet: https://docs.axelar.dev/dev/reference/mainnet-chain-names
To confirm the successful deployment and functioning of your contracts, conduct an end-to-end test from initiating an interchain proposal on the source chain to its execution on the destination chain. Use the DummyState contract here to execute the proposal code. If the message updates correctly, the deployment is operational.
- Deploy the
DummyState
contract to the same chain as theInterchainProposalExecutor
contract.
yarn deploy --tags DummyState --network {chainName}
Example command:
yarn deploy --tags DummyState --network polygon
- Confirm the accuracy of whitelisted addresses:
- The whitelisted sender should reference the
InterchainProposalSender
contract. - The whitelisted caller should reference your signer account provided in
/info/keys.json
.
Remember: chain names are case-sensitive.
- Initiate the
executeDummyState
task on the source chain:
yarn task executeDummyState {destinationChain} {message} --network {srcChainName}
Example command:
yarn task executeDummyState Polygon "Hello From Avalanche" --network avalanche
This command sends a test proposal to the InterchainProposalSender
contract to update the DummyState
contract message on the destination chain. You can track the execution status via the axelarscan link printed upon completion.
- Verify the DummyState message
Upon execution completion, check the DummyState
contract message on the destination chain using:
yarn task readDummyState --network {destinationChain}
Example command:
yarn task readDummyState --network polygon
If the message updates successfully, your contract is functioning correctly.
Testnet: https://docs.axelar.dev/resources/testnet Mainnet: https://docs.axelar.dev/resources/mainnet