Sponsored Link:   Ambrosus Main-Net Launching: Stake AMB in Masternodes and get regular rewards for maintaining network integrity.
Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 8 txns
 Latest 8 txns

TxHash Age From To Value [TxFee]
0x5af62d283dc9ec657a7a743cdb6c6f7c35f8ecaf2ba5a59053f63c4fbcb161c9239 days 23 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820 Ether0.000260262
0x273471b5c97c0616e0ee637c4b9b611a20c1cb75e7c4bee595179933a2c7dc71243 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820 Ether0.000944623
0x84266402203e3503d999e9251ad728c607629f36af8109ddf2b1c50336039a73243 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820 Ether0.003424902
0xdd668615a08c06a07be9ff549afd4de31023294958d41cffd91ace8aebae7086243 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820 Ether0.000484975
0x5c7dd801d655cec44df46fced20056664fa6e869b9e7b51c0fca8465ed79a4a4243 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820 Ether0.001565581
0xe3d642920987f1dde93a9a8348e52d7efb4f78d357a4c3bca7cea51df1b1e8d9243 days 1 hr ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820 Ether0.001565581
0x4c393b9434a7959449d14801e827169818f9c56052efd4de847a23776410a9bf243 days 2 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN   0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820 Ether0.001849365
0x93a1038b378d424b74c1ef4ad853096cff24a7754c9baad1e32bb343e1cb427d317 days 10 hrs ago0x8b8a571730b631f58e7965d78582eae1b0417ab6  IN    Contract Creation0 Ether0.014789448
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 6 Internal Transactions

ParentTxHash Block Age From To Value
0x5af62d283dc9ec657a7a743cdb6c6f7c35f8ecaf2ba5a59053f63c4fbcb161c94575078239 days 23 hrs ago0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820x8b8a571730b631f58e7965d78582eae1b0417ab60 Ether
0x273471b5c97c0616e0ee637c4b9b611a20c1cb75e7c4bee595179933a2c7dc714555934243 days 1 hr ago0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820x5252013df34cfb6e4faa0df410490493044036980.0066448 Ether
0x273471b5c97c0616e0ee637c4b9b611a20c1cb75e7c4bee595179933a2c7dc714555934243 days 1 hr ago0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820x79b2b9047f5ee28029033f10e8811816eff289010.0058142 Ether
0x273471b5c97c0616e0ee637c4b9b611a20c1cb75e7c4bee595179933a2c7dc714555934243 days 1 hr ago0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820xb569db9407a7ca3f0b73090d1dc7fe2f4e5ba26e0.004153 Ether
0x556a651c6db2309b776901dea00ade7e13562a8810b08dd58df16259e18f63cf4555700243 days 2 hrs ago0xad4c4ff144e42c73b6333b75af3cee5af901c10e0xeb4245c88c660ae4ee23c76954e5490ccd7bbd820.0165 Ether
0xbe78301aa4ba176855f83cc24ef92343c6903683d7295a609afc2bb30a05efbf4553465243 days 11 hrs ago0xd7cf8eae66f26e13a400772a054b19fb3d98c2690xeb4245c88c660ae4ee23c76954e5490ccd7bbd820.000112 Ether
[ Download CSV Export  ] 
Contract SelfDestruct called at TxHash 0x5af62d283dc9ec657a7a743cdb6c6f7c35f8ecaf2ba5a59053f63c4fbcb161c9

Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity) Solidity compiler bugs.

Contract Source Code Verified (Exact match)
Contract Name: OrganizeFunds
Compiler Version: v0.4.15+commit.bbb8e64f
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.15;

/**
 *
 * @author  David Rosen <kaandoit@mcon.org>
 *
 * Version A
 *
 * Overview:
 * This divides all incoming funds among various `activity` accounts. The division cannot be changed
 * after the contract is locked.
 */


// --------------------------
//  R Split Contract
// --------------------------
contract OrganizeFunds {

  struct ActivityAccount {
    uint credited;   // total funds credited to this account
    uint balance;    // current balance = credited - amount withdrawn
    uint pctx10;     // percent allocation times ten
    address addr;    // payout addr of this acct
  }

  uint constant TENHUNDWEI = 1000;                     // need gt. 1000 wei to distribute
  uint constant MAX_ACCOUNTS = 10;                     // max accounts this contract can handle

  event MessageEvent(string message);
  event MessageEventI(string message, uint val);


  bool public isLocked;
  address public owner;                                // deployer executor
  mapping (uint => ActivityAccount) activityAccounts;  // accounts by index
  uint public activityCount;                           // how many activity accounts
  uint public totalFundsReceived;                      // amount received since begin of time
  uint public totalFundsDistributed;                   // amount distributed since begin of time
  uint public totalFundsWithdrawn;                     // amount withdrawn since begin of time
  uint public withdrawGas = 100000;                    // gas for withdrawals


  modifier ownerOnly {
    require(msg.sender == owner);
    _;
  }

  modifier unlockedOnly {
    require(!isLocked);
    _;
  }



  //
  // constructor
  //
  function OrganizeFunds() {
    owner = msg.sender;
  }

  function lock() public ownerOnly {
    isLocked = true;
  }


  //
  // reset
  // reset all accounts
  // in case we have any funds that have not been withdrawn, they become  newly received and undistributed.
  //
  function reset() public ownerOnly unlockedOnly {
    totalFundsReceived = this.balance;
    totalFundsDistributed = 0;
    totalFundsWithdrawn = 0;
    activityCount = 0;
    MessageEvent("ok: all accts reset");
  }


  //
  // set withdrawal gas
  // nonstandard gas is necessary to support push-withdrawals to other contract
  //
  function setWitdrawGas(uint256 _withdrawGas) public ownerOnly unlockedOnly {
    withdrawGas = _withdrawGas;
    MessageEventI("ok: withdraw gas set", withdrawGas);
  }


  //
  // add a new account
  //
  function addAccount(address _addr, uint256 _pctx10) public ownerOnly unlockedOnly {
    if (activityCount >= MAX_ACCOUNTS) {
      MessageEvent("err: max accounts");
      return;
    }
    activityAccounts[activityCount].addr = _addr;
    activityAccounts[activityCount].pctx10 = _pctx10;
    activityAccounts[activityCount].credited = 0;
    activityAccounts[activityCount].balance = 0;
    ++activityCount;
    MessageEvent("ok: acct added");
  }


  // ----------------------------
  // get acct info
  // ----------------------------
  function getAccountInfo(address _addr) public constant returns(uint _idx, uint _pctx10, uint _credited, uint _balance) {
    for (uint i = 0; i < activityCount; i++ ) {
      address addr = activityAccounts[i].addr;
      if (addr == _addr) {
        _idx = i;
        _pctx10 = activityAccounts[i].pctx10;
        _credited = activityAccounts[i].credited;
        _balance = activityAccounts[i].balance;
        return;
      }
    }
  }


  //
  // get total percentages x10
  //
  function getTotalPctx10() public constant returns(uint _totalPctx10) {
    _totalPctx10 = 0;
    for (uint i = 0; i < activityCount; i++ ) {
      _totalPctx10 += activityAccounts[i].pctx10;
    }
  }


  //
  // default payable function.
  // call us with plenty of gas, or catastrophe will ensue
  //
  function () payable {
    totalFundsReceived += msg.value;
    MessageEventI("ok: received", msg.value);
  }


  //
  // distribute funds to all activities
  //
  function distribute() public {
    //only payout if we have more than 1000 wei
    if (this.balance < TENHUNDWEI) {
      return;
    }
    //each account gets their prescribed percentage of this holdover.
    uint i;
    uint pctx10;
    uint acctDist;
    for (i = 0; i < activityCount; i++ ) {
      pctx10 = activityAccounts[i].pctx10;
      acctDist = totalFundsReceived * pctx10 / TENHUNDWEI;
      //we also double check to ensure that the amount credited cannot exceed the total amount due to this acct
      if (activityAccounts[i].credited >= acctDist) {
        acctDist = 0;
      } else {
        acctDist = acctDist - activityAccounts[i].credited;
      }
      activityAccounts[i].credited += acctDist;
      activityAccounts[i].balance += acctDist;
      totalFundsDistributed += acctDist;
    }
    MessageEvent("ok: distributed funds");
  }


  //
  // withdraw actvity balance
  // can be called by owner to push funds to another contract
  //
  function withdraw() public {
    for (uint i = 0; i < activityCount; i++ ) {
      address addr = activityAccounts[i].addr;
      if (addr == msg.sender || msg.sender == owner) {
        uint amount = activityAccounts[i].balance;
        if (amount > 0) {
          activityAccounts[i].balance = 0;
          totalFundsWithdrawn += amount;
          if (!addr.call.gas(withdrawGas).value(amount)()) {
            //put back funds in case of err
            activityAccounts[i].balance = amount;
            totalFundsWithdrawn -= amount;
            MessageEvent("err: error sending funds");
            return;
          }
        }
      }
    }
  }


  //
  // suicide
  //
  function hariKari() public ownerOnly unlockedOnly {
    selfdestruct(owner);
  }

}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"withdrawGas","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalFundsDistributed","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getTotalPctx10","outputs":[{"name":"_totalPctx10","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalFundsWithdrawn","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"getAccountInfo","outputs":[{"name":"_idx","type":"uint256"},{"name":"_pctx10","type":"uint256"},{"name":"_credited","type":"uint256"},{"name":"_balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isLocked","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"hariKari","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalFundsReceived","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_pctx10","type":"uint256"}],"name":"addAccount","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_withdrawGas","type":"uint256"}],"name":"setWitdrawGas","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"reset","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"distribute","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"activityCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"lock","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"message","type":"string"}],"name":"MessageEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"message","type":"string"},{"indexed":false,"name":"val","type":"uint256"}],"name":"MessageEventI","type":"event"}]

  Contract Creation Code Switch To Opcodes View
6060604052620186a0600655341561001657600080fd5b5b6000805461010060a860020a03191661010033600160a060020a0316021790555b5b610a1c806100486000396000f300606060405236156100e35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631261795d811461015c57806319bee474146101815780632a0d06ec146101a65780633ccfd60b146101cb5780636a29150e146101e05780637b510fe8146102055780638da5cb5b1461024f578063a4e2d6341461027e578063acdfb350146102a5578063bf27f585146102ba578063c1ce56eb146102df578063c61f13a114610303578063d826f88f1461031b578063e4fc6b6d14610330578063e6240deb14610345578063f83d08ba1461036a575b5b60038054349081019091557f3153b209df3c2a22a3472c6135a220cd44ec305b370e51ab765a974692a4fb749060405160208101919091526040808252600c818301527f6f6b3a207265636569766564000000000000000000000000000000000000000060608301526080909101905180910390a15b005b341561016757600080fd5b61016f61037f565b60405190815260200160405180910390f35b341561018c57600080fd5b61016f610385565b60405190815260200160405180910390f35b34156101b157600080fd5b61016f61038b565b60405190815260200160405180910390f35b34156101d657600080fd5b61015a6103be565b005b34156101eb57600080fd5b61016f610501565b60405190815260200160405180910390f35b341561021057600080fd5b610224600160a060020a0360043516610507565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561025a57600080fd5b610262610586565b604051600160a060020a03909116815260200160405180910390f35b341561028957600080fd5b61029161059a565b604051901515815260200160405180910390f35b34156102b057600080fd5b61015a6105a3565b005b34156102c557600080fd5b61016f6105ea565b60405190815260200160405180910390f35b34156102ea57600080fd5b61015a600160a060020a03600435166024356105f0565b005b341561030e57600080fd5b61015a600435610743565b005b341561032657600080fd5b61015a6107e8565b005b341561033b57600080fd5b61015a61088d565b005b341561035057600080fd5b61016f610999565b60405190815260200160405180910390f35b341561037557600080fd5b61015a61099f565b005b60065481565b60045481565b6000805b6002548110156103b95760008181526001602052604090206002015491909101905b60010161038f565b5b5090565b600080805b6002548310156104fb57600083815260016020526040902060030154600160a060020a039081169250331682148061040e575060005433600160a060020a0390811661010090920416145b156104ed5750600082815260016020819052604082200154908111156104ed576000838152600160208190526040808320909101919091556005805483019055600654600160a060020a03841691839051600060405180830381858888f1935050505015156104ed57600083815260016020819052604091829020018290556005805483900390556000805160206109d1833981519152905160208082526018908201527f6572723a206572726f722073656e64696e672066756e647300000000000000006040808301919091526060909101905180910390a16104fb565b5b5b5b6001909201916103c3565b5b505050565b60055481565b600080808080805b60025482101561057c5750600081815260016020526040902060030154600160a060020a039081169087168114156105705760008281526001602081905260409091206002810154815491909201549397509095509350909150849061057c565b5b60019091019061050f565b5b50509193509193565b6000546101009004600160a060020a031681565b60005460ff1681565b60005433600160a060020a0390811661010090920416146105c357600080fd5b60005460ff16156105d357600080fd5b6000546101009004600160a060020a0316ff5b5b5b565b60035481565b60005433600160a060020a03908116610100909204161461061057600080fd5b60005460ff161561062057600080fd5b600254600a9010610683576000805160206109d183398151915260405160208082526011908201527f6572723a206d6178206163636f756e74730000000000000000000000000000006040808301919091526060909101905180910390a161073d565b600280546000908152600160208190526040808320600301805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03881617905583548352808320840185905583548352808320839055835483528083208201929092558254019091556000805160206109d183398151915290516020808252600e908201527f6f6b3a20616363742061646465640000000000000000000000000000000000006040808301919091526060909101905180910390a15b5b5b5050565b60005433600160a060020a03908116610100909204161461076357600080fd5b60005460ff161561077357600080fd5b60068190557f3153b209df3c2a22a3472c6135a220cd44ec305b370e51ab765a974692a4fb7481604051602081019190915260408082526014818301527f6f6b3a207769746864726177206761732073657400000000000000000000000060608301526080909101905180910390a15b5b5b50565b60005433600160a060020a03908116610100909204161461080857600080fd5b60005460ff161561081857600080fd5b600160a060020a033016316003556000600481905560058190556002556000805160206109d183398151915260405160208082526013908201527f6f6b3a20616c6c206163637473207265736574000000000000000000000000006040808301919091526060909101905180910390a15b5b5b565b60008060006103e830600160a060020a03163110156108ab576104fb565b600092505b600254831015610940576000838152600160205260409020600201546003549092506103e89083025b60008581526001602052604090205491900491508190106108fc5750600061090e565b60008381526001602052604090205490035b60008381526001602081905260409091208054830181550180548201905560048054820190555b6001909201916108b0565b6000805160206109d183398151915260405160208082526015908201527f6f6b3a2064697374726962757465642066756e647300000000000000000000006040808301919091526060909101905180910390a15b505050565b60025481565b60005433600160a060020a0390811661010090920416146109bf57600080fd5b6000805460ff191660011790555b5b56007ba22a0cbd3226111d8a61812ff4cd1934aace2147b8c59de1ecc9975f7af218a165627a7a723058207f8d7f124b304fad5a8aca8df3d40efd3e1d01dbbd0cd81639ef74a15ca0d8a30029

   Swarm Source:
bzzr://7f8d7f124b304fad5a8aca8df3d40efd3e1d01dbbd0cd81639ef74a15ca0d8a3

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.