Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function flashLoan() could fail on some ethereum versions #12

Open
duzy opened this issue May 30, 2022 · 0 comments
Open

function flashLoan() could fail on some ethereum versions #12

duzy opened this issue May 30, 2022 · 0 comments

Comments

@duzy
Copy link

duzy commented May 30, 2022

The implementation

(bool success, ) = msg.sender.call(
abi.encodeWithSignature(
"receiveFlashLoan(uint256)",
amount
)
);

it is highly recommended to be replaced with this:

interface IFlashLoanReceiver {
    function receiveFlashLoan(uint256) external returns(bool);
}

and then

bool success = IFlashLoanReceiver(msg.sender).receiveFlashLoan(amount);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant