Source Code
Latest 25 from a total of 422 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim_bounty | 4215993 | 3107 days ago | IN | 0 ETH | 0.00045576 | ||||
| Transfer | 4112443 | 3133 days ago | IN | 0 ETH | 0.00094848 | ||||
| Transfer | 4107562 | 3134 days ago | IN | 0 ETH | 0.00094848 | ||||
| Transfer | 4105668 | 3135 days ago | IN | 0 ETH | 0.00149047 | ||||
| Transfer | 4105449 | 3135 days ago | IN | 0 ETH | 0.00104333 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00021717 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00044786 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00021717 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00021717 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049693 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00021692 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00021717 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00021717 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00044812 | ||||
| Auto_withdraw | 4105225 | 3135 days ago | IN | 0 ETH | 0.00049718 |
Latest 9 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 4039777 | 3149 days ago | 1 ETH | ||||
| Transfer | 4039777 | 3149 days ago | 4,148.35336647 ETH | ||||
| Transfer | 4039776 | 3149 days ago | 6 ETH | ||||
| Transfer | 4039776 | 3149 days ago | 1 ETH | ||||
| Transfer | 4039776 | 3149 days ago | 20 ETH | ||||
| Transfer | 4039775 | 3149 days ago | 200 ETH | ||||
| Transfer | 4039735 | 3149 days ago | 2.5 ETH | ||||
| Transfer | 4039589 | 3149 days ago | 1 ETH | ||||
| Transfer | 4039530 | 3149 days ago | 4 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DistrictBuyer
Compiler Version
v0.4.13+commit.fb4cb1a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2017-07-18
*/
pragma solidity ^0.4.13;
/*
District Buyer
========================
Buys District 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);
}
contract DistrictBuyer {
// Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
// Bounty for executing buy.
uint256 public bounty;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens;
// Record the time the contract bought the tokens.
uint256 public time_bought;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
// Emergency kill switch in case a critical bug is found.
bool public kill_switch;
// SHA3 hash of kill switch password.
bytes32 password_hash = 0x1b266c9bad3a46ed40bf43471d89b83712ed06c2250887c457f5f21f17b2eb97;
// Earliest time contract is allowed to buy into the crowdsale.
uint256 earliest_buy_time = 1500390000;
// The developer address.
address developer = 0x000Fb8369677b3065dE5821a86Bc9551d5e5EAb9;
// The crowdsale address.
address public sale = 0xF8094e15c897518B5Ac5287d7070cA5850eFc6ff;
// The token address.
ERC20 public token = ERC20(0x0AbdAce70D3790235af448C88547603b945604ea);
// Allows the developer or anyone with the password to claim the bounty and shut down everything except withdrawals in emergencies.
function activate_kill_switch(string password) {
// Only activate the kill switch if the sender is the developer or the password is correct.
if (msg.sender != developer && sha3(password) != password_hash) throw;
// Store the claimed bounty in a temporary variable.
uint256 claimed_bounty = bounty;
// Update bounty prior to sending to prevent recursive call.
bounty = 0;
// Irreversibly activate the kill switch.
kill_switch = true;
// Send the caller their bounty for activating the kill switch.
msg.sender.transfer(claimed_bounty);
}
// Withdraws all ETH deposited or tokens purchased by the user.
// "internal" means this function is not externally callable.
function withdraw(address user, bool has_fee) internal {
// If called before the ICO, cancel user's participation in the sale.
if (!bought_tokens) {
// Store the user's balance prior to withdrawal in a temporary variable.
uint256 eth_to_withdraw = balances[user];
// Update the user's balance prior to sending ETH to prevent recursive call.
balances[user] = 0;
// Return the user's funds. Throws on failure to prevent loss of funds.
user.transfer(eth_to_withdraw);
}
// Withdraw the user's tokens if the contract has already purchased them.
else {
// Retrieve current token balance of contract.
uint256 contract_token_balance = token.balanceOf(address(this));
// Disallow token withdrawals if there are no tokens to withdraw.
if (contract_token_balance == 0) throw;
// Store the user's token balance in a temporary variable.
uint256 tokens_to_withdraw = (balances[user] * contract_token_balance) / contract_eth_value;
// Update the value of tokens currently held by the contract.
contract_eth_value -= balances[user];
// Update the user's balance prior to sending to prevent recursive call.
balances[user] = 0;
// No fee if the user withdraws their own funds manually.
uint256 fee = 0;
// 1% fee for automatic withdrawals.
if (has_fee) {
fee = tokens_to_withdraw / 100;
// Send the fee to the developer.
if(!token.transfer(developer, fee)) throw;
}
// Send the funds. Throws on failure to prevent loss of funds.
if(!token.transfer(user, tokens_to_withdraw - fee)) throw;
}
}
// Automatically withdraws on users' behalves (less a 1% fee on tokens).
function auto_withdraw(address user){
// Only allow automatic withdrawals after users have had a chance to manually withdraw.
if (!bought_tokens || now < time_bought + 1 hours) throw;
// Withdraw the user's funds for them.
withdraw(user, true);
}
// Allows developer to add ETH to the buy execution bounty.
function add_to_bounty() payable {
// Only allow the developer to contribute to the buy execution bounty.
if (msg.sender != developer) throw;
// Disallow adding to bounty if kill switch is active.
if (kill_switch) throw;
// 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;
}
// Buys tokens in the crowdsale and rewards the caller, callable by anyone.
function claim_bounty(){
// Short circuit to save gas if the contract has already bought tokens.
if (bought_tokens) return;
// Short circuit to save gas if the earliest buy time hasn't been reached.
if (now < earliest_buy_time) return;
// Short circuit to save gas if kill switch is active.
if (kill_switch) return;
// Record that the contract has bought the tokens.
bought_tokens = true;
// Record the time the contract bought the tokens.
time_bought = now;
// Store the claimed bounty in a temporary variable.
uint256 claimed_bounty = bounty;
// Update bounty prior to sending to prevent recursive call.
bounty = 0;
// Record the amount of ETH sent as the contract's current value.
contract_eth_value = this.balance - claimed_bounty;
// Transfer all the funds (less the bounty) to the crowdsale address
// to buy tokens. Throws if the crowdsale hasn't started yet or has
// already completed, preventing loss of funds.
if(!sale.call.value(contract_eth_value)()) throw;
// Send the caller their bounty for buying tokens for the contract.
msg.sender.transfer(claimed_bounty);
}
// A helper function for the default function, allowing contracts to interact.
function default_helper() payable {
// Treat near-zero ETH transactions as withdrawal requests.
if (msg.value <= 1 finney) {
// No fee on manual withdrawals.
withdraw(msg.sender, false);
}
// Deposit the user's funds for use in purchasing tokens.
else {
// Disallow deposits if kill switch is active.
if (kill_switch) throw;
// Only allow deposits if the contract hasn't already purchased the tokens.
if (bought_tokens) throw;
// Update records of deposited ETH to include the received amount.
balances[msg.sender] += msg.value;
}
}
// Default function. Called when a user sends ETH to the contract.
function () payable {
// Prevent sale contract from refunding ETH to avoid partial fulfillment.
if (msg.sender == address(sale)) throw;
// Delegate to the helper function.
default_helper();
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[],"name":"claim_bounty","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"default_helper","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[],"name":"add_to_bounty","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"bought_tokens","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"sale","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"bounty","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"kill_switch","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"time_bought","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"contract_eth_value","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"user","type":"address"}],"name":"auto_withdraw","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"password","type":"string"}],"name":"activate_kill_switch","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"payable":true,"type":"fallback"}]Contract Creation Code
60606040527f1b266c9bad3a46ed40bf43471d89b83712ed06c2250887c457f5f21f17b2eb9760065563596e227060075560088054600160a060020a0319908116720fb8369677b3065de5821a86bc9551d5e5eab91790915560098054821673f8094e15c897518b5ac5287d7070ca5850efc6ff179055600a8054909116730abdace70d3790235af448c88547603b945604ea17905534156100a057600080fd5b5b610814806100b06000396000f300606060405236156100a95763ffffffff60e060020a60003504166302f5801581146100d657806327e235e3146100eb5780635259347d1461011c57806362f5ed61146101265780636360fc3f146101305780636ad1fe0214610157578063943dfef114610186578063a089feea146101ab578063c3dac9a1146101d2578063c42bb1e4146101f7578063d2c03c011461021c578063d4701c351461023d578063fc0c546a14610290575b6100d45b60095433600160a060020a03908116911614156100c957600080fd5b6100d16102bf565b5b565b005b34156100e157600080fd5b6100d461031f565b005b34156100f657600080fd5b61010a600160a060020a03600435166103e0565b60405190815260200160405180910390f35b6100d46102bf565b005b6100d46103f2565b005b341561013b57600080fd5b610143610438565b604051901515815260200160405180910390f35b341561016257600080fd5b61016a610441565b604051600160a060020a03909116815260200160405180910390f35b341561019157600080fd5b61010a610450565b60405190815260200160405180910390f35b34156101b657600080fd5b610143610456565b604051901515815260200160405180910390f35b34156101dd57600080fd5b61010a61045f565b60405190815260200160405180910390f35b341561020257600080fd5b61010a610465565b60405190815260200160405180910390f35b341561022757600080fd5b6100d4600160a060020a036004351661046b565b005b341561024857600080fd5b6100d460046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061049b95505050505050565b005b341561029b57600080fd5b61016a610573565b604051600160a060020a03909116815260200160405180910390f35b66038d7ea4c6800034116102dd576102d8336000610582565b6100d1565b60055460ff16156102ed57600080fd5b60025460ff16156102fd57600080fd5b600160a060020a03331660009081526020819052604090208054340190555b5b565b60025460009060ff1615610332576103dc565b600754421015610341576103dc565b60055460ff1615610351576103dc565b506002805460ff191660019081179091554260035580546000909155600160a060020a033081163182900360048190556009549091169060405160006040518083038185876187965a03f19250505015156103ab57600080fd5b600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156103dc57600080fd5b5b50565b60006020819052908152604090205481565b60085433600160a060020a0390811691161461040d57600080fd5b60055460ff161561041d57600080fd5b60025460ff161561042d57600080fd5b60018054340190555b565b60025460ff1681565b600954600160a060020a031681565b60015481565b60055460ff1681565b60035481565b60045481565b60025460ff1615806104825750600354610e100142105b1561048c57600080fd5b6103dc816001610582565b5b50565b60085460009033600160a060020a0390811691161480159061051c5750600654826040518082805190602001908083835b602083106104ec57805182525b601f1990920191602091820191016104cc565b6001836020036101000a038019825116818451161790925250505091909101925060409150505190819003902014155b1561052657600080fd5b5060018054600082556005805460ff1916909217909155600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561056e57600080fd5b5b5050565b600a54600160a060020a031681565b60025460009081908190819060ff1615156105e457600160a060020a038616600081815260208190526040808220805492905590955085156108fc0290869051600060405180830381858888f1935050505015156105df57600080fd5b6107de565b600a54600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561063d57600080fd5b6102c65a03f1151561064e57600080fd5b505050604051805193505082151561066557600080fd5b600454600160a060020a038716600090815260208190526040902054840281151561068c57fe5b600160a060020a0388166000908152602081905260408120805460048054919091039055819055919004925090508415610756576064825b600a54600854929091049250600160a060020a039081169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561073057600080fd5b6102c65a03f1151561074157600080fd5b50505060405180519050151561075657600080fd5b5b600a54600160a060020a031663a9059cbb8783850360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156107b857600080fd5b6102c65a03f115156107c957600080fd5b5050506040518051905015156107de57600080fd5b5b5b5050505050505600a165627a7a7230582071a1f473b4f2089715440331b40344eb08da0efbf0461fa4303a6c4332b852240029
Deployed Bytecode
0x606060405236156100a95763ffffffff60e060020a60003504166302f5801581146100d657806327e235e3146100eb5780635259347d1461011c57806362f5ed61146101265780636360fc3f146101305780636ad1fe0214610157578063943dfef114610186578063a089feea146101ab578063c3dac9a1146101d2578063c42bb1e4146101f7578063d2c03c011461021c578063d4701c351461023d578063fc0c546a14610290575b6100d45b60095433600160a060020a03908116911614156100c957600080fd5b6100d16102bf565b5b565b005b34156100e157600080fd5b6100d461031f565b005b34156100f657600080fd5b61010a600160a060020a03600435166103e0565b60405190815260200160405180910390f35b6100d46102bf565b005b6100d46103f2565b005b341561013b57600080fd5b610143610438565b604051901515815260200160405180910390f35b341561016257600080fd5b61016a610441565b604051600160a060020a03909116815260200160405180910390f35b341561019157600080fd5b61010a610450565b60405190815260200160405180910390f35b34156101b657600080fd5b610143610456565b604051901515815260200160405180910390f35b34156101dd57600080fd5b61010a61045f565b60405190815260200160405180910390f35b341561020257600080fd5b61010a610465565b60405190815260200160405180910390f35b341561022757600080fd5b6100d4600160a060020a036004351661046b565b005b341561024857600080fd5b6100d460046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061049b95505050505050565b005b341561029b57600080fd5b61016a610573565b604051600160a060020a03909116815260200160405180910390f35b66038d7ea4c6800034116102dd576102d8336000610582565b6100d1565b60055460ff16156102ed57600080fd5b60025460ff16156102fd57600080fd5b600160a060020a03331660009081526020819052604090208054340190555b5b565b60025460009060ff1615610332576103dc565b600754421015610341576103dc565b60055460ff1615610351576103dc565b506002805460ff191660019081179091554260035580546000909155600160a060020a033081163182900360048190556009549091169060405160006040518083038185876187965a03f19250505015156103ab57600080fd5b600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156103dc57600080fd5b5b50565b60006020819052908152604090205481565b60085433600160a060020a0390811691161461040d57600080fd5b60055460ff161561041d57600080fd5b60025460ff161561042d57600080fd5b60018054340190555b565b60025460ff1681565b600954600160a060020a031681565b60015481565b60055460ff1681565b60035481565b60045481565b60025460ff1615806104825750600354610e100142105b1561048c57600080fd5b6103dc816001610582565b5b50565b60085460009033600160a060020a0390811691161480159061051c5750600654826040518082805190602001908083835b602083106104ec57805182525b601f1990920191602091820191016104cc565b6001836020036101000a038019825116818451161790925250505091909101925060409150505190819003902014155b1561052657600080fd5b5060018054600082556005805460ff1916909217909155600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561056e57600080fd5b5b5050565b600a54600160a060020a031681565b60025460009081908190819060ff1615156105e457600160a060020a038616600081815260208190526040808220805492905590955085156108fc0290869051600060405180830381858888f1935050505015156105df57600080fd5b6107de565b600a54600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561063d57600080fd5b6102c65a03f1151561064e57600080fd5b505050604051805193505082151561066557600080fd5b600454600160a060020a038716600090815260208190526040902054840281151561068c57fe5b600160a060020a0388166000908152602081905260408120805460048054919091039055819055919004925090508415610756576064825b600a54600854929091049250600160a060020a039081169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561073057600080fd5b6102c65a03f1151561074157600080fd5b50505060405180519050151561075657600080fd5b5b600a54600160a060020a031663a9059cbb8783850360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156107b857600080fd5b6102c65a03f115156107c957600080fd5b5050506040518051905015156107de57600080fd5b5b5b5050505050505600a165627a7a7230582071a1f473b4f2089715440331b40344eb08da0efbf0461fa4303a6c4332b852240029
Swarm Source
bzzr://71a1f473b4f2089715440331b40344eb08da0efbf0461fa4303a6c4332b85224
Loading...
Loading
Loading...
Loading
Net Worth in USD
$2.21
Net Worth in ETH
0.0011
Token Allocations
ETH
100.00%
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $2,012.92 | 0.0011 | $2.21 |
Loading...
Loading
Loading...
Loading
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.