merge transactions and update
This commit is contained in:
13
internal/blockchain/eth/draft/multiSend_eth.sol
Normal file
13
internal/blockchain/eth/draft/multiSend_eth.sol
Normal file
@@ -0,0 +1,13 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
contract MultiSend {
|
||||
function multiTransfer(address[] calldata to, uint256[] calldata amounts) external payable {
|
||||
uint256 length = to.length;
|
||||
require(length == amounts.length, "Arrays must have the same length");
|
||||
|
||||
for (uint256 i = 0; i < length; i++) {
|
||||
payable(to[i]).transfer(amounts[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user