File 1 of 1: BatchSerder.sol
pragma solidity ^0.4.15;
contract ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transferFrom( address from, address to, uint value) returns (bool ok);
}
contract BatchSerder {
function sendErc20(address _tokenAddress, address[] _to, uint256[] _value) payable returns (bool _success) {
require(_to.length == _value.length,"to is not equal to value");
require(_to.length <= 255,"to is more than 255");
ERC20 token = ERC20(_tokenAddress);
for (uint8 i = 0; i < _to.length; i++) {
require(token.transferFrom(msg.sender, _to[i], _value[i]) == true,"batch sending error");
}
return true;
}
}
{
"compilationTarget": {
"contracts/BatchSerder.sol": "BatchSerder"
},
"evmVersion": "byzantium",
"libraries": {},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}