The Intuition V2 smart contracts for the Intuition protocol, built using Foundry.
- Forge: compile, test, fuzz, format, and deploy smart contracts
- [Bun]: Foundry defaults to git submodules, but this template also uses Node.js packages for managing dependencies
- Forge Std: collection of helpful contracts and utilities for testing
- Prettier: code formatter for non-Solidity files
- Solhint: linter for Solidity code
- Execute BaseEmissionsControllerDeploy.s.sol
- Update the
INTUITION_SEPOLIA_BASE_EMISSIONS_CONTROLLER
in .env
- Update the
- Execute MultiVaultMigrationDeploy.s.sol
- Update the
INTUITION_SEPOLIA_MULTI_VAULT_MIGRATION_MODE
in .env
- Update the
- Execute IntuitionDeployAndSetup.s.sol
- Update the
BASE_SEPOLIA_SATELLITE_EMISSIONS_CONTROLLER
in .env
- Update the
- Execute BaseEmissionsControllerSetup.s.sol
- Make sure to set
INTUITION_SEPOLIA_PROXY_ADMIN
in .env - Execute MultiVaultMigrationModeUpgrade.s.sol
forge test --match-path 'tests/unit/CoreEmissionsController/*.sol'
This is a list of the most frequently needed commands.
Build the contracts:
$ forge build
Delete the build artifacts and cache directories:
$ forge clean
Compile the contracts:
$ forge build
Get a test coverage report:
$ forge coverage
Deploy to Anvil:
$ forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545
For this script to work, you need to have a MNEMONIC
environment variable set to a valid
BIP39 mnemonic.
For instructions on how to deploy to a testnet or mainnet, check out the Solidity Scripting tutorial.
Format the contracts:
$ forge fmt
Get a gas report:
$ forge test --gas-report
Lint the contracts:
$ bun run lint
Run the tests:
$ forge test
Generate test coverage and output result to the terminal:
$ bun run test:coverage
Generate test coverage with lcov report (you'll have to open the ./coverage/index.html
file in your browser, to do so
simply copy paste the path):
$ bun run test:coverage:report
Note
This command requires you to have lcov
installed on your machine. On
macOS, you can install it with Homebrew: brew install lcov
.
This project is licensed under MIT.
EntryPoint: 0x334bE66b33EC87698c16D4386896f8E807d5d2D8