Documentation
¶
Index ¶
- Constants
- Variables
- func VerifyProof(holder common.Address, storageRoot common.Hash, ...) error
- type Mapbased
- func (m *Mapbased) DiscoverSlot(ctx context.Context, holder common.Address) (int, *big.Rat, error)
- func (m *Mapbased) GetProof(ctx context.Context, holder common.Address, block *big.Int, islot int) (*ethstorageproof.StorageProof, error)
- func (m *Mapbased) VerifyProof(holder common.Address, storageRoot common.Hash, ...) error
Constants ¶
View Source
const (
DiscoveryIterations = 30
)
Variables ¶
View Source
var ErrSlotNotFound = errors.New("storage slot not found")
ErrSlotNotFound represents the storage slot not found error
Functions ¶
func VerifyProof ¶
func VerifyProof(holder common.Address, storageRoot common.Hash, proof ethstorageproof.StorageResult, mapIndexSlot int, targetBalance, targetBlock *big.Int) error
VerifyProof verifies a map based storage proof. The targetBalance parameter is the full balance value, without decimals.
Types ¶
type Mapbased ¶
type Mapbased struct {
// contains filtered or unexported fields
}
Mapbased tokens are those where the balance is stored on a map `address => uint256`. Most of ERC20 tokens follows this approach.
func (*Mapbased) DiscoverSlot ¶
DiscoverSlot tries to find the EVM storage index slot. A token holder address must be provided in order to have a balance to search and compare. Returns ErrSlotNotFound if the slot cannot be found. If found, returns also the amount stored.
func (*Mapbased) GetProof ¶
func (m *Mapbased) GetProof(ctx context.Context, holder common.Address, block *big.Int, islot int) (*ethstorageproof.StorageProof, error)
GetProof returns the storage merkle proofs for the acount holder.
func (*Mapbased) VerifyProof ¶
func (m *Mapbased) VerifyProof(holder common.Address, storageRoot common.Hash, proofs []ethstorageproof.StorageResult, mapIndexSlot int, targetBalance, targetBlock *big.Int) error
VerifyProof verifies a map based storage proof.
Click to show internal directories.
Click to hide internal directories.