Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 10 from a total of 10 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Payment Settle | 7139619 | 2194 days ago | IN | 0 ETH | 0.00029514 | ||||
Payment Settle | 7139619 | 2194 days ago | IN | 0 ETH | 0.00029514 | ||||
Payment Fork | 7126529 | 2197 days ago | IN | 0 ETH | 0.00062374 | ||||
Payment Fork | 7126520 | 2197 days ago | IN | 0 ETH | 0.00005048 | ||||
Payment Settle | 7126517 | 2197 days ago | IN | 0 ETH | 0.00011124 | ||||
Payment Settle | 7126514 | 2197 days ago | IN | 0 ETH | 0.00011137 | ||||
Payment Settle | 7126511 | 2197 days ago | IN | 0 ETH | 0.00004622 | ||||
Payment Create | 7126509 | 2197 days ago | IN | 1 ETH | 0.00032408 | ||||
Payment Create | 7125306 | 2197 days ago | IN | 0.4 ETH | 0.00032395 | ||||
Payment Create | 7125289 | 2197 days ago | IN | 1 ETH | 0.00053092 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Syndicate
Compiler Version
v0.5.0+commit.1d4f565a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-01-25 */ pragma solidity ^0.5.0; /** * Syndicate * * A way to distribute ownership of ether in time **/ contract Syndicate { struct Payment { address sender; address payable receiver; uint256 timestamp; uint256 time; uint256 weiValue; uint256 weiPaid; bool isFork; uint256 parentIndex; bool isForked; uint256 fork1Index; uint256 fork2Index; } Payment[] public payments; event PaymentUpdated(uint256 index); event PaymentCreated(uint256 index); mapping(address => mapping (address => bool)) public delegates; /** * Change whether _delegate can settle and fork payments on behalf of * msg.sender. **/ function delegate(address _delegate, bool delegated) public { delegates[msg.sender][_delegate] = delegated; } /** * Pay from sender to receiver a certain amount over a certain amount of time. **/ function paymentCreate(address payable _receiver, uint256 _time) public payable { // Verify that value has been sent require(msg.value > 0); // Verify the time is non-zero require(_time > 0); payments.push(Payment({ sender: msg.sender, receiver: _receiver, timestamp: block.timestamp, time: _time, weiValue: msg.value, weiPaid: 0, isFork: false, parentIndex: 0, isForked: false, fork1Index: 0, fork2Index: 0 })); emit PaymentCreated(payments.length - 1); } /** * Settle an individual payment at the current point in time. * * Transfers the owedWei at the current point in time to the receiving * address. **/ function paymentSettle(uint256 index) public { requirePaymentIndexInRange(index); Payment storage payment = payments[index]; requireExecutionAllowed(payment.receiver); uint256 owedWei = paymentWeiOwed(index); payment.weiPaid += owedWei; payment.receiver.transfer(owedWei); emit PaymentUpdated(index); } /** * Return the wei owed on a payment at the current block timestamp. **/ function paymentWeiOwed(uint256 index) public view returns (uint256) { requirePaymentIndexInRange(index); Payment memory payment = payments[index]; // Calculate owed wei based on current time and total wei owed/paid return max(payment.weiPaid, payment.weiValue * min(block.timestamp - payment.timestamp, payment.time) / payment.time) - payment.weiPaid; } /** * Forks a payment to another address for the remaining duration of a payment. * Allows responsibility of funds to be delegated to other addresses by * payment recipient or a delegate. * * Payment completion time is unaffected by forking, the only thing that * changes is recipient(s). * * Payments can be forked until weiValue is 0, at which point the Payment is * settled. Child payments can also be forked. * * The genealogy of a payment can be represented as a binary tree. **/ function paymentFork(uint256 index, address payable _receiver, uint256 _weiValue) public { requirePaymentIndexInRange(index); Payment storage payment = payments[index]; // Make sure the payment receiver or a delegate is operating requireExecutionAllowed(payment.receiver); uint256 remainingWei = payment.weiValue - payment.weiPaid; uint256 remainingTime = max(0, payment.time - (block.timestamp - payment.timestamp)); // Ensure there is more remainingWei than requested fork wei require(remainingWei > _weiValue); require(_weiValue > 0); // Create a new Payment of _weiValue to _receiver over the remaining time of // payment at index payment.weiValue = payment.weiPaid; emit PaymentUpdated(index); payments.push(Payment({ sender: payment.receiver, receiver: _receiver, timestamp: block.timestamp, time: remainingTime, weiValue: _weiValue, weiPaid: 0, isFork: true, parentIndex: index, isForked: false, fork1Index: 0, fork2Index: 0 })); payment.fork1Index = payments.length - 1; emit PaymentCreated(payments.length - 1); payments.push(Payment({ sender: payment.receiver, receiver: payment.receiver, timestamp: block.timestamp, time: remainingTime, weiValue: remainingWei - _weiValue, weiPaid: 0, isFork: true, parentIndex: index, isForked: false, fork1Index: 0, fork2Index: 0 })); payment.fork2Index = payments.length - 1; emit PaymentCreated(payments.length - 1); payment.isForked = true; } /** * Accessor for determining if a given payment is fully settled. **/ function isPaymentSettled(uint256 index) public view returns (bool) { requirePaymentIndexInRange(index); return payments[index].weiValue == payments[index].weiPaid; } /** * Reverts if the supplied payment index is out of range. **/ function requirePaymentIndexInRange(uint256 index) public view { require(index < payments.length); } /** * Checks if msg.sender is allowed to modify payments on behalf of receiver. **/ function requireExecutionAllowed(address payable receiver) public view { require(msg.sender == receiver || delegates[receiver][msg.sender] == true); } /** * 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 Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[{"name":"receiver","type":"address"}],"name":"requireExecutionAllowed","outputs":[],"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":"index","type":"uint256"}],"name":"requirePaymentIndexInRange","outputs":[],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"paymentWeiOwed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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"},{"name":"isForked","type":"bool"},{"name":"fork1Index","type":"uint256"},{"name":"fork2Index","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":false,"inputs":[{"name":"_delegate","type":"address"},{"name":"delegated","type":"bool"}],"name":"delegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_receiver","type":"address"},{"name":"_time","type":"uint256"}],"name":"paymentCreate","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"delegates","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","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
608060405234801561001057600080fd5b50610ddd806100206000396000f3fe6080604052600436106100ad5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166224967e81146100b25780630937e68a146100e75780634bf8bed81461010e57806356daf2c1146101385780637841b7801461016257806379ff69d9146101a057806387d81789146101ca57806396b1bbbe1461025a578063982ef0a714610299578063c69ab283146102d4578063e584324214610300575b600080fd5b3480156100be57600080fd5b506100e5600480360360208110156100d557600080fd5b5035600160a060020a031661033b565b005b3480156100f357600080fd5b506100fc610387565b60408051918252519081900360200190f35b34801561011a57600080fd5b506100e56004803603602081101561013157600080fd5b503561038d565b34801561014457600080fd5b506100fc6004803603602081101561015b57600080fd5b503561039b565b34801561016e57600080fd5b5061018c6004803603602081101561018557600080fd5b5035610495565b604080519115158252519081900360200190f35b3480156101ac57600080fd5b506100e5600480360360208110156101c357600080fd5b50356104e9565b3480156101d657600080fd5b506101f4600480360360208110156101ed57600080fd5b50356105b7565b60408051600160a060020a039c8d1681529a909b1660208b0152898b01989098526060890196909652608088019490945260a0870192909252151560c086015260e085015215156101008401526101208301526101408201529051908190036101600190f35b34801561026657600080fd5b506100e56004803603606081101561027d57600080fd5b50803590600160a060020a036020820135169060400135610633565b3480156102a557600080fd5b506100e5600480360360408110156102bc57600080fd5b50600160a060020a0381351690602001351515610ae8565b6100e5600480360360408110156102ea57600080fd5b50600160a060020a038135169060200135610b20565b34801561030c57600080fd5b5061018c6004803603604081101561032357600080fd5b50600160a060020a0381358116916020013516610cf9565b33600160a060020a03821614806103795750600160a060020a03811660009081526001602081815260408084203385529091529091205460ff161515145b151561038457600080fd5b50565b60005490565b600054811061038457600080fd5b60006103a68261038d565b6103ae610d40565b60008054849081106103bc57fe5b60009182526020918290206040805161016081018252600b9093029091018054600160a060020a03908116845260018201541693830193909352600283015490820181905260038301546060830181905260048401546080840152600584015460a08401819052600685015460ff908116151560c0860152600786015460e086015260088601541615156101008501526009850154610120850152600a9094015461014084015291935061048d91839161047890420382610d19565b85608001510281151561048757fe5b04610d31565b039392505050565b60006104a08261038d565b60008054839081106104ae57fe5b90600052602060002090600b0201600501546000838154811015156104cf57fe5b90600052602060002090600b020160040154149050919050565b6104f28161038d565b6000808281548110151561050257fe5b60009182526020909120600b90910201600181015490915061052c90600160a060020a031661033b565b60006105378361039b565b600583018054820190556001830154604051919250600160a060020a03169082156108fc029083906000818181858888f1935050505015801561057e573d6000803e3d6000fd5b506040805184815290517f4eed8cfa0602bd25527039457fcd1ed279611aac9f849fbc0502823cf06c50749181900360200190a1505050565b60008054829081106105c557fe5b60009182526020909120600b9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a909a0154600160a060020a03998a169b509790981698959794969395929460ff928316949193921691908b565b61063c8361038d565b6000808481548110151561064c57fe5b60009182526020909120600b90910201600181015490915061067690600160a060020a031661033b565b600081600501548260040154039050600061069e600084600201544203856003015403610d31565b90508382116106ac57600080fd5b600084116106b957600080fd5b600583015460048401556040805187815290517f4eed8cfa0602bd25527039457fcd1ed279611aac9f849fbc0502823cf06c50749181900360200190a16000610160604051908101604052808560010160009054906101000a9004600160a060020a0316600160a060020a0316815260200187600160a060020a03168152602001428152602001838152602001868152602001600081526020016001151581526020018881526020016000151581526020016000815260200160008152509080600181540180825580915050906001820390600052602060002090600b02016000909192909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e082015181600701556101008201518160080160006101000a81548160ff021916908315150217905550610120820151816009015561014082015181600a015550505060016000805490500383600901819055507f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f6001600080549050036040518082815260200191505060405180910390a16000610160604051908101604052808560010160009054906101000a9004600160a060020a0316600160a060020a031681526020018560010160009054906101000a9004600160a060020a0316600160a060020a031681526020014281526020018381526020018685038152602001600081526020016001151581526020018881526020016000151581526020016000815260200160008152509080600181540180825580915050906001820390600052602060002090600b02016000909192909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e082015181600701556101008201518160080160006101000a81548160ff021916908315150217905550610120820151816009015561014082015181600a015550505060016000805490500383600a01819055507f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f6001600080549050036040518082815260200191505060405180910390a15050600801805460ff19166001179055505050565b336000908152600160209081526040808320600160a060020a0395909516835293905291909120805460ff1916911515919091179055565b60003411610b2d57600080fd5b60008111610b3a57600080fd5b60006101606040519081016040528033600160a060020a0316815260200184600160a060020a0316815260200142815260200183815260200134815260200160008152602001600015158152602001600081526020016000151581526020016000815260200160008152509080600181540180825580915050906001820390600052602060002090600b02016000909192909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e082015181600701556101008201518160080160006101000a81548160ff021916908315150217905550610120820151816009015561014082015181600a01555050507f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f6001600080549050036040518082815260200191505060405180910390a15050565b600160209081526000928352604080842090915290825290205460ff1681565b6000818310610d285781610d2a565b825b9392505050565b6000818311610d285781610d2a565b610160604051908101604052806000600160a060020a031681526020016000600160a060020a0316815260200160008152602001600081526020016000815260200160008152602001600015158152602001600081526020016000151581526020016000815260200160008152509056fea165627a7a72305820ebfe0c4ea0377b3f336b6d2ac499e093a07434e5a25dcfaef6d671f6fb967c7f0029
Deployed Bytecode
0x6080604052600436106100ad5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166224967e81146100b25780630937e68a146100e75780634bf8bed81461010e57806356daf2c1146101385780637841b7801461016257806379ff69d9146101a057806387d81789146101ca57806396b1bbbe1461025a578063982ef0a714610299578063c69ab283146102d4578063e584324214610300575b600080fd5b3480156100be57600080fd5b506100e5600480360360208110156100d557600080fd5b5035600160a060020a031661033b565b005b3480156100f357600080fd5b506100fc610387565b60408051918252519081900360200190f35b34801561011a57600080fd5b506100e56004803603602081101561013157600080fd5b503561038d565b34801561014457600080fd5b506100fc6004803603602081101561015b57600080fd5b503561039b565b34801561016e57600080fd5b5061018c6004803603602081101561018557600080fd5b5035610495565b604080519115158252519081900360200190f35b3480156101ac57600080fd5b506100e5600480360360208110156101c357600080fd5b50356104e9565b3480156101d657600080fd5b506101f4600480360360208110156101ed57600080fd5b50356105b7565b60408051600160a060020a039c8d1681529a909b1660208b0152898b01989098526060890196909652608088019490945260a0870192909252151560c086015260e085015215156101008401526101208301526101408201529051908190036101600190f35b34801561026657600080fd5b506100e56004803603606081101561027d57600080fd5b50803590600160a060020a036020820135169060400135610633565b3480156102a557600080fd5b506100e5600480360360408110156102bc57600080fd5b50600160a060020a0381351690602001351515610ae8565b6100e5600480360360408110156102ea57600080fd5b50600160a060020a038135169060200135610b20565b34801561030c57600080fd5b5061018c6004803603604081101561032357600080fd5b50600160a060020a0381358116916020013516610cf9565b33600160a060020a03821614806103795750600160a060020a03811660009081526001602081815260408084203385529091529091205460ff161515145b151561038457600080fd5b50565b60005490565b600054811061038457600080fd5b60006103a68261038d565b6103ae610d40565b60008054849081106103bc57fe5b60009182526020918290206040805161016081018252600b9093029091018054600160a060020a03908116845260018201541693830193909352600283015490820181905260038301546060830181905260048401546080840152600584015460a08401819052600685015460ff908116151560c0860152600786015460e086015260088601541615156101008501526009850154610120850152600a9094015461014084015291935061048d91839161047890420382610d19565b85608001510281151561048757fe5b04610d31565b039392505050565b60006104a08261038d565b60008054839081106104ae57fe5b90600052602060002090600b0201600501546000838154811015156104cf57fe5b90600052602060002090600b020160040154149050919050565b6104f28161038d565b6000808281548110151561050257fe5b60009182526020909120600b90910201600181015490915061052c90600160a060020a031661033b565b60006105378361039b565b600583018054820190556001830154604051919250600160a060020a03169082156108fc029083906000818181858888f1935050505015801561057e573d6000803e3d6000fd5b506040805184815290517f4eed8cfa0602bd25527039457fcd1ed279611aac9f849fbc0502823cf06c50749181900360200190a1505050565b60008054829081106105c557fe5b60009182526020909120600b9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a909a0154600160a060020a03998a169b509790981698959794969395929460ff928316949193921691908b565b61063c8361038d565b6000808481548110151561064c57fe5b60009182526020909120600b90910201600181015490915061067690600160a060020a031661033b565b600081600501548260040154039050600061069e600084600201544203856003015403610d31565b90508382116106ac57600080fd5b600084116106b957600080fd5b600583015460048401556040805187815290517f4eed8cfa0602bd25527039457fcd1ed279611aac9f849fbc0502823cf06c50749181900360200190a16000610160604051908101604052808560010160009054906101000a9004600160a060020a0316600160a060020a0316815260200187600160a060020a03168152602001428152602001838152602001868152602001600081526020016001151581526020018881526020016000151581526020016000815260200160008152509080600181540180825580915050906001820390600052602060002090600b02016000909192909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e082015181600701556101008201518160080160006101000a81548160ff021916908315150217905550610120820151816009015561014082015181600a015550505060016000805490500383600901819055507f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f6001600080549050036040518082815260200191505060405180910390a16000610160604051908101604052808560010160009054906101000a9004600160a060020a0316600160a060020a031681526020018560010160009054906101000a9004600160a060020a0316600160a060020a031681526020014281526020018381526020018685038152602001600081526020016001151581526020018881526020016000151581526020016000815260200160008152509080600181540180825580915050906001820390600052602060002090600b02016000909192909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e082015181600701556101008201518160080160006101000a81548160ff021916908315150217905550610120820151816009015561014082015181600a015550505060016000805490500383600a01819055507f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f6001600080549050036040518082815260200191505060405180910390a15050600801805460ff19166001179055505050565b336000908152600160209081526040808320600160a060020a0395909516835293905291909120805460ff1916911515919091179055565b60003411610b2d57600080fd5b60008111610b3a57600080fd5b60006101606040519081016040528033600160a060020a0316815260200184600160a060020a0316815260200142815260200183815260200134815260200160008152602001600015158152602001600081526020016000151581526020016000815260200160008152509080600181540180825580915050906001820390600052602060002090600b02016000909192909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e082015181600701556101008201518160080160006101000a81548160ff021916908315150217905550610120820151816009015561014082015181600a01555050507f52abc2220e71c35c28bb3b3423a7403d5ce4f808dd7ac2c12d1c8e16ae01a19f6001600080549050036040518082815260200191505060405180910390a15050565b600160209081526000928352604080842090915290825290205460ff1681565b6000818310610d285781610d2a565b825b9392505050565b6000818311610d285781610d2a565b610160604051908101604052806000600160a060020a031681526020016000600160a060020a0316815260200160008152602001600081526020016000815260200160008152602001600015158152602001600081526020016000151581526020016000815260200160008152509056fea165627a7a72305820ebfe0c4ea0377b3f336b6d2ac499e093a07434e5a25dcfaef6d671f6fb967c7f0029
Swarm Source
bzzr://ebfe0c4ea0377b3f336b6d2ac499e093a07434e5a25dcfaef6d671f6fb967c7f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.