-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into oz-audit-vm-1-5-0
- Loading branch information
Showing
123 changed files
with
2,769 additions
and
1,151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[codespell] | ||
skip = .git,_typos.toml,artifacts,lib,node_modules,artifacts-zk,yarn.lock,contracts-preprocessed,Cargo.lock | ||
skip = .git,_typos.toml,artifacts,lib,node_modules,artifacts-zk,yarn.lock,contracts-preprocessed,Cargo.lock,SECURITY.md | ||
count = true | ||
quiet-level = 3 | ||
ignore-words = ./.codespell/wordlist.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: L1 contracts foundry CI | ||
|
||
env: | ||
ANVIL_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" | ||
ANVIL_RPC_URL: "http://127.0.0.1:8545" | ||
|
||
on: | ||
pull_request: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Use Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.18.0 | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Build artifacts | ||
working-directory: ./l1-contracts-foundry | ||
run: forge build | ||
|
||
- name: Build system-contract artifacts | ||
run: yarn sc build | ||
|
||
- name: Create cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
key: artifacts-l1-contracts-foudry-${{ github.sha }} | ||
path: | | ||
l1-contracts-foundry/cache | ||
l1-contracts-foundry/out | ||
system-contracts/artifacts-zk | ||
system-contracts/bootloader/build | ||
system-contracts/cache-zk | ||
system-contracts/contracts-preprocessed | ||
system-contracts/typechain | ||
scripts: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Restore artifacts cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
fail-on-cache-miss: true | ||
key: artifacts-l1-contracts-foudry-${{ github.sha }} | ||
path: | | ||
l1-contracts-foundry/cache | ||
l1-contracts-foundry/out | ||
system-contracts/artifacts-zk | ||
system-contracts/bootloader/build | ||
system-contracts/cache-zk | ||
system-contracts/contracts-preprocessed | ||
system-contracts/typechain | ||
- name: Use Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Run anvil | ||
run: | | ||
anvil --silent & | ||
ANVIL_READY=0 | ||
for i in {1..10}; do | ||
if curl -s -o /dev/null $ANVIL_RPC_URL -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_chainId","id":1}'; then | ||
echo "Anvil is ready" | ||
ANVIL_READY=1 | ||
break | ||
else | ||
echo "Waiting for Anvil to become ready..." | ||
sleep 1 | ||
fi | ||
done | ||
if [ $ANVIL_READY -ne 1 ]; then | ||
echo "Anvil failed to become ready after 10 attempts." | ||
exit 1 | ||
fi | ||
- name: Run DeployL1 script | ||
working-directory: ./l1-contracts-foundry | ||
run: forge script ./script/DeployL1.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY | ||
|
||
- name: Run RegisterHyperchain script | ||
working-directory: ./l1-contracts-foundry | ||
run: forge script ./script/RegisterHyperchain.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY | ||
|
||
- name: Run DeployErc20 script | ||
working-directory: ./l1-contracts-foundry | ||
run: forge script ./script/DeployErc20.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY | ||
|
||
- name: Run InitializeL2WethToken script | ||
working-directory: ./l1-contracts-foundry | ||
run: forge script ./script/InitializeL2WethToken.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Slither scanner | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
slither-l1: | ||
name: Slither check for L1 contracts | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.18.0 | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install Slither | ||
run: | | ||
pip install slither-analyzer | ||
- name: Use Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Remove non-compiled files | ||
run: | | ||
rm -rf ./l1-contracts/contracts/state-transition/utils/ | ||
rm -rf ./l1-contracts/contracts/state-transition/Verifier.sol | ||
rm -rf ./l1-contracts/contracts/state-transition/TestnetVerifier.sol | ||
rm -rf ./l1-contracts/contracts/dev-contracts/test/VerifierTest.sol | ||
rm -rf ./l1-contracts/contracts/dev-contracts/test/VerifierRecursiveTest.sol | ||
- name: Run Slither | ||
run: slither --config ./l1-contracts/slither.config.json ./l1-contracts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[profile.default] | ||
src = "../l1-contracts/contracts" | ||
out = "out" | ||
libs = ["lib"] | ||
remappings = [ | ||
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", | ||
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", | ||
"contracts/=../l1-contracts/contracts/", | ||
"l2-contracts/=../l2-contracts/contracts/" | ||
] | ||
allow_paths = ["../l1-contracts/contracts", "../l2-contracts/contracts"] | ||
fs_permissions = [ | ||
{ access = "read", path = "../system-contracts/bootloader/build/artifacts"}, | ||
{ access = "read", path = "../system-contracts/artifacts-zk/contracts-preprocessed"}, | ||
{ access = "read", path = "./script-config" }, | ||
{ access = "read-write", path = "./script-out" }, | ||
{ access = "read", path = "./out" } | ||
] | ||
evm_version="cancun" |
Submodule openzeppelin-contracts
added at
dc44c9
16 changes: 16 additions & 0 deletions
16
l1-contracts-foundry/script-config/config-deploy-erc20.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
create2_factory_addr = "0x4e59b44847b379578588920cA78FbF26c0B4956C" | ||
create2_factory_salt = "0x00000000000000000000000000000000000000000000000000000000000000ff" | ||
|
||
[tokens.dai] | ||
name = "DAI" | ||
symbol = "DAI" | ||
decimals = 18 | ||
implementation = "TestnetERC20Token.sol" | ||
mint = "10000000000" | ||
|
||
[tokens.weth] | ||
name = "Wrapped Ether" | ||
symbol = "WETH" | ||
decimals = 18 | ||
implementation = "WETH9.sol" | ||
mint = "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
era_chain_id = 9 | ||
owner_address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" | ||
|
||
[contracts] | ||
governance_security_council_address = "0x0000000000000000000000000000000000000000" | ||
governance_min_delay = 0 | ||
create2_factory_salt = "0x00000000000000000000000000000000000000000000000000000000000000ff" | ||
create2_factory_addr = "0x0000000000000000000000000000000000000000" | ||
validator_timelock_execution_delay = 0 | ||
genesis_root = "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
genesis_rollup_leaf_index = 0 | ||
genesis_batch_commitment = "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
latest_protocol_version = 0 | ||
recursion_node_level_vk_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
recursion_leaf_level_vk_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
recursion_circuits_set_vks_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
priority_tx_max_gas_limit = 80000000 | ||
shared_bridge_upgrade_storage_switch = 0 | ||
diamond_init_pubdata_pricing_mode = 0 | ||
diamond_init_batch_overhead_l1_gas = 1000000 | ||
diamond_init_max_pubdata_per_batch = 120000 | ||
diamond_init_max_l2_gas_per_batch = 80000000 | ||
diamond_init_priority_tx_max_pubdata = 99000 | ||
diamond_init_minimal_l2_gas_price = 250000000 | ||
|
||
[tokens] | ||
token_weth_address = "0x0000000000000000000000000000000000000000" | ||
|
||
[hyperchain] | ||
hyperchain_chain_id = 9 | ||
base_token_addr = "0x0000000000000000000000000000000000000001" | ||
bridgehub_create_new_chain_salt = 0 | ||
validium_mode = false | ||
validator_sender_operator_commit_eth = "0x0000000000000000000000000000000000000000" | ||
validator_sender_operator_blobs_eth = "0x0000000000000000000000000000000000000001" | ||
base_token_gas_price_multiplier_nominator = 1 | ||
base_token_gas_price_multiplier_denominator = 1 |
6 changes: 6 additions & 0 deletions
6
l1-contracts-foundry/script-config/config-initialize-l2-weth-token.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
l2_shared_bridge_addr = "0x0000000000000000000000000000000000000000" | ||
l2_weth_token_proxy_addr = "0x0000000000000000000000000000000000000000" | ||
l2_weth_token_impl_addr = "0x0000000000000000000000000000000000000000" | ||
deploy_l2_bridge_counterpart_gas_limit = "10000000" | ||
required_l2_gas_price_per_pubdata = "800" | ||
gas_multiplier = "3" |
Empty file.
Oops, something went wrong.