Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitscript authored Oct 10, 2022
1 parent 5d2b2d7 commit b432e17
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 28Day-Transfer.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.5.0 <0.9.0;

contract Day4 {
address owner;
//Create a constructor() to set the owner of contract
constructor() {
owner = msg.sender;
}
//Create a payable function send(address type array for storing addresses, uint type array to store the amount).

function send(address payable[] memory to, uint256[] memory amount)
public
payable
ownerOnly
{
require(to.length == amount.length, "to must be same length as amount");
for (uint256 i = 0; i < to.length; i++) {
to[i].transfer(amount[i]); //to array - 0x00 0x01 0x02
//amount array - 10 20 30
}
}

modifier ownerOnly() {
require(msg.sender == owner);
_;
}
}

0 comments on commit b432e17

Please sign in to comment.