Skip to content

Commit

Permalink
beef up scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Apr 1, 2023
1 parent 6af79d8 commit c2bf90d
Show file tree
Hide file tree
Showing 9 changed files with 270 additions and 10 deletions.
8 changes: 3 additions & 5 deletions .env.devnet
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Devnet Specs: https://github.com/ethereum-optimism/optimism/blob/develop/specs/meta/devnet.md

export OP_CHALLENGER_KEY="ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
export OP_CHALLENGER_KEY="54FE7CFBA40FE5ABBF9595B06C79C3BDF68FB4C7D8A78A7F53ACC771CEB029C5"
export OP_CHALLENGER_PUB_KEY="0xAF00b1C8A848BE9aFb28860BA0dC27b02fE3BD4d"
export OP_CHALLENGER_L1_WS="ws://127.0.0.1:8546"
export OP_CHALLENGER_TRUSTED_OP_NODE_RPC="http://localhost:7545"
export OP_CHALLENGER_L2OO="0x6900000000000000000000000000000000000000"

# Paste the DisputeGameFactory env variable logged by `start_devnet.sh` here.

export OP_CHALLENGER_DGF="0x020000000fc854958a2400c973d2523146343d31"
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

all: devnet-up start

devnet-up:
./start_devnet.sh

start:
cargo run -- --l1-ws-endpoint $OP_CHALLENGER_L1_WS --trusted-op-node-endpoint $OP_CHALLENGER_TRUSTED_OP_NODE_RPC --l2-output-oracle $OP_CHALLENGER_L2OO --dispute-game-factory $OP_CHALLENGER_DGF
30 changes: 25 additions & 5 deletions start_devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,35 @@ source .env.devnet

# Change accordingly
MONOREPO_DIR="$HOME/dev/optimism/monorepo"
# MONOREPO_DIR="$HOME/optimism/optimism"

# Boot up the devnet
(cd $MONOREPO_DIR && make devnet-down && make devnet-up)
(cd $MONOREPO_DIR && make devnet-down && L2OO_ADDRESS="0x6900000000000000000000000000000000000000" make devnet-up)

# Fetching balance of the sponsor
echo "----------------------------------------------------------------"
echo " - Fetching balance of the sponsor"
cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://localhost:8545
echo "----------------------------------------------------------------"

# Send some ETH to the deployer
echo "----------------------------------------------------------------"
echo " - Sending some ETH to the deployer"
cast send --rpc-url http://localhost:8545 --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 0xAF00b1C8A848BE9aFb28860BA0dC27b02fE3BD4d --value 1000000000000000000
echo "----------------------------------------------------------------"

# Deploy the mock dispute game contract
echo "----------------------------------------------------------------"
echo " - Deploying the mock dispute game contract"
(cd ./testdata/mock-dgf && forge script script/DeployMocks.s.sol --rpc-url http://localhost:8545 --private-key $OP_CHALLENGER_KEY --broadcast)

echo "----------------------------------------------------------------"
echo " - Paste the environment variable logged by the forge script"
echo " - into the \`.env.devnet\` file and then source it again before"
echo " - running the \`op-challenger\`."

# echo "----------------------------------------------------------------"
# echo " - Paste the environment variable logged by the forge script"
# echo " - into the \`.env.devnet\` file and then source it again before"
# echo " - running the \`op-challenger\`."
# echo "----------------------------------------------------------------"

echo "----------------------------------------------------------------"
echo " All done! You can now run the \`op-challenger\`."
echo "----------------------------------------------------------------"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"transactions": [
{
"hash": null,
"transactionType": "CREATE",
"contractName": "MockDisputeGameFactory",
"contractAddress": "0xD2Db1588383596edd521238Fc04EF10645067A4F",
"function": null,
"arguments": null,
"rpc": "http://localhost:8545",
"transaction": {
"type": "0x02",
"from": "0x0600000075f2f1cd4e0dfd5411a075e60993aa6f",
"gas": "0x41297",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b506102c1806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633142e55e14610030575b600080fd5b61004361003e3660046100e8565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b600060405161006d906100db565b604051809103906000f080158015610089573d6000803e3d6000fd5b5090508385600281111561009f5761009f610175565b6040516001600160a01b038416907ffad0599ff449d8d9685eadecca8cb9e00924c5fd8367c1c09469824939e1ffec90600090a4949350505050565b6101008061018c83390190565b600080600080606085870312156100fe57600080fd5b84356003811061010d57600080fd5b935060208501359250604085013567ffffffffffffffff8082111561013157600080fd5b818701915087601f83011261014557600080fd5b81358181111561015457600080fd5b88602082850101111561016657600080fd5b95989497505060200194505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b5060e18061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b8b9c18814602d575b600080fd5b603c6038366004603e565b5050565b005b60008060208385031215605057600080fd5b823567ffffffffffffffff80821115606757600080fd5b818501915085601f830112607a57600080fd5b813581811115608857600080fd5b866020828501011115609957600080fd5b6020929092019691955090935050505056fea2646970667358221220ca973e1250364de7b60ac88a044c6bc0c2bfa878e204daa3c5c76d5dec8ca35164736f6c63430008130033a2646970667358221220df0e2fb5be1dc312297616600d34a69a083dbafe64c9ea54f7a37a332d0c2d0d64736f6c63430008130033",
"nonce": "0x0",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [],
"path": "/Users/andreasbigger/optimism/op-challenger/testdata/mock-dgf/broadcast/DeployMocks.s.sol/900/run-latest.json",
"returns": {},
"timestamp": 1680316709,
"chain": 900,
"multi": false,
"commit": "6af79d8"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"transactions": [
{
"hash": null,
"transactionType": "CREATE",
"contractName": "MockDisputeGameFactory",
"contractAddress": "0x020000000fc854958a2400c973D2523146343D31",
"function": null,
"arguments": null,
"rpc": "http://localhost:8545",
"transaction": {
"type": "0x02",
"from": "0xaf00b1c8a848be9afb28860ba0dc27b02fe3bd4d",
"gas": "0x41297",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b506102c1806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633142e55e14610030575b600080fd5b61004361003e3660046100e8565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b600060405161006d906100db565b604051809103906000f080158015610089573d6000803e3d6000fd5b5090508385600281111561009f5761009f610175565b6040516001600160a01b038416907ffad0599ff449d8d9685eadecca8cb9e00924c5fd8367c1c09469824939e1ffec90600090a4949350505050565b6101008061018c83390190565b600080600080606085870312156100fe57600080fd5b84356003811061010d57600080fd5b935060208501359250604085013567ffffffffffffffff8082111561013157600080fd5b818701915087601f83011261014557600080fd5b81358181111561015457600080fd5b88602082850101111561016657600080fd5b95989497505060200194505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b5060e18061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b8b9c18814602d575b600080fd5b603c6038366004603e565b5050565b005b60008060208385031215605057600080fd5b823567ffffffffffffffff80821115606757600080fd5b818501915085601f830112607a57600080fd5b813581811115608857600080fd5b866020828501011115609957600080fd5b6020929092019691955090935050505056fea2646970667358221220ca973e1250364de7b60ac88a044c6bc0c2bfa878e204daa3c5c76d5dec8ca35164736f6c63430008130033a2646970667358221220df0e2fb5be1dc312297616600d34a69a083dbafe64c9ea54f7a37a332d0c2d0d64736f6c63430008130033",
"nonce": "0x0",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [],
"path": "/Users/andreasbigger/optimism/op-challenger/testdata/mock-dgf/broadcast/DeployMocks.s.sol/900/run-latest.json",
"returns": {},
"timestamp": 1680317219,
"chain": 900,
"multi": false,
"commit": "6af79d8"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"transactions": [
{
"hash": null,
"transactionType": "CREATE",
"contractName": "MockDisputeGameFactory",
"contractAddress": "0x020000000fc854958a2400c973D2523146343D31",
"function": null,
"arguments": null,
"rpc": "http://localhost:8545",
"transaction": {
"type": "0x02",
"from": "0xaf00b1c8a848be9afb28860ba0dc27b02fe3bd4d",
"gas": "0x41297",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b506102c1806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633142e55e14610030575b600080fd5b61004361003e3660046100e8565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b600060405161006d906100db565b604051809103906000f080158015610089573d6000803e3d6000fd5b5090508385600281111561009f5761009f610175565b6040516001600160a01b038416907ffad0599ff449d8d9685eadecca8cb9e00924c5fd8367c1c09469824939e1ffec90600090a4949350505050565b6101008061018c83390190565b600080600080606085870312156100fe57600080fd5b84356003811061010d57600080fd5b935060208501359250604085013567ffffffffffffffff8082111561013157600080fd5b818701915087601f83011261014557600080fd5b81358181111561015457600080fd5b88602082850101111561016657600080fd5b95989497505060200194505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b5060e18061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b8b9c18814602d575b600080fd5b603c6038366004603e565b5050565b005b60008060208385031215605057600080fd5b823567ffffffffffffffff80821115606757600080fd5b818501915085601f830112607a57600080fd5b813581811115608857600080fd5b866020828501011115609957600080fd5b6020929092019691955090935050505056fea2646970667358221220ca973e1250364de7b60ac88a044c6bc0c2bfa878e204daa3c5c76d5dec8ca35164736f6c63430008130033a2646970667358221220df0e2fb5be1dc312297616600d34a69a083dbafe64c9ea54f7a37a332d0c2d0d64736f6c63430008130033",
"nonce": "0x0",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [],
"path": "/Users/andreasbigger/optimism/op-challenger/testdata/mock-dgf/broadcast/DeployMocks.s.sol/900/run-latest.json",
"returns": {},
"timestamp": 1680317332,
"chain": 900,
"multi": false,
"commit": "6af79d8"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"transactions": [
{
"hash": "0x6403189c086e0d879c016fe4b39a9548583d50bedde7b765c94fc0e5b044ed40",
"transactionType": "CREATE",
"contractName": "MockDisputeGameFactory",
"contractAddress": "0x020000000fc854958a2400c973D2523146343D31",
"function": null,
"arguments": null,
"rpc": "http://localhost:8545",
"transaction": {
"type": "0x02",
"from": "0xaf00b1c8a848be9afb28860ba0dc27b02fe3bd4d",
"gas": "0x41297",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b506102c1806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633142e55e14610030575b600080fd5b61004361003e3660046100e8565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b600060405161006d906100db565b604051809103906000f080158015610089573d6000803e3d6000fd5b5090508385600281111561009f5761009f610175565b6040516001600160a01b038416907ffad0599ff449d8d9685eadecca8cb9e00924c5fd8367c1c09469824939e1ffec90600090a4949350505050565b6101008061018c83390190565b600080600080606085870312156100fe57600080fd5b84356003811061010d57600080fd5b935060208501359250604085013567ffffffffffffffff8082111561013157600080fd5b818701915087601f83011261014557600080fd5b81358181111561015457600080fd5b88602082850101111561016657600080fd5b95989497505060200194505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b5060e18061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b8b9c18814602d575b600080fd5b603c6038366004603e565b5050565b005b60008060208385031215605057600080fd5b823567ffffffffffffffff80821115606757600080fd5b818501915085601f830112607a57600080fd5b813581811115608857600080fd5b866020828501011115609957600080fd5b6020929092019691955090935050505056fea2646970667358221220ca973e1250364de7b60ac88a044c6bc0c2bfa878e204daa3c5c76d5dec8ca35164736f6c63430008130033a2646970667358221220df0e2fb5be1dc312297616600d34a69a083dbafe64c9ea54f7a37a332d0c2d0d64736f6c63430008130033",
"nonce": "0x0",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [
"0x6403189c086e0d879c016fe4b39a9548583d50bedde7b765c94fc0e5b044ed40"
],
"path": "/Users/andreasbigger/optimism/op-challenger/testdata/mock-dgf/broadcast/DeployMocks.s.sol/900/run-latest.json",
"returns": {},
"timestamp": 1680317484,
"chain": 900,
"multi": false,
"commit": "6af79d8"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"transactions": [
{
"hash": "0x6403189c086e0d879c016fe4b39a9548583d50bedde7b765c94fc0e5b044ed40",
"transactionType": "CREATE",
"contractName": "MockDisputeGameFactory",
"contractAddress": "0x020000000fc854958a2400c973D2523146343D31",
"function": null,
"arguments": null,
"rpc": "http://localhost:8545",
"transaction": {
"type": "0x02",
"from": "0xaf00b1c8a848be9afb28860ba0dc27b02fe3bd4d",
"gas": "0x41297",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b506102c1806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633142e55e14610030575b600080fd5b61004361003e3660046100e8565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b600060405161006d906100db565b604051809103906000f080158015610089573d6000803e3d6000fd5b5090508385600281111561009f5761009f610175565b6040516001600160a01b038416907ffad0599ff449d8d9685eadecca8cb9e00924c5fd8367c1c09469824939e1ffec90600090a4949350505050565b6101008061018c83390190565b600080600080606085870312156100fe57600080fd5b84356003811061010d57600080fd5b935060208501359250604085013567ffffffffffffffff8082111561013157600080fd5b818701915087601f83011261014557600080fd5b81358181111561015457600080fd5b88602082850101111561016657600080fd5b95989497505060200194505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b5060e18061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b8b9c18814602d575b600080fd5b603c6038366004603e565b5050565b005b60008060208385031215605057600080fd5b823567ffffffffffffffff80821115606757600080fd5b818501915085601f830112607a57600080fd5b813581811115608857600080fd5b866020828501011115609957600080fd5b6020929092019691955090935050505056fea2646970667358221220ca973e1250364de7b60ac88a044c6bc0c2bfa878e204daa3c5c76d5dec8ca35164736f6c63430008130033a2646970667358221220df0e2fb5be1dc312297616600d34a69a083dbafe64c9ea54f7a37a332d0c2d0d64736f6c63430008130033",
"nonce": "0x0",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0x6403189c086e0d879c016fe4b39a9548583d50bedde7b765c94fc0e5b044ed40",
"transactionIndex": "0x0",
"blockHash": "0xe4bbeab2637b22c7f2e63bb756b6f8b333c48f75d9add6539b7e7efc9bd80038",
"blockNumber": "0x336",
"from": "0xAF00b1C8A848BE9aFb28860BA0dC27b02fE3BD4d",
"to": null,
"cumulativeGasUsed": "0x321fe",
"gasUsed": "0x321fe",
"contractAddress": "0x020000000fc854958a2400c973D2523146343D31",
"logs": [],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"effectiveGasPrice": "0xb2d05e07"
}
],
"libraries": [],
"pending": [],
"path": "/Users/andreasbigger/optimism/op-challenger/testdata/mock-dgf/broadcast/DeployMocks.s.sol/900/run-latest.json",
"returns": {},
"timestamp": 1680317487,
"chain": 900,
"multi": false,
"commit": "6af79d8"
}
50 changes: 50 additions & 0 deletions testdata/mock-dgf/broadcast/DeployMocks.s.sol/900/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"transactions": [
{
"hash": "0x6403189c086e0d879c016fe4b39a9548583d50bedde7b765c94fc0e5b044ed40",
"transactionType": "CREATE",
"contractName": "MockDisputeGameFactory",
"contractAddress": "0x020000000fc854958a2400c973D2523146343D31",
"function": null,
"arguments": null,
"rpc": "http://localhost:8545",
"transaction": {
"type": "0x02",
"from": "0xaf00b1c8a848be9afb28860ba0dc27b02fe3bd4d",
"gas": "0x41297",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b506102c1806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633142e55e14610030575b600080fd5b61004361003e3660046100e8565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b600060405161006d906100db565b604051809103906000f080158015610089573d6000803e3d6000fd5b5090508385600281111561009f5761009f610175565b6040516001600160a01b038416907ffad0599ff449d8d9685eadecca8cb9e00924c5fd8367c1c09469824939e1ffec90600090a4949350505050565b6101008061018c83390190565b600080600080606085870312156100fe57600080fd5b84356003811061010d57600080fd5b935060208501359250604085013567ffffffffffffffff8082111561013157600080fd5b818701915087601f83011261014557600080fd5b81358181111561015457600080fd5b88602082850101111561016657600080fd5b95989497505060200194505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b5060e18061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b8b9c18814602d575b600080fd5b603c6038366004603e565b5050565b005b60008060208385031215605057600080fd5b823567ffffffffffffffff80821115606757600080fd5b818501915085601f830112607a57600080fd5b813581811115608857600080fd5b866020828501011115609957600080fd5b6020929092019691955090935050505056fea2646970667358221220ca973e1250364de7b60ac88a044c6bc0c2bfa878e204daa3c5c76d5dec8ca35164736f6c63430008130033a2646970667358221220df0e2fb5be1dc312297616600d34a69a083dbafe64c9ea54f7a37a332d0c2d0d64736f6c63430008130033",
"nonce": "0x0",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0x6403189c086e0d879c016fe4b39a9548583d50bedde7b765c94fc0e5b044ed40",
"transactionIndex": "0x0",
"blockHash": "0xe4bbeab2637b22c7f2e63bb756b6f8b333c48f75d9add6539b7e7efc9bd80038",
"blockNumber": "0x336",
"from": "0xAF00b1C8A848BE9aFb28860BA0dC27b02fE3BD4d",
"to": null,
"cumulativeGasUsed": "0x321fe",
"gasUsed": "0x321fe",
"contractAddress": "0x020000000fc854958a2400c973D2523146343D31",
"logs": [],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"effectiveGasPrice": "0xb2d05e07"
}
],
"libraries": [],
"pending": [],
"path": "/Users/andreasbigger/optimism/op-challenger/testdata/mock-dgf/broadcast/DeployMocks.s.sol/900/run-latest.json",
"returns": {},
"timestamp": 1680317487,
"chain": 900,
"multi": false,
"commit": "6af79d8"
}

0 comments on commit c2bf90d

Please sign in to comment.