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
ceb82a0a
Unverified
Commit
ceb82a0a
authored
Dec 14, 2022
by
mergify[bot]
Committed by
GitHub
Dec 14, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4419 from ethereum-optimism/feat/wd-helper
op-chain-ops: withdrawal tx helper
parents
8b0e7ae1
c0b4d704
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
withdrawal.go
op-chain-ops/crossdomain/withdrawal.go
+14
-0
No files found.
op-chain-ops/crossdomain/withdrawal.go
View file @
ceb82a0a
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"errors"
"errors"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
...
@@ -139,3 +140,16 @@ func (w *Withdrawal) StorageSlot() (common.Hash, error) {
...
@@ -139,3 +140,16 @@ func (w *Withdrawal) StorageSlot() (common.Hash, error) {
slot
:=
crypto
.
Keccak256
(
preimage
)
slot
:=
crypto
.
Keccak256
(
preimage
)
return
common
.
BytesToHash
(
slot
),
nil
return
common
.
BytesToHash
(
slot
),
nil
}
}
// WithdrawalTransaction will convert the Withdrawal to a type
// suitable for sending a transaction.
func
(
w
*
Withdrawal
)
WithdrawalTransaction
()
bindings
.
TypesWithdrawalTransaction
{
return
bindings
.
TypesWithdrawalTransaction
{
Nonce
:
w
.
Nonce
,
Sender
:
*
w
.
Sender
,
Target
:
*
w
.
Target
,
Value
:
w
.
Value
,
GasLimit
:
w
.
GasLimit
,
Data
:
w
.
Data
,
}
}
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