More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 135 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0xaa3f3485 | 4905484 | 2602 days ago | IN | 0 ETH | 0.00058093 | ||||
Withdraw Tokens | 4893425 | 2604 days ago | IN | 0 ETH | 0.00026378 | ||||
Transfer | 4013146 | 2787 days ago | IN | 0 ETH | 0.00173984 | ||||
Transfer | 4002363 | 2790 days ago | IN | 0 ETH | 0.0006142 | ||||
Transfer | 4001120 | 2790 days ago | IN | 0 ETH | 0.0021748 | ||||
Transfer | 3994564 | 2791 days ago | IN | 0 ETH | 0.00143536 | ||||
Transfer | 3991682 | 2792 days ago | IN | 0 ETH | 0.00130488 | ||||
Transfer | 3989798 | 2792 days ago | IN | 0 ETH | 0.00004349 | ||||
Transfer | 3989707 | 2792 days ago | IN | 0 ETH | 0.00260976 | ||||
Transfer | 3989350 | 2792 days ago | IN | 0 ETH | 0.00001754 | ||||
Transfer | 3989246 | 2792 days ago | IN | 0 ETH | 0.00095208 | ||||
Transfer | 3989239 | 2792 days ago | IN | 0 ETH | 0.0006142 | ||||
Transfer | 3989234 | 2792 days ago | IN | 0 ETH | 0.00130488 | ||||
Transfer | 3989165 | 2792 days ago | IN | 0 ETH | 0.00091341 | ||||
Transfer | 3989054 | 2792 days ago | IN | 0 ETH | 0.00260976 | ||||
Transfer | 3989003 | 2792 days ago | IN | 0 ETH | 0.00091341 | ||||
Transfer | 3988963 | 2792 days ago | IN | 0 ETH | 0.00105 | ||||
Transfer | 3988903 | 2792 days ago | IN | 0 ETH | 0.00130488 | ||||
Transfer | 3988824 | 2792 days ago | IN | 0 ETH | 0.00091341 | ||||
Transfer | 3988816 | 2792 days ago | IN | 0 ETH | 0.0021748 | ||||
Pay Seller | 3988799 | 2792 days ago | IN | 0 ETH | 0.00081328 | ||||
Transfer | 3988791 | 2792 days ago | IN | 0 ETH | 0.00095208 | ||||
Transfer | 3988791 | 2792 days ago | IN | 0 ETH | 0.0021748 | ||||
Transfer | 3988783 | 2792 days ago | IN | 0 ETH | 0.00239228 | ||||
Transfer | 3988775 | 2792 days ago | IN | 0 ETH | 0.00131616 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
3988799 | 2792 days ago | 328.13187498 ETH |
Loading...
Loading
Contract Name:
IOU
Compiler Version
v0.4.11+commit.68ef5810
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-07-01 */ pragma solidity ^0.4.11; /* Allows buyers to securely/confidently buy recent ICO tokens that are still non-transferrable, on an IOU basis. Like HitBTC, but with protection, control, and guarantee of either the purchased tokens or ETH refunded. The Buyer's ETH will be locked into the contract until the purchased IOU/tokens arrive here and are ready for the buyer to invoke withdraw(), OR until cut-off time defined below is exceeded and as a result ETH refunds/withdrawals become enabled. In other words, the seller must fulfill the IOU token purchases any time before the cut-off time defined below, otherwise the buyer gains the ability to withdraw their ETH. The buyer's ETH will ONLY be released to the seller AFTER the adequate amount of tokens have been deposited for ALL purchases. Estimated Time of Distribution: 3-5 weeks from ICO according to TenX Cut-off Time: ~ August 9, 2017 Greetz: blast [email protected] (Please report any findings or suggestions for a 1 ETH bounty!) Thank you */ contract ERC20 { function transfer(address _to, uint _value); function balanceOf(address _owner) constant returns (uint balance); } contract IOU { // Store the amount of IOUs purchased by a buyer mapping (address => uint256) public iou_purchased; // Store the amount of ETH sent in by a buyer mapping (address => uint256) public eth_sent; // Total IOUs available to sell uint256 public total_iou_available = 52500000000000000000000; // Total IOUs purchased by all buyers uint256 public total_iou_purchased; // Total IOU withdrawn by all buyers (keep track to protect buyers) uint256 public total_iou_withdrawn; // IOU per ETH (price) uint256 public price_per_eth = 160; // PAY token contract address (IOU offering) ERC20 public token = ERC20(0xB97048628DB6B661D4C2aA833e95Dbe1A905B280); // The seller's address (to receive ETH upon distribution, and for authing safeties) address seller = 0xB00Ae1e677B27Eee9955d632FF07a8590210B366; // Halt further purchase ability just in case bool public halt_purchases; modifier pwner() { if(msg.sender != seller) throw; _; } /* Safety to withdraw unbought tokens back to seller. Ensures the amount that buyers still need to withdraw remains available */ function withdrawTokens() pwner { token.transfer(seller, token.balanceOf(address(this)) - (total_iou_purchased - total_iou_withdrawn)); } /* Safety to prevent anymore purchases/sales from occurring in the event of unforeseen issue. Buyer withdrawals still remain enabled. */ function haltPurchases() pwner { halt_purchases = true; } function resumePurchases() pwner { halt_purchases = false; } /* Update available IOU to purchase */ function updateAvailability(uint256 _iou_amount) pwner { if(_iou_amount < total_iou_purchased) throw; total_iou_available = _iou_amount; } /* Update IOU price */ function updatePrice(uint256 _price) pwner { price_per_eth = _price; } /* Release buyer's ETH to seller ONLY if amount of contract's tokens balance is >= to the amount that still needs to be withdrawn. Protects buyer. The seller must call this function manually after depositing the adequate amount of tokens for all buyers to collect This effectively ends the sale, but withdrawals remain open */ function paySeller() pwner { // not enough tokens in balance to release ETH, protect buyer and abort if(token.balanceOf(address(this)) < (total_iou_purchased - total_iou_withdrawn)) throw; // Halt further purchases to prevent accidental over-selling halt_purchases = true; // Release buyer's ETH to the seller seller.transfer(this.balance); } function withdraw() payable { /* Main mechanism to ensure a buyer's purchase/ETH/IOU is safe. Refund the buyer's ETH if we're beyond the cut-off date of our distribution promise AND if the contract doesn't have an adequate amount of tokens to distribute to the buyer. Time-sensitive buyer/ETH protection is only applicable if the contract doesn't have adequate tokens for the buyer. The "adequacy" check prevents the seller and/or third party attacker from locking down buyers' ETH by sending in an arbitrary amount of tokens. If for whatever reason the tokens remain locked for an unexpected period beyond the time defined by block.number, patient buyers may still wait until the contract is filled with their purchased IOUs/tokens. Once the tokens are here, they can initiate a withdraw() to retrieve their tokens. Attempting to withdraw any sooner (after the block has been mined, but tokens not arrived) will result in a refund of buyer's ETH. */ if(block.number > 4199999 && iou_purchased[msg.sender] > token.balanceOf(address(this))) { // We didn't fulfill our promise to have adequate tokens withdrawable at xx time // Refund the buyer's ETH automatically instead uint256 eth_to_refund = eth_sent[msg.sender]; // If the user doesn't have any ETH or tokens to withdraw, get out ASAP if(eth_to_refund == 0 || iou_purchased[msg.sender] == 0) throw; // Adjust total purchased so others can buy, and so numbers align with total_iou_withdrawn total_iou_purchased -= iou_purchased[msg.sender]; // Clear record of buyer's ETH and IOU balance before refunding eth_sent[msg.sender] = 0; iou_purchased[msg.sender] = 0; msg.sender.transfer(eth_to_refund); return; } /* Check if there is an adequate amount of tokens in the contract yet and allow the buyer to withdraw tokens */ if(token.balanceOf(address(this)) == 0 || iou_purchased[msg.sender] > token.balanceOf(address(this))) throw; uint256 iou_to_withdraw = iou_purchased[msg.sender]; // If the user doesn't have any IOUs to withdraw, get out ASAP if(iou_to_withdraw == 0) throw; // Clear record of buyer's IOU and ETH balance before transferring out iou_purchased[msg.sender] = 0; eth_sent[msg.sender] = 0; total_iou_withdrawn += iou_to_withdraw; // Distribute tokens to the buyer token.transfer(msg.sender, iou_to_withdraw); } function purchase() payable { if(halt_purchases) throw; if(msg.value == 0) throw; // Determine amount of tokens user wants to/can buy uint256 iou_to_purchase = price_per_eth * msg.value; // Check if we have enough IOUs left to sell if((total_iou_purchased + iou_to_purchase) > total_iou_available) throw; // Update the amount of IOUs purchased by user. Also keep track of the total ETH they sent in iou_purchased[msg.sender] += iou_to_purchase; eth_sent[msg.sender] += msg.value; // Update the total amount of IOUs purchased by all buyers total_iou_purchased += iou_to_purchase; } // Fallback function/entry point function () payable { if(msg.value == 0) { withdraw(); } else { purchase(); } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"eth_sent","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"haltPurchases","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"_iou_amount","type":"uint256"}],"name":"updateAvailability","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"resumePurchases","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"purchase","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"iou_purchased","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"total_iou_withdrawn","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"total_iou_available","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"}],"name":"updatePrice","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"withdrawTokens","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"price_per_eth","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"total_iou_purchased","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"paySeller","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"halt_purchases","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"payable":true,"type":"fallback"}]
Contract Creation Code
6060604052690b1e07dc231427d0000060025560a060055560068054600160a060020a031990811673b97048628db6b661d4c2aa833e95dbe1a905b280179091556007805490911673b00ae1e677b27eee9955d632ff07a8590210b366179055341561006757fe5b5b6109c2806100776000396000f300606060405236156100ca5763ffffffff60e060020a60003504166305bc99f881146100f057806308551d341461011e5780633ccfd60b1461013057806348330cf61461013a57806360e6fb261461014f57806364edfbf014610161578063820ecdaf1461016b57806384605d0d146101995780638c7d3241146101bb5780638d6cc56d146101dd5780638d8f2adb146101f257806396dfa78b1461020457806398ef4b0b14610226578063a0c97bce14610248578063f1317c091461025a578063fc0c546a1461027e575b6100ee5b3415156100e2576100dd6102aa565b6100ea565b6100ea6105c0565b5b5b565b005b34156100f857fe5b61010c600160a060020a036004351661063b565b60408051918252519081900360200190f35b341561012657fe5b6100ee61064d565b005b6100ee6102aa565b005b341561014257fe5b6100ee600435610691565b005b341561015757fe5b6100ee6106c7565b005b6100ee6105c0565b005b341561017357fe5b61010c600160a060020a0360043516610705565b60408051918252519081900360200190f35b34156101a157fe5b61010c610717565b60408051918252519081900360200190f35b34156101c357fe5b61010c61071d565b60408051918252519081900360200190f35b34156101e557fe5b6100ee600435610723565b005b34156101fa57fe5b6100ee610749565b005b341561020c57fe5b61010c610856565b60408051918252519081900360200190f35b341561022e57fe5b61010c61085c565b60408051918252519081900360200190f35b341561025057fe5b6100ee610862565b005b341561026257fe5b61026a610977565b604080519115158252519081900360200190f35b341561028657fe5b61028e610987565b60408051600160a060020a039092168252519081900360200190f35b600060006240163f4311801561034557506006546040805160006020918201819052825160e060020a6370a08231028152600160a060020a033081166004830152935193909416936370a08231936024808301949391928390030190829087803b151561031357fe5b6102c65a03f1151561032157fe5b50506040805151600160a060020a0333166000908152602081905291909120541190505b156103ee57600160a060020a03331660009081526001602052604090205491508115806103885750600160a060020a033316600090815260208190526040902054155b156103935760006000fd5b600160a060020a0333166000818152602081815260408083208054600380549190910390556001835281842084905591839052908290555184156108fc0291859190818181858888f1935050505015156103e957fe5b6105bc565b6006546040805160006020918201819052825160e060020a6370a08231028152600160a060020a033081166004830152935193909416936370a08231936024808301949391928390030190829087803b151561044657fe5b6102c65a03f1151561045457fe5b505060405151159050806104ed57506006546040805160006020918201819052825160e060020a6370a08231028152600160a060020a033081166004830152935193909416936370a08231936024808301949391928390030190829087803b15156104bb57fe5b6102c65a03f115156104c957fe5b50506040805151600160a060020a0333166000908152602081905291909120541190505b156104f85760006000fd5b50600160a060020a03331660009081526020819052604090205480151561051f5760006000fd5b600160a060020a033381166000818152602081815260408083208390556001909152808220829055600480548601815560065482517fa9059cbb00000000000000000000000000000000000000000000000000000000815291820194909452602481018690529051929093169263a9059cbb926044808301939282900301818387803b15156105aa57fe5b6102c65a03f115156105b857fe5b5050505b5050565b60075460009060a060020a900460ff16156105db5760006000fd5b3415156105e85760006000fd5b34600554029050600254816003540111156106035760006000fd5b600160a060020a0333166000908152602081815260408083208054850190556001909152902080543401905560038054820190555b50565b60016020526000908152604090205481565b60075433600160a060020a039081169116146106695760006000fd5b6007805474ff0000000000000000000000000000000000000000191660a060020a1790555b5b565b60075433600160a060020a039081169116146106ad5760006000fd5b6003548110156106bd5760006000fd5b60028190555b5b50565b60075433600160a060020a039081169116146106e35760006000fd5b6007805474ff0000000000000000000000000000000000000000191690555b5b565b60006020819052908152604090205481565b60045481565b60025481565b60075433600160a060020a0390811691161461073f5760006000fd5b60058190555b5b50565b60075433600160a060020a039081169116146107655760006000fd5b600654600754600480546003546040805160006020918201819052825160e060020a6370a0823102815230600160a060020a039081169782019790975292519786169763a9059cbb9790961695949093039387936370a08231936024808201949392918390030190829087803b15156107da57fe5b6102c65a03f115156107e857fe5b50505060405180519050036040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b151561084157fe5b6102c65a03f1151561084f57fe5b5050505b5b565b60055481565b60035481565b60075433600160a060020a0390811691161461087e5760006000fd5b60045460035403600660009054906101000a9004600160a060020a0316600160a060020a03166370a08231306000604051602001526040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15156108fa57fe5b6102c65a03f1151561090857fe5b50505060405180519050101561091e5760006000fd5b6007805474ff0000000000000000000000000000000000000000191660a060020a1790819055604051600160a060020a039182169130163180156108fc02916000818181858888f1935050505015156100ea57fe5b5b5b565b60075460a060020a900460ff1681565b600654600160a060020a0316815600a165627a7a723058202cc601ebeb61adcc28bddcfc1d9fbd9bf8ac6a1e7856081884727aa6ac4e09b50029
Deployed Bytecode
0x606060405236156100ca5763ffffffff60e060020a60003504166305bc99f881146100f057806308551d341461011e5780633ccfd60b1461013057806348330cf61461013a57806360e6fb261461014f57806364edfbf014610161578063820ecdaf1461016b57806384605d0d146101995780638c7d3241146101bb5780638d6cc56d146101dd5780638d8f2adb146101f257806396dfa78b1461020457806398ef4b0b14610226578063a0c97bce14610248578063f1317c091461025a578063fc0c546a1461027e575b6100ee5b3415156100e2576100dd6102aa565b6100ea565b6100ea6105c0565b5b5b565b005b34156100f857fe5b61010c600160a060020a036004351661063b565b60408051918252519081900360200190f35b341561012657fe5b6100ee61064d565b005b6100ee6102aa565b005b341561014257fe5b6100ee600435610691565b005b341561015757fe5b6100ee6106c7565b005b6100ee6105c0565b005b341561017357fe5b61010c600160a060020a0360043516610705565b60408051918252519081900360200190f35b34156101a157fe5b61010c610717565b60408051918252519081900360200190f35b34156101c357fe5b61010c61071d565b60408051918252519081900360200190f35b34156101e557fe5b6100ee600435610723565b005b34156101fa57fe5b6100ee610749565b005b341561020c57fe5b61010c610856565b60408051918252519081900360200190f35b341561022e57fe5b61010c61085c565b60408051918252519081900360200190f35b341561025057fe5b6100ee610862565b005b341561026257fe5b61026a610977565b604080519115158252519081900360200190f35b341561028657fe5b61028e610987565b60408051600160a060020a039092168252519081900360200190f35b600060006240163f4311801561034557506006546040805160006020918201819052825160e060020a6370a08231028152600160a060020a033081166004830152935193909416936370a08231936024808301949391928390030190829087803b151561031357fe5b6102c65a03f1151561032157fe5b50506040805151600160a060020a0333166000908152602081905291909120541190505b156103ee57600160a060020a03331660009081526001602052604090205491508115806103885750600160a060020a033316600090815260208190526040902054155b156103935760006000fd5b600160a060020a0333166000818152602081815260408083208054600380549190910390556001835281842084905591839052908290555184156108fc0291859190818181858888f1935050505015156103e957fe5b6105bc565b6006546040805160006020918201819052825160e060020a6370a08231028152600160a060020a033081166004830152935193909416936370a08231936024808301949391928390030190829087803b151561044657fe5b6102c65a03f1151561045457fe5b505060405151159050806104ed57506006546040805160006020918201819052825160e060020a6370a08231028152600160a060020a033081166004830152935193909416936370a08231936024808301949391928390030190829087803b15156104bb57fe5b6102c65a03f115156104c957fe5b50506040805151600160a060020a0333166000908152602081905291909120541190505b156104f85760006000fd5b50600160a060020a03331660009081526020819052604090205480151561051f5760006000fd5b600160a060020a033381166000818152602081815260408083208390556001909152808220829055600480548601815560065482517fa9059cbb00000000000000000000000000000000000000000000000000000000815291820194909452602481018690529051929093169263a9059cbb926044808301939282900301818387803b15156105aa57fe5b6102c65a03f115156105b857fe5b5050505b5050565b60075460009060a060020a900460ff16156105db5760006000fd5b3415156105e85760006000fd5b34600554029050600254816003540111156106035760006000fd5b600160a060020a0333166000908152602081815260408083208054850190556001909152902080543401905560038054820190555b50565b60016020526000908152604090205481565b60075433600160a060020a039081169116146106695760006000fd5b6007805474ff0000000000000000000000000000000000000000191660a060020a1790555b5b565b60075433600160a060020a039081169116146106ad5760006000fd5b6003548110156106bd5760006000fd5b60028190555b5b50565b60075433600160a060020a039081169116146106e35760006000fd5b6007805474ff0000000000000000000000000000000000000000191690555b5b565b60006020819052908152604090205481565b60045481565b60025481565b60075433600160a060020a0390811691161461073f5760006000fd5b60058190555b5b50565b60075433600160a060020a039081169116146107655760006000fd5b600654600754600480546003546040805160006020918201819052825160e060020a6370a0823102815230600160a060020a039081169782019790975292519786169763a9059cbb9790961695949093039387936370a08231936024808201949392918390030190829087803b15156107da57fe5b6102c65a03f115156107e857fe5b50505060405180519050036040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b151561084157fe5b6102c65a03f1151561084f57fe5b5050505b5b565b60055481565b60035481565b60075433600160a060020a0390811691161461087e5760006000fd5b60045460035403600660009054906101000a9004600160a060020a0316600160a060020a03166370a08231306000604051602001526040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15156108fa57fe5b6102c65a03f1151561090857fe5b50505060405180519050101561091e5760006000fd5b6007805474ff0000000000000000000000000000000000000000191660a060020a1790819055604051600160a060020a039182169130163180156108fc02916000818181858888f1935050505015156100ea57fe5b5b5b565b60075460a060020a900460ff1681565b600654600160a060020a0316815600a165627a7a723058202cc601ebeb61adcc28bddcfc1d9fbd9bf8ac6a1e7856081884727aa6ac4e09b50029
Swarm Source
bzzr://2cc601ebeb61adcc28bddcfc1d9fbd9bf8ac6a1e7856081884727aa6ac4e09b5
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 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.