ICM smart contracts for DERA chain, including:
- ValidatorManager
- Teleporter
- ICTT (unused)
The repository is forked from Avalanche
contracts/governance/includes contracts related to L1 governance.ictt/Interchain Token Transfer contracts. Facilitates the transfer of tokens among L1s.teleporter/includesTeleporterMessenger, which serves as the interface for most contracts to use ICM.registry/includes a registry contract for managing different versions ofTeleporterMessenger.
validator-manager/includes contracts for managing the validator set of an L1.
abi-bindings/includes Go ABI bindings for the contracts incontracts/.audits/includes all audits conducted on contracts in this repository.tests/includes integration tests for the contracts incontracts/, written using the Ginkgo testing framework.utils/includes Go utility functions for interacting with the contracts incontracts/. Included are Golang scripts to derive the expected EVM contract address deployed from a given EOA at a specific nonce, and also construct a transaction to deploy provided byte code to the same address on any EVM chain using Nick's method.scripts/includes bash scripts for interacting with TeleporterMessenger in various environments, as well as utility scripts.abi_bindings.shgenerates ABI bindings for the contracts incontracts/and outputs them toabi-bindings/.lint.shperforms Solidity and Golang linting.
- Determine the
SUBNETID_HEXusing the ICM relayer tools (command mode)
$ ./bin/cli convertID --source-id=SUBNETID_CB58prepend the result with 0x to get the final SUBNETID_HEX
*Note: the
SUBNETID_CB58is retrieved usingavalanche blockchain describecommand.
-
Create
.envfile from template and fill in necessary information. -
Get all submodules:
git submodule update --init --recursive
$ forge build$ forge test- The ValidatorManager and Teleporter smart contracts are deployed during L1 deployment process, thus initial deployment is not necessary.
- Increase monotonically the
VERSION_NUMBERincontracts/validator-manager/NativeTokenStakingManager.sol
function initialize(
PoSValidatorManagerSettings calldata settings
) external reinitializer(<VERSION_NUMBER>) {
__NativeTokenStakingManager_init(settings);
}- Compile
$ forge clean && forge build- Upgrade ValidatorManager implementation
$ forge script contracts/validator-manager/scripts/UpgradeScript.s.sol \
--rpc-url RPC_URL --broadcast -vvvvNote: Should dry-run before actual deployment by omitting the
--broadcastargument from the command
- Confirm the new implementation using
utils/validator-manager-rscommand
$ cd utils/validator-manager-rs
$ cargo run -p cli -- admin proxy-infoValidatorManager CLI is proprietary tools developed by DERA team to interact with ValidatorManager and Teleporter smart contracts. See the CLI documentation for more details.