Skip to content

Commit

Permalink
Add Sepolia verifier contracts and gateway deployment details (#26)
Browse files Browse the repository at this point in the history
* Add OP sepolia gateway info

* Add deployed addresses for base

* Add arbitrum sepolia deployment address

* Remove console.log

* Update comment

* Add environment on wrangler.toml
  • Loading branch information
makoto committed Jan 4, 2024
1 parent 3027453 commit 587de25
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 15 deletions.
4 changes: 3 additions & 1 deletion arb-gateway/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ main = "./src/worker.ts"
node_compat = true
compatibility_date = "2023-10-13"


[dev]
port = 8080

[build]
command = "yarn build"

[vars]
[env.sepolia]
name = "arb-sepolia-gateway-worker"
32 changes: 29 additions & 3 deletions arb-verifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,43 @@ bun run test

## Deployments

### L2
### Goerli

#### L2

- TestL2.sol = [0xAdef74372444e716C0473dEe1F9Cb3108EFa3818](https://goerli.arbiscan.io/address/0xAdef74372444e716C0473dEe1F9Cb3108EFa3818#code)

### L1
#### L1

- ArbVerifier = [0x9E46DeE08Ad370bEFa7858c0E9a6c87f2D7E57A1](https://goerli.etherscan.io/address/0x9E46DeE08Ad370bEFa7858c0E9a6c87f2D7E57A1#code)

- TestL1.sol = [0x0d6c6B70cd561EB59e6818D832197fFad60840AB](https://goerli.etherscan.io/address/0x0d6c6B70cd561EB59e6818D832197fFad60840AB#code)

### Gateway server
#### Gateway server

- https://arb-gateway-worker.ens-cf.workers.dev


### Sepolia

#### L2

- TestL2.sol = [0x162A433068F51e18b7d13932F27e66a3f99E6890](https://api-sepolia.arbiscan.io/address/0x162A433068F51e18b7d13932F27e66a3f99E6890#code)

#### L1

- ArbVerifier = [0x6820E47CED34D6F275c6d26C3876D48B2c1fdf27](https://sepolia.etherscan.io/address/0x6820E47CED34D6F275c6d26C3876D48B2c1fdf27#code)
- TestL1.sol = [0x50200c7Ccb1abD927184396547ea8dD1A18CAA3A](https://sepolia.etherscan.io/address/0x50200c7Ccb1abD927184396547ea8dD1A18CAA3A#code)

deploying "ArbVerifier" (tx: 0x61ae88749f911f1e09d7c073f34a13bb843c71fafaf93a1266423798bd3aadc6)...: deployed at 0x6820E47CED34D6F275c6d26C3876D48B2c1fdf27 with 3872186 gas
deploying "TestL1" (tx: 0x0a7b6b74357d20f33cb89df12da3db34b5cd3c764403888420108ca13f0126fa)...: deployed at 0x50200c7Ccb1abD927184396547ea8dD1A18CAA3A with 2411152 gas

#### Gateway url

- https://arb-sepolia-gateway-worker.ens-cf.workers.dev

## Testing gateway

```
TARGET_ADDRESS=$TEST_L1_ADDRESS PROVIDER_URL=$L1_PROVIDER_URL npx hardhat run ../l1-verifier/scripts/remote.ts --network sepolia
```
6 changes: 6 additions & 0 deletions arb-verifier/arguments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = [
[
'https://arb-sepolia-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json'
],
'0xd80810638dbDF9081b72C1B33c65375e807281C8'
];
2 changes: 2 additions & 0 deletions arb-verifier/deploy_l1/00_arb_verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import 'dotenv/config';
const GATEWAY_URLS = {
arbDevnetL1: 'http://localhost:8089/{sender}/{data}.json',
goerli: 'https://arb-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json',
sepolia: 'https://arb-sepolia-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json',
};

const ROLLUP_ADDRESSES = {
goerli: '0x45e5cAea8768F42B385A366D3551Ad1e0cbFAb17',
sepolia: '0xd80810638dbDF9081b72C1B33c65375e807281C8',
};

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
Expand Down
25 changes: 24 additions & 1 deletion arb-verifier/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,49 @@ const config: HardhatUserConfig = {
l2: 'arbitrumGoerli',
},
},
sepolia: {
url: L1_PROVIDER_URL,
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: ['deploy_l1/'],
companionNetworks: {
l2: 'arbitrumSepolia',
},
},
arbitrumGoerli: {
url: 'https://rpc.goerli.arbitrum.gateway.fm',
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: ['deploy_l2/'],
},
arbitrumSepolia: {
url: 'https://sepolia-rollup.arbitrum.io/rpc',
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: [ "deploy_l2/" ],
},
},
etherscan: {
apiKey: {
goerli: L1_ETHERSCAN_API_KEY,
sepolia: L1_ETHERSCAN_API_KEY,
arbitrumGoerli: L2_ETHERSCAN_API_KEY,
arbitrumSepolia: L2_ETHERSCAN_API_KEY,
},
customChains: [
{
network: 'arbitrumGoerli',
chainId: 421613,
urls: {
apiURL: 'https://api-goerli.arbiscan.io/api',
browserURL: 'https://api-goerli.arbiscan.io.io',
browserURL: 'https://api-goerli.arbiscan.io',
},
},
{
network: "arbitrumSepolia",
chainId: 421614,
urls: {
apiURL: "https://api-sepolia.arbiscan.io/api",
browserURL: "https://api-sepolia.arbiscan.io"
}
}
],
},
namedAccounts: {
Expand Down
2 changes: 1 addition & 1 deletion op-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ wrangler secret put L1_PROVIDER_URL
wrangler secret put L2_PROVIDER_URL
wrangler secret put L2_OUTPUT_ORACLE
wrangler secret put DELAY
yarn deploy
yarn deploy --env op-sepolia // or --env base-sepolia for base deployment
```

## How to test
Expand Down
7 changes: 5 additions & 2 deletions op-gateway/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name = "op-gateway-worker"
account_id = "15dcc9085cb794bb4f29d3e8177ac880"
main = "./src/worker.ts"
node_compat = true
Expand All @@ -10,4 +9,8 @@ port = 8080
[build]
command = "yarn build"

[vars]
[env.base-sepolia]
name = "base-sepolia-gateway-worker"

[env.op-sepolia]
name = "op-sepolia-gateway-worker"
39 changes: 39 additions & 0 deletions op-verifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,42 @@ hardhat test --network opDevnetL1
```

The tests will require small modifications to work on public testnets; specifically, contract addresses are currently fetched from `http://localhost:8080/addresses.json`; this will need to be made conditional on the network being used.

## Deployed addresses

### Optimism

#### L1

- OPVerifier = [0x0e8DA38565915B7e74e2d78F80ba1BF815F34116](https://sepolia.etherscan.io/address/0x0e8DA38565915B7e74e2d78F80ba1BF815F34116#code)
- TestL1 = [0x00198c6c94522A81698190ADF411641995Eb180c](https://sepolia.etherscan.io/address/0x00198c6c94522A81698190ADF411641995Eb180c#code
)
#### L2

- TestL2 = [0x94fbCE7ca1a0152cfC99F90f4421d31cf356c896](https://sepolia-optimism.etherscan.io/address/0x94fbCE7ca1a0152cfC99F90f4421d31cf356c896)

#### Gateway url

- https://op-sepolia-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json

### Base

#### L1

- OPVerifier = [0xAdef74372444e716C0473dEe1F9Cb3108EFa3818](https://sepolia.etherscan.io/address/0xAdef74372444e716C0473dEe1F9Cb3108EFa3818#code
)
- TestL1 = [0x540C93800699C044dB8cf1f0F059ca0FA5CaED92](https://sepolia.etherscan.io/address/0x540C93800699C044dB8cf1f0F059ca0FA5CaED92#code)

#### L2

- TestL2 = [0x94fbCE7ca1a0152cfC99F90f4421d31cf356c896](https://sepolia.basescan.org/address/0x94fbCE7ca1a0152cfC99F90f4421d31cf356c896#code)

#### Gateway url

- https://base-sepolia-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json

## Testing gateway

```
TARGET_ADDRESS=$TEST_L1_ADDRESS PROVIDER_URL=$L1_PROVIDER_URL npx hardhat run ../l1-verifier/scripts/remote.ts --network sepolia
```
6 changes: 6 additions & 0 deletions op-verifier/arguments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = [
[
'https://base-sepolia-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json'
],
'0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254'
];
9 changes: 7 additions & 2 deletions op-verifier/deploy_l1/00_op_verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import fs from 'fs';
const GATEWAY_URLS = {
'opDevnetL1':'http://localhost:8080/{sender}/{data}.json',
'goerli':'https://op-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json',
'sepolia':'https://op-sepolia-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json',
'sepoliaforbase':'https://base-sepolia-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json',
}

const L2_OUTPUT_ORACLE_ADDRESSES = {
'goerli': '0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0'
'goerli': '0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0',
'sepolia': '0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F',
'sepoliaforbase': '0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254',
}

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
Expand All @@ -20,12 +24,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const opAddresses = await (await fetch("http://localhost:8080/addresses.json")).json();
L2_OUTPUT_ORACLE_ADDRESS = opAddresses.L2OutputOracleProxy
}else{
GATEWAY_URL = GATEWAY_URLS[network.name]
L2_OUTPUT_ORACLE_ADDRESS = L2_OUTPUT_ORACLE_ADDRESSES[network.name]
}
console.log('OPVerifier', [[GATEWAY_URL], L2_OUTPUT_ORACLE_ADDRESS])
await deploy('OPVerifier', {
from: deployer,
args: [[GATEWAY_URLS[network.name]], L2_OUTPUT_ORACLE_ADDRESS],
args: [[GATEWAY_URL], L2_OUTPUT_ORACLE_ADDRESS],
log: true,
});
};
Expand Down
2 changes: 1 addition & 1 deletion op-verifier/deploy_l1/10_testl1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const OPVerifier = await deployments.get('OPVerifier');
const TestL2 = await hre.companionNetworks['l2'].deployments.get('TestL2');

console.log(`TestL1 is deployed with OPVerifier.address ${OPVerifier.address} and TestL2.address ${TestL2.address} as argments`)
await deploy('TestL1', {
from: deployer,
args: [OPVerifier.address, TestL2.address],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, getNamedAccounts} = hre;
const {deployments, getNamedAccounts, network} = hre;
const {deploy} = deployments;

const {deployer} = await getNamedAccounts();
Expand Down
52 changes: 49 additions & 3 deletions op-verifier/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,42 @@ const config: HardhatUserConfig = {
url: "https://goerli.optimism.io",
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: [ "deploy_l2/" ],
}
},
sepolia: {
url: L1_PROVIDER_URL,
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: [ "deploy_l1/" ],
companionNetworks: {
l2: "optimismSepolia",
},
},
sepoliaforbase: {
url: L1_PROVIDER_URL,
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: [ "deploy_l1/" ],
companionNetworks: {
l2: "baseSepolia",
},
},
optimismSepolia: {
url: "https://sepolia.optimism.io",
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: [ "deploy_l2/" ],
},
baseSepolia: {
url: "https://sepolia.base.org",
accounts: [DEPLOYER_PRIVATE_KEY],
deploy: [ "deploy_l2/" ],
},
},
etherscan: {
apiKey: {
goerli: L1_ETHERSCAN_API_KEY,
optimismGoerli: L2_ETHERSCAN_API_KEY
sepolia: L1_ETHERSCAN_API_KEY,
optimismGoerli: L2_ETHERSCAN_API_KEY,
baseGoerli: L2_ETHERSCAN_API_KEY,
optimismSepolia: L2_ETHERSCAN_API_KEY,
baseSepolia: L2_ETHERSCAN_API_KEY,
},
customChains: [
{
Expand All @@ -51,7 +81,23 @@ const config: HardhatUserConfig = {
apiURL: "https://api-goerli-optimism.etherscan.io/api",
browserURL: "https://goerli-optimism.etherscan.io"
}
}
},
{
network: "optimismSepolia",
chainId: 11155420,
urls: {
apiURL: "https://api-sepolia-optimism.etherscan.io/api",
browserURL: "https://sepolia-optimism.etherscan.io"
}
},
{
network: "baseSepolia",
chainId: 84532,
urls: {
apiURL: "https://api-sepolia.basescan.org/api",
browserURL: "https://sepolia.basescan.org"
}
},
]
},
namedAccounts: {
Expand Down

0 comments on commit 587de25

Please sign in to comment.