Documentation
¶
Overview ¶
Package reentrancy provides a reentrancy guard for stateful precompiles that make outgoing calls to other contracts.
Reentrancy occurs when the contract (C) called by a precompile (P) makes a further call back into P, which may result in theft of funds (see DAO hack). A reentrancy guard detects these recursive calls and reverts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Guard ¶
func Guard(env vm.PrecompileEnvironment, key []byte) error
Guard returns vm.ErrExecutionReverted i.f.f. it has already been called with the same `key`, by the same contract, in the same transaction. It otherwise returns nil. The `key` MAY be nil.
Contract equality is defined as the libevm.AddressContext "self" address being the same under EVM semantics.
Types ¶
This section is empty.