Official repository for Aptos smart contracts used by the Cross-Chain Transfer Protocol.
Before you can start working with the contracts in this repository, make sure you have the following prerequisites installed:
- Run
make setup
to install required dependencies (Aptos CLI, Import Git submodules). - IntelliJ is recommended for developing Move contracts. Install the Move Intellij IDE Plugin.
./docker-start-containers.sh
make test
# Install Dependencies
yarn install
# Run e2e tests
yarn test:e2e
- Rename .env.example to .env and fill in the required environment variables.
- Run the example script for Base/EVM -> Aptos
yarn receive-message-example
- Run the example script for Aptos -> Base/EVM
yarn deposit-for-burn-example
- Create a deployer keypair and fund it with APT
- Deploy MessageTransmitter and TokenMessengerMinter package
yarn deploy --privateKey=<key> --rpc=<rpcUrl> --aptosExtensionsPackageId=<packageId> --stablecoinPackageId=<packageId>
- Verify source bytecode
# Message Transmitter
yarn verify-pkg --packageName=message_transmitter --rpc=<rpcUrl> --packageId=<MessageTransmitterPackageId> --namedDeps aptos_extensions=<packageId>,deployer=<deployerAccountAddress>
# TokenMessengerMinter
yarn verify-pkg --packageName=token_messenger_minter --rpc=<rpcUrl> --packageId=<TokenMessengerMinterPackageId> --namedDeps aptos_extensions=<packageId>,deployer=<deployerAccountAddress>,message_transmitter=<packageId>,stablecoin=<packageId>
- Build payload for publishing
# Message Transmitter
aptos move build-publish-payload --package-dir packages/message_transmitter --named-addresses deployer=<deployerAccountAddress>,aptos_extensions=<packageId>,message_transmitter=<packageId> --json-output-file upgrade.json
# Token Messenger Minter
aptos move build-publish-payload --package-dir packages/token_messenger_minter --named-addresses deployer=<deployerAccountAddress>,aptos_extensions=<packageId>,message_transmitter=<packageId>,stablecoin=<packageId>,token_messenger_minter=<packageId> --json-output-file upgrade.json
- Execute Tx for upgrading
yarn upgrade-pkg --privateKey=<upgradeAdminKey> --rpc=<rpcUrl> --payloadFilePath=upgrade.json --aptosExtensionsPackageId=<packageId> --packageId=<packageId>