Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ReservedTokensFinalizeAgent
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 2018-06-06
*/
pragma solidity ^0.4.11;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// Temporarily have SafeMath here until all contracts have been migrated to SafeMathLib version from OpenZeppelin
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint a, uint b) internal returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* Safe unsigned safe math.
*
* https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli
*
* Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol
*
* Maintained here until merged to mainline zeppelin-solidity.
*
*/
library SafeMathLibExt {
function times(uint a, uint b) returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function divides(uint a, uint b) returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function minus(uint a, uint b) returns (uint) {
assert(b <= a);
return a - b;
}
function plus(uint a, uint b) returns (uint) {
uint c = a + b;
assert(c>=a);
return c;
}
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/*
* Haltable
*
* Abstract contract that allows children to implement an
* emergency stop mechanism. Differs from Pausable by causing a throw when in halt mode.
*
*
* Originally envisioned in FirstBlood ICO contract.
*/
contract Haltable is Ownable {
bool public halted;
modifier stopInEmergency {
if (halted) throw;
_;
}
modifier stopNonOwnersInEmergency {
if (halted && msg.sender != owner) throw;
_;
}
modifier onlyInEmergency {
if (!halted) throw;
_;
}
// called by the owner on emergency, triggers stopped state
function halt() external onlyOwner {
halted = true;
}
// called by the owner on end of emergency, returns to normal state
function unhalt() external onlyOwner onlyInEmergency {
halted = false;
}
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* Interface for defining crowdsale pricing.
*/
contract PricingStrategy {
address public tier;
/** Interface declaration. */
function isPricingStrategy() public constant returns (bool) {
return true;
}
/** Self check if all references are correctly set.
*
* Checks that pricing strategy matches crowdsale parameters.
*/
function isSane(address crowdsale) public constant returns (bool) {
return true;
}
/**
* @dev Pricing tells if this is a presale purchase or not.
@param purchaser Address of the purchaser
@return False by default, true if a presale purchaser
*/
function isPresalePurchase(address purchaser) public constant returns (bool) {
return false;
}
/* How many weis one token costs */
function updateRate(uint newOneTokenInWei) public;
/**
* When somebody tries to buy tokens for X eth, calculate how many tokens they get.
*
*
* @param value - What is the value of the transaction send in as wei
* @param tokensSold - how much tokens have been sold this far
* @param weiRaised - how much money has been raised this far in the main token sale - this number excludes presale
* @param msgSender - who is the investor of this transaction
* @param decimals - how many decimal units the token has
* @return Amount of tokens the investor receives
*/
function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint tokenAmount);
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* Finalize agent defines what happens at the end of succeseful crowdsale.
*
* - Allocate tokens for founders, bounties and community
* - Make tokens transferable
* - etc.
*/
contract FinalizeAgent {
bool public reservedTokensAreDistributed = false;
function isFinalizeAgent() public constant returns(bool) {
return true;
}
/** Return true if we can run finalizeCrowdsale() properly.
*
* This is a safety check function that doesn't allow crowdsale to begin
* unless the finalizer has been set up properly.
*/
function isSane() public constant returns (bool);
function distributeReservedTokens(uint reservedTokensDistributionBatch);
/** Called once by crowdsale finalize() if the sale was success. */
function finalizeCrowdsale();
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant 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);
}
/**
* A token that defines fractional units as decimals.
*/
contract FractionalERC20Ext is ERC20 {
uint public decimals;
uint public minCap;
}
/**
* Abstract base contract for token sales.
*
* Handle
* - start and end dates
* - accepting investments
* - minimum funding goal and refund
* - various statistics during the crowdfund
* - different pricing strategies
* - different investment policies (require server side customer id, allow only whitelisted addresses)
*
*/
contract CrowdsaleExt is Haltable {
/* Max investment count when we are still allowed to change the multisig address */
uint public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 5;
using SafeMathLibExt for uint;
/* The token we are selling */
FractionalERC20Ext public token;
/* How we are going to price our offering */
PricingStrategy public pricingStrategy;
/* Post-success callback */
FinalizeAgent public finalizeAgent;
/* name of the crowdsale tier */
string public name;
/* tokens will be transfered from this address */
address public multisigWallet;
/* if the funding goal is not reached, investors may withdraw their funds */
uint public minimumFundingGoal;
/* the UNIX timestamp start date of the crowdsale */
uint public startsAt;
/* the UNIX timestamp end date of the crowdsale */
uint public endsAt;
/* the number of tokens already sold through this contract*/
uint public tokensSold = 0;
/* How many wei of funding we have raised */
uint public weiRaised = 0;
/* How many distinct addresses have invested */
uint public investorCount = 0;
/* Has this crowdsale been finalized */
bool public finalized;
bool public isWhiteListed;
address[] public joinedCrowdsales;
uint8 public joinedCrowdsalesLen = 0;
uint8 public joinedCrowdsalesLenMax = 50;
struct JoinedCrowdsaleStatus {
bool isJoined;
uint8 position;
}
mapping (address => JoinedCrowdsaleStatus) joinedCrowdsaleState;
/** How much ETH each address has invested to this crowdsale */
mapping (address => uint256) public investedAmountOf;
/** How much tokens this crowdsale has credited for each investor address */
mapping (address => uint256) public tokenAmountOf;
struct WhiteListData {
bool status;
uint minCap;
uint maxCap;
}
//is crowdsale updatable
bool public isUpdatable;
/** Addresses that are allowed to invest even before ICO offical opens. For testing, for ICO partners, etc. */
mapping (address => WhiteListData) public earlyParticipantWhitelist;
/** List of whitelisted addresses */
address[] public whitelistedParticipants;
/** This is for manul testing for the interaction from owner wallet. You can set it to any value and inspect this in blockchain explorer to see that crowdsale interaction works. */
uint public ownerTestValue;
/** State machine
*
* - Preparing: All contract initialization calls and variables have not been set yet
* - Prefunding: We have not passed start time yet
* - Funding: Active crowdsale
* - Success: Minimum funding goal reached
* - Failure: Minimum funding goal not reached before ending time
* - Finalized: The finalized has been called and succesfully executed
*/
enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Finalized}
// A new investment was made
event Invested(address investor, uint weiAmount, uint tokenAmount, uint128 customerId);
// Address early participation whitelist status changed
event Whitelisted(address addr, bool status, uint minCap, uint maxCap);
event WhitelistItemChanged(address addr, bool status, uint minCap, uint maxCap);
// Crowdsale start time has been changed
event StartsAtChanged(uint newStartsAt);
// Crowdsale end time has been changed
event EndsAtChanged(uint newEndsAt);
function CrowdsaleExt(string _name, address _token, PricingStrategy _pricingStrategy, address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal, bool _isUpdatable, bool _isWhiteListed) {
owner = msg.sender;
name = _name;
token = FractionalERC20Ext(_token);
setPricingStrategy(_pricingStrategy);
multisigWallet = _multisigWallet;
if(multisigWallet == 0) {
throw;
}
if(_start == 0) {
throw;
}
startsAt = _start;
if(_end == 0) {
throw;
}
endsAt = _end;
// Don't mess the dates
if(startsAt >= endsAt) {
throw;
}
// Minimum funding goal can be zero
minimumFundingGoal = _minimumFundingGoal;
isUpdatable = _isUpdatable;
isWhiteListed = _isWhiteListed;
}
/**
* Don't expect to just send in money and get tokens.
*/
function() payable {
throw;
}
/**
* Make an investment.
*
* Crowdsale must be running for one to invest.
* We must have not pressed the emergency brake.
*
* @param receiver The Ethereum address who receives the tokens
* @param customerId (optional) UUID v4 to track the successful payments on the server side
*
*/
function investInternal(address receiver, uint128 customerId) stopInEmergency private {
// Determine if it's a good time to accept investment from this participant
if(getState() == State.PreFunding) {
// Are we whitelisted for early deposit
throw;
} else if(getState() == State.Funding) {
// Retail participants can only come in when the crowdsale is running
// pass
if(isWhiteListed) {
if(!earlyParticipantWhitelist[receiver].status) {
throw;
}
}
} else {
// Unwanted state
throw;
}
uint weiAmount = msg.value;
// Account presale sales separately, so that they do not count against pricing tranches
uint tokenAmount = pricingStrategy.calculatePrice(weiAmount, weiRaised, tokensSold, msg.sender, token.decimals());
if(tokenAmount == 0) {
// Dust transaction
throw;
}
if(isWhiteListed) {
if(tokenAmount < earlyParticipantWhitelist[receiver].minCap && tokenAmountOf[receiver] == 0) {
// tokenAmount < minCap for investor
throw;
}
// Check that we did not bust the investor's cap
if (isBreakingInvestorCap(receiver, tokenAmount)) {
throw;
}
updateInheritedEarlyParticipantWhitelist(receiver, tokenAmount);
} else {
if(tokenAmount < token.minCap() && tokenAmountOf[receiver] == 0) {
throw;
}
}
if(investedAmountOf[receiver] == 0) {
// A new investor
investorCount++;
}
// Update investor
investedAmountOf[receiver] = investedAmountOf[receiver].plus(weiAmount);
tokenAmountOf[receiver] = tokenAmountOf[receiver].plus(tokenAmount);
// Update totals
weiRaised = weiRaised.plus(weiAmount);
tokensSold = tokensSold.plus(tokenAmount);
// Check that we did not bust the cap
if(isBreakingCap(weiAmount, tokenAmount, weiRaised, tokensSold)) {
throw;
}
assignTokens(receiver, tokenAmount);
// Pocket the money
if(!multisigWallet.send(weiAmount)) throw;
// Tell us invest was success
Invested(receiver, weiAmount, tokenAmount, customerId);
}
/**
* Allow anonymous contributions to this crowdsale.
*/
function invest(address addr) public payable {
investInternal(addr, 0);
}
/**
* The basic entry point to participate the crowdsale process.
*
* Pay for funding, get invested tokens back in the sender address.
*/
function buy() public payable {
invest(msg.sender);
}
function distributeReservedTokens(uint reservedTokensDistributionBatch) public inState(State.Success) onlyOwner stopInEmergency {
// Already finalized
if(finalized) {
throw;
}
// Finalizing is optional. We only call it if we are given a finalizing agent.
if(address(finalizeAgent) != address(0)) {
finalizeAgent.distributeReservedTokens(reservedTokensDistributionBatch);
}
}
function areReservedTokensDistributed() public constant returns (bool) {
return finalizeAgent.reservedTokensAreDistributed();
}
function canDistributeReservedTokens() public constant returns(bool) {
CrowdsaleExt lastTierCntrct = CrowdsaleExt(getLastTier());
if ((lastTierCntrct.getState() == State.Success) && !lastTierCntrct.halted() && !lastTierCntrct.finalized() && !lastTierCntrct.areReservedTokensDistributed()) return true;
return false;
}
/**
* Finalize a succcesful crowdsale.
*
* The owner can triggre a call the contract that provides post-crowdsale actions, like releasing the tokens.
*/
function finalize() public inState(State.Success) onlyOwner stopInEmergency {
// Already finalized
if(finalized) {
throw;
}
// Finalizing is optional. We only call it if we are given a finalizing agent.
if(address(finalizeAgent) != address(0)) {
finalizeAgent.finalizeCrowdsale();
}
finalized = true;
}
/**
* Allow to (re)set finalize agent.
*
* Design choice: no state restrictions on setting this, so that we can fix fat finger mistakes.
*/
function setFinalizeAgent(FinalizeAgent addr) public onlyOwner {
assert(address(addr) != address(0));
assert(address(finalizeAgent) == address(0));
finalizeAgent = addr;
// Don't allow setting bad agent
if(!finalizeAgent.isFinalizeAgent()) {
throw;
}
}
/**
* Allow addresses to do early participation.
*/
function setEarlyParticipantWhitelist(address addr, bool status, uint minCap, uint maxCap) public onlyOwner {
if (!isWhiteListed) throw;
assert(addr != address(0));
assert(maxCap > 0);
assert(minCap <= maxCap);
assert(now <= endsAt);
if (!isAddressWhitelisted(addr)) {
whitelistedParticipants.push(addr);
Whitelisted(addr, status, minCap, maxCap);
} else {
WhitelistItemChanged(addr, status, minCap, maxCap);
}
earlyParticipantWhitelist[addr] = WhiteListData({status:status, minCap:minCap, maxCap:maxCap});
}
function setEarlyParticipantWhitelistMultiple(address[] addrs, bool[] statuses, uint[] minCaps, uint[] maxCaps) public onlyOwner {
if (!isWhiteListed) throw;
assert(now <= endsAt);
assert(addrs.length == statuses.length);
assert(statuses.length == minCaps.length);
assert(minCaps.length == maxCaps.length);
for (uint iterator = 0; iterator < addrs.length; iterator++) {
setEarlyParticipantWhitelist(addrs[iterator], statuses[iterator], minCaps[iterator], maxCaps[iterator]);
}
}
function updateInheritedEarlyParticipantWhitelist(address reciever, uint tokensBought) private {
if (!isWhiteListed) throw;
if (tokensBought < earlyParticipantWhitelist[reciever].minCap && tokenAmountOf[reciever] == 0) throw;
uint8 tierPosition = getTierPosition(this);
for (uint8 j = tierPosition + 1; j < joinedCrowdsalesLen; j++) {
CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]);
crowdsale.updateEarlyParticipantWhitelist(reciever, tokensBought);
}
}
function updateEarlyParticipantWhitelist(address addr, uint tokensBought) public {
if (!isWhiteListed) throw;
assert(addr != address(0));
assert(now <= endsAt);
assert(isTierJoined(msg.sender));
if (tokensBought < earlyParticipantWhitelist[addr].minCap && tokenAmountOf[addr] == 0) throw;
//if (addr != msg.sender && contractAddr != msg.sender) throw;
uint newMaxCap = earlyParticipantWhitelist[addr].maxCap;
newMaxCap = newMaxCap.minus(tokensBought);
earlyParticipantWhitelist[addr] = WhiteListData({status:earlyParticipantWhitelist[addr].status, minCap:0, maxCap:newMaxCap});
}
function isAddressWhitelisted(address addr) public constant returns(bool) {
for (uint i = 0; i < whitelistedParticipants.length; i++) {
if (whitelistedParticipants[i] == addr) {
return true;
break;
}
}
return false;
}
function whitelistedParticipantsLength() public constant returns (uint) {
return whitelistedParticipants.length;
}
function isTierJoined(address addr) public constant returns(bool) {
return joinedCrowdsaleState[addr].isJoined;
}
function getTierPosition(address addr) public constant returns(uint8) {
return joinedCrowdsaleState[addr].position;
}
function getLastTier() public constant returns(address) {
if (joinedCrowdsalesLen > 0)
return joinedCrowdsales[joinedCrowdsalesLen - 1];
else
return address(0);
}
function setJoinedCrowdsales(address addr) private onlyOwner {
assert(addr != address(0));
assert(joinedCrowdsalesLen <= joinedCrowdsalesLenMax);
assert(!isTierJoined(addr));
joinedCrowdsales.push(addr);
joinedCrowdsaleState[addr] = JoinedCrowdsaleStatus({
isJoined: true,
position: joinedCrowdsalesLen
});
joinedCrowdsalesLen++;
}
function updateJoinedCrowdsalesMultiple(address[] addrs) public onlyOwner {
assert(addrs.length > 0);
assert(joinedCrowdsalesLen == 0);
assert(addrs.length <= joinedCrowdsalesLenMax);
for (uint8 iter = 0; iter < addrs.length; iter++) {
setJoinedCrowdsales(addrs[iter]);
}
}
function setStartsAt(uint time) onlyOwner {
assert(!finalized);
assert(isUpdatable);
assert(now <= time); // Don't change past
assert(time <= endsAt);
assert(now <= startsAt);
CrowdsaleExt lastTierCntrct = CrowdsaleExt(getLastTier());
if (lastTierCntrct.finalized()) throw;
uint8 tierPosition = getTierPosition(this);
//start time should be greater then end time of previous tiers
for (uint8 j = 0; j < tierPosition; j++) {
CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]);
assert(time >= crowdsale.endsAt());
}
startsAt = time;
StartsAtChanged(startsAt);
}
/**
* Allow crowdsale owner to close early or extend the crowdsale.
*
* This is useful e.g. for a manual soft cap implementation:
* - after X amount is reached determine manual closing
*
* This may put the crowdsale to an invalid state,
* but we trust owners know what they are doing.
*
*/
function setEndsAt(uint time) public onlyOwner {
assert(!finalized);
assert(isUpdatable);
assert(now <= time);// Don't change past
assert(startsAt <= time);
assert(now <= endsAt);
CrowdsaleExt lastTierCntrct = CrowdsaleExt(getLastTier());
if (lastTierCntrct.finalized()) throw;
uint8 tierPosition = getTierPosition(this);
for (uint8 j = tierPosition + 1; j < joinedCrowdsalesLen; j++) {
CrowdsaleExt crowdsale = CrowdsaleExt(joinedCrowdsales[j]);
assert(time <= crowdsale.startsAt());
}
endsAt = time;
EndsAtChanged(endsAt);
}
/**
* Allow to (re)set pricing strategy.
*
* Design choice: no state restrictions on the set, so that we can fix fat finger mistakes.
*/
function setPricingStrategy(PricingStrategy _pricingStrategy) public onlyOwner {
assert(address(_pricingStrategy) != address(0));
assert(address(pricingStrategy) == address(0));
pricingStrategy = _pricingStrategy;
// Don't allow setting bad agent
if(!pricingStrategy.isPricingStrategy()) {
throw;
}
}
/**
* Allow to change the team multisig address in the case of emergency.
*
* This allows to save a deployed crowdsale wallet in the case the crowdsale has not yet begun
* (we have done only few test transactions). After the crowdsale is going
* then multisig address stays locked for the safety reasons.
*/
function setMultisig(address addr) public onlyOwner {
// Change
if(investorCount > MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE) {
throw;
}
multisigWallet = addr;
}
/**
* @return true if the crowdsale has raised enough money to be a successful.
*/
function isMinimumGoalReached() public constant returns (bool reached) {
return weiRaised >= minimumFundingGoal;
}
/**
* Check if the contract relationship looks good.
*/
function isFinalizerSane() public constant returns (bool sane) {
return finalizeAgent.isSane();
}
/**
* Check if the contract relationship looks good.
*/
function isPricingSane() public constant returns (bool sane) {
return pricingStrategy.isSane(address(this));
}
/**
* Crowdfund state machine management.
*
* We make it a function and do not assign the result to a variable, so there is no chance of the variable being stale.
*/
function getState() public constant returns (State) {
if(finalized) return State.Finalized;
else if (address(finalizeAgent) == 0) return State.Preparing;
else if (!finalizeAgent.isSane()) return State.Preparing;
else if (!pricingStrategy.isSane(address(this))) return State.Preparing;
else if (block.timestamp < startsAt) return State.PreFunding;
else if (block.timestamp <= endsAt && !isCrowdsaleFull()) return State.Funding;
else if (isMinimumGoalReached()) return State.Success;
else return State.Failure;
}
/** Interface marker. */
function isCrowdsale() public constant returns (bool) {
return true;
}
//
// Modifiers
//
/** Modified allowing execution only if the crowdsale is currently running. */
modifier inState(State state) {
if(getState() != state) throw;
_;
}
//
// Abstract functions
//
/**
* Check if the current invested breaks our cap rules.
*
*
* The child contract must define their own cap setting rules.
* We allow a lot of flexibility through different capping strategies (ETH, token count)
* Called from invest().
*
* @param weiAmount The amount of wei the investor tries to invest in the current transaction
* @param tokenAmount The amount of tokens we try to give to the investor in the current transaction
* @param weiRaisedTotal What would be our total raised balance after this transaction
* @param tokensSoldTotal What would be our total sold tokens count after this transaction
*
* @return true if taking this investment would break our cap rules
*/
function isBreakingCap(uint weiAmount, uint tokenAmount, uint weiRaisedTotal, uint tokensSoldTotal) public constant returns (bool limitBroken);
function isBreakingInvestorCap(address receiver, uint tokenAmount) public constant returns (bool limitBroken);
/**
* Check if the current crowdsale is full and we can no longer sell any tokens.
*/
function isCrowdsaleFull() public constant returns (bool);
/**
* Create new tokens or transfer issued tokens to the investor depending on the cap model.
*/
function assignTokens(address receiver, uint tokenAmount) private;
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* Standard ERC20 token with Short Hand Attack and approve() race condition mitigation.
*
* Based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, SafeMath {
/* Token supply got increased and a new owner received these tokens */
event Minted(address receiver, uint amount);
/* Actual balances of token holders */
mapping(address => uint) balances;
/* approve() allowances */
mapping (address => mapping (address => uint)) allowed;
/* Interface declaration */
function isToken() public constant returns (bool weAre) {
return true;
}
function transfer(address _to, uint _value) returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], _value);
balances[_to] = safeAdd(balances[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint _value) returns (bool success) {
uint _allowance = allowed[_from][msg.sender];
balances[_to] = safeAdd(balances[_to], _value);
balances[_from] = safeSub(balances[_from], _value);
allowed[_from][msg.sender] = safeSub(_allowance, _value);
Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner];
}
function approve(address _spender, uint _value) returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw;
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* Upgrade agent interface inspired by Lunyr.
*
* Upgrade agent transfers tokens to a new contract.
* Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting.
*/
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public constant returns (bool) {
return true;
}
function upgradeFrom(address _from, uint256 _value) public;
}
/**
* A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision.
*
* First envisioned by Golem and Lunyr projects.
*/
contract UpgradeableToken is StandardToken {
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can bgun
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet
* - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
function UpgradeableToken(address _upgradeMaster) {
upgradeMaster = _upgradeMaster;
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
UpgradeState state = getUpgradeState();
if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) {
// Called in a bad state
throw;
}
// Validate input value.
if (value == 0) throw;
balances[msg.sender] = safeSub(balances[msg.sender], value);
// Take tokens out from circulation
totalSupply = safeSub(totalSupply, value);
totalUpgraded = safeAdd(totalUpgraded, value);
// Upgrade agent reissues the tokens
upgradeAgent.upgradeFrom(msg.sender, value);
Upgrade(msg.sender, upgradeAgent, value);
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
if(!canUpgrade()) {
// The token is not yet in a state that we could think upgrading
throw;
}
if (agent == 0x0) throw;
// Only a master can designate the next agent
if (msg.sender != upgradeMaster) throw;
// Upgrade has already begun for an agent
if (getUpgradeState() == UpgradeState.Upgrading) throw;
upgradeAgent = UpgradeAgent(agent);
// Bad interface
if(!upgradeAgent.isUpgradeAgent()) throw;
// Make sure that token supplies match in source and target
if (upgradeAgent.originalSupply() != totalSupply) throw;
UpgradeAgentSet(upgradeAgent);
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public constant returns(UpgradeState) {
if(!canUpgrade()) return UpgradeState.NotAllowed;
else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent;
else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade;
else return UpgradeState.Upgrading;
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
if (master == 0x0) throw;
if (msg.sender != upgradeMaster) throw;
upgradeMaster = master;
}
/**
* Child contract can enable to provide the condition when the upgrade can begun.
*/
function canUpgrade() public constant returns(bool) {
return true;
}
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* Define interface for releasing the token transfer after a successful crowdsale.
*/
contract ReleasableToken is ERC20, Ownable {
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/
bool public released = false;
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping (address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
if(!released) {
if(!transferAgents[_sender]) {
throw;
}
}
_;
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public {
// We don't do interface check here as we might want to a normal wallet address to act as a release agent
releaseAgent = addr;
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public {
transferAgents[addr] = state;
}
/**
* One way function to release the tokens to the wild.
*
* Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached).
*/
function releaseTokenTransfer() public onlyReleaseAgent {
released = true;
}
/** The function can be called only before or after the tokens have been releasesd */
modifier inReleaseState(bool releaseState) {
if(releaseState != released) {
throw;
}
_;
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
if(msg.sender != releaseAgent) {
throw;
}
_;
}
function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) {
// Call StandardToken.transfer()
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) {
// Call StandardToken.transferForm()
return super.transferFrom(_from, _to, _value);
}
}
/**
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/**
* A token that can increase its supply by another contract.
*
* This allows uncapped crowdsale by dynamically increasing the supply when money pours in.
* Only mint agents, contracts whitelisted by owner, can mint new tokens.
*
*/
contract MintableTokenExt is StandardToken, Ownable {
using SafeMathLibExt for uint;
bool public mintingFinished = false;
/** List of agents that are allowed to create new tokens */
mapping (address => bool) public mintAgents;
event MintingAgentChanged(address addr, bool state );
/** inPercentageUnit is percents of tokens multiplied to 10 up to percents decimals.
* For example, for reserved tokens in percents 2.54%
* inPercentageUnit = 254
* inPercentageDecimals = 2
*/
struct ReservedTokensData {
uint inTokens;
uint inPercentageUnit;
uint inPercentageDecimals;
bool isReserved;
bool isDistributed;
}
mapping (address => ReservedTokensData) public reservedTokensList;
address[] public reservedTokensDestinations;
uint public reservedTokensDestinationsLen = 0;
bool reservedTokensDestinationsAreSet = false;
modifier onlyMintAgent() {
// Only crowdsale contracts are allowed to mint new tokens
if(!mintAgents[msg.sender]) {
throw;
}
_;
}
/** Make sure we are not done yet. */
modifier canMint() {
if(mintingFinished) throw;
_;
}
function finalizeReservedAddress(address addr) public onlyMintAgent canMint {
ReservedTokensData storage reservedTokensData = reservedTokensList[addr];
reservedTokensData.isDistributed = true;
}
function isAddressReserved(address addr) public constant returns (bool isReserved) {
return reservedTokensList[addr].isReserved;
}
function areTokensDistributedForAddress(address addr) public constant returns (bool isDistributed) {
return reservedTokensList[addr].isDistributed;
}
function getReservedTokens(address addr) public constant returns (uint inTokens) {
return reservedTokensList[addr].inTokens;
}
function getReservedPercentageUnit(address addr) public constant returns (uint inPercentageUnit) {
return reservedTokensList[addr].inPercentageUnit;
}
function getReservedPercentageDecimals(address addr) public constant returns (uint inPercentageDecimals) {
return reservedTokensList[addr].inPercentageDecimals;
}
function setReservedTokensListMultiple(
address[] addrs,
uint[] inTokens,
uint[] inPercentageUnit,
uint[] inPercentageDecimals
) public canMint onlyOwner {
assert(!reservedTokensDestinationsAreSet);
assert(addrs.length == inTokens.length);
assert(inTokens.length == inPercentageUnit.length);
assert(inPercentageUnit.length == inPercentageDecimals.length);
for (uint iterator = 0; iterator < addrs.length; iterator++) {
if (addrs[iterator] != address(0)) {
setReservedTokensList(addrs[iterator], inTokens[iterator], inPercentageUnit[iterator], inPercentageDecimals[iterator]);
}
}
reservedTokensDestinationsAreSet = true;
}
/**
* Create new tokens and allocate them to an address..
*
* Only callably by a crowdsale contract (mint agent).
*/
function mint(address receiver, uint amount) onlyMintAgent canMint public {
totalSupply = totalSupply.plus(amount);
balances[receiver] = balances[receiver].plus(amount);
// This will make the mint transaction apper in EtherScan.io
// We can remove this after there is a standardized minting event
Transfer(0, receiver, amount);
}
/**
* Owner can allow a crowdsale contract to mint new tokens.
*/
function setMintAgent(address addr, bool state) onlyOwner canMint public {
mintAgents[addr] = state;
MintingAgentChanged(addr, state);
}
function setReservedTokensList(address addr, uint inTokens, uint inPercentageUnit, uint inPercentageDecimals) private canMint onlyOwner {
assert(addr != address(0));
if (!isAddressReserved(addr)) {
reservedTokensDestinations.push(addr);
reservedTokensDestinationsLen++;
}
reservedTokensList[addr] = ReservedTokensData({
inTokens: inTokens,
inPercentageUnit: inPercentageUnit,
inPercentageDecimals: inPercentageDecimals,
isReserved: true,
isDistributed: false
});
}
}
/**
* A crowdsaled token.
*
* An ERC-20 token designed specifically for crowdsales with investor protection and further development path.
*
* - The token transfer() is disabled until the crowdsale is over
* - The token contract gives an opt-in upgrade path to a new contract
* - The same token can be part of several crowdsales through approve() mechanism
* - The token can be capped (supply set in the constructor) or uncapped (crowdsale contract can mint new tokens)
*
*/
contract CrowdsaleTokenExt is ReleasableToken, MintableTokenExt, UpgradeableToken {
/** Name and symbol were updated. */
event UpdatedTokenInformation(string newName, string newSymbol);
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
string public name;
string public symbol;
uint public decimals;
/* Minimum ammount of tokens every buyer can buy. */
uint public minCap;
/**
* Construct the token.
*
* This token must be created through a team multisig wallet, so that it is owned by that wallet.
*
* @param _name Token name
* @param _symbol Token symbol - should be all caps
* @param _initialSupply How many tokens we start with
* @param _decimals Number of decimal places
* @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends.
*/
function CrowdsaleTokenExt(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable, uint _globalMinCap)
UpgradeableToken(msg.sender) {
// Create any address, can be transferred
// to team multisig via changeOwner(),
// also remember to call setUpgradeMaster()
owner = msg.sender;
name = _name;
symbol = _symbol;
totalSupply = _initialSupply;
decimals = _decimals;
minCap = _globalMinCap;
// Create initially all balance on the team multisig
balances[owner] = totalSupply;
if(totalSupply > 0) {
Minted(owner, totalSupply);
}
// No more new supply allowed after the token creation
if(!_mintable) {
mintingFinished = true;
if(totalSupply == 0) {
throw; // Cannot create a token without supply and no minting
}
}
}
/**
* When token is released to be transferable, enforce no new tokens can be created.
*/
function releaseTokenTransfer() public onlyReleaseAgent {
mintingFinished = true;
super.releaseTokenTransfer();
}
/**
* Allow upgrade agent functionality kick in only if the crowdsale was success.
*/
function canUpgrade() public constant returns(bool) {
return released && super.canUpgrade();
}
/**
* Owner can update token information here.
*
* It is often useful to conceal the actual token association, until
* the token operations, like central issuance or reissuance have been completed.
*
* This function allows the token owner to rename the token after the operations
* have been completed and then point the audience to use the token contract.
*/
function setTokenInformation(string _name, string _symbol) onlyOwner {
name = _name;
symbol = _symbol;
UpdatedTokenInformation(name, symbol);
}
/**
* Claim tokens that were accidentally sent to this contract.
*
* @param _token The address of the token contract that you want to recover.
*/
function claimTokens(address _token) public onlyOwner {
require(_token != address(0));
ERC20 token = ERC20(_token);
uint balance = token.balanceOf(this);
token.transfer(owner, balance);
ClaimedTokens(_token, owner, balance);
}
}
/**
* The default behavior for the crowdsale end.
*
* Unlock tokens.
*/
contract ReservedTokensFinalizeAgent is FinalizeAgent {
using SafeMathLibExt for uint;
CrowdsaleTokenExt public token;
CrowdsaleExt public crowdsale;
uint public distributedReservedTokensDestinationsLen = 0;
function ReservedTokensFinalizeAgent(CrowdsaleTokenExt _token, CrowdsaleExt _crowdsale) public {
token = _token;
crowdsale = _crowdsale;
}
/** Check that we can release the token */
function isSane() public constant returns (bool) {
return (token.releaseAgent() == address(this));
}
//distributes reserved tokens. Should be called before finalization
function distributeReservedTokens(uint reservedTokensDistributionBatch) public {
assert(msg.sender == address(crowdsale));
assert(reservedTokensDistributionBatch > 0);
assert(!reservedTokensAreDistributed);
assert(distributedReservedTokensDestinationsLen < token.reservedTokensDestinationsLen());
// How many % of tokens the founders and others get
uint tokensSold = 0;
for (uint8 i = 0; i < crowdsale.joinedCrowdsalesLen(); i++) {
CrowdsaleExt tier = CrowdsaleExt(crowdsale.joinedCrowdsales(i));
tokensSold = tokensSold.plus(tier.tokensSold());
}
uint startLooping = distributedReservedTokensDestinationsLen;
uint batch = token.reservedTokensDestinationsLen().minus(distributedReservedTokensDestinationsLen);
if (batch >= reservedTokensDistributionBatch) {
batch = reservedTokensDistributionBatch;
}
uint endLooping = startLooping + batch;
// move reserved tokens
for (uint j = startLooping; j < endLooping; j++) {
address reservedAddr = token.reservedTokensDestinations(j);
if (!token.areTokensDistributedForAddress(reservedAddr)) {
uint allocatedBonusInPercentage;
uint allocatedBonusInTokens = token.getReservedTokens(reservedAddr);
uint percentsOfTokensUnit = token.getReservedPercentageUnit(reservedAddr);
uint percentsOfTokensDecimals = token.getReservedPercentageDecimals(reservedAddr);
if (percentsOfTokensUnit > 0) {
allocatedBonusInPercentage = tokensSold * percentsOfTokensUnit / 10**percentsOfTokensDecimals / 100;
token.mint(reservedAddr, allocatedBonusInPercentage);
}
if (allocatedBonusInTokens > 0) {
token.mint(reservedAddr, allocatedBonusInTokens);
}
token.finalizeReservedAddress(reservedAddr);
distributedReservedTokensDestinationsLen++;
}
}
if (distributedReservedTokensDestinationsLen == token.reservedTokensDestinationsLen()) {
reservedTokensAreDistributed = true;
}
}
/** Called once by crowdsale finalize() if the sale was success. */
function finalizeCrowdsale() public {
assert(msg.sender == address(crowdsale));
if (token.reservedTokensDestinationsLen() > 0) {
assert(reservedTokensAreDistributed);
}
token.releaseTokenTransfer();
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[],"name":"finalizeCrowdsale","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isFinalizeAgent","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isSane","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"crowdsale","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"distributedReservedTokensDestinationsLen","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"reservedTokensDistributionBatch","type":"uint256"}],"name":"distributeReservedTokens","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"reservedTokensAreDistributed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_crowdsale","type":"address"}],"payable":false,"type":"constructor"}]Contract Creation Code
60606040526000805460ff19168155600255341561001957fe5b604051604080610ced8339810160405280516020909101515b6000805461010060a860020a031916610100600160a060020a03858116919091029190911790915560018054600160a060020a0319169183169190911790555b50505b610c69806100846000396000f300606060405236156100725763ffffffff60e060020a6000350416630bf318a38114610074578063614cb9041461008657806382771c8e146100aa5780639c1e03a0146100ce578063c71a7aea146100fa578063cddaf2411461011c578063f9cb6d7a14610131578063fc0c546a14610155575bfe5b341561007c57fe5b610084610181565b005b341561008e57fe5b610096610291565b604080519115158252519081900360200190f35b34156100b257fe5b610096610297565b604080519115158252519081900360200190f35b34156100d657fe5b6100de610328565b60408051600160a060020a039092168252519081900360200190f35b341561010257fe5b61010a610337565b60408051918252519081900360200190f35b341561012457fe5b61008460043561033d565b005b341561013957fe5b610096610c20565b604080519115158252519081900360200190f35b341561015d57fe5b6100de610c29565b60408051600160a060020a039092168252519081900360200190f35b60015433600160a060020a0390811691161461019957fe5b6000600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156101f657fe5b6102c65a03f1151561020457fe5b5050506040518051905011156102225760005460ff16151561022257fe5b5b60008054604080517f5f412d4f0000000000000000000000000000000000000000000000000000000081529051610100909204600160a060020a031692635f412d4f9260048084019382900301818387803b151561027d57fe5b6102c65a03f1151561028b57fe5b5050505b565b60015b90565b6000805460408051602090810184905281517fd1f276d30000000000000000000000000000000000000000000000000000000081529151600160a060020a03308116946101009004169263d1f276d392600480830193919282900301818887803b151561030057fe5b6102c65a03f1151561030e57fe5b50505060405180519050600160a060020a03161490505b90565b600154600160a060020a031681565b60025481565b600060006000600060006000600060006000600060006000600160009054906101000a9004600160a060020a0316600160a060020a031633600160a060020a031614151561038757fe5b60008d1161039157fe5b60005460ff161561039e57fe5b600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156103f957fe5b6102c65a03f1151561040757fe5b50506040515160025410905061041957fe5b60009b5060009a505b600154604080516000602091820181905282517febdfa4550000000000000000000000000000000000000000000000000000000081529251600160a060020a039094169363ebdfa4559360048082019493918390030190829087803b151561048657fe5b6102c65a03f1151561049457fe5b5050506040518051905060ff168b60ff16101561060c57600160009054906101000a9004600160a060020a0316600160a060020a031663bede2cac8c6000604051602001526040518263ffffffff1660e060020a028152600401808260ff168152602001915050602060405180830381600087803b151561051157fe5b6102c65a03f1151561051f57fe5b5050506040518051905099508b73bbcc7dc670a46e3d0309170ac22ac42953df182f6366098d4f90918c600160a060020a031663518ab2a86000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561058e57fe5b6102c65a03f1151561059c57fe5b505050604051805190506000604051602001526040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15156105e957fe5b6102c65a03f415156105f757fe5b5050604051519c50505b6001909a0199610422565b6002549850600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561066c57fe5b6102c65a03f1151561067a57fe5b5050604080518051600254600060209384015283517ff4f3bdc100000000000000000000000000000000000000000000000000000000815260048101929092526024820152915173bbcc7dc670a46e3d0309170ac22ac42953df182f935063f4f3bdc1926044808201939291829003018186803b15156106f657fe5b6102c65a03f4151561070457fe5b5050604051519850508c8810610718578c97505b87890196508895505b86861015610b8857600060019054906101000a9004600160a060020a0316600160a060020a0316637386f0a7876000604051602001526040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b151561078c57fe5b6102c65a03f1151561079a57fe5b505060408051805160008054602093840182905284517fb4ecb847000000000000000000000000000000000000000000000000000000008152600160a060020a0380851660048301529551939b50610100909104909416945063b4ecb847936024808201949392918390030190829087803b151561081457fe5b6102c65a03f1151561082257fe5b50506040515115159050610b7c57600060019054906101000a9004600160a060020a0316600160a060020a031663612544b3866000604051602001526040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15156108a557fe5b6102c65a03f115156108b357fe5b505060408051805160008054602093840182905284517f3d0acdaa000000000000000000000000000000000000000000000000000000008152600160a060020a038c8116600483015295519399506101009091049094169450633d0acdaa936024808201949392918390030190829087803b151561092d57fe5b6102c65a03f1151561093b57fe5b505060408051805160008054602093840182905284517f45e7e140000000000000000000000000000000000000000000000000000000008152600160a060020a038c81166004830152955193985061010090910490941694506345e7e140936024808201949392918390030190829087803b15156109b557fe5b6102c65a03f115156109c357fe5b5050604051519150506000821115610a7757606481600a0a838e028115156109e757fe5b048115156109f157fe5b60008054604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a038b8116600483015295909404602485018190529051909850610100909104909316926340c10f1992604480820193929182900301818387803b1515610a6557fe5b6102c65a03f11515610a7357fe5b5050505b6000831115610afd5760008054604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a038981166004830152602482018890529151610100909304909116926340c10f199260448084019382900301818387803b1515610aeb57fe5b6102c65a03f11515610af957fe5b5050505b60008054604080517f6ffc22b8000000000000000000000000000000000000000000000000000000008152600160a060020a038981166004830152915161010090930490911692636ffc22b89260248084019382900301818387803b1515610b6157fe5b6102c65a03f11515610b6f57fe5b5050600280546001019055505b5b600190950194610721565b600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515610be357fe5b6102c65a03f11515610bf157fe5b50506040515160025414159050610c10576000805460ff191660011790555b5b50505050505050505050505050565b60005460ff1681565b6000546101009004600160a060020a0316815600a165627a7a723058208d2c08f3dad064a2a58ea957b3727a868cbd525d67a6fc06a969713377e129b9002900000000000000000000000037482af232c829fd91ad1094f600e380a2fa294a000000000000000000000000de8aaaf5e77a628a07d27d219e07b44f71a718b4
Deployed Bytecode
0x606060405236156100725763ffffffff60e060020a6000350416630bf318a38114610074578063614cb9041461008657806382771c8e146100aa5780639c1e03a0146100ce578063c71a7aea146100fa578063cddaf2411461011c578063f9cb6d7a14610131578063fc0c546a14610155575bfe5b341561007c57fe5b610084610181565b005b341561008e57fe5b610096610291565b604080519115158252519081900360200190f35b34156100b257fe5b610096610297565b604080519115158252519081900360200190f35b34156100d657fe5b6100de610328565b60408051600160a060020a039092168252519081900360200190f35b341561010257fe5b61010a610337565b60408051918252519081900360200190f35b341561012457fe5b61008460043561033d565b005b341561013957fe5b610096610c20565b604080519115158252519081900360200190f35b341561015d57fe5b6100de610c29565b60408051600160a060020a039092168252519081900360200190f35b60015433600160a060020a0390811691161461019957fe5b6000600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156101f657fe5b6102c65a03f1151561020457fe5b5050506040518051905011156102225760005460ff16151561022257fe5b5b60008054604080517f5f412d4f0000000000000000000000000000000000000000000000000000000081529051610100909204600160a060020a031692635f412d4f9260048084019382900301818387803b151561027d57fe5b6102c65a03f1151561028b57fe5b5050505b565b60015b90565b6000805460408051602090810184905281517fd1f276d30000000000000000000000000000000000000000000000000000000081529151600160a060020a03308116946101009004169263d1f276d392600480830193919282900301818887803b151561030057fe5b6102c65a03f1151561030e57fe5b50505060405180519050600160a060020a03161490505b90565b600154600160a060020a031681565b60025481565b600060006000600060006000600060006000600060006000600160009054906101000a9004600160a060020a0316600160a060020a031633600160a060020a031614151561038757fe5b60008d1161039157fe5b60005460ff161561039e57fe5b600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156103f957fe5b6102c65a03f1151561040757fe5b50506040515160025410905061041957fe5b60009b5060009a505b600154604080516000602091820181905282517febdfa4550000000000000000000000000000000000000000000000000000000081529251600160a060020a039094169363ebdfa4559360048082019493918390030190829087803b151561048657fe5b6102c65a03f1151561049457fe5b5050506040518051905060ff168b60ff16101561060c57600160009054906101000a9004600160a060020a0316600160a060020a031663bede2cac8c6000604051602001526040518263ffffffff1660e060020a028152600401808260ff168152602001915050602060405180830381600087803b151561051157fe5b6102c65a03f1151561051f57fe5b5050506040518051905099508b73bbcc7dc670a46e3d0309170ac22ac42953df182f6366098d4f90918c600160a060020a031663518ab2a86000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561058e57fe5b6102c65a03f1151561059c57fe5b505050604051805190506000604051602001526040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15156105e957fe5b6102c65a03f415156105f757fe5b5050604051519c50505b6001909a0199610422565b6002549850600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561066c57fe5b6102c65a03f1151561067a57fe5b5050604080518051600254600060209384015283517ff4f3bdc100000000000000000000000000000000000000000000000000000000815260048101929092526024820152915173bbcc7dc670a46e3d0309170ac22ac42953df182f935063f4f3bdc1926044808201939291829003018186803b15156106f657fe5b6102c65a03f4151561070457fe5b5050604051519850508c8810610718578c97505b87890196508895505b86861015610b8857600060019054906101000a9004600160a060020a0316600160a060020a0316637386f0a7876000604051602001526040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b151561078c57fe5b6102c65a03f1151561079a57fe5b505060408051805160008054602093840182905284517fb4ecb847000000000000000000000000000000000000000000000000000000008152600160a060020a0380851660048301529551939b50610100909104909416945063b4ecb847936024808201949392918390030190829087803b151561081457fe5b6102c65a03f1151561082257fe5b50506040515115159050610b7c57600060019054906101000a9004600160a060020a0316600160a060020a031663612544b3866000604051602001526040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15156108a557fe5b6102c65a03f115156108b357fe5b505060408051805160008054602093840182905284517f3d0acdaa000000000000000000000000000000000000000000000000000000008152600160a060020a038c8116600483015295519399506101009091049094169450633d0acdaa936024808201949392918390030190829087803b151561092d57fe5b6102c65a03f1151561093b57fe5b505060408051805160008054602093840182905284517f45e7e140000000000000000000000000000000000000000000000000000000008152600160a060020a038c81166004830152955193985061010090910490941694506345e7e140936024808201949392918390030190829087803b15156109b557fe5b6102c65a03f115156109c357fe5b5050604051519150506000821115610a7757606481600a0a838e028115156109e757fe5b048115156109f157fe5b60008054604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a038b8116600483015295909404602485018190529051909850610100909104909316926340c10f1992604480820193929182900301818387803b1515610a6557fe5b6102c65a03f11515610a7357fe5b5050505b6000831115610afd5760008054604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a038981166004830152602482018890529151610100909304909116926340c10f199260448084019382900301818387803b1515610aeb57fe5b6102c65a03f11515610af957fe5b5050505b60008054604080517f6ffc22b8000000000000000000000000000000000000000000000000000000008152600160a060020a038981166004830152915161010090930490911692636ffc22b89260248084019382900301818387803b1515610b6157fe5b6102c65a03f11515610b6f57fe5b5050600280546001019055505b5b600190950194610721565b600060019054906101000a9004600160a060020a0316600160a060020a031663c33105176000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515610be357fe5b6102c65a03f11515610bf157fe5b50506040515160025414159050610c10576000805460ff191660011790555b5b50505050505050505050505050565b60005460ff1681565b6000546101009004600160a060020a0316815600a165627a7a723058208d2c08f3dad064a2a58ea957b3727a868cbd525d67a6fc06a969713377e129b90029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000037482af232c829fd91ad1094f600e380a2fa294a000000000000000000000000de8aaaf5e77a628a07d27d219e07b44f71a718b4
-----Decoded View---------------
Arg [0] : _token (address): 0x37482AF232c829FD91Ad1094F600e380a2fa294a
Arg [1] : _crowdsale (address): 0xDE8aAAF5e77a628A07D27D219e07b44f71A718B4
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000037482af232c829fd91ad1094f600e380a2fa294a
Arg [1] : 000000000000000000000000de8aaaf5e77a628a07d27d219e07b44f71a718b4
Swarm Source
bzzr://8d2c08f3dad064a2a58ea957b3727a868cbd525d67a6fc06a969713377e129b9
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 32 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.