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

Update Airdropper.sol #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions Airdropper.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity 0.4.21;
pragma solidity 0.4.24;


/**
Expand Down Expand Up @@ -62,7 +62,7 @@ contract Ownable {
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
constructor() public {
owner = msg.sender;
}

Expand Down Expand Up @@ -118,7 +118,7 @@ contract Airdropper is Ownable {
* @param tokenAddress Address of the token contract.
* @param decimals Decimals as specified by the token.
*/
function Airdropper(address tokenAddress, uint decimals) public {
constructor(address tokenAddress, uint decimals) public {
require(decimals <= 77); // 10**77 < 2**256-1 < 10**78

token = ERC20(tokenAddress);
Expand All @@ -135,7 +135,7 @@ contract Airdropper is Ownable {
function airdrop(address source, address[] dests, uint[] values) public onlyOwner {
// This simple validation will catch most mistakes without consuming
// too much gas.
require(dests.length == values.length);
require(dests.length == values.length && dests.length <= 50);

for (uint256 i = 0; i < dests.length; i++) {
require(token.transferFrom(source, dests[i], values[i].mul(multiplier)));
Expand All @@ -157,4 +157,3 @@ contract Airdropper is Ownable {
selfdestruct(owner);
}
}