mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-11 06:58:20 -05:00
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Co-authored-by: HAOYUatHZ <HAOYUatHZ@users.noreply.github.com> Co-authored-by: Haichen Shen <shenhaichen@gmail.com> Co-authored-by: zimpha <zimpha@users.noreply.github.com> Co-authored-by: icemelon <icemelon@users.noreply.github.com>
Scroll Contracts
Note: For more comprehensive documentation, see ./docs/.
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"
...
Dependencies
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
yarn prepareto install the precommit linting hook - 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