mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
rollup: add rollup/withdrawtrie package (#543)
This commit is contained in:
parent
803286714a
commit
a6ac896a2e
1 changed files with 18 additions and 0 deletions
18
rollup/withdrawtrie/withdraw_trie.go
Normal file
18
rollup/withdrawtrie/withdraw_trie.go
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
package withdrawtrie
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/scroll-tech/go-ethereum/common"
|
||||||
|
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
|
||||||
|
)
|
||||||
|
|
||||||
|
// StateDB represents the StateDB interface
|
||||||
|
// required to get withdraw trie root
|
||||||
|
type StateDB interface {
|
||||||
|
GetState(common.Address, common.Hash) common.Hash
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadWTRSlot reads WithdrawTrieRoot slot in L2MessageQueue predeploy, i.e., `messageRoot`
|
||||||
|
// in contracts/src/libraries/common/AppendOnlyMerkleTree.sol
|
||||||
|
func ReadWTRSlot(addr common.Address, state StateDB) common.Hash {
|
||||||
|
return state.GetState(addr, rcfg.WithdrawTrieRootSlot)
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue