mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-30 00:23:46 +00:00
* init rollup/rcfg/config.go minor * update traces struct * init withdraw_trie.go * finish * fix `L2MessageQueueAddress` * refactor(rollup): add `UsingScroll` into `ChainConfig` (#218) * update comments * update comments
18 lines
569 B
Go
18 lines
569 B
Go
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)
|
|
}
|