Skip to content

Official repository for Aptos smart contracts used by the Cross-Chain Transfer Protocol

Notifications You must be signed in to change notification settings

circlefin/aptos-cctp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aptos-cctp-private

Official repository for Aptos smart contracts used by the Cross-Chain Transfer Protocol.


Getting Started

Prerequisites

Before you can start working with the contracts in this repository, make sure you have the following prerequisites installed:

  1. Run make setup to install required dependencies (Aptos CLI, Import Git submodules).
  2. IntelliJ is recommended for developing Move contracts. Install the Move Intellij IDE Plugin.

Testing

Run Aptos and EVM Local Network

./docker-start-containers.sh

Run Unit Tests for All Package Modules

make test

Running E2E Tests

# Install Dependencies
yarn install
# Run e2e tests
yarn test:e2e

Running Example Scripts on Testnet

  1. Rename .env.example to .env and fill in the required environment variables.
  2. Run the example script for Base/EVM -> Aptos
yarn receive-message-example
  1. Run the example script for Aptos -> Base/EVM
yarn deposit-for-burn-example

Deployment

  1. Create a deployer keypair and fund it with APT
  2. Deploy MessageTransmitter and TokenMessengerMinter package
yarn deploy --privateKey=<key> --rpc=<rpcUrl>  --aptosExtensionsPackageId=<packageId> --stablecoinPackageId=<packageId>
  1. 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>

Upgrading

  1. 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
  1. Execute Tx for upgrading
yarn upgrade-pkg --privateKey=<upgradeAdminKey> --rpc=<rpcUrl> --payloadFilePath=upgrade.json --aptosExtensionsPackageId=<packageId> --packageId=<packageId>