Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
713e73a7
Commit
713e73a7
authored
Jul 31, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `BlockHashOracle` binding
parent
a0dbcce7
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
301 additions
and
2 deletions
+301
-2
artifacts.json
op-bindings/artifacts.json
+1
-0
blockhashoracle.go
op-bindings/bindings/blockhashoracle.go
+254
-0
blockhashoracle_more.go
op-bindings/bindings/blockhashoracle_more.go
+25
-0
abi_test.go
op-challenger/fault/abi_test.go
+7
-0
deploy.go
op-e2e/e2eutils/disputegame/deploy.go
+13
-1
helper.go
op-e2e/e2eutils/disputegame/helper.go
+1
-1
No files found.
op-bindings/artifacts.json
View file @
713e73a7
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
"CrossDomainMessenger"
,
"CrossDomainMessenger"
,
"MIPS"
,
"MIPS"
,
"PreimageOracle"
,
"PreimageOracle"
,
"BlockHashOracle"
,
"EAS"
,
"EAS"
,
"SchemaRegistry"
"SchemaRegistry"
]
]
op-bindings/bindings/blockhashoracle.go
0 → 100644
View file @
713e73a7
This diff is collapsed.
Click to expand it.
op-bindings/bindings/blockhashoracle_more.go
0 → 100644
View file @
713e73a7
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package
bindings
import
(
"encoding/json"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
const
BlockHashOracleStorageLayoutJSON
=
"{
\"
storage
\"
:[{
\"
astId
\"
:1000,
\"
contract
\"
:
\"
src/dispute/BlockHashOracle.sol:BlockHashOracle
\"
,
\"
label
\"
:
\"
blockHashes
\"
,
\"
offset
\"
:0,
\"
slot
\"
:
\"
0
\"
,
\"
type
\"
:
\"
t_mapping(t_uint256,t_userDefinedValueType(Hash)1001)
\"
}],
\"
types
\"
:{
\"
t_mapping(t_uint256,t_userDefinedValueType(Hash)1001)
\"
:{
\"
encoding
\"
:
\"
mapping
\"
,
\"
label
\"
:
\"
mapping(uint256 =
\u003e
Hash)
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
,
\"
key
\"
:
\"
t_uint256
\"
,
\"
value
\"
:
\"
t_userDefinedValueType(Hash)1001
\"
},
\"
t_uint256
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
uint256
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
},
\"
t_userDefinedValueType(Hash)1001
\"
:{
\"
encoding
\"
:
\"
inplace
\"
,
\"
label
\"
:
\"
Hash
\"
,
\"
numberOfBytes
\"
:
\"
32
\"
}}}"
var
BlockHashOracleStorageLayout
=
new
(
solc
.
StorageLayout
)
var
BlockHashOracleDeployedBin
=
"0x608060405234801561001057600080fd5b50600436106100365760003560e01c80636057361d1461003b57806399d548aa14610050575b600080fd5b61004e61004936600461010e565b610075565b005b61006361005e36600461010e565b6100c0565b60405190815260200160405180910390f35b8040806100ae576040517fd82756d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60009182526020829052604090912055565b60008181526020819052604081205490819003610109576040517f37cf270500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60006020828403121561012057600080fd5b503591905056fea164736f6c634300080f000a"
func
init
()
{
if
err
:=
json
.
Unmarshal
([]
byte
(
BlockHashOracleStorageLayoutJSON
),
BlockHashOracleStorageLayout
);
err
!=
nil
{
panic
(
err
)
}
layouts
[
"BlockHashOracle"
]
=
BlockHashOracleStorageLayout
deployedBytecodes
[
"BlockHashOracle"
]
=
BlockHashOracleDeployedBin
}
op-challenger/fault/abi_test.go
View file @
713e73a7
...
@@ -27,6 +27,12 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu
...
@@ -27,6 +27,12 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu
return
common
.
Address
{},
nil
,
nil
,
nil
,
err
return
common
.
Address
{},
nil
,
nil
,
nil
,
err
}
}
backend
:=
backends
.
NewSimulatedBackend
(
core
.
GenesisAlloc
{
from
:
{
Balance
:
big
.
NewInt
(
params
.
Ether
)}},
50
_000_000
)
backend
:=
backends
.
NewSimulatedBackend
(
core
.
GenesisAlloc
{
from
:
{
Balance
:
big
.
NewInt
(
params
.
Ether
)}},
50
_000_000
)
blockHashOracle
,
_
,
_
,
err
:=
bindings
.
DeployBlockHashOracle
(
opts
,
backend
)
if
err
!=
nil
{
return
common
.
Address
{},
nil
,
nil
,
nil
,
err
}
_
,
_
,
contract
,
err
:=
bindings
.
DeployFaultDisputeGame
(
_
,
_
,
contract
,
err
:=
bindings
.
DeployFaultDisputeGame
(
opts
,
opts
,
backend
,
backend
,
...
@@ -35,6 +41,7 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu
...
@@ -35,6 +41,7 @@ func setupFaultDisputeGame() (common.Address, *bind.TransactOpts, *backends.Simu
uint64
(
604800
),
// 7 days
uint64
(
604800
),
// 7 days
common
.
Address
{
0xdd
},
// VM
common
.
Address
{
0xdd
},
// VM
common
.
Address
{
0xee
},
// L2OutputOracle (Not used in Alphabet Game)
common
.
Address
{
0xee
},
// L2OutputOracle (Not used in Alphabet Game)
blockHashOracle
,
// Block hash oracle
)
)
if
err
!=
nil
{
if
err
!=
nil
{
return
common
.
Address
{},
nil
,
nil
,
nil
,
err
return
common
.
Address
{},
nil
,
nil
,
nil
,
err
...
...
op-e2e/e2eutils/disputegame/deploy.go
View file @
713e73a7
...
@@ -50,8 +50,20 @@ func deployDisputeGameContracts(require *require.Assertions, ctx context.Context
...
@@ -50,8 +50,20 @@ func deployDisputeGameContracts(require *require.Assertions, ctx context.Context
alphaVMAddr
,
err
:=
bind
.
WaitDeployed
(
ctx
,
client
,
tx
)
alphaVMAddr
,
err
:=
bind
.
WaitDeployed
(
ctx
,
client
,
tx
)
require
.
NoError
(
err
)
require
.
NoError
(
err
)
// Deploy the block hash oracle
_
,
tx
,
blockHashOracle
,
err
:=
bindings
.
DeployBlockHashOracle
(
opts
,
client
)
require
.
NoError
(
err
)
blockHashOracleAddr
,
err
:=
bind
.
WaitDeployed
(
ctx
,
client
,
tx
)
require
.
NoError
(
err
)
// Store the genesis block hash in the oracle
tx
,
err
=
blockHashOracle
.
Store
(
opts
,
big
.
NewInt
(
0
))
require
.
NoError
(
err
)
_
,
err
=
utils
.
WaitReceiptOK
(
ctx
,
client
,
tx
.
Hash
())
require
.
NoError
(
err
,
"failed to store genesis block hash in oracle"
)
// Deploy the fault dispute game implementation
// Deploy the fault dispute game implementation
_
,
tx
,
_
,
err
=
bindings
.
DeployFaultDisputeGame
(
opts
,
client
,
alphabetVMAbsolutePrestateClaim
,
big
.
NewInt
(
alphabetGameDepth
),
gameDuration
,
alphaVMAddr
,
common
.
Address
{
0xBE
,
0xEF
})
_
,
tx
,
_
,
err
=
bindings
.
DeployFaultDisputeGame
(
opts
,
client
,
alphabetVMAbsolutePrestateClaim
,
big
.
NewInt
(
alphabetGameDepth
),
gameDuration
,
alphaVMAddr
,
common
.
Address
{
0xBE
,
0xEF
}
,
blockHashOracleAddr
)
require
.
NoError
(
err
)
require
.
NoError
(
err
)
faultDisputeGameAddr
,
err
:=
bind
.
WaitDeployed
(
ctx
,
client
,
tx
)
faultDisputeGameAddr
,
err
:=
bind
.
WaitDeployed
(
ctx
,
client
,
tx
)
require
.
NoError
(
err
)
require
.
NoError
(
err
)
...
...
op-e2e/e2eutils/disputegame/helper.go
View file @
713e73a7
...
@@ -33,7 +33,7 @@ const (
...
@@ -33,7 +33,7 @@ const (
StatusDefenderWins
StatusDefenderWins
)
)
var
alphaExtraData
=
common
.
Hex2Bytes
(
"
1
000000000000000000000000000000000000000000000000000000000000000"
)
var
alphaExtraData
=
common
.
Hex2Bytes
(
"
0x00000000000000000000000000000000000000000000000000000000000000010
000000000000000000000000000000000000000000000000000000000000000"
)
var
alphabetVMAbsolutePrestate
=
common
.
Hex2Bytes
(
"0000000000000000000000000000000000000000000000000000000000000060"
)
var
alphabetVMAbsolutePrestate
=
common
.
Hex2Bytes
(
"0000000000000000000000000000000000000000000000000000000000000060"
)
var
alphabetVMAbsolutePrestateClaim
=
crypto
.
Keccak256Hash
(
alphabetVMAbsolutePrestate
)
var
alphabetVMAbsolutePrestateClaim
=
crypto
.
Keccak256Hash
(
alphabetVMAbsolutePrestate
)
var
CorrectAlphabet
=
"abcdefghijklmnop"
var
CorrectAlphabet
=
"abcdefghijklmnop"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment