Contract
0xB03b5ad79e59dc60974021059C85D3BC397C8EDa
1
Contract Overview
Balance:
0 Ether
Token:
More Info
My Name Tag:
Not Available
TokenTracker:
[ Download CSV Export ]
Latest 4 internal transactions
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0xea58f3c545dc4158c8ad8d0e5abb19b2bb3d22ded28a73a0942af00b64c84c9a | 2897186 | 1405 days 17 hrs ago | 0x4ea04f65be42ec913d1b0eeef912b2bae899af5b | 0xb03b5ad79e59dc60974021059c85d3bc397c8eda | 0 Ether | ||
0xabe2060afcb5e015d69f728250176b8e760900155d624138e099891f5095ca5f | 2830197 | 1417 days 8 hrs ago | 0x828f8863093deef19f0e6f54ccb427c51fa2bdd1 | 0xb03b5ad79e59dc60974021059c85d3bc397c8eda | 0 Ether | ||
0xf971ad58f0db4866cce8cc96ea42c5c60ad767ffcde555e65eae43a8099d7a36 | 2805829 | 1421 days 14 hrs ago | 0xfc5834db23ba9a127f788f11fdb306f0219e383e | 0xb03b5ad79e59dc60974021059c85d3bc397c8eda | 0 Ether | ||
0x2405254305b9dccc289bc293b1329026fc02a2f9114868f433701e77bbf99ee8 | 2805081 | 1421 days 17 hrs ago | 0xfc5834db23ba9a127f788f11fdb306f0219e383e | 0xb03b5ad79e59dc60974021059c85d3bc397c8eda | 0 Ether |
[ Download CSV Export ]
Contract Name:
InkProtocolTestnet
Compiler Version
v0.4.19+commit.c4cbbb05
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-01-31 */ pragma solidity ^0.4.18; // File: contracts/InkMediator.sol interface InkMediator { function mediationExpiry() external returns (uint32); function requestMediator(uint256 _transactionId, uint256 _transactionAmount, address _transactionOwner) external returns (bool); function confirmTransactionFee(uint256 _transactionAmount) external returns (uint256); function confirmTransactionAfterExpiryFee(uint256 _transactionAmount) external returns (uint256); function confirmTransactionAfterDisputeFee(uint256 _transactionAmount) external returns (uint256); function confirmTransactionByMediatorFee(uint256 _transactionAmount) external returns (uint256); function refundTransactionFee(uint256 _transactionAmount) external returns (uint256); function refundTransactionAfterExpiryFee(uint256 _transactionAmount) external returns (uint256); function refundTransactionAfterDisputeFee(uint256 _transactionAmount) external returns (uint256); function refundTransactionByMediatorFee(uint256 _transactionAmount) external returns (uint256); function settleTransactionByMediatorFee(uint256 _buyerAmount, uint256 _sellerAmount) external returns (uint256, uint256); } // File: contracts/InkOwner.sol interface InkOwner { function authorizeTransaction(uint256 _id, address _buyer) external returns (bool); } // File: contracts/InkProtocolInterface.sol interface InkProtocolInterface { /* Protocol */ function link(address _to) external; function createTransaction(address _seller, uint256 _amount, bytes32 _metadata, address _policy, address _mediator) external; function createTransaction(address _seller, uint256 _amount, bytes32 _metadata, address _policy, address _mediator, address _owner) external; function revokeTransaction(uint256 _id) external; function acceptTransaction(uint256 _id) external; function confirmTransaction(uint256 _id) external; function confirmTransactionAfterExpiry(uint256 _id) external; function refundTransaction(uint256 _id) external; function refundTransactionAfterExpiry(uint256 _id) external; function disputeTransaction(uint256 _id) external; function escalateDisputeToMediator(uint256 _id) external; function settleTransaction(uint256 _id) external; function refundTransactionByMediator(uint256 _id) external; function confirmTransactionByMediator(uint256 _id) external; function settleTransactionByMediator(uint256 _id, uint256 _buyerAmount, uint256 _sellerAmount) external; function provideTransactionFeedback(uint256 _id, uint8 _rating, bytes32 _comment) external; /* ERC20 */ function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); function allowance(address owner, address spender) public view returns (uint256); function increaseApproval(address spender, uint addedValue) public returns (bool); function decreaseApproval(address spender, uint subtractedValue) public returns (bool); } // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: contracts/InkProtocolCore.sol /// @title Ink Protocol: Decentralized reputation and payments for peer-to-peer marketplaces. contract InkProtocolCore is InkProtocolInterface, StandardToken { string public constant name = "Ink Protocol"; string public constant symbol = "XNK"; uint8 public constant decimals = 18; uint256 private constant gasLimitForExpiryCall = 1000000; uint256 private constant gasLimitForMediatorCall = 4000000; enum Expiry { Transaction, // 0 Fulfillment, // 1 Escalation, // 2 Mediation // 3 } enum TransactionState { // This is an internal state to represent an uninitialized transaction. Null, // 0 Initiated, // 1 Accepted, // 2 Disputed, // 3 Escalated, // 4 Revoked, // 5 RefundedByMediator, // 6 SettledByMediator, // 7 ConfirmedByMediator, // 8 Confirmed, // 9 Refunded, // 10 ConfirmedAfterExpiry, // 11 ConfirmedAfterDispute, // 12 RefundedAfterDispute, // 13 RefundedAfterExpiry, // 14 ConfirmedAfterEscalation, // 15 RefundedAfterEscalation, // 16 Settled // 17 } // The running ID counter for all Ink Transactions. uint256 private globalTransactionId = 0; // Mapping of all transactions by ID (globalTransactionId). mapping(uint256 => Transaction) internal transactions; // The struct definition for an Ink Transaction. struct Transaction { // The address of the buyer on the transaction. address buyer; // The address of the seller on the transaction. address seller; // The address of the policy contract for the transaction. address policy; // The address of the mediator contract for the transaction. address mediator; // The state of the transaction. TransactionState state; // The (block) time that the transaction transitioned to its current state. // This value is only set for the states that need it to be set (states // with an expiry involved). uint256 stateTime; // The XNK amount of the transaction. uint256 amount; } // Event emitted when a transaction is initiated. event TransactionInitiated( uint256 indexed id, address owner, address indexed buyer, address indexed seller, address policy, address mediator, uint256 amount, // A hash string representing the metadata for the transaction. This is // somewhat arbitrary for the transaction. Only the transaction owner // will really know the original contents of the metadata and may choose // to share it at their discretion. bytes32 metadata ); // Event emitted when a transaction has been accepted by the seller. event TransactionAccepted( uint256 indexed id ); // Event emitted when a transaction has been disputed by the buyer. event TransactionDisputed( uint256 indexed id ); // Event emitted when a transaction is escalated to the mediator by the // seller. event TransactionEscalated( uint256 indexed id ); // Event emitted when a transaction is revoked by the seller. event TransactionRevoked( uint256 indexed id ); // Event emitted when a transaction is revoked by the seller. event TransactionRefundedByMediator( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is settled by the mediator. event TransactionSettledByMediator( uint256 indexed id, uint256 buyerAmount, uint256 sellerAmount, uint256 buyerMediatorFee, uint256 sellerMediatorFee ); // Event emitted when a transaction is confirmed by the mediator. event TransactionConfirmedByMediator( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is confirmed by the buyer. event TransactionConfirmed( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is refunded by the seller. event TransactionRefunded( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is confirmed by the seller after the // transaction expiry. event TransactionConfirmedAfterExpiry( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is confirmed by the buyer after it was // disputed. event TransactionConfirmedAfterDispute( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is refunded by the seller after it was // disputed. event TransactionRefundedAfterDispute( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is refunded by the buyer after the // escalation expiry. event TransactionRefundedAfterExpiry( uint256 indexed id, uint256 mediatorFee ); // Event emitted when a transaction is confirmed by the buyer after the // mediation expiry. event TransactionConfirmedAfterEscalation( uint256 indexed id ); // Event emitted when a transaction is refunded by the seller after the // mediation expiry. event TransactionRefundedAfterEscalation( uint256 indexed id ); // Event emitted when a transaction is settled by either the buyer or the // seller after the mediation expiry. event TransactionSettled( uint256 indexed id, uint256 buyerAmount, uint256 sellerAmount ); // Event emitted when a transaction's feedback is updated by the buyer. event FeedbackUpdated( uint256 indexed transactionId, uint8 rating, bytes32 comment ); // Event emitted an account is (unidirectionally) linked to another account. // For two accounts to be acknowledged as linked, the linkage must be // bidirectional. event AccountLinked( address indexed from, address indexed to ); /* Constructor */ function InkProtocolCore() public { // Start with a total supply of 500,000,000 Ink Tokens (XNK). totalSupply_ = 500000000000000000000000000; } /* ERC20 override functions */ function transfer(address _to, uint256 _value) public returns (bool) { // Don't allow token transfers to the Ink contract. require(_to != address(this)); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { // Don't allow token transfers to the Ink contract. require(_to != address(this)); return super.transferFrom(_from, _to, _value); } /* Account linking functions Functions used by users and agents to declare a unidirectionally account linking. */ // Called by a user who wishes to link with another _account. function link(address _to) external { require(_to != address(0)); require(_to != msg.sender); AccountLinked({ from: msg.sender, to: _to }); } /* Transaction functions */ function createTransaction(address _seller, uint256 _amount, bytes32 _metadata, address _policy, address _mediator) external { _createTransaction(_seller, _amount, _metadata, _policy, _mediator, address(0)); } function createTransaction(address _seller, uint256 _amount, bytes32 _metadata, address _policy, address _mediator, address _owner) external { _createTransaction(_seller, _amount, _metadata, _policy, _mediator, _owner); } function revokeTransaction(uint256 _id) external { _revokeTransaction(_id, _findTransactionForBuyer(_id)); } function acceptTransaction(uint256 _id) external { _acceptTransaction(_id, _findTransactionForSeller(_id)); } function confirmTransaction(uint256 _id) external { _confirmTransaction(_id, _findTransactionForBuyer(_id)); } function confirmTransactionAfterExpiry(uint256 _id) external { _confirmTransactionAfterExpiry(_id, _findTransactionForSeller(_id)); } function refundTransaction(uint256 _id) external { _refundTransaction(_id, _findTransactionForSeller(_id)); } function refundTransactionAfterExpiry(uint256 _id) external { _refundTransactionAfterExpiry(_id, _findTransactionForBuyer(_id)); } function disputeTransaction(uint256 _id) external { _disputeTransaction(_id, _findTransactionForBuyer(_id)); } function escalateDisputeToMediator(uint256 _id) external { _escalateDisputeToMediator(_id, _findTransactionForSeller(_id)); } function settleTransaction(uint256 _id) external { _settleTransaction(_id, _findTransactionForParty(_id)); } function refundTransactionByMediator(uint256 _id) external { _refundTransactionByMediator(_id, _findTransactionForMediator(_id)); } function confirmTransactionByMediator(uint256 _id) external { _confirmTransactionByMediator(_id, _findTransactionForMediator(_id)); } function settleTransactionByMediator(uint256 _id, uint256 _buyerAmount, uint256 _sellerAmount) external { _settleTransactionByMediator(_id, _findTransactionForMediator(_id), _buyerAmount, _sellerAmount); } function provideTransactionFeedback(uint256 _id, uint8 _rating, bytes32 _comment) external { _provideTransactionFeedback(_id, _findTransactionForBuyer(_id), _rating, _comment); } /* Private functions */ function _createTransaction(address _seller, uint256 _amount, bytes32 _metadata, address _policy, address _mediator, address _owner) private { require(_seller != address(0) && _seller != msg.sender); require(_owner != msg.sender && _owner != _seller); require(_amount > 0); // Per specifications, if a mediator is involved then a policy is required. // Otherwise, policy must be a zero address. if (_mediator == address(0)) { require(_policy == address(0)); } else { require(_policy != address(0)); } // Increment the transaction. uint256 id = globalTransactionId++; // Create the transaction. Transaction storage transaction = transactions[id]; transaction.buyer = msg.sender; transaction.seller = _seller; transaction.state = TransactionState.Initiated; transaction.amount = _amount; transaction.policy = _policy; _resolveMediator(id, transaction, _mediator, _owner); _resolveOwner(id, _owner); // Emit the event. TransactionInitiated({ id: id, owner: _owner, buyer: msg.sender, seller: _seller, policy: _policy, mediator: _mediator, amount: _amount, metadata: _metadata }); // Place the buyer's tokens in escrow (ie. this contract). _transferFrom(msg.sender, this, _amount); } function _revokeTransaction(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Initiated); TransactionRevoked({ id: _id }); _transferFromEscrow(_transaction.buyer, _transaction.amount); _cleanupTransaction(_id, _transaction, false); } function _acceptTransaction(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Initiated); if (_transaction.mediator != address(0)) { _updateTransactionState(_transaction, TransactionState.Accepted); } TransactionAccepted({ id: _id }); if (_transaction.mediator == address(0)) { // If there is no mediator involved, the transaction is immediately confirmed. _completeTransaction(_id, _transaction, TransactionState.Confirmed, _transaction.seller); } } function _confirmTransaction(uint256 _id, Transaction storage _transaction) private { TransactionState finalState; if (_transaction.state == TransactionState.Accepted) { finalState = TransactionState.Confirmed; } else if (_transaction.state == TransactionState.Disputed) { finalState = TransactionState.ConfirmedAfterDispute; } else if (_transaction.state == TransactionState.Escalated) { require(_afterExpiry(_transaction, _fetchExpiry(_transaction, Expiry.Mediation))); finalState = TransactionState.ConfirmedAfterEscalation; } else { revert(); } _completeTransaction(_id, _transaction, finalState, _transaction.seller); } function _confirmTransactionAfterExpiry(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Accepted); require(_afterExpiry(_transaction, _fetchExpiry(_transaction, Expiry.Transaction))); _completeTransaction(_id, _transaction, TransactionState.ConfirmedAfterExpiry, _transaction.seller); } function _refundTransaction(uint256 _id, Transaction storage _transaction) private { TransactionState finalState; if (_transaction.state == TransactionState.Accepted) { finalState = TransactionState.Refunded; } else if (_transaction.state == TransactionState.Disputed) { finalState = TransactionState.RefundedAfterDispute; } else if (_transaction.state == TransactionState.Escalated) { require(_afterExpiry(_transaction, _fetchExpiry(_transaction, Expiry.Mediation))); finalState = TransactionState.RefundedAfterEscalation; } else { revert(); } _completeTransaction(_id, _transaction, finalState, _transaction.buyer); } function _refundTransactionAfterExpiry(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Disputed); require(_afterExpiry(_transaction, _fetchExpiry(_transaction, Expiry.Escalation))); _completeTransaction(_id, _transaction, TransactionState.RefundedAfterExpiry, _transaction.buyer); } function _disputeTransaction(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Accepted); require(_afterExpiry(_transaction, _fetchExpiry(_transaction, Expiry.Fulfillment))); _updateTransactionState(_transaction, TransactionState.Disputed); TransactionDisputed({ id: _id }); } function _escalateDisputeToMediator(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Disputed); _updateTransactionState(_transaction, TransactionState.Escalated); TransactionEscalated({ id: _id }); } function _settleTransaction(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Escalated); require(_afterExpiry(_transaction, _fetchExpiry(_transaction, Expiry.Mediation))); // Divide the escrow amount in half and give it to the buyer. There's // a possibility that one account will get slightly more than the other. // We have decided to give the lesser amount to the buyer (arbitrarily). uint256 buyerAmount = _transaction.amount.div(2); // The remaining amount is given to the seller. uint256 sellerAmount = _transaction.amount.sub(buyerAmount); TransactionSettled({ id: _id, buyerAmount: buyerAmount, sellerAmount: sellerAmount }); _transferFromEscrow(_transaction.buyer, buyerAmount); _transferFromEscrow(_transaction.seller, sellerAmount); _cleanupTransaction(_id, _transaction, true); } function _refundTransactionByMediator(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Escalated); _completeTransaction(_id, _transaction, TransactionState.RefundedByMediator, _transaction.buyer); } function _confirmTransactionByMediator(uint256 _id, Transaction storage _transaction) private { require(_transaction.state == TransactionState.Escalated); _completeTransaction(_id, _transaction, TransactionState.ConfirmedByMediator, _transaction.seller); } function _settleTransactionByMediator(uint256 _id, Transaction storage _transaction, uint256 _buyerAmount, uint256 _sellerAmount) private { require(_transaction.state == TransactionState.Escalated); require(_buyerAmount.add(_sellerAmount) == _transaction.amount); uint256 buyerMediatorFee; uint256 sellerMediatorFee; (buyerMediatorFee, sellerMediatorFee) = InkMediator(_transaction.mediator).settleTransactionByMediatorFee(_buyerAmount, _sellerAmount); // Require that the sum of the fees be no more than the transaction's amount. require(buyerMediatorFee <= _buyerAmount && sellerMediatorFee <= _sellerAmount); TransactionSettledByMediator({ id: _id, buyerAmount: _buyerAmount, sellerAmount: _sellerAmount, buyerMediatorFee: buyerMediatorFee, sellerMediatorFee: sellerMediatorFee }); _transferFromEscrow(_transaction.buyer, _buyerAmount.sub(buyerMediatorFee)); _transferFromEscrow(_transaction.seller, _sellerAmount.sub(sellerMediatorFee)); _transferFromEscrow(_transaction.mediator, buyerMediatorFee.add(sellerMediatorFee)); _cleanupTransaction(_id, _transaction, true); } function _provideTransactionFeedback(uint256 _id, Transaction storage _transaction, uint8 _rating, bytes32 _comment) private { // The transaction must be completed (Null state with a buyer) to allow // feedback. require(_transaction.state == TransactionState.Null); // As per functional specifications, ratings must be an integer between // 1 and 5, inclusive. require(_rating >= 1 && _rating <= 5); FeedbackUpdated({ transactionId: _id, rating: _rating, comment: _comment }); } function _completeTransaction(uint256 _id, Transaction storage _transaction, TransactionState _finalState, address _transferTo) private { uint256 mediatorFee = _fetchMediatorFee(_transaction, _finalState); if (_finalState == TransactionState.Confirmed) { TransactionConfirmed({ id: _id, mediatorFee: mediatorFee }); } else if (_finalState == TransactionState.ConfirmedAfterDispute) { TransactionConfirmedAfterDispute({ id: _id, mediatorFee: mediatorFee }); } else if (_finalState == TransactionState.ConfirmedAfterEscalation) { TransactionConfirmedAfterEscalation({ id: _id }); } else if (_finalState == TransactionState.ConfirmedAfterExpiry) { TransactionConfirmedAfterExpiry({ id: _id, mediatorFee: mediatorFee }); } else if (_finalState == TransactionState.Refunded) { TransactionRefunded({ id: _id, mediatorFee: mediatorFee }); } else if (_finalState == TransactionState.RefundedAfterDispute) { TransactionRefundedAfterDispute({ id: _id, mediatorFee: mediatorFee }); } else if (_finalState == TransactionState.RefundedAfterEscalation) { TransactionRefundedAfterEscalation({ id: _id }); } else if (_finalState == TransactionState.RefundedAfterExpiry) { TransactionRefundedAfterExpiry({ id: _id, mediatorFee: mediatorFee }); } else if (_finalState == TransactionState.RefundedByMediator) { TransactionRefundedByMediator({ id: _id, mediatorFee: mediatorFee }); } else if (_finalState == TransactionState.ConfirmedByMediator) { TransactionConfirmedByMediator({ id: _id, mediatorFee: mediatorFee }); } _transferFromEscrow(_transferTo, _transaction.amount.sub(mediatorFee)); _transferFromEscrow(_transaction.mediator, mediatorFee); _cleanupTransaction(_id, _transaction, true); } function _fetchExpiry(Transaction storage _transaction, Expiry _expiryType) private returns (uint32) { uint32 expiry; bool success; if (_expiryType == Expiry.Transaction) { success = _transaction.policy.call.gas(gasLimitForExpiryCall)(bytes4(keccak256("transactionExpiry()"))); } else if (_expiryType == Expiry.Fulfillment) { success = _transaction.policy.call.gas(gasLimitForExpiryCall)(bytes4(keccak256("fulfillmentExpiry()"))); } else if (_expiryType == Expiry.Escalation) { success = _transaction.policy.call.gas(gasLimitForExpiryCall)(bytes4(keccak256("escalationExpiry()"))); } else if (_expiryType == Expiry.Mediation) { success = _transaction.mediator.call.gas(gasLimitForExpiryCall)(bytes4(keccak256("mediationExpiry()"))); } if (success) { assembly { if eq(returndatasize(), 0x20) { let _freeMemPointer := mload(0x40) returndatacopy(_freeMemPointer, 0, 0x20) expiry := mload(_freeMemPointer) } } } return expiry; } function _fetchMediatorFee(Transaction storage _transaction, TransactionState _finalState) private returns (uint256) { if (_transaction.mediator == address(0)) { return 0; } uint256 mediatorFee; bool success; if (_finalState == TransactionState.Confirmed) { success = _transaction.mediator.call.gas(gasLimitForMediatorCall)(bytes4(keccak256("confirmTransactionFee(uint256)")), _transaction.amount); } else if (_finalState == TransactionState.ConfirmedAfterExpiry) { success = _transaction.mediator.call.gas(gasLimitForMediatorCall)(bytes4(keccak256("confirmTransactionAfterExpiryFee(uint256)")), _transaction.amount); } else if (_finalState == TransactionState.ConfirmedAfterDispute) { success = _transaction.mediator.call.gas(gasLimitForMediatorCall)(bytes4(keccak256("confirmTransactionAfterDisputeFee(uint256)")), _transaction.amount); } else if (_finalState == TransactionState.ConfirmedByMediator) { mediatorFee = InkMediator(_transaction.mediator).confirmTransactionByMediatorFee(_transaction.amount); } else if (_finalState == TransactionState.Refunded) { success = _transaction.mediator.call.gas(gasLimitForMediatorCall)(bytes4(keccak256("refundTransactionFee(uint256)")), _transaction.amount); } else if (_finalState == TransactionState.RefundedAfterExpiry) { success = _transaction.mediator.call.gas(gasLimitForMediatorCall)(bytes4(keccak256("refundTransactionAfterExpiryFee(uint256)")), _transaction.amount); } else if (_finalState == TransactionState.RefundedAfterDispute) { success = _transaction.mediator.call.gas(gasLimitForMediatorCall)(bytes4(keccak256("refundTransactionAfterDisputeFee(uint256)")), _transaction.amount); } else if (_finalState == TransactionState.RefundedByMediator) { mediatorFee = InkMediator(_transaction.mediator).refundTransactionByMediatorFee(_transaction.amount); } if (success) { assembly { if eq(returndatasize(), 0x20) { let _freeMemPointer := mload(0x40) returndatacopy(_freeMemPointer, 0, 0x20) mediatorFee := mload(_freeMemPointer) } } // The mediator's fee cannot be more than transaction's amount. if (mediatorFee > _transaction.amount) { mediatorFee = 0; } } else { require(mediatorFee <= _transaction.amount); } return mediatorFee; } function _resolveOwner(uint256 _transactionId, address _owner) private { if (_owner != address(0)) { // If an owner is specified, it must authorize the transaction. require(InkOwner(_owner).authorizeTransaction( _transactionId, msg.sender )); } } function _resolveMediator(uint256 _transactionId, Transaction storage _transaction, address _mediator, address _owner) private { if (_mediator != address(0)) { // The mediator must accept the transaction otherwise we abort. require(InkMediator(_mediator).requestMediator(_transactionId, _transaction.amount, _owner)); // Assign the mediator to the transaction. _transaction.mediator = _mediator; } } function _afterExpiry(Transaction storage _transaction, uint32 _expiry) private view returns (bool) { return now.sub(_transaction.stateTime) >= _expiry; } function _findTransactionForBuyer(uint256 _id) private view returns (Transaction storage transaction) { transaction = _findTransaction(_id); require(msg.sender == transaction.buyer); } function _findTransactionForSeller(uint256 _id) private view returns (Transaction storage transaction) { transaction = _findTransaction(_id); require(msg.sender == transaction.seller); } function _findTransactionForParty(uint256 _id) private view returns (Transaction storage transaction) { transaction = _findTransaction(_id); require(msg.sender == transaction.buyer || msg.sender == transaction.seller); } function _findTransactionForMediator(uint256 _id) private view returns (Transaction storage transaction) { transaction = _findTransaction(_id); require(msg.sender == transaction.mediator); } function _findTransaction(uint256 _id) private view returns (Transaction storage transaction) { transaction = transactions[_id]; require(_id < globalTransactionId); } function _transferFrom(address _from, address _to, uint256 _value) private returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); return true; } function _transferFromEscrow(address _to, uint256 _value) private returns (bool) { if (_value > 0) { return _transferFrom(this, _to, _value); } return true; } function _updateTransactionState(Transaction storage _transaction, TransactionState _state) private { _transaction.state = _state; _transaction.stateTime = now; } function _cleanupTransaction(uint256 _id, Transaction storage _transaction, bool _completed) private { // Remove data that is no longer needed on the contract. if (_completed) { delete _transaction.state; delete _transaction.seller; delete _transaction.policy; delete _transaction.mediator; delete _transaction.stateTime; delete _transaction.amount; } else { delete transactions[_id]; } } } // File: contracts/InkProtocolTestnet.sol contract InkProtocolTestnet is InkProtocolCore { string public constant name = "Ink Protocol (Testnet)"; string public constant symbol = "TESTXNK"; // Distribute 1,000 TESTXNK tokens at a time. uint public constant distributionAmount = 1000000000000000000000; mapping(address => uint) public xnkDistributions; function InkProtocolTestnet() public { balances[msg.sender] = totalSupply_; } function requestTestXNK() public returns (bool) { require(xnkDistributions[msg.sender] < now - 1 minutes); xnkDistributions[msg.sender] = now; balances[msg.sender] = balances[msg.sender].add(distributionAmount); Transfer(this, msg.sender, distributionAmount); } }
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"settleTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"requestTestXNK","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"confirmTransactionAfterExpiry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"disputeTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_rating","type":"uint8"},{"name":"_comment","type":"bytes32"}],"name":"provideTransactionFeedback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"refundTransactionByMediator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"escalateDisputeToMediator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"revokeTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"link","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"xnkDistributions","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_buyerAmount","type":"uint256"},{"name":"_sellerAmount","type":"uint256"}],"name":"settleTransactionByMediator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"acceptTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"distributionAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"refundTransactionAfterExpiry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"confirmTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_seller","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_metadata","type":"bytes32"},{"name":"_policy","type":"address"},{"name":"_mediator","type":"address"},{"name":"_owner","type":"address"}],"name":"createTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"refundTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"confirmTransactionByMediator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_seller","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_metadata","type":"bytes32"},{"name":"_policy","type":"address"},{"name":"_mediator","type":"address"}],"name":"createTransaction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"owner","type":"address"},{"indexed":true,"name":"buyer","type":"address"},{"indexed":true,"name":"seller","type":"address"},{"indexed":false,"name":"policy","type":"address"},{"indexed":false,"name":"mediator","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"metadata","type":"bytes32"}],"name":"TransactionInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"}],"name":"TransactionAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"}],"name":"TransactionDisputed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"}],"name":"TransactionEscalated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"}],"name":"TransactionRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionRefundedByMediator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"buyerAmount","type":"uint256"},{"indexed":false,"name":"sellerAmount","type":"uint256"},{"indexed":false,"name":"buyerMediatorFee","type":"uint256"},{"indexed":false,"name":"sellerMediatorFee","type":"uint256"}],"name":"TransactionSettledByMediator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionConfirmedByMediator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionConfirmed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionConfirmedAfterExpiry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionConfirmedAfterDispute","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionRefundedAfterDispute","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"mediatorFee","type":"uint256"}],"name":"TransactionRefundedAfterExpiry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"}],"name":"TransactionConfirmedAfterEscalation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"}],"name":"TransactionRefundedAfterEscalation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"buyerAmount","type":"uint256"},{"indexed":false,"name":"sellerAmount","type":"uint256"}],"name":"TransactionSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"transactionId","type":"uint256"},{"indexed":false,"name":"rating","type":"uint8"},{"indexed":false,"name":"comment","type":"bytes32"}],"name":"FeedbackUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"}],"name":"AccountLinked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]
Contract Creation Code
60606040526000600355341561001457600080fd5b6b019d971e4fe8401e740000006001819055600160a060020a0333166000908152602081905260409020556127dc8061004e6000396000f3006060604052600436106101665763ffffffff60e060020a60003504166306fdde03811461016b578063095ea7b3146101f557806318160ddd1461022b57806319062b8f146102505780631c86aa7b146102685780631f4a5c321461027b57806323b872dd14610291578063313ce567146102b957806349bf2caf146102e25780634f438a12146102f85780636381ca2614610317578063661884631461032d5780636875c3191461034f57806370a0823114610365578063735631ad1461038457806391a897121461039a57806392c4212d146103b9578063935e97c2146103d857806395d89b41146103f4578063a9059cbb14610407578063a9dd689514610429578063b0e0c6811461043f578063bfd3c5fa14610452578063c01a8c8414610468578063cc94d9231461047e578063d4e678b8146104b7578063d73dd623146104cd578063dd62ed3e146104ef578063fb0b6b6d14610514578063fb8a5f1c1461052a575b600080fd5b341561017657600080fd5b61017e61055d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ba5780820151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020057600080fd5b610217600160a060020a0360043516602435610594565b604051901515815260200160405180910390f35b341561023657600080fd5b61023e610601565b60405190815260200160405180910390f35b341561025b57600080fd5b610266600435610607565b005b341561027357600080fd5b61021761061c565b341561028657600080fd5b6102666004356106ec565b341561029c57600080fd5b610217600160a060020a03600435811690602435166044356106fe565b34156102c457600080fd5b6102cc610734565b60405160ff909116815260200160405180910390f35b34156102ed57600080fd5b610266600435610739565b341561030357600080fd5b61026660043560ff6024351660443561074b565b341561032257600080fd5b610266600435610764565b341561033857600080fd5b610217600160a060020a0360043516602435610776565b341561035a57600080fd5b610266600435610870565b341561037057600080fd5b61023e600160a060020a0360043516610882565b341561038f57600080fd5b6102666004356108a1565b34156103a557600080fd5b610266600160a060020a03600435166108b3565b34156103c457600080fd5b61023e600160a060020a036004351661092c565b34156103e357600080fd5b61026660043560243560443561093e565b34156103ff57600080fd5b61017e610952565b341561041257600080fd5b610217600160a060020a0360043516602435610989565b341561043457600080fd5b6102666004356109bd565b341561044a57600080fd5b61023e6109cf565b341561045d57600080fd5b6102666004356109dc565b341561047357600080fd5b6102666004356109ee565b341561048957600080fd5b610266600160a060020a03600435811690602435906044359060643581169060843581169060a43516610a00565b34156104c257600080fd5b610266600435610a16565b34156104d857600080fd5b610217600160a060020a0360043516602435610a28565b34156104fa57600080fd5b61023e600160a060020a0360043581169060243516610acc565b341561051f57600080fd5b610266600435610af7565b341561053557600080fd5b610266600160a060020a03600435811690602435906044359060643581169060843516610b09565b60408051908101604052601681527f496e6b2050726f746f636f6c2028546573746e65742900000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60015490565b6106198161061483610b1f565b610b64565b50565b600160a060020a033316600090815260056020526040812054603b194201901061064557600080fd5b600160a060020a03331660009081526005602090815260408083204290559082905290205461068390683635c9adc5dea0000063ffffffff610c5816565b60008033600160a060020a0316600160a060020a031681526020019081526020016000208190555033600160a060020a031630600160a060020a0316600080516020612791833981519152683635c9adc5dea0000060405190815260200160405180910390a390565b610619816106f983610c67565b610c92565b600030600160a060020a031683600160a060020a03161415151561072157600080fd5b61072c848484610cf4565b949350505050565b601281565b6106198161074683610e62565b610e8a565b61075f8361075885610e62565b8484610f06565b505050565b6106198161077183610f94565b610fbf565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107d357600160a060020a03338116600090815260026020908152604080832093881683529290529081205561080a565b6107e3818463ffffffff61100016565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6106198161087d83610c67565b611012565b600160a060020a0381166000908152602081905260409020545b919050565b610619816108ae83610e62565b611073565b600160a060020a03811615156108c857600080fd5b33600160a060020a031681600160a060020a0316141515156108e957600080fd5b80600160a060020a031633600160a060020a03167f663f26703bd344e9f8d6bc0b1f4e4fa06a81703a4eb10c90e62d60044e8be4ca60405160405180910390a350565b60056020526000908152604090205481565b61075f8361094b85610f94565b84846110ed565b60408051908101604052600781527f54455354584e4b00000000000000000000000000000000000000000000000000602082015281565b600030600160a060020a031683600160a060020a0316141515156109ac57600080fd5b6109b68383611295565b9392505050565b610619816109ca83610c67565b611395565b683635c9adc5dea0000081565b610619816109e983610e62565b611438565b610619816109fb83610e62565b611492565b610a0e868686868686611544565b505050505050565b61061981610a2383610c67565b611758565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610a60908363ffffffff610c5816565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b61061981610b0483610f94565b611807565b610b1885858585856000611544565b5050505050565b6000610b2a8261184b565b805490915033600160a060020a0390811691161480610b595750600181015433600160a060020a039081169116145b151561089c57600080fd5b6000806004600384015460a060020a900460ff166011811115610b8357fe5b14610b8d57600080fd5b610ba183610b9c856003611867565b611ac7565b1515610bac57600080fd5b6005830154610bc290600263ffffffff611af016565b6005840154909250610bda908363ffffffff61100016565b9050837fa06caae8c696e5deb33f685024044b74125cb932e11521aef47de748321657c4838360405191825260208201526040908101905180910390a28254610c2c90600160a060020a031683611b07565b506001830154610c4590600160a060020a031682611b07565b50610c5284846001611b2c565b50505050565b6000828201838110156109b657fe5b6000610c728261184b565b600181015490915033600160a060020a0390811691161461089c57600080fd5b6002600382015460a060020a900460ff166011811115610cae57fe5b14610cb857600080fd5b610cc781610b9c836000611867565b1515610cd257600080fd5b6001810154610cf09083908390600b90600160a060020a0316611c02565b5050565b6000600160a060020a0383161515610d0b57600080fd5b600160a060020a038416600090815260208190526040902054821115610d3057600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610d6357600080fd5b600160a060020a038416600090815260208190526040902054610d8c908363ffffffff61100016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610dc1908363ffffffff610c5816565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610e07908363ffffffff61100016565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516916000805160206127918339815191529085905190815260200160405180910390a35060019392505050565b6000610e6d8261184b565b805490915033600160a060020a0390811691161461089c57600080fd5b6002600382015460a060020a900460ff166011811115610ea657fe5b14610eb057600080fd5b610ebf81610b9c836001611867565b1515610eca57600080fd5b610ed5816003611f41565b817f61e60550bebc2b32282d4baacb9094d9c194d45912cea3e6b10440d24bf5d0fa60405160405180910390a25050565b6000600384015460a060020a900460ff166011811115610f2257fe5b14610f2c57600080fd5b60018260ff1610158015610f44575060058260ff1611155b1515610f4f57600080fd5b837f9f44fa19e0abffa12779e64cc67180970a6d6347762f4ac38fc2138aa91c1c63838360405160ff909216825260208201526040908101905180910390a250505050565b6000610f9f8261184b565b600381015490915033600160a060020a0390811691161461089c57600080fd5b6004600382015460a060020a900460ff166011811115610fdb57fe5b14610fe557600080fd5b8054610cf09083908390600690600160a060020a0316611c02565b60008282111561100c57fe5b50900390565b60038082015460a060020a900460ff16601181111561102d57fe5b1461103757600080fd5b611042816004611f41565b817f8b121cf0b80d0ec0eca560152e8d363b52a2a71555996ab42c92d4085260df2960405160405180910390a25050565b6001600382015460a060020a900460ff16601181111561108f57fe5b1461109957600080fd5b817f4c4e829c9b8c87162e976ab955be6db24dace1afaa0ebe4308b6c273a92f587560405160405180910390a2805460058201546110e091600160a060020a031690611b07565b50610cf082826000611b2c565b6000806004600386015460a060020a900460ff16601181111561110c57fe5b1461111657600080fd5b600585015461112b858563ffffffff610c5816565b1461113557600080fd5b6003850154600160a060020a0316636351546d858560006040516040015260405160e060020a63ffffffff8516028152600481019290925260248201526044016040805180830381600087803b151561118d57600080fd5b6102c65a03f1151561119e57600080fd5b5050506040518051906020018051919350909150508382118015906111c35750828111155b15156111ce57600080fd5b857f71ee872f6b66015ff808a57b598a99d1ee18238cc1e404131e3819b2ea1c5d67858585856040518085815260200184815260200183815260200182815260200194505050505060405180910390a2845461124290600160a060020a031661123d868563ffffffff61100016565b611b07565b50600185015461126590600160a060020a031661123d858463ffffffff61100016565b50600385015461128890600160a060020a031661123d848463ffffffff610c5816565b50610a0e86866001611b2c565b6000600160a060020a03831615156112ac57600080fd5b600160a060020a0333166000908152602081905260409020548211156112d157600080fd5b600160a060020a0333166000908152602081905260409020546112fa908363ffffffff61100016565b600160a060020a03338116600090815260208190526040808220939093559085168152205461132f908363ffffffff610c5816565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03166000805160206127918339815191528460405190815260200160405180910390a350600192915050565b6001600382015460a060020a900460ff1660118111156113b157fe5b146113bb57600080fd5b6003810154600160a060020a0316156113d9576113d9816002611f41565b817f7a1b26a806da79e562075fc6b7e43c2b23b32be7ee69504c79293740427bdf6c60405160405180910390a26003810154600160a060020a03161515610cf0576001810154610cf09083908390600990600160a060020a0316611c02565b60038082015460a060020a900460ff16601181111561145357fe5b1461145d57600080fd5b61146c81610b9c836002611867565b151561147757600080fd5b8054610cf09083908390600e90600160a060020a0316611c02565b60006002600383015460a060020a900460ff1660118111156114b057fe5b14156114be57506009611527565b60038083015460a060020a900460ff1660118111156114d957fe5b14156114e75750600c611527565b6004600383015460a060020a900460ff16601181111561150357fe5b14156101665761151882610b9c846003611867565b151561152357600080fd5b50600f5b600182015461075f90849084908490600160a060020a0316611c02565b600080600160a060020a03881615801590611571575033600160a060020a031688600160a060020a031614155b151561157c57600080fd5b33600160a060020a031683600160a060020a0316141580156115b0575087600160a060020a031683600160a060020a031614155b15156115bb57600080fd5b600087116115c857600080fd5b600160a060020a03841615156115f157600160a060020a038516156115ec57600080fd5b611606565b600160a060020a038516151561160657600080fd5b5050600380546001808201835560008281526004602052604090208054600160a060020a0333811673ffffffffffffffffffffffffffffffffffffffff199283161783558284018054918d1691909216179055928301805492939274ff0000000000000000000000000000000000000000191660a060020a8302179055506005810187905560028101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387161790556116c182828686611f82565b6116cb8284612054565b87600160a060020a031633600160a060020a0316837f35828c8d6154574f01b22f17b2042aec1f7cb05d62f0301a30265c4dd2da9c238689898d8d604051600160a060020a0395861681529385166020850152919093166040808401919091526060830193909352608082015260a001905180910390a461174d3330896120e7565b505050505050505050565b60006002600383015460a060020a900460ff16601181111561177657fe5b14156117845750600a6117ed565b60038083015460a060020a900460ff16601181111561179f57fe5b14156117ad5750600d6117ed565b6004600383015460a060020a900460ff1660118111156117c957fe5b1415610166576117de82610b9c846003611867565b15156117e957600080fd5b5060105b815461075f90849084908490600160a060020a0316611c02565b6004600382015460a060020a900460ff16601181111561182357fe5b1461182d57600080fd5b6001810154610cf09083908390600890600160a060020a0316611c02565b6000818152600460205260409020600354821061089c57600080fd5b600080808084600381111561187857fe5b14156118f8576002850154600160a060020a0316620f42406040517f7472616e73616374696f6e4578706972792829000000000000000000000000008152601301604051809103902060e060020a9004906040518263ffffffff1660e060020a02815260040160006040518083038160008887f193505050509050611a9d565b600184600381111561190657fe5b1415611986576002850154600160a060020a0316620f42406040517f66756c66696c6c6d656e744578706972792829000000000000000000000000008152601301604051809103902060e060020a9004906040518263ffffffff1660e060020a02815260040160006040518083038160008887f193505050509050611a9d565b600284600381111561199457fe5b1415611a14576002850154600160a060020a0316620f42406040517f657363616c6174696f6e457870697279282900000000000000000000000000008152601201604051809103902060e060020a9004906040518263ffffffff1660e060020a02815260040160006040518083038160008887f193505050509050611a9d565b6003846003811115611a2257fe5b1415611a9d576003850154600160a060020a0316620f42406040517f6d6564696174696f6e45787069727928290000000000000000000000000000008152601101604051809103902060e060020a9004906040518263ffffffff1660e060020a02815260040160006040518083038160008887f19450505050505b8015611abb5760203d1415611abb5760405160206000823e80519250505b8192505b505092915050565b60008163ffffffff16611ae784600401544261100090919063ffffffff16565b10159392505050565b6000808284811515611afe57fe5b04949350505050565b600080821115611b2357611b1c3084846120e7565b90506105fb565b50600192915050565b8015611b925760038201805460018401805473ffffffffffffffffffffffffffffffffffffffff19908116909155600285018054909116905574ffffffffffffffffffffffffffffffffffffffffff19169055600060048301819055600583015561075f565b505060009081526004602081905260408220805473ffffffffffffffffffffffffffffffffffffffff19908116825560018201805482169055600282018054909116905560038101805474ffffffffffffffffffffffffffffffffffffffffff1916905590810182905560050155565b6000611c0e84846121d0565b90506009836011811115611c1e57fe5b1415611c5d57847f4b7c1d2c22e04f819aa1ab2f67b789b2432185c9cedbd628e119c1ff7e6f46a58260405190815260200160405180910390a2611f00565b600c836011811115611c6b57fe5b1415611caa57847f5576af7dc4242c1c01eea6e56373d17ea24ffe9aed53a2d1ef839b67bf4f2c398260405190815260200160405180910390a2611f00565b600f836011811115611cb857fe5b1415611cf057847f450d94efd29a31cdb09ddbe25c83523a34f947d3259a820ef2ea4fe5813e8d1060405160405180910390a2611f00565b600b836011811115611cfe57fe5b1415611d3d57847f4ff1ddec585d16be2198539398b5fb2a9ad551e7c49015adccc77770f32eece18260405190815260200160405180910390a2611f00565b600a836011811115611d4b57fe5b1415611d8a57847f7efce4ff22cb1dc0ec2d7360a102d3a72f80f135a3225d1d4b5900bfe01772c78260405190815260200160405180910390a2611f00565b600d836011811115611d9857fe5b1415611dd757847fd245a08477e3a73e161b57006daf04802fbdc3a73e83f0a1c88bc7ef24c008dc8260405190815260200160405180910390a2611f00565b6010836011811115611de557fe5b1415611e1d57847f25107a47cbfbdd273f20e135cb8a301e5d3ec7e57d6c1ade30872c6b7abef83660405160405180910390a2611f00565b600e836011811115611e2b57fe5b1415611e6a57847fdd68b3868d9fe2fb70f4ad224f3b016220ced249fe29f3d6cc40f993a8b1992f8260405190815260200160405180910390a2611f00565b6006836011811115611e7857fe5b1415611eb757847fd2231919a95e10714ef63773b9983e2a78e27e6c42a1e5702f382f50a81b92218260405190815260200160405180910390a2611f00565b6008836011811115611ec557fe5b1415611f0057847f1217b6ffcf46b9b41bf25d22d73fa7b407bbb50bb3601728c80d288e2de5634d8260405190815260200160405180910390a25b611f1b8261123d83876005015461100090919063ffffffff16565b506003840154611f3490600160a060020a031682611b07565b50610b1885856001611b2c565b60038201805482919074ff0000000000000000000000000000000000000000191660a060020a836011811115611f7357fe5b02179055505042600490910155565b600160a060020a03821615610c525781600160a060020a031663bc3c28468585600501548460006040516020015260405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401602060405180830381600087803b1515611ffc57600080fd5b6102c65a03f1151561200d57600080fd5b50505060405180519050151561202257600080fd5b600383018054600160a060020a03841673ffffffffffffffffffffffffffffffffffffffff1990911617905550505050565b600160a060020a03811615610cf05780600160a060020a03166359a23200833360006040516020015260405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401602060405180830381600087803b15156120c157600080fd5b6102c65a03f115156120d257600080fd5b505050604051805190501515610cf057600080fd5b6000600160a060020a03831615156120fe57600080fd5b600160a060020a03841660009081526020819052604090205482111561212357600080fd5b600160a060020a03841660009081526020819052604090205461214c908363ffffffff61100016565b600160a060020a038086166000908152602081905260408082209390935590851681522054612181908363ffffffff610c5816565b600160a060020a03808516600081815260208190526040908190209390935591908616906000805160206127918339815191529085905190815260200160405180910390a35060019392505050565b600382015460009081908190600160a060020a031615156121f45760009250611abf565b600984601181111561220257fe5b141561228f576003850154600160a060020a0316623d09006040517f636f6e6669726d5472616e73616374696f6e4665652875696e743235362900008152601e01604051809103902060e060020a900490876005015460405160e060020a63ffffffff8516028152600481019190915260240160006040518083038160008887f19350505050905061274b565b600b84601181111561229d57fe5b1415612350576003850154600160a060020a0316623d09006040517f636f6e6669726d5472616e73616374696f6e416674657245787069727946656581527f2875696e743235362900000000000000000000000000000000000000000000006020820152602901604051809103902060e060020a900490876005015460405160e060020a63ffffffff8516028152600481019190915260240160006040518083038160008887f19350505050905061274b565b600c84601181111561235e57fe5b1415612411576003850154600160a060020a0316623d09006040517f636f6e6669726d5472616e73616374696f6e416674657244697370757465466581527f652875696e7432353629000000000000000000000000000000000000000000006020820152602a01604051809103902060e060020a900490876005015460405160e060020a63ffffffff8516028152600481019190915260240160006040518083038160008887f19350505050905061274b565b600884601181111561241f57fe5b14156124a25760038501546005860154600160a060020a039091169063c32049549060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561248057600080fd5b6102c65a03f1151561249157600080fd5b50505060405180519050915061274b565b600a8460118111156124b057fe5b141561253d576003850154600160a060020a0316623d09006040517f726566756e645472616e73616374696f6e4665652875696e74323536290000008152601d01604051809103902060e060020a900490876005015460405160e060020a63ffffffff8516028152600481019190915260240160006040518083038160008887f19350505050905061274b565b600e84601181111561254b57fe5b14156125fe576003850154600160a060020a0316623d09006040517f726566756e645472616e73616374696f6e41667465724578706972794665652881527f75696e74323536290000000000000000000000000000000000000000000000006020820152602801604051809103902060e060020a900490876005015460405160e060020a63ffffffff8516028152600481019190915260240160006040518083038160008887f19350505050905061274b565b600d84601181111561260c57fe5b14156126bf576003850154600160a060020a0316623d09006040517f726566756e645472616e73616374696f6e41667465724469737075746546656581527f2875696e743235362900000000000000000000000000000000000000000000006020820152602901604051809103902060e060020a900490876005015460405160e060020a63ffffffff8516028152600481019190915260240160006040518083038160008887f19350505050905061274b565b60068460118111156126cd57fe5b141561274b5760038501546005860154600160a060020a039091169063dc6e72629060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561272e57600080fd5b6102c65a03f1151561273f57600080fd5b50505060405180519250505b801561277f5760203d14156127695760405160206000823e80519250505b846005015482111561277a57600091505b611abb565b6005850154821115611abb57600080fd00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058200919c7daa5f919eb046418ec98e492cd8f44d636e82d25b8806a43f039030f970029
Swarm Source
bzzr://0919c7daa5f919eb046418ec98e492cd8f44d636e82d25b8806a43f039030f97
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.