Disperse
0xd15fe25ed0dba12fe05e7029c88b10c25e8880e3
Verification
Verified
v0.4.25+commit.59dbf8f1
Type
Contract
1,780 bytes
ABI entries
3
0 read · 3 write
License
none
Contract information
- Address
- 0xd15fe25ed0dba12fe05e7029c88b10c25e8880e3
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.4.25+commit.59dbf8f1
- Optimization
- Disabled
- Creator
- 0xba5Ed09963…d3c28ba5Ed
- Creation tx
- 0x3a9ea1f1e7…e4e7989d0d
Token
Not a token
This contract does not expose ERC-20 metadata.
Read contract (0)
No read functions
The ABI is unavailable or exposes no view functions.
ABI
[
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "recipients",
"type": "address[]"
},
{
"name": "values",
"type": "uint256[]"
}
],
"name": "disperseTokenSimple",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "recipients",
"type": "address[]"
},
{
"name": "values",
"type": "uint256[]"
}
],
"name": "disperseToken",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "recipients",
"type": "address[]"
},
{
"name": "values",
"type": "uint256[]"
}
],
"name": "disperseEther",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
}
]Source code
pragma solidity ^0.4.25;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
contract Disperse {
function disperseEther(address[] recipients, uint256[] values) external payable {
for (uint256 i = 0; i < recipients.length; i++)
recipients[i].transfer(values[i]);
uint256 balance = address(this).balance;
if (balance > 0)
msg.sender.transfer(balance);
}
function disperseToken(IERC20 token, address[] recipients, uint256[] values) external {
uint256 total = 0;
for (uint256 i = 0; i < recipients.length; i++)
total += values[i];
require(token.transferFrom(msg.sender, address(this), total));
for (i = 0; i < recipients.length; i++)
require(token.transfer(recipients[i], values[i]));
}
function disperseTokenSimple(IERC20 token, address[] recipients, uint256[] values) external {
for (uint256 i = 0; i < recipients.length; i++)
require(token.transferFrom(msg.sender, recipients[i], values[i]));
}
}
Chain explorer2933msChain node77ms