github.com/cryptotooltop/go-ethereum@v0.0.0-20231103184714-151d1922f3e5/rollup/withdrawtrie/withdraw_trie.go (about)

     1  package withdrawtrie
     2  
     3  import (
     4  	"github.com/scroll-tech/go-ethereum/common"
     5  	"github.com/scroll-tech/go-ethereum/rollup/rcfg"
     6  )
     7  
     8  // StateDB represents the StateDB interface
     9  // required to get withdraw trie root
    10  type StateDB interface {
    11  	GetState(common.Address, common.Hash) common.Hash
    12  }
    13  
    14  // ReadWTRSlot reads WithdrawTrieRoot slot in L2MessageQueue predeploy, i.e., `messageRoot`
    15  // in contracts/src/libraries/common/AppendOnlyMerkleTree.sol
    16  func ReadWTRSlot(addr common.Address, state StateDB) common.Hash {
    17  	return state.GetState(addr, rcfg.WithdrawTrieRootSlot)
    18  }