For an overview of the mechanics and implemented mathematics in TenderSwap, check following sources:
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
Deployments and upgrades can through the SwapFactory
contract for indexing purposes on the Tenderize Subgraph.
TenderSwap can also be deployed standlone following the same pattern as the SwapFactory
contract.
Factory::deploy
requires an implementation address. Each pool will have its own implementation contract where
constants
or immutables
can be specified for each pool. While this adds operational overhead and complexity for
potential upgrades, it significantly improves the gas cost of functions that use these parameters.
Format the contracts:
forge fmt
or
yarn lint:sol
Format other files:
yarn prettier:write
Get a gas report:
forge test --gas-report
Lint the contracts:
pnpm lint
Run the tests:
forge test
- Foundry uses git submodules to manage dependencies. For detailed instructions on working with dependencies, please refer to the guide in the book
- You don't have to create a
.env
file, but filling in the environment variables may be useful when debugging and testing against a fork.
- abigger87/femplate
- cleanunicorn/ethereum-smartcontract-template
- foundry-rs/forge-template
- FrankieIsLost/forge-template
This project is licensed under MIT.