Contract 0x8c418ecce033e1e7832373eecf58ac967edce705

Contract Overview

Balance:
1 Ether
TxHash Block Age From To Value [TxFee]
0x2db07bfb8a7ee45e9d134e497eb80cd13472ce79261f9981b35dfea1fce71c7a367291469 days 12 hrs ago0xddec6c333538fcd3de7cfb56d6beed7fd8dee604 IN  0x8c418ecce033e1e7832373eecf58ac967edce7050 Ether0.00020246
0x38d92c0388b3d32c1c9ca7fb8c9e6601c09834f4d3d206134fc938679ac5e00b367290269 days 12 hrs ago0xddec6c333538fcd3de7cfb56d6beed7fd8dee604 IN  0x8c418ecce033e1e7832373eecf58ac967edce7050 Ether0.00020246
0x5925727258265e800a98eee995b74779ffbf0153d3d7465f95b8add5534f591d367288469 days 12 hrs ago0xddec6c333538fcd3de7cfb56d6beed7fd8dee604 IN  0x8c418ecce033e1e7832373eecf58ac967edce7050 Ether0.000252324
0x3922c2fea6f42cd31d99afd9b44be02fd0edb6c03a31aa5eb0987928e7a1b8bd367287869 days 12 hrs ago0xddec6c333538fcd3de7cfb56d6beed7fd8dee604 IN  0x8c418ecce033e1e7832373eecf58ac967edce7050 Ether0.00024746
0x4662fed32739212e0fc1216438e1c8db34ff9cd8036f9a85c4ce641ddb4aa0c5367287569 days 12 hrs ago0xddec6c333538fcd3de7cfb56d6beed7fd8dee604 IN  0x8c418ecce033e1e7832373eecf58ac967edce7051 Ether0.000148094
0x0487869cef2295e1d23d4480df0053fcc9b03113c3f8f292161da4dea1489bdb367287169 days 12 hrs ago0xddec6c333538fcd3de7cfb56d6beed7fd8dee604 IN  Contract Creation0 Ether0.001421227
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value

Contract Source Code Verified (Exact Match)

Contract Name:
Syndicate

Compiler Version
v0.5.0+commit.1d4f565a

Optimization Enabled:
No

Runs (Optimizer):
200

Contract Source Code

pragma solidity ^0.5.0;

/**
 * Syndicate
 *
 * A way to distribute ownership of ether in time
 **/

contract Syndicate {

  mapping (address => uint256) public balances;

  struct Payment {
    address sender;
    address payable receiver;
    uint256 timestamp;
    uint256 time;
    uint256 weiValue;
    uint256 weiPaid;
    bool isFork;
    uint256 parentIndex;
  }

  Payment[] public payments;

  // A mapping of Payment index to forked payments that have been created
  mapping (uint256 => uint256[]) public _forks;

  event PaymentUpdated(uint256 index);
  event PaymentCreated(uint256 index);

  /**
   * Deposit to a given address over a certain amount of time.
   **/
  function deposit(address payable _receiver, uint256 _time) external payable {
    balances[msg.sender] += msg.value;
    pay(_receiver, msg.value, _time);
  }

  /**
   * Pay from sender to receiver a certain amount over a certain amount of time.
   **/
  function pay(address payable _receiver, uint256 _weiValue, uint256 _time) public {
    // Verify that the balance is there and value is non-zero
    require(_weiValue <= balances[msg.sender] && _weiValue > 0);
    // Verify the time is non-zero
    require(_time > 0);
    payments.push(Payment({
      sender: msg.sender,
      receiver: _receiver,
      timestamp: block.timestamp,
      time: _time,
      weiValue: _weiValue,
      weiPaid: 0,
      isFork: false,
      parentIndex: 0
    }));
    // Update the balance value of the sender to effectively lock the funds in place
    balances[msg.sender] -= _weiValue;
    emit PaymentCreated(payments.length - 1);
  }

  /**
   * Settle an individual payment at the current point in time.
   *
   * Can be called idempotently.
   **/
  function paymentSettle(uint256 index) public {
    uint256 owedWei = paymentWeiOwed(index);
    balances[payments[index].receiver] += owedWei;
    payments[index].weiPaid += owedWei;
    emit PaymentUpdated(index);
  }

  /**
   * Return the wei owed on a payment at the current block timestamp.
   **/
  function paymentWeiOwed(uint256 index) public view returns (uint256) {
    assertPaymentIndexInRange(index);
    Payment memory payment = payments[index];
    // Calculate owed wei based on current time and total wei owed/paid
    return payment.weiValue * min(block.timestamp - payment.timestamp, payment.time) / payment.time - payment.weiPaid;
  }

  /**
   * Forks a payment to another address for the duration of a payment. Allows
   * responsibility of funds to be delegated to other addresses by payment
   * recipient.
   *
   * Payment completion time is unaffected by forking, the only thing that
   * changes is recipient.
   *
   * Payments can be forked until weiValue is 0, at which point the Payment is
   * settled. Child payments can also be forked.
   **/
  function paymentFork(uint256 index, address payable _receiver, uint256 _weiValue) public {
    // Settle the payment to the current point in time
    paymentSettle(index);

    Payment memory payment = payments[index];
    // Make sure the payment owner is operating
    require(msg.sender == payment.receiver);

    uint256 remainingWei = payment.weiValue - payment.weiPaid;
    uint256 remainingTime = max(0, payment.time - (block.timestamp - payment.timestamp));

    // Ensure there is enough unsettled wei in the payment
    require(remainingWei >= _weiValue);
    require(_weiValue > 0);

    // Create a new Payment of _weiValue to _receiver over the remaining time of
    // Payment at index
    payments[index].weiValue -= _weiValue;
    payments.push(Payment({
      sender: msg.sender,
      receiver: _receiver,
      timestamp: block.timestamp,
      time: remainingTime,
      weiValue: _weiValue,
      weiPaid: 0,
      isFork: true,
      parentIndex: index
    }));
    _forks[index].push(payments.length - 1);
    emit PaymentUpdated(index);
    emit PaymentCreated(payments.length - 1);
  }

  /**
   * Get the number of forks for the payment at index.
   **/
  function paymentForkCount(uint256 index) public view returns (uint256) {
    assertPaymentIndexInRange(index);
    return _forks[index].length;
  }

  /**
   * Accessor for determining if a given payment is fully settled.
   **/
  function isPaymentSettled(uint256 index) public view returns (bool) {
    assertPaymentIndexInRange(index);
    Payment memory payment = payments[index];
    return payment.weiValue == payment.weiPaid;
  }

  /**
   * Reverts if the supplied payment index is out of range
   **/
  function assertPaymentIndexInRange(uint256 index) public view {
    require(index < payments.length);
  }

  /**
   * Withdraw target address balance from Syndicate to ether.
   **/
  function withdraw(address payable target, uint256 weiValue) public {
    require(balances[target] >= weiValue);
    balances[target] -= weiValue;
    target.transfer(weiValue);
  }

  /**
   * One argument, target address.
   **/
  function withdraw(address payable target) public {
    withdraw(target, balances[target]);
  }

  /**
   * No arguments, withdraws full balance to sender from sender balance.
   **/
  function withdraw() public {
    withdraw(msg.sender, balances[msg.sender]);
  }

  /**
   * Accessor for array length
   **/
  function paymentCount() public view returns (uint) {
    return payments.length;
  }

  /**
   * Return the smaller of two values.
   **/
  function min(uint a, uint b) private pure returns (uint) {
    return a < b ? a : b;
  }

  /**
   * Return the larger of two values.
   **/
  function max(uint a, uint b) private pure returns (uint) {
    return a > b ? a : b;
  }
}

Contract ABI

[{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"paymentForkCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paymentCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"_forks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_receiver","type":"address"},{"name":"_time","type":"uint256"}],"name":"deposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"target","type":"address"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"paymentWeiOwed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_receiver","type":"address"},{"name":"_weiValue","type":"uint256"},{"name":"_time","type":"uint256"}],"name":"pay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"isPaymentSettled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"index","type":"uint256"}],"name":"paymentSettle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"payments","outputs":[{"name":"sender","type":"address"},{"name":"receiver","type":"address"},{"name":"timestamp","type":"uint256"},{"name":"time","type":"uint256"},{"name":"weiValue","type":"uint256"},{"name":"weiPaid","type":"uint256"},{"name":"isFork","type":"bool"},{"name":"parentIndex","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"index","type":"uint256"},{"name":"_receiver","type":"address"},{"name":"_weiValue","type":"uint256"}],"name":"paymentFork","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"assertPaymentIndexInRange","outputs":[],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"target","type":"address"},{"name":"weiValue","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"index","type":"uint256"}],"name":"PaymentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"index","type":"uint256"}],"name":"PaymentCreated","type":"event"}]

Contract Creation Code

608060405234801561001057600080fd5b5061141a806100206000396000f3fe6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063031f0bcf146100e05780630937e68a1461012f578063214e49631461015a57806327e235e3146101b35780633ccfd60b1461021857806347e7ef241461022f57806351cff8d91461027d57806356daf2c1146102ce5780635f0653461461031d5780637841b7801461038257806379ff69d9146103d557806387d817891461041057806396b1bbbe146104ec578063e48a1d6014610551578063f3fef3a31461058c575b600080fd5b3480156100ec57600080fd5b506101196004803603602081101561010357600080fd5b81019080803590602001909291905050506105e7565b6040518082815260200191505060405180910390f35b34801561013b57600080fd5b50610144610610565b6040518082815260200191505060405180910390f35b34801561016657600080fd5b5061019d6004803603604081101561017d57600080fd5b81019080803590602001909291908035906020019092919050505061061d565b6040518082815260200191505060405180910390f35b3480156101bf57600080fd5b50610202600480360360208110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061064d565b6040518082815260200191505060405180910390f35b34801561022457600080fd5b5061022d610665565b005b61027b6004803603604081101561024557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106af565b005b34801561028957600080fd5b506102cc600480360360208110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061070a565b005b3480156102da57600080fd5b50610307600480360360208110156102f157600080fd5b8101908080359060200190929190505050610755565b6040518082815260200191505060405180910390f35b34801561032957600080fd5b506103806004803603606081101561034057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506108c4565b005b34801561038e57600080fd5b506103bb600480360360208110156103a557600080fd5b8101908080359060200190929190505050610b37565b604051808215151515815260200191505060405180910390f35b3480156103e157600080fd5b5061040e600480360360208110156103f857600080fd5b8101908080359060200190929190505050610c82565b005b34801561041c57600080fd5b506104496004803603602081101561043357600080fd5b8101908080359060200190929190505050610d84565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001878152602001868152602001858152602001848152602001831515151581526020018281526020019850505050505050505060405180910390f35b3480156104f857600080fd5b5061054f6004803603606081101561050f57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e28565b005b34801561055d57600080fd5b5061058a6004803603602081101561057457600080fd5b810190808035906020019092919050505061124e565b005b34801561059857600080fd5b506105e5600480360360408110156105af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611264565b005b60006105f28261124e565b60026000838152602001908152602001600020805490509050919050565b6000600180549050905090565b60026020528160005260406000208181548110151561063857fe5b90600052602060002001600091509150505481565b60006020528060005260406000206000915090505481565b6106ad336000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611264565b565b346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506107068234836108c4565b5050565b610752816000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611264565b50565b60006107608261124e565b61076861137a565b60018381548110151561077757fe5b906000526020600020906008020161010060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820160009054906101000a900460ff1615151515815260200160078201548152505090508060a0015181606001516108ab836040015142038460600151611348565b8360800151028115156108ba57fe5b0403915050919050565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111580156109125750600082115b151561091d57600080fd5b60008111151561092c57600080fd5b6001610100604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020014281526020018381526020018481526020016000815260200160001515815260200160008152509080600181540180825580915050906001820390600052602060002090600802016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160070155505050816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f60018080549050036040518082815260200191505060405180910390a1505050565b6000610b428261124e565b610b4a61137a565b600183815481101515610b5957fe5b906000526020600020906008020161010060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820160009054906101000a900460ff1615151515815260200160078201548152505090508060a00151816080015114915050919050565b6000610c8d82610755565b905080600080600185815481101515610ca257fe5b906000526020600020906008020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600183815481101515610d2b57fe5b9060005260206000209060080201600501600082825401925050819055507f4eed8cfa0602bd25527039457fcd1ed279611aac9f849fbc0502823cf06c5074826040518082815260200191505060405180910390a15050565b600181815481101515610d9357fe5b90600052602060002090600802016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030154908060040154908060050154908060060160009054906101000a900460ff16908060070154905088565b610e3183610c82565b610e3961137a565b600184815481101515610e4857fe5b906000526020600020906008020161010060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820154815260200160048201548152602001600582015481526020016006820160009054906101000a900460ff161515151581526020016007820154815250509050806020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9c57600080fd5b60008160a0015182608001510390506000610fc4600084604001514203856060015103611361565b9050838210151515610fd557600080fd5b600084111515610fe457600080fd5b83600187815481101515610ff457fe5b9060005260206000209060080201600401600082825403925050819055506001610100604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff16815260200142815260200183815260200186815260200160008152602001600115158152602001888152509080600181540180825580915050906001820390600052602060002090600802016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e0820151816007015550505060026000878152602001908152602001600020600180805490500390806001815401808255809150509060018203906000526020600020016000909192909190915055507f4eed8cfa0602bd25527039457fcd1ed279611aac9f849fbc0502823cf06c5074866040518082815260200191505060405180910390a17f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f60018080549050036040518082815260200191505060405180910390a1505050505050565b6001805490508110151561126157600080fd5b50565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156112b157600080fd5b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611343573d6000803e3d6000fd5b505050565b60008183106113575781611359565b825b905092915050565b60008183116113705781611372565b825b905092915050565b61010060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152509056fea165627a7a723058208a700c1f2ff9de6b61fbf5431b220064abee5870d42d779e48733497f0f694630029

Swarm Source

bzzr://8a700c1f2ff9de6b61fbf5431b220064abee5870d42d779e48733497f0f69463
Block Age Transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward