mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-09 22:18:00 -05:00
Scroll Contracts
Directory Structure
integration-test
|- xxx.test.ts - "Hardhat integration tests"
lib
|- forge-std - "foundry dependency"
scripts
|- deploy_xxx.ts - "hardhat deploy script"
|- foundry - "foundry deploy scripts"
src
|- test
| `- xxx.t.sol - "Unit testi in solidity"
`- xxx.sol - "solidity contract"
.gitmodules - "foundry dependecy modules"
foundry.toml - "configure foundry"
hardhat.config.ts - "configure hardhat"
remappings.txt - "foundry dependency mappings"
...
Dependency
Foundry
First run the command below to get foundryup, the Foundry toolchain installer:
curl -L https://foundry.paradigm.xyz | bash
If you do not want to use the redirect, feel free to manually download the foundryup installation script from here.
Then, run foundryup in a new terminal session or after reloading your PATH.
Other ways to install Foundry can be found here.
Hardhat
yarn install
Build
- Run
git submodule update --init --recursiveto initialise git submodules. - Run
yarn prettier:solidityto run linting in fix mode, will auto-format all solidity codes. - Run
yarn prettierto run linting in fix mode, will auto-format all typescript codes. - Run
forge buildto compile contracts with foundry. - Run
npx hardhat compileto compile with hardhat. - Run
forge test -vvvto run foundry units tests. It will compile all contracts before running the unit tests. - Run
npx hardhat testto run integration tests. It may not compile all contracts before running, it's better to runnpx hardhat compilefirst.
TODO
- unit tests
- L1 Messenger
- L1 Gateways
- L1 Gateway Router
- L2 Messenger
- L2 Gateways
- L2 Gateway Router
- ScrollStandardERC20Factory
- Whitelist
- SimpleGasOracle
- integration tests
- ERC20Gateway
- GatewayRouter
- ZKRollup contracts
- Gas Oracle contracts for cross chain message call
- ERC721/ERC115 interface design
- add proof verification codes
- security analysis