{"id":21850472,"url":"https://github.com/circlefin/evm-cctp-contracts","last_synced_at":"2025-04-13T05:04:42.501Z","repository":{"id":94752839,"uuid":"578663037","full_name":"circlefin/evm-cctp-contracts","owner":"circlefin","description":"Official repository for all EVM-compatible smart contracts used by the Cross-Chain Transfer Protocol","archived":false,"fork":false,"pushed_at":"2025-03-11T14:30:17.000Z","size":1889,"stargazers_count":141,"open_issues_count":14,"forks_count":75,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-13T05:04:03.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/circlefin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-15T15:31:03.000Z","updated_at":"2025-04-04T11:12:30.000Z","dependencies_parsed_at":"2023-04-25T22:47:33.961Z","dependency_job_id":"cf5bf455-d26e-4e7c-9904-3393ddf39e55","html_url":"https://github.com/circlefin/evm-cctp-contracts","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circlefin%2Fevm-cctp-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circlefin%2Fevm-cctp-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circlefin%2Fevm-cctp-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circlefin%2Fevm-cctp-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/circlefin","download_url":"https://codeload.github.com/circlefin/evm-cctp-contracts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T00:17:42.634Z","updated_at":"2025-04-13T05:04:42.470Z","avatar_url":"https://github.com/circlefin.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# evm-cctp-contracts\n\n## Prerequisites\n\n### Install dependencies\n\n- Run `git submodule update --init --recursive` to update/download all libraries.\n- Run `yarn install` to install any additional dependencies.\n\n### VSCode IDE Setup\n\n- Install solidity extension https://marketplace.visualstudio.com/items?itemName=juanblanco.solidity\n- Navigate to a .sol file\n- Right-click, select `Solidity: Change global compiler version (Remote)`\n\n![](./pictures/Solidity-Change-Compiler.png)\n\n- Select 0.7.6\n\n![](./pictures/Solidity-Compiler-Version.png)\n\n- Install solhint extension https://marketplace.visualstudio.com/items?itemName=idrabenia.solidity-solhint\n\n### Install Foundry\n\nInstall Foundry CLI (forge 0.2.0) from official [website](https://book.getfoundry.sh/getting-started/installation.html#on-linux-and-macos.).\n\n- To install a specific version, see [here](https://github.com/foundry-rs/foundry/blob/3f13a986e69c18ea19ce634fea00f4df6b3666b0/foundryup/README.md#usage).\n\n## Testing\n\n### Unit tests\n\nRun `forge test` to run test using installed forge cli or `make test` to run tests in docker container.\n\n### Run unit tests with debug logs\n\nLog level is controlled by the -v flag. For example, `forge test -vv` displays console.log() statements from within contracts. Highest verbosity is -vvvvv. More info: https://book.getfoundry.sh/forge/tests.html#logs-and-traces. Contracts that use console.log() must import lib/forge-std/src/console.sol.\n\n### Integration tests\n\nRun `make anvil-test` to setup `anvil` test node in docker container and run integration tests. There is an example in `anvil/` folder\n\n### Linting\n\nRun `yarn lint` to lint all `.sol` files in the `src` and `test` directories.\n\n### Static analysis\n\nRun `make analyze-{message-transmitter | message-transmitter-v2 | token-messenger-minter}` to set up Mythril dependency and run Mythril on all source files. If Mythril dependency has been installed, alternatively run `myth -v4 analyze $FILE_PATH --solc-json mythril.config.json --solv 0.7.6` to run static analysis on a `.sol` file at the given `$FILE_PATH`. Please note that this can take several minutes.\n\n### Continuous Integration using Github Actions\n\nWe use Github actions to run linter and all the tests. The workflow configuration can be found in [.github/workflows/ci.yml](.github/workflows/ci.yml)\n\n### Manual Triggering of the Olympix CI Workflow for Security Alerts\nYou can manually trigger the Olympix.ai Code Scanning workflow using the `workflow_dispatch` feature of GitHub Actions.\n1. Click on the `Actions` tab.\n2. In the left sidebar, select `Olympix Scan`.\n3. Select the branch \u0026 click on the `Run workflow` button.\n\n### Alternative Installations\n\n#### Docker + Foundry\n\nUse Docker to run Foundry commands. Run `make build` to build Foundry docker image. Then run `docker run --rm foundry \"\u003cCOMMAND\u003e\"` to run any [forge](https://book.getfoundry.sh/reference/forge/), [anvil](https://book.getfoundry.sh/reference/anvil/) or [cast](https://book.getfoundry.sh/reference/cast/) commands. There are some pre defined commands available in `Makefile` for testing and deploying contract on `anvil`. More info on Docker and Foundry [here](https://book.getfoundry.sh/tutorials/foundry-docker).\n\nℹ️ Note\n\n- Some machines (including those with M1 chips) may be unable to build the docker image locally. This is a known issue.\n\n## Deployment\n\n### V1\n\nThe contracts are deployed using [Forge Scripts](https://book.getfoundry.sh/tutorials/solidity-scripting). The script is located in [scripts/v1/deploy.s.sol](/scripts/v1/deploy.s.sol). Follow the below steps to deploy the contracts:\n\n1. Add the below environment variables to your [env](.env) file\n    - `MESSAGE_TRANSMITTER_DEPLOYER_KEY`\n    - `TOKEN_MESSENGER_DEPLOYER_KEY`\n    - `TOKEN_MINTER_DEPLOYER_KEY`\n    - `TOKEN_CONTROLLER_DEPLOYER_KEY`\n    - `ATTESTER_ADDRESS`\n    - `USDC_CONTRACT_ADDRESS`\n    - `REMOTE_USDC_CONTRACT_ADDRESS`\n    - `MESSAGE_TRANSMITTER_PAUSER_ADDRESS`\n    - `TOKEN_MINTER_PAUSER_ADDRESS`\n    - `MESSAGE_TRANSMITTER_RESCUER_ADDRESS`\n    - `TOKEN_MESSENGER_RESCUER_ADDRESS`\n    - `TOKEN_MINTER_RESCUER_ADDRESS`\n    - `TOKEN_CONTROLLER_ADDRESS`\n    - `DOMAIN`\n    - `REMOTE_DOMAIN`\n    - `BURN_LIMIT_PER_MESSAGE`\n\n    In addition, to link the remote bridge, one of two steps needs to be followed:\n    - Add the `REMOTE_TOKEN_MESSENGER_DEPLOYER` address to your [env](.env) file and run [scripts/precomputeRemoteMessengerAddress.py](/scripts/precomputeRemoteMessengerAddress.py) with argument `--REMOTE_RPC_URL` for the remote chain, which will automatically add the `REMOTE_TOKEN_MESSENGER_ADDRESS` to the .env file\n    - Manually add the `REMOTE_TOKEN_MESSENGER_ADDRESS` to your .env file.\n\n2. Run `make simulate-deploy RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to perform a dry run. *Note: Use address from one of the private keys (used for deploying) above as `sender`. It is used to deploy the shared libraries that contracts use*\n3. Run `make deploy RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to deploy the contracts\n\n### V2\n\n#### Create2Factory\n\nDeploy Create2Factory first if not yet deployed.\n\n1. Add the environment variable `CREATE2_FACTORY_DEPLOYER_KEY` to your [env](.env) file.\n2. Run `make simulate-deploy-create2-factory RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to perform a dry run.\n3. Run\n    ```make deploy-create2-factory RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e```\n  to deploy the Create2Factory.\n\n#### V2 Implementation Contracts\n\nDeploy the implementation contracts.\n\n1. Add the following [env](.env) variables\n\n    - `CREATE2_FACTORY_CONTRACT_ADDRESS`\n    - `CREATE2_FACTORY_OWNER_KEY`\n    - `TOKEN_MINTER_V2_OWNER_ADDRESS`\n    - `TOKEN_MINTER_V2_OWNER_KEY`\n    - `TOKEN_CONTROLLER_ADDRESS`\n    - `DOMAIN`\n    - `MESSAGE_BODY_VERSION`\n    - `VERSION`\n\n2. Run `make simulate-deploy-implementations-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to perform a dry run.\n\n3. Run\n    ```make deploy-implementations-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e```\n  to deploy MessageTransmitterV2, TokenMinterV2, and TokenMessengerV2.\n\n#### V2 Proxies\n\nThe proxies are deployed via `CREATE2` through Create2Factory. The scripts assumes the remote chains are EVM compatible and predicts that remote contracts will be deployed at the same addresses. Follow the below steps to deploy the contracts:\n\n1. Replace the environment variables in your [env](.env) file with the following:\n\n    Note: `REMOTE_DOMAINS`, `REMOTE_USDC_CONTRACT_ADDRESSES`, and `REMOTE_TOKEN_MESSENGER_V2_ADDRESSES` must all correspond 1:1:1 in order.\n\n    - `USDC_CONTRACT_ADDRESS`\n    - `TOKEN_CONTROLLER_ADDRESS`\n    - `REMOTE_DOMAINS`\n    - `REMOTE_USDC_CONTRACT_ADDRESSES`\n    - `REMOTE_TOKEN_MESSENGER_V2_ADDRESSES`\n    - `CREATE2_FACTORY_CONTRACT_ADDRESS`\n\n    - `MESSAGE_TRANSMITTER_V2_IMPLEMENTATION_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_OWNER_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_PAUSER_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_RESCUER_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_ATTESTER_MANAGER_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_ATTESTER_1_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_ATTESTER_2_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_PROXY_ADMIN_ADDRESS`\n\n    - `TOKEN_MINTER_V2_CONTRACT_ADDRESS`\n    - `TOKEN_MINTER_V2_PAUSER_ADDRESS`\n    - `TOKEN_MINTER_V2_RESCUER_ADDRESS`\n\n    - `TOKEN_MESSENGER_V2_IMPLEMENTATION_ADDRESS`\n    - `TOKEN_MESSENGER_V2_OWNER_ADDRESS`\n    - `TOKEN_MESSENGER_V2_RESCUER_ADDRESS`\n    - `TOKEN_MESSENGER_V2_FEE_RECIPIENT_ADDRESS`\n    - `TOKEN_MESSENGER_V2_DENYLISTER_ADDRESS`\n    - `TOKEN_MESSENGER_V2_PROXY_ADMIN_ADDRESS`\n\n    - `DOMAIN`\n    - `BURN_LIMIT_PER_MESSAGE`\n\n    - `CREATE2_FACTORY_OWNER_KEY`\n    - `TOKEN_CONTROLLER_KEY`\n    - `TOKEN_MINTER_V2_OWNER_KEY`\n\n2. Run `make simulate-deploy-proxies-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to perform a dry run.\n\n3. Run `make deploy-proxies-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to deploy the contracts\n\n4. ONLY perform steps 5-7 for additional remote resources NOT already configured above.\n\n5. Replace the environment variables in your [env](.env) file with the following. We'll just add one remote resource (e.g. adding remote token messenger and remote usdc contract addresses) at a time, so just pick any and then repeat these steps. This will need to be repeated for each remote chain:\n\n   - `TOKEN_MESSENGER_V2_OWNER_KEY`\n   - `TOKEN_CONTROLLER_KEY`\n   - `TOKEN_MESSENGER_V2_CONTRACT_ADDRESS`\n   - `TOKEN_MINTER_V2_CONTRACT_ADDRESS`\n   - `USDC_CONTRACT_ADDRESS`\n   - `REMOTE_USDC_CONTRACT_ADDRESS`\n   - `REMOTE_DOMAIN`\n\n6. Run `make simulate-setup-remote-resources-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to perform a dry run of adding remote resources.\n\n7. Run `make setup-remote-resources-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to setup the remote resources.\n\n**[Remaining steps are only for mainnet]**\n\n8. Replace the environment variables in your [env](.env) file with:\n\n    - `MESSAGE_TRANSMITTER_V2_CONTRACT_ADDRESS`\n    - `TOKEN_MESSENGER_V2_CONTRACT_ADDRESS`\n    - `TOKEN_MINTER_V2_CONTRACT_ADDRESS`\n    - `MESSAGE_TRANSMITTER_V2_OWNER_KEY`\n    - `TOKEN_MESSENGER_V2_OWNER_KEY`\n    - `TOKEN_MINTER_V2_OWNER_KEY`\n    - `MESSAGE_TRANSMITTER_V2_NEW_OWNER_ADDRESS`\n    - `TOKEN_MESSENGER_V2_NEW_OWNER_ADDRESS`\n    - `TOKEN_MINTER_V2_NEW_OWNER_ADDRESS`\n    - `NEW_TOKEN_CONTROLLER_ADDRESS`\n\n9. Run `make simulate-rotate-keys-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to perform a dry run of rotating the keys.\n\n10. Run `make rotate-keys-v2 RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to rotate keys.\n\n#### AddressUtilsExternal\n\nUse Create2Factory to deploy the helper library to a deterministic address for easy integration.\n\n1. Set the following [env](.env) variables:\n\n    - `CREATE2_FACTORY_CONTRACT_ADDRESS`\n    - `CREATE2_FACTORY_OWNER_KEY`\n\n2. Run `make simulate-deploy-address-utils-external RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to perform a dry run.\n\n3. Run `make deploy-address-utils-external RPC_URL=\u003cRPC_URL\u003e SENDER=\u003cSENDER\u003e` to deploy.\n\n## License\n\nFor license information, see LICENSE and additional notices stored in NOTICES.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirclefin%2Fevm-cctp-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcirclefin%2Fevm-cctp-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirclefin%2Fevm-cctp-contracts/lists"}