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

ERC3156FlashBorrowerMockUpgradeable

Inherits: Initializable, IERC3156FlashBorrower

WARNING: this IERC3156FlashBorrower mock implementation is for testing purposes ONLY. Writing a secure flash lock borrower is not an easy task, and should be done with the utmost care. This is not an example of how it should be done, and no pattern present in this mock should be considered secure. Following best practices, always have your contract properly audited before using them to manipulate important funds on live networks.

State Variables

_RETURN_VALUE

bytes32 internal constant _RETURN_VALUE = keccak256("ERC3156FlashBorrower.onFlashLoan");

_enableApprove

bool _enableApprove;

_enableReturn

bool _enableReturn;

Functions

__ERC3156FlashBorrowerMock_init

function __ERC3156FlashBorrowerMock_init(bool enableReturn, bool enableApprove) internal onlyInitializing;

__ERC3156FlashBorrowerMock_init_unchained

function __ERC3156FlashBorrowerMock_init_unchained(bool enableReturn, bool enableApprove) internal onlyInitializing;

onFlashLoan

function onFlashLoan(address, address token, uint256 amount, uint256 fee, bytes calldata data)
    public
    returns (bytes32);

Events

BalanceOf

event BalanceOf(address token, address account, uint256 value);

TotalSupply

event TotalSupply(address token, uint256 value);