Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 3161791 | 3320 days ago | 0.2 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Presale
Compiler Version
v0.4.2+commit.af6afb04
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2017-02-11
*/
pragma solidity ^0.4.2;
contract Presale {
mapping (address => uint) public balances;
uint public transfered_total = 0;
uint public constant min_goal_amount = 5 ether;
uint public constant max_goal_amount = 10 ether;
// Vega Fund Round A Address
address public project_wallet;
uint public presale_start_block;
uint public presale_end_block;
// est. of blocks count in 1 month
// Based on 1 block every 17 seconds, 30 days would produce ~152,471
// Just for allowing for some additional time round to 153,000
uint constant blocks_in_one_months = 153000;
// block number of the end of refund window,
// which will occur in the end of 1 month after presale
uint public refund_window_end_block;
function Presale(uint _start_block, uint _end_block, address _project_wallet) {
if (_start_block <= block.number) throw;
if (_end_block <= _start_block) throw;
if (_project_wallet == 0) throw;
presale_start_block = _start_block;
presale_end_block = _end_block;
project_wallet = _project_wallet;
refund_window_end_block = presale_end_block + blocks_in_one_months;
}
function has_presale_started() private constant returns (bool) {
return block.number >= presale_start_block;
}
function has_presale_time_ended() private constant returns (bool) {
return block.number > presale_end_block;
}
function is_min_goal_reached() private constant returns (bool) {
return transfered_total >= min_goal_amount;
}
function is_max_goal_reached() private constant returns (bool) {
return transfered_total >= max_goal_amount;
}
// Accept ETH while presale is active or until maximum goal is reached.
function () payable {
// check if presale has started
if (!has_presale_started()) throw;
// check if presale date is not over
if (has_presale_time_ended()) throw;
// don`t accept transactions with zero value
if (msg.value == 0) throw;
// check if max goal is not reached
if (is_max_goal_reached()) throw;
if (transfered_total + msg.value > max_goal_amount) {
// return change
var change_to_return = transfered_total + msg.value - max_goal_amount;
if (!msg.sender.send(change_to_return)) throw;
var to_add = max_goal_amount - transfered_total;
balances[msg.sender] += to_add;
transfered_total += to_add;
} else {
// set data
balances[msg.sender] += msg.value;
transfered_total += msg.value;
}
}
// Transfer ETH to Vega Round A address, as soon as minimum goal is reached.
function transfer_funds_to_project() {
if (!is_min_goal_reached()) throw;
if (this.balance == 0) throw;
// transfer ethers to Vega Round A address
if (!project_wallet.send(this.balance)) throw;
}
// Refund ETH in case minimum goal was not reached during presale.
// Refund will be available for one month window after presale.
function refund() {
if (!has_presale_time_ended()) throw;
if (is_min_goal_reached()) throw;
if (block.number > refund_window_end_block) throw;
var amount = balances[msg.sender];
// check if sender has balance
if (amount == 0) throw;
// reset balance
balances[msg.sender] = 0;
// actual refund
if (!msg.sender.send(amount)) throw;
}
// In case any ETH has left unclaimed after one month window, send them to Vega Round A address.
function transfer_left_funds_to_project() {
if (!has_presale_time_ended()) throw;
if (is_min_goal_reached()) throw;
if (block.number <= refund_window_end_block) throw;
if (this.balance == 0) throw;
// transfer left ETH to Vega Round A address
if (!project_wallet.send(this.balance)) throw;
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[],"name":"refund_window_end_block","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"min_goal_amount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"transfered_total","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"project_wallet","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"transfer_left_funds_to_project","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"transfer_funds_to_project","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"presale_start_block","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"presale_end_block","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"max_goal_amount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"_start_block","type":"uint256"},{"name":"_end_block","type":"uint256"},{"name":"_project_wallet","type":"address"}],"type":"constructor"},{"payable":true,"type":"fallback"}]Contract Creation Code
606060408190526000600155808061045781395060c06040525160805160a0514383116029576002565b8282116033576002565b80600160a060020a0316600014156048576002565b600392909255600481905560028054600160a060020a031916909217909155620255a8016005556103da8061007d6000396000f36060604052361561008d5760e060020a600035046322aa719681146100a157806327e235e3146100af57806328d3e3e1146100cc578063291d4f98146100e0578063590e1ae3146100ee5780638d809b0e14610100578063a37173e914610117578063af9b1cef14610127578063cba9c0e014610147578063cd5ba97814610155578063e3a70ec114610163575b610177600060006101a96003544310155b90565b346100025761029360055481565b346100025761029360043560006020819052908152604090205481565b3461000257610293674563918244f4000081565b346100025761029360015481565b346100025761017760006102c46101b8565b34610002576102a5600254600160a060020a031681565b34610002576101776103576101b8565b34610002576101776103cf5b600154674563918244f4000090101561009e565b346100025761029360035481565b346100025761029360045481565b3461000257610293678ac7230489e8000081565b005b33600160a060020a03166000908152602081905260409020805434908101909155600180549190910190555b5050565b15156101b457610002565b6101c25b600454431161009e565b156101cc57610002565b34600014156101da57610002565b6101f1600154678ac7230489e8000090101561009e565b156101fb57610002565b678ac7230489e800003460016000505401111561017957604051600154678ac7230489e7ffff193490910101925033600160a060020a03169083156108fc029084906000818181858888f19350505050151561025657610002565b506001805433600160a060020a031660009081526020819052604090208054678ac7230489e80000929092039182019055815481019091556101a5565b60408051918252519081900360200190f35b60408051600160a060020a039092168252519081900360200190f35b50565b15156102cf57610002565b6102d7610133565b156102e157610002565b6005544311156102f057610002565b5033600160a060020a03166000908152602081905260408120549081141561031757610002565b33600160a060020a0316600081815260208190526040808220829055516108fc84150291849190818181858888f1935050505015156102c157610002565b565b151561036257610002565b61036a610133565b1561037457610002565b600554431161038257610002565b30600160a060020a0316316000141561039a57610002565b600254604051600160a060020a039182169130163180156108fc02916000818181858888f19350505050151561035557610002565b15156103825761000256
Deployed Bytecode
0x6060604052361561008d5760e060020a600035046322aa719681146100a157806327e235e3146100af57806328d3e3e1146100cc578063291d4f98146100e0578063590e1ae3146100ee5780638d809b0e14610100578063a37173e914610117578063af9b1cef14610127578063cba9c0e014610147578063cd5ba97814610155578063e3a70ec114610163575b610177600060006101a96003544310155b90565b346100025761029360055481565b346100025761029360043560006020819052908152604090205481565b3461000257610293674563918244f4000081565b346100025761029360015481565b346100025761017760006102c46101b8565b34610002576102a5600254600160a060020a031681565b34610002576101776103576101b8565b34610002576101776103cf5b600154674563918244f4000090101561009e565b346100025761029360035481565b346100025761029360045481565b3461000257610293678ac7230489e8000081565b005b33600160a060020a03166000908152602081905260409020805434908101909155600180549190910190555b5050565b15156101b457610002565b6101c25b600454431161009e565b156101cc57610002565b34600014156101da57610002565b6101f1600154678ac7230489e8000090101561009e565b156101fb57610002565b678ac7230489e800003460016000505401111561017957604051600154678ac7230489e7ffff193490910101925033600160a060020a03169083156108fc029084906000818181858888f19350505050151561025657610002565b506001805433600160a060020a031660009081526020819052604090208054678ac7230489e80000929092039182019055815481019091556101a5565b60408051918252519081900360200190f35b60408051600160a060020a039092168252519081900360200190f35b50565b15156102cf57610002565b6102d7610133565b156102e157610002565b6005544311156102f057610002565b5033600160a060020a03166000908152602081905260408120549081141561031757610002565b33600160a060020a0316600081815260208190526040808220829055516108fc84150291849190818181858888f1935050505015156102c157610002565b565b151561036257610002565b61036a610133565b1561037457610002565b600554431161038257610002565b30600160a060020a0316316000141561039a57610002565b600254604051600160a060020a039182169130163180156108fc02916000818181858888f19350505050151561035557610002565b15156103825761000256
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000303e280000000000000000000000000000000000000000000000000000000000303e3c00000000000000000000000043f996926fbb1f4622c67259939462fac7735ee5
-----Decoded View---------------
Arg [0] : _start_block (uint256): 3161640
Arg [1] : _end_block (uint256): 3161660
Arg [2] : _project_wallet (address): 0x43f996926Fbb1f4622C67259939462fAc7735ee5
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000303e28
Arg [1] : 0000000000000000000000000000000000000000000000000000000000303e3c
Arg [2] : 00000000000000000000000043f996926fbb1f4622c67259939462fac7735ee5
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.