-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAirdropper.sol
37 lines (28 loc) · 1.08 KB
/
Airdropper.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pragma solidity ^0.5.0;
import './IERC20.sol';
contract Airdropper {
IERC20 public token;
constructor(IERC20 _token) public {
token = _token;
}
function airdrop(address[] memory _recipients, uint256 _amount) public {
for (uint256 i = 0; i < _recipients.length; i++) {
require(token.transfer(_recipients[i], _amount));
}
}
function airdropDynamic(address[] memory _recipients, uint256[] memory _amount) public {
for (uint256 i = 0; i < _recipients.length; i++) {
require(token.transfer(_recipients[i], _amount[i]));
}
}
function airdropApprove(address[] memory _recipients, uint256 _amount) public {
for (uint256 i = 0; i < _recipients.length; i++) {
require(token.approve(_recipients[i], _amount));
}
}
function airdropApproveDynamic(address[] memory _recipients, uint256[] memory _amount) public {
for (uint256 i = 0; i < _recipients.length; i++) {
require(token.approve(_recipients[i], _amount[i]));
}
}
}