reentrancy

package
v1.13.14-0.4.0.rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL