Skip to content

Commit

Permalink
Support Ethereum (#92)
Browse files Browse the repository at this point in the history
* config

* set fee

* config

* config
  • Loading branch information
hujw77 authored Dec 12, 2023
1 parent 01c0037 commit 8222415
Show file tree
Hide file tree
Showing 21 changed files with 256 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.env
/docs
/out
Expand Down
15 changes: 9 additions & 6 deletions bin/dao.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ ormp=$(jq -r ".ORMP_ADDR" $c3)
oracle=$(jq -r ".ORACLE_ADDR" $c3)
relayer=$(jq -r ".RELAYER_ADDR" $c3)

seth send -F $deployer $ormp "changeSetter(address)" $dao --chain darwinia
seth send -F $deployer $ormp "changeSetter(address)" $dao --chain arbitrum
# seth send -F $deployer $ormp "changeSetter(address)" $dao --chain darwinia
# seth send -F $deployer $ormp "changeSetter(address)" $dao --chain arbitrum
# seth send -F $deployer $ormp "changeSetter(address)" $dao --chain ethereum

seth send -F $deployer $oracle "changeOwner(address)" $dao --chain darwinia
seth send -F $deployer $oracle "changeOwner(address)" $dao --chain arbitrum
# seth send -F $deployer $oracle "changeOwner(address)" $dao --chain darwinia
# seth send -F $deployer $oracle "changeOwner(address)" $dao --chain arbitrum
# seth send -F $deployer $oracle "changeOwner(address)" $dao --chain ethereum

seth send -F $deployer $relayer "changeOwner(address)" $dao --chain darwinia
seth send -F $deployer $relayer "changeOwner(address)" $dao --chain arbitrum
# seth send -F $deployer $relayer "changeOwner(address)" $dao --chain darwinia
# seth send -F $deployer $relayer "changeOwner(address)" $dao --chain arbitrum
seth send -F $deployer $relayer "changeOwner(address)" $dao --chain ethereum
12 changes: 7 additions & 5 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

set -eo pipefail

# forge script script/deploy/Deploy.s.sol:Deploy --chain-id 46 --broadcast --verify --slow
# forge script script/deploy/Deploy.s.sol:Deploy --chain-id 42161 --broadcast --verify --slow --legacy
# forge script script/deploy/Deploy.s.sol:Deploy --chain-id 1 --legacy --broadcast --verify --slow
forge script script/deploy/Deploy.s.sol:Deploy --chain-id 46 --broadcast --verify --slow
forge script script/deploy/Deploy.s.sol:Deploy --chain-id 42161 --broadcast --verify --slow --legacy

# forge script script/deploy/Deploy.s.sol:Deploy --chain-id 44 --broadcast --verify
# forge script script/deploy/Deploy.s.sol:Deploy --chain-id 421614 --broadcast --verify
# forge script script/deploy/Deploy.s.sol:Deploy --chain-id 11155111 --broadcast --verify

forge script script/deploy/Deploy.s.sol:Deploy --chain-id 44 --broadcast --verify
forge script script/deploy/Deploy.s.sol:Deploy --chain-id 421614 --broadcast --verify
forge script script/deploy/Deploy.s.sol:Deploy --chain-id 11155111 --broadcast --verify
16 changes: 10 additions & 6 deletions bin/fee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ set -eo pipefail

set -x
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 42161 --chain-id 46 --broadcast --slow
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 1 --chain-id 46 --broadcast --slow
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 46 --chain-id 42161 --broadcast --slow --legacy
forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 1 --chain-id 42161 --broadcast --slow --legacy
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 46 --chain-id 1 --broadcast --slow --legacy
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 42161 --chain-id 1 --broadcast --slow --legacy

forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 11155111 --chain-id 44 --broadcast
forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 421614 --chain-id 44 --broadcast
forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 421614 --chain-id 11155111 --broadcast
forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 44 --chain-id 11155111 --broadcast
forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 44 --chain-id 421614 --broadcast --skip-simulation --legacy
forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 11155111 --chain-id 421614 --broadcast --skip-simulation --legacy
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 11155111 --chain-id 44 --broadcast
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 421614 --chain-id 44 --broadcast
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 421614 --chain-id 11155111 --broadcast
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 44 --chain-id 11155111 --broadcast
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 44 --chain-id 421614 --broadcast --skip-simulation --legacy
# forge script script/fee/Fee.s.sol:Fee --sig "run(uint256)" 11155111 --chain-id 421614 --broadcast --skip-simulation --legacy
9 changes: 5 additions & 4 deletions bin/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ verify() {

# verify $ormp 42161 $(cast abi-encode "constructor(address)" $deployer) src/ORMP.sol:ORMP
# verify $ormp 46 $(cast abi-encode "constructor(address)" $deployer) src/ORMP.sol:ORMP
# verify $oracle 42161 $(cast abi-encode "constructor(address,address)" $deployer $ormp) src/eco/Oracle.sol:Oracle
# verify $oracle 46 $(cast abi-encode "constructor(address,address)" $deployer $ormp) src/eco/Oracle.sol:Oracle
# verify $oracle 42161 $(cast abi-encode "constructor(address,address,address)" $deployer $ormp $subapi) src/eco/Oracle.sol:Oracle
# verify $oracle 46 $(cast abi-encode "constructor(address,address,address)" $deployer $ormp $subapi) src/eco/Oracle.sol:Oracle
# verify $relayer 42161 $(cast abi-encode "constructor(address,address)" $deployer $ormp) src/eco/Relayer.sol:Relayer
# verify $relayer 46 $(cast abi-encode "constructor(address,address)" $deployer $ormp) src/eco/Relayer.sol:Relayer

verify $oracle 44 $(cast abi-encode "constructor(address,address,address)" $deployer $ormp $subapi) src/eco/Oracle.sol:Oracle
verify $oracle 421614 $(cast abi-encode "constructor(address,address,address)" $deployer $ormp $subapi) src/eco/Oracle.sol:Oracle
# verify $ormp 1 $(cast abi-encode "constructor(address)" $deployer) src/ORMP.sol:ORMP
# verify $oracle 1 $(cast abi-encode "constructor(address,address,address)" $deployer $ormp $subapi) src/eco/Oracle.sol:Oracle
# verify $relayer 1 $(cast abi-encode "constructor(address,address)" $deployer $ormp) src/eco/Relayer.sol:Relayer
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ via_ir = false
no_storage_caching = false
no_rpc_rate_limit = false
bytecode_hash = "ipfs"
# use_literal_content = true
cbor_metadata = true

fs_permissions = [
Expand All @@ -70,6 +71,7 @@ crab = "https://crab-rpc.darwinia.network"
darwinia = "https://rpc.darwinia.network"
arbitrum = "https://arb1.arbitrum.io/rpc"
sepolia = "https://sepolia.infura.io/v3/${INFURA_KEY}"
ethereum = "https://mainnet.infura.io/v3/${INFURA_KEY}"

[etherscan]
arbitrum = { key = "${ETHERSCAN_ARBITRUM_KEY}" }
Expand Down
6 changes: 6 additions & 0 deletions script/input/1/deploy.c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"DAO": "0x0f14341A7f464320319025540E8Fe48Ad0fe5aec",
"DEPLOYER": "0x0f14341A7f464320319025540E8Fe48Ad0fe5aec",
"ORACLE_OPERATOR": "0x912D7601569cBc2DF8A7f0aaE50BFd18e8C64d05",
"RELAYER_OPERATOR": "0x912D7601569cBc2DF8A7f0aaE50BFd18e8C64d05"
}
24 changes: 24 additions & 0 deletions script/input/1/fee.c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"ORACLE": {
"46": {
"fee": 20000000000000
},
"42161": {
"fee": 5000000000000000
}
},
"RELAYER": {
"46": {
"dstPriceRatio": 12000,
"dstGasPriceInWei": 180000000000,
"baseGas": 200000,
"gasPerByte": 16
},
"42161": {
"dstPriceRatio": 10000000000,
"dstGasPriceInWei": 110000000,
"baseGas": 1,
"gasPerByte": 16
}
}
}
11 changes: 10 additions & 1 deletion script/input/42161/fee.c.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"ORACLE": {
"46": {
"fee": 500000000000
"fee": 20000000000000
},
"1": {
"fee": 100000000000000000
}
},
"RELAYER": {
Expand All @@ -10,6 +13,12 @@
"dstGasPriceInWei": 180000000000,
"baseGas": 200000,
"gasPerByte": 16
},
"1": {
"dstPriceRatio": 10000000000,
"dstGasPriceInWei": 50000000000,
"baseGas": 200000,
"gasPerByte": 16
}
}
}
3 changes: 0 additions & 3 deletions script/input/42161/oracle.c.json

This file was deleted.

8 changes: 4 additions & 4 deletions script/input/44/fee.c.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"ORACLE": {
"421614": {
"fee": 50000000000000000000
"fee": 5000000000000000000
},
"11155111": {
"fee": 50000000000000000000
"fee": 5000000000000000000
}
},
"RELAYER": {
"421614": {
"dstPriceRatio": 9000000000000000,
"dstGasPriceInWei": 110000000,
"dstGasPriceInWei": 1000000,
"baseGas": 1,
"gasPerByte": 16
},
"11155111": {
"dstPriceRatio": 9000000000000000,
"dstGasPriceInWei": 10000000000,
"dstGasPriceInWei": 1000000,
"baseGas": 1,
"gasPerByte": 16
}
Expand Down
9 changes: 9 additions & 0 deletions script/input/46/fee.c.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"ORACLE": {
"42161": {
"fee": 2500000000000000000000
},
"1": {
"fee": 55000000000000000000000
}
},
"RELAYER": {
Expand All @@ -10,6 +13,12 @@
"dstGasPriceInWei": 110000000,
"baseGas": 1,
"gasPerByte": 16
},
"1": {
"dstPriceRatio": 9000000000000000,
"dstGasPriceInWei": 50000000000,
"baseGas": 200000,
"gasPerByte": 16
}
}
}
3 changes: 0 additions & 3 deletions script/input/46/oracle.c.json

This file was deleted.

Loading

0 comments on commit 8222415

Please sign in to comment.