Address Contract Partially Verified
Address
0xCc89405E3CFD38412093840A3ac2F851Dd395DfB
Balance
76.6000 ETH
Nonce
1
Code Size
2659 bytes
Creator
0x000Fb836...EAb9 at tx 0x7429af32...bb5ab3
Indexed Transactions
0
Contract Bytecode
2659 bytes
0x6060604052361561009e5763ffffffff60e060020a6000350416633ccfd60b81146100d05780634bd54f04146100e25780635259347d1461010e57806362f5ed61146101185780636360fc3f146101225780636ad1fe0214610146578063943dfef1146101725780639722732514610194578063a6f2ae3a146101a6578063adcaea0a146101b8578063fc0c546a146101e6578063fc7e286d14610212575b6100ce5b60035433600160a060020a039081166101009092041614156100c3576100cb565b6100cb610240565b5b565b005b34156100d857fe5b6100ce610325565b005b34156100ea57fe5b6100f26105bb565b60408051600160a060020a039092168252519081900360200190f35b6100ce610240565b005b6100ce6105ca565b005b341561012a57fe5b6101326105e6565b604080519115158252519081900360200190f35b341561014e57fe5b6100f26105ef565b60408051600160a060020a039092168252519081900360200190f35b341561017a57fe5b610182610603565b60408051918252519081900360200190f35b341561019c57fe5b6100ce610609565b005b34156101ae57fe5b6100ce61092b565b005b34156101c057fe5b610182600160a060020a0360043516610a04565b60408051918252519081900360200190f35b34156101ee57fe5b6100f2610a16565b60408051600160a060020a039092168252519081900360200190f35b341561021a57fe5b610182600160a060020a0360043516610a25565b60408051918252519081900360200190f35b60035460ff16151561028857600160a060020a033316600090815260208190526040902080543401908190556801a055690d9db800009011156102835760006000fd5b6100cb565b34156102945760006000fd5b600360019054906101000a9004600160a060020a0316600160a060020a0316634084c3ab6000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156102ef57fe5b6102c65a03f115156102fd57fe5b5050604051511515905061031857610283610609565b6100cb565b6100cb610325565b5b5b5b565b600160a060020a033381166000908152602081815260408083208054908490556002546005548351850186905283517f70a08231000000000000000000000000000000000000000000000000000000008152308816600482018190529451939794319290920395948594859485948594909216926370a08231926024808201939182900301818787803b15156103b757fe5b6102c65a03f115156103c557fe5b505060405151955050612710808702860194508490888802028115156103e757fe5b049250838588028115156103f757fe5b0461271002915060009050816001600033600160a060020a0316600160a060020a0316815260200190815260200160002054101561045257600160a060020a03331660009081526001602052604090205460649083035b0490505b600554604080516000602091820181905282517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03338116600483015286880360248301529351939094169363a9059cbb936044808301949391928390030190829087803b15156104c857fe5b6102c65a03f115156104d657fe5b505060405151151590506104ea5760006000fd5b600554600654604080516000602091820181905282517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039485166004820152602481018790529251939094169363a9059cbb936044808501949192918390030190829087803b151561056257fe5b6102c65a03f1151561057057fe5b505060405151151590506105845760006000fd5b604051600160a060020a0333169084156108fc029085906000818181858888f1935050505015156105b157fe5b5b50505050505050565b600454600160a060020a031681565b60035460ff16156105db5760006000fd5b60028054340190555b565b60035460ff1681565b6003546101009004600160a060020a031681565b60025481565b600060006000600360019054906101000a9004600160a060020a0316600160a060020a0316633de39c116000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561066a57fe5b6102c65a03f1151561067857fe5b5050604051513a1115905061068d5760006000fd5b600360019054906101000a9004600160a060020a0316600160a060020a03166348cd4cb16000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156106e857fe5b6102c65a03f115156106f657fe5b505060405151431015905061070b5760006000fd5b600460009054906101000a9004600160a060020a0316600160a060020a0316636e4e5c1d6000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561076657fe5b6102c65a03f1151561077457fe5b505060405151151590506107885760006000fd5b60048054604080516000602091820181905282517f26987b600000000000000000000000000000000000000000000000000000000081529251600160a060020a0390941694631bf7d7499486946326987b60948184019490939183900390910190829087803b15156107f657fe5b6102c65a03f1151561080457fe5b505050604051805190506000604051608001526040518263ffffffff1660e060020a02815260040180828152602001915050608060405180830381600087803b151561084c57fe5b6102c65a03f1151561085a57fe5b505060408051602080820180519284015160035460009283905285517f1517d10700000000000000000000000000000000000000000000000000000000815295519499509097506101009004600160a060020a03169450631517d1079360048082019492918390030190829087803b15156108d157fe5b6102c65a03f115156108df57fe5b5050604051519150508083116108f55760006000fd5b8181840381151561090257fe5b33600160a060020a0316600090815260016020526040902080549290910490910190555b505050565b60035460ff161561093b576100cb565b6003805460ff19166001179081905560025460408051600060209182015281517ff48c305400000000000000000000000000000000000000000000000000000000815230600160a060020a03908116600483018190529351610100909604169463f48c305494933193909303926024808301939282900301818588803b15156109c057fe5b6125ee5a03f115156109ce57fe5b5050604051600254600160a060020a033316935080156108fc029250906000818181858888f1935050505015156100cb57fe5b5b565b60016020526000908152604090205481565b600554600160a060020a031681565b600060208190529081526040902054815600a165627a7a72305820c796cfefab43cec452a68ddb845b7f8e101a7bd8e9f4e99ab7ea1162a952cbbb0029
Verified Source Code Partial Match
Compiler: v0.4.11+commit.68ef5810
Optimization: Yes (200 runs)
StatusBuyer.sol 157 lines
pragma solidity ^0.4.11;
/*
Status Buyer
========================
Buys Status tokens from the crowdsale on your behalf.
Author: /u/Cintix
*/
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
// Interface to Status ICO Contract
contract StatusContribution {
uint256 public maxGasPrice;
uint256 public startBlock;
uint256 public totalNormalCollected;
uint256 public finalizedBlock;
function proxyPayment(address _th) payable returns (bool);
}
// Interface to Status Cap Determination Contract
contract DynamicCeiling {
function curves(uint currentIndex) returns (bytes32 hash,
uint256 limit,
uint256 slopeFactor,
uint256 collectMinimum);
uint256 public currentIndex;
uint256 public revealedCurves;
}
contract StatusBuyer {
// Store the amount of ETH deposited by each account.
mapping (address => uint256) public deposits;
// Track how much SNT each account would have been able to purchase on their own.
mapping (address => uint256) public simulated_snt;
// Bounty for executing buy.
uint256 public bounty;
// Track whether the contract has bought tokens yet.
bool public bought_tokens;
// The Status Token Sale address.
StatusContribution public sale = StatusContribution(0x55d34b686aa8C04921397c5807DB9ECEdba00a4c);
// The Status DynamicCeiling Contract address.
DynamicCeiling public dynamic = DynamicCeiling(0xc636e73Ff29fAEbCABA9E0C3f6833EaD179FFd5c);
// Status Network Token (SNT) Contract address.
ERC20 public token = ERC20(0x744d70FDBE2Ba4CF95131626614a1763DF805B9E);
// The developer address.
address developer = 0x4e6A1c57CdBfd97e8efe831f8f4418b1F2A09e6e;
// Withdraws all ETH/SNT owned by the user in the ratio currently owned by the contract.
function withdraw() {
// Store the user's deposit prior to withdrawal in a temporary variable.
uint256 user_deposit = deposits[msg.sender];
// Update the user's deposit prior to sending ETH to prevent recursive call.
deposits[msg.sender] = 0;
// Retrieve current ETH balance of contract (less the bounty).
uint256 contract_eth_balance = this.balance - bounty;
// Retrieve current SNT balance of contract.
uint256 contract_snt_balance = token.balanceOf(address(this));
// Calculate total SNT value of ETH and SNT owned by the contract.
// 1 ETH Wei -> 10000 SNT Wei
uint256 contract_value = (contract_eth_balance * 10000) + contract_snt_balance;
// Calculate amount of ETH to withdraw.
uint256 eth_amount = (user_deposit * contract_eth_balance * 10000) / contract_value;
// Calculate amount of SNT to withdraw.
uint256 snt_amount = 10000 * ((user_deposit * contract_snt_balance) / contract_value);
// No fee for withdrawing if user would have made it into the crowdsale alone.
uint256 fee = 0;
// 1% fee on portion of tokens user would not have been able to buy alone.
if (simulated_snt[msg.sender] < snt_amount) {
fee = (snt_amount - simulated_snt[msg.sender]) / 100;
}
// Send the funds. Throws on failure to prevent loss of funds.
if(!token.transfer(msg.sender, snt_amount - fee)) throw;
if(!token.transfer(developer, fee)) throw;
msg.sender.transfer(eth_amount);
}
// Allow anyone to contribute to the buy execution bounty.
function add_to_bounty() payable {
// Disallow adding to the bounty if contract has already bought the tokens.
if (bought_tokens) throw;
// Update bounty to include received amount.
bounty += msg.value;
}
// Allow users to simulate entering the crowdsale to avoid the fee. Callable by anyone.
function simulate_ico() {
// Limit maximum gas price to the same value as the Status ICO (50 GWei).
if (tx.gasprice > sale.maxGasPrice()) throw;
// Restrict until after the ICO has started.
if (block.number < sale.startBlock()) throw;
if (dynamic.revealedCurves() == 0) throw;
// Extract the buy limit and rate-limiting slope factor of the current curve/cap.
uint256 limit;
uint256 slopeFactor;
(,limit,slopeFactor,) = dynamic.curves(dynamic.currentIndex());
// Retrieve amount of ETH the ICO has collected so far.
uint256 totalNormalCollected = sale.totalNormalCollected();
// Verify the ICO is not currently at a cap, waiting for a reveal.
if (limit <= totalNormalCollected) throw;
// Add the maximum contributable amount to the user's simulated SNT balance.
simulated_snt[msg.sender] += ((limit - totalNormalCollected) / slopeFactor);
}
// Buys tokens in the crowdsale and rewards the sender. Callable by anyone.
function buy() {
// Short circuit to save gas if the contract has already bought tokens.
if (bought_tokens) return;
// Record that the contract has bought tokens first to prevent recursive call.
bought_tokens = true;
// Transfer all the funds (less the bounty) to the Status ICO contract
// to buy tokens. Throws if the crowdsale hasn't started yet or has
// already completed, preventing loss of funds.
sale.proxyPayment.value(this.balance - bounty)(address(this));
// Send the user their bounty for buying tokens for the contract.
msg.sender.transfer(bounty);
}
// A helper function for the default function, allowing contracts to interact.
function default_helper() payable {
// Only allow deposits if the contract hasn't already purchased the tokens.
if (!bought_tokens) {
// Update records of deposited ETH to include the received amount.
deposits[msg.sender] += msg.value;
// Block each user from contributing more than 30 ETH. No whales! >:C
if (deposits[msg.sender] > 30 ether) throw;
}
else {
// Reject ETH sent after the contract has already purchased tokens.
if (msg.value != 0) throw;
// If the ICO isn't over yet, simulate entering the crowdsale.
if (sale.finalizedBlock() == 0) {
simulate_ico();
}
else {
// Withdraw user's funds if they sent 0 ETH to the contract after the ICO.
withdraw();
}
}
}
// Default function. Called when a user sends ETH to the contract.
function () payable {
// Avoid recursively buying tokens when the sale contract refunds ETH.
if (msg.sender == address(sale)) return;
// Delegate to the helper function.
default_helper();
}
}
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
add_to_bounty 0x62f5ed61
No parameters
bought_tokens 0x6360fc3f
No parameters
returns: bool
bounty 0x943dfef1
No parameters
returns: uint256
buy 0xa6f2ae3a
No parameters
default_helper 0x5259347d
No parameters
deposits 0xfc7e286d
address
returns: uint256
dynamic 0x4bd54f04
No parameters
returns: address
sale 0x6ad1fe02
No parameters
returns: address
simulate_ico 0x97227325
No parameters
simulated_snt 0xadcaea0a
address
returns: uint256
token 0xfc0c546a
No parameters
returns: address
withdraw 0x3ccfd60b
No parameters
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address