Skip to content
Verified contractPartial

Distributor

Address0x55446cb4980059f30f7dce130effbfa0533e40e8
Balance

0 ETH

 

Transactions

12

 

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,858,180
Creation transaction
0x34259b61f5…146414689d
Main copy (most transactions)
0xdddf1aae…19deb81f

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.