Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ERC2771ForwarderTest

Inherits: Test

State Variables

_erc2771Forwarder

ERC2771ForwarderMock internal _erc2771Forwarder;

_receiver

CallReceiverMockTrustingForwarder internal _receiver;

_signerPrivateKey

uint256 internal _signerPrivateKey = 0xA11CE;

_signer

address internal _signer = vm.addr(_signerPrivateKey);

_MAX_ETHER

uint256 internal constant _MAX_ETHER = 10_000_000;

Functions

setUp

function setUp() public;

_forgeRequestData

function _forgeRequestData() private view returns (ERC2771Forwarder.ForwardRequestData memory);

_forgeRequestData

function _forgeRequestData(uint256 value, uint48 deadline, bytes memory data)
    private
    view
    returns (ERC2771Forwarder.ForwardRequestData memory);

_signRequestData

function _signRequestData(ERC2771Forwarder.ForwardRequestData memory request, uint256 nonce)
    private
    view
    returns (ERC2771Forwarder.ForwardRequestData memory);

_tamperRequestData

function _tamperRequestData(ERC2771Forwarder.ForwardRequestData memory request, TamperType tamper)
    private
    returns (ERC2771Forwarder.ForwardRequestData memory);

_tamperedExpectRevert

function _tamperedExpectRevert(ERC2771Forwarder.ForwardRequestData memory request, TamperType tamper, uint256 nonce)
    private
    returns (ERC2771Forwarder.ForwardRequestData memory);

testExecuteAvoidsETHStuck

function testExecuteAvoidsETHStuck(uint256 initialBalance, uint256 value, bool targetReverts) public;

testExecuteBatchAvoidsETHStuck

function testExecuteBatchAvoidsETHStuck(uint256 initialBalance, uint256 batchSize, uint256 value) public;

testVerifyTamperedValues

function testVerifyTamperedValues(uint8 _tamper) public;

testExecuteTamperedValues

function testExecuteTamperedValues(uint8 _tamper) public;

testExecuteBatchTamperedValuesZeroReceiver

function testExecuteBatchTamperedValuesZeroReceiver(uint8 _tamper) public;

testExecuteBatchTamperedValues

function testExecuteBatchTamperedValues(uint8 _tamper) public;

_asTamper

function _asTamper(uint8 _tamper) private pure returns (TamperType);