Automatically merged updates to draft EIP(s) 3234 (#3458)

Hi, I'm a bot! This change was automatically merged because:

 - It only modifies existing Draft, Review, or Last Call EIP(s)
 - The PR was approved or written by at least one author of each modified EIP
 - The build is passing
This commit is contained in:
rictorlome 2021-04-02 09:17:36 -04:00 committed by GitHub
parent bdb02678be
commit 559bf352fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,8 +61,8 @@ interface IERC3234BatchFlashLender {
*/ */
function batchFlashLoan( function batchFlashLoan(
IERC3234BatchFlashBorrower receiver, IERC3234BatchFlashBorrower receiver,
address[] calldata token, address[] calldata tokens,
uint256[] calldata amount, uint256[] calldata amounts,
bytes[] calldata data bytes[] calldata data
) external returns (bool); ) external returns (bool);
} }
@ -83,7 +83,13 @@ function batchFlashLoan(
) external returns (bool) { ) external returns (bool) {
... ...
require( require(
receiver.onBatchFlashLoan(msg.sender, tokens, amounts, fees, data), receiver.onBatchFlashLoan(
msg.sender,
tokens,
amounts,
fees,
data
) == keccak256("ERC3234BatchFlashBorrower.onBatchFlashLoan"),
"IERC3234: Callback failed" "IERC3234: Callback failed"
); );
... ...
@ -106,20 +112,20 @@ If successful, `batchFlashLoan` MUST return `true`.
### Receiver Specification ### Receiver Specification
A `receiver` of flash loans MUST implement the IERC3234FlashBorrower interface: A `receiver` of flash loans MUST implement the IERC3234BatchFlashBorrower interface:
``` ```
pragma solidity ^0.7.0 || ^0.8.0; pragma solidity ^0.7.0 || ^0.8.0;
interface IERC3234FlashBorrower { interface IERC3234BatchFlashBorrower {
/** /**
* @dev Receive a flash loan. * @dev Receive a flash loan.
* @param initiator The initiator of the loan. * @param initiator The initiator of the loan.
* @param token The loan currency. * @param tokens The loan currency.
* @param amount The amount of tokens lent. * @param amounts The amount of tokens lent.
* @param fee The additional amount of tokens to repay. * @param fees The additional amount of tokens to repay.
* @param data Arbitrary data structure, intended to contain user-defined parameters. * @param data Arbitrary data structure, intended to contain user-defined parameters.
* @return The keccak256 hash of "ERC3234BatchFlashBorrower.onBatchFlashLoan" * @return The keccak256 hash of "ERC3234BatchFlashBorrower.onBatchFlashLoan"
*/ */