|
| 1 | +# Scroll Contracts |
| 2 | + |
| 3 | +## Directory Structure |
| 4 | + |
| 5 | +``` |
| 6 | +integration-test |
| 7 | +|- xxx.test.ts - "Hardhat integration tests" |
| 8 | +lib |
| 9 | +|- forge-std - "foundry dependency" |
| 10 | +scripts |
| 11 | +|- deploy.ts - "hardhat deploy script" |
| 12 | +src |
| 13 | +|- test |
| 14 | +| `- xxx.t.sol - "Unit testi in solidity" |
| 15 | +`- xxx.sol - "solidity contract" |
| 16 | +.gitmodules - "foundry dependecy modules" |
| 17 | +foundry.toml - "configure foundry" |
| 18 | +hardhat.config.ts - "configure hardhat" |
| 19 | +remappings.txt - "foundry dependency mappings" |
| 20 | +... |
| 21 | +``` |
| 22 | + |
| 23 | +## Dependency |
| 24 | + |
| 25 | +### Foundry |
| 26 | + |
| 27 | +First run the command below to get foundryup, the Foundry toolchain installer: |
| 28 | + |
| 29 | +```bash |
| 30 | +curl -L https://foundry.paradigm.xyz | bash |
| 31 | +``` |
| 32 | + |
| 33 | +If you do not want to use the redirect, feel free to manually download the foundryup installation script from [here](https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup). |
| 34 | + |
| 35 | +Then, run `foundryup` in a new terminal session or after reloading your `PATH`. |
| 36 | + |
| 37 | +Other ways to install Foundry can be found [here](https://github.com/foundry-rs/foundry#installation). |
| 38 | + |
| 39 | +### Hardhat |
| 40 | + |
| 41 | +``` |
| 42 | +yarn install |
| 43 | +``` |
| 44 | + |
| 45 | +## Build |
| 46 | + |
| 47 | ++ Run `git submodule update --init --recursive` to initialise git submodules. |
| 48 | ++ Run `yarn prettier:solidity` to run linting in fix mode, will auto-format all solidity codes. |
| 49 | ++ Run `yarn prettier` to run linting in fix mode, will auto-format all typescript codes. |
| 50 | ++ Run `forge build` to compile contracts with foundry. |
| 51 | ++ Run `npx hardhat compile` to compile with hardhat. |
| 52 | ++ Run `forge test -vvv` to run foundry units tests. It will compile all contracts before running the unit tests. |
| 53 | ++ Run `npx hardhat test` to run integration tests. It may not compile all contracts before running, it's better to run `npx hardhat compile` first. |
| 54 | + |
| 55 | +## TODO |
| 56 | + |
| 57 | +- [ ] unit tests |
| 58 | + - [ ] L1 Messenger |
| 59 | + - [x] L1 Gateways |
| 60 | + - [x] L1 Gateway Router |
| 61 | + - [ ] L2 Messenger |
| 62 | + - [x] L2 Gateways |
| 63 | + - [x] L2 Gateway Router |
| 64 | + - [x] ScrollStandardERC20Factory |
| 65 | + - [x] Whitelist |
| 66 | + - [ ] SimpleGasOracle |
| 67 | +- [ ] integration tests |
| 68 | + - [x] ERC20Gateway |
| 69 | + - [x] GatewayRouter |
| 70 | +- [ ] ZKRollup contracts |
| 71 | +- [x] Gas Oracle contracts for cross chain message call |
| 72 | +- [ ] ERC721/ERC115 interface design |
| 73 | +- [ ] add proof verification codes |
| 74 | +- [ ] security analysis |
0 commit comments