Verified contractPartial
Distributor
Address0xdddf1aaef817ac7326ad963d700b484119deb81f
- Balance
0 ETH
- Transactions
13
- Compiler
solc 0.4.18
- Same code
4 more contracts
Details
- Compiler
- solc 0.4.18+commit.9cf6e910
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 4,848,885
- Creation transaction
- 0xe02e766991…e3ac49e659
Distributor.sol
pragma solidity ^0.4.18;
contract Distributor {
address public owner;
mapping (address => uint) public received;
mapping (address => uint) public balances;
address[] public receivers;
uint public index;
uint public total;
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
function Distributor() public {
owner = msg.sender;
}
function addReceivers(address[] _receivers, uint[] _balances) public onlyOwner {
for(uint i = 0; i < _receivers.length; i++) {
address receiver = _receivers[i];
require(balances[receiver] == 0);
balances[receiver] = _balances[i];
total += _balances[i];
receivers.push(receiver);
}
}
function process(uint count) public onlyOwner {
for(uint i = 0; index < receivers.length && i < count; i++) {
address receiver = receivers[index];
require(received[receiver] == 0);
uint value = balances[receiver];
received[receiver] = balances[receiver];
receiver.transfer(value);
index++;
}
}
function () public payable {
}
function retreive() public onlyOwner {
owner.transfer(this.balance);
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.