Warning
This repository is under active development. Tests are being updated and are incomplete.
This repository provides a Foundry configuration for developing and testing CMTAT smart contracts.
For Hardhat-based development and full test suite, see the main CMTAT repository.
CMTAT Version: v3.2.0-rc0
CMTAT-Foundry/
├── lib/
│ ├── CMTAT/ # CMTAT contracts (submodule)
│ ├── forge-std/ # Foundry standard library
│ ├── openzeppelin-contracts/ # OpenZeppelin contracts
│ └── openzeppelin-contracts-upgradeable/
├── test/ # Foundry test files
│ ├── HelperContract.sol # Shared test utilities
│ ├── BurnModule.t.sol # Burn functionality tests
│ ├── MintModule.t.sol # Mint functionality tests
│ ├── ERC20Module.t.sol # ERC20 standard tests
│ └── FreezeModule.t.sol # Freeze functionality tests
├── script/ # Deployment scripts
├── foundry.toml # Foundry configuration
└── remappings.txt # Import remappings
Install the Foundry toolchain by following the official instructions.
Clone the repository and initialize submodules:
git clone https://github.com/CMTA/CMTAT-Foundry.git
cd CMTAT-Foundry
forge installTo update submodules later:
forge updateCompile all contracts:
forge buildRun all tests:
forge testRun tests with verbosity for more details:
forge test -vvvRun a specific test contract:
forge test --match-contract BurnModuleTestRun a specific test function:
forge test --match-test test_AdminCanBurnGenerate gas usage reports:
forge test --gas-reportGenerate test coverage report:
forge coverageStart a local Anvil node:
anvilIn a separate terminal, deploy the contract:
export RPC_URL=http://127.0.0.1:8545
export PRIVATE_KEY=<your-private-key>
forge create lib/CMTAT/contracts/deployment/CMTATStandalone.sol:CMTATStandalone \
--rpc-url=$RPC_URL \
--private-key=$PRIVATE_KEYThe CMTAT library provides several deployment options:
| Contract | Description |
|---|---|
CMTATStandalone.sol |
Standard non-upgradeable deployment |
CMTATUpgradeable.sol |
Transparent proxy upgradeable deployment |
CMTATUpgradeableUUPS.sol |
UUPS proxy upgradeable deployment |
See CMTAT main repository for the whole list.
Format Solidity files with Foundry:
forge fmt- Foundry Book
- CMTAT GitHub
- forge-std Reference
- Tests have been made with the help of Claude
This project is licensed under MPL-2.0.