ETH Price: $3,440.36 (-1.16%)
Gas: 10 Gwei

Contract

0xc373bff29E2cAF22Af2e3Fc76Cd4322B2359A15b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Purchase Members...32318142017-02-22 19:27:092702 days ago1487791629IN
0xc373bff2...B2359A15b
0.1 ETH0.0029132420
Set Token Contra...32316082017-02-22 18:37:212702 days ago1487788641IN
0xc373bff2...B2359A15b
0 ETH0.0008801620
0x6060604032315582017-02-22 18:25:392702 days ago1487787939IN
 Create: LegendsCrowdfund
0 ETH0.0194787240

Latest 3 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
32322032017-02-22 20:57:432702 days ago1487797063
0xc373bff2...B2359A15b
2 ETH
32322032017-02-22 20:57:432702 days ago1487797063
0xc373bff2...B2359A15b
2 ETH
32318142017-02-22 19:27:092702 days ago1487791629
0xc373bff2...B2359A15b
0.1 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LegendsCrowdfund

Compiler Version
v0.4.9+commit.364da425

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2017-02-22
*/

pragma solidity ^0.4.9;

/**
 * @title ERC20
 */
contract ERC20 {
    function totalSupply() constant returns (uint256 totalSupply);
    function balanceOf(address _owner) constant returns (uint256 balance);
    function transfer(address _to, uint256 _value) returns (bool success);
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
    function approve(address _spender, uint256 _value) returns (bool success);
    function allowance(address _owner, address _spender) constant returns (uint256 remaining);
    
    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}


/**
 * @title LegendsToken
 */
contract LegendsToken is ERC20 {
    string public name = 'VIP';             //The Token's name: e.g. DigixDAO Tokens
    uint8 public decimals = 18;             // 1Token ¨= 1$ (1ETH ¨= 10$)
    string public symbol = 'VIP';           //An identifier: e.g. REP
    string public version = 'VIP_0.1';

    mapping (address => uint) ownerVIP;
    mapping (address => mapping (address => uint)) allowed;
    uint public totalVIP;
    uint public start;

    address public legendsCrowdfund;

    bool public testing;

    modifier fromCrowdfund() {
        if (msg.sender != legendsCrowdfund) {
            throw;
        }
        _;
    }

    modifier isActive() {
        if (block.timestamp < start) {
            throw;
        }
        _;
    }

    modifier isNotActive() {
        if (!testing && block.timestamp >= start) {
            throw;
        }
        _;
    }

    modifier recipientIsValid(address recipient) {
        if (recipient == 0 || recipient == address(this)) {
            throw;
        }
        _;
    }

    modifier allowanceIsZero(address spender, uint value) {
        // 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;
        }
        _;
    }

    /**
     * @dev Tokens have been added to an address by the crowdfunding contract.
     * @param recipient Address receiving the VIP.
     * @param VIP Amount of VIP added.
     */
    event TokensAdded(address indexed recipient, uint VIP);

    /**
     * @dev Constructor.
     * @param _legendsCrowdfund Address of crowdfund contract.
     * @param _preallocation Address to receive the pre-allocation.
     * @param _start Timestamp when the token becomes active.
     */
    function LegendsToken(address _legendsCrowdfund, address _preallocation, uint _start, bool _testing) {
        legendsCrowdfund = _legendsCrowdfund;
        start = _start;
        testing = _testing;
        totalVIP = ownerVIP[_preallocation] = 25000 ether;
    }

    /**
     * @dev Add to token balance on address. Must be from crowdfund.
     * @param recipient Address to add tokens to.
     * @return VIP Amount of VIP to add.
     */
    function addTokens(address recipient, uint VIP) external isNotActive fromCrowdfund {
        ownerVIP[recipient] += VIP;
        totalVIP += VIP;
        TokensAdded(recipient, VIP);
    }

    /**
     * @dev Implements ERC20 totalSupply()
     */
    function totalSupply() constant returns (uint256 totalSupply) {
        totalSupply = totalVIP;
    }

    /**
     * @dev Implements ERC20 balanceOf()
     */
    function balanceOf(address _owner) constant returns (uint256 balance) {
        balance = ownerVIP[_owner];
    }

    /**
     * @dev Implements ERC20 transfer()
     */
    function transfer(address _to, uint256 _value) isActive recipientIsValid(_to) returns (bool success) {
        if (ownerVIP[msg.sender] >= _value) {
            ownerVIP[msg.sender] -= _value;
            ownerVIP[_to] += _value;
            Transfer(msg.sender, _to, _value);
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Implements ERC20 transferFrom()
     */
    function transferFrom(address _from, address _to, uint256 _value) isActive recipientIsValid(_to) returns (bool success) {
        if (allowed[_from][msg.sender] >= _value && ownerVIP[_from] >= _value) {
            ownerVIP[_to] += _value;
            ownerVIP[_from] -= _value;
            allowed[_from][msg.sender] -= _value;
            Transfer(_from, _to, _value);
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Implements ERC20 approve()
     */
    function approve(address _spender, uint256 _value) isActive allowanceIsZero(_spender, _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    /**
     * @dev Implements ERC20 allowance()
     */
    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
        remaining = allowed[_owner][_spender];
    }

    /**
     * @dev Direct Buy
     */
    function () payable {
        LegendsCrowdfund(legendsCrowdfund).purchaseMembership.value(msg.value)(msg.sender);
    }

}



/**
 * @title LegendsCrowdfund
 */
contract LegendsCrowdfund {

    address public creator;
    address public exitAddress;

    uint public start;
    uint public limitVIP;

    LegendsToken public legendsToken;

    mapping (address => uint) public recipientETH;
    mapping (address => uint) public recipientVIP;

    uint public totalETH;
    uint public totalVIP;

    event VIPPurchase(address indexed sender, address indexed recipient, uint ETH, uint VIP);

    modifier saleActive() {
        if (address(legendsToken) == 0) {
            throw;
        }
        if (block.timestamp < start) {
            throw;
        }
        _;
    }

    modifier hasValue() {
        if (msg.value == 0) {
            throw;
        }
        _;
    }

    modifier recipientIsValid(address recipient) {
        if (recipient == 0 || recipient == address(this)) {
            throw;
        }
        _;
    }

    modifier isCreator() {
        if (msg.sender != creator) {
            throw;
        }
        _;
    }

    modifier tokenContractNotSet() {
        if (address(legendsToken) != 0) {
            throw;
        }
        _;
    }

    /**
     * @dev Constructor.
     * @param _exitAddress Address that all ETH should be forwarded to.
     * @param _start Timestamp of when the crowdsale will start.
     * @param _limitVIP Maximum amount of VIP that can be allocated in total. Denominated in wei.
     */
    function LegendsCrowdfund(address _exitAddress, uint _start, uint _limitVIP) {
        creator = msg.sender;
        exitAddress = _exitAddress;
        start = _start;
        limitVIP = _limitVIP;
    }

    /**
     * @dev Set the address of the token contract. Must be called by creator of this. Can only be set once.
     * @param _legendsToken Address of the token contract.
     */
    function setTokenContract(LegendsToken _legendsToken) external isCreator tokenContractNotSet {
        legendsToken = _legendsToken;
    }

    /**
     * @dev Forward Ether to the exit address. Store all ETH and VIP information in public state and logs.
     * @param recipient Address that tokens should be attributed to.
     */
    function purchaseMembership(address recipient) external payable saleActive hasValue recipientIsValid(recipient) {

        // Attempt to send the ETH to the exit address.
        if (!exitAddress.send(msg.value)) {
            throw;
        }

        // Update ETH amounts.
        recipientETH[recipient] += msg.value;
        totalETH += msg.value;

        // Calculate VIP amount.
        uint VIP = msg.value * 10;  // $1 / VIP based on $10 / ETH value.

        // Are we in the pre-sale?
        if (block.timestamp - start < 2 weeks) {
            VIP = (VIP * 10) / 9;   // 10% discount.
        }

        // Update VIP amounts.
        recipientVIP[recipient] += VIP;
        totalVIP += VIP;

        // Check we have not exceeded the maximum VIP.
        if (totalVIP > limitVIP) {
            throw;
        }

        // Tell the token contract about the increase.
        legendsToken.addTokens(recipient, VIP);

        // Log this purchase.
        VIPPurchase(msg.sender, recipient, msg.value, VIP);
    }

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"creator","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalETH","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalVIP","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"limitVIP","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"recipientETH","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"recipient","type":"address"}],"name":"purchaseMembership","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"exitAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_legendsToken","type":"address"}],"name":"setTokenContract","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"start","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"legendsToken","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"recipientVIP","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"_exitAddress","type":"address"},{"name":"_start","type":"uint256"},{"name":"_limitVIP","type":"uint256"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":true,"name":"recipient","type":"address"},{"indexed":false,"name":"ETH","type":"uint256"},{"indexed":false,"name":"VIP","type":"uint256"}],"name":"VIPPurchase","type":"event"}]

6060604052341561000c57fe5b60405160608061058a8339810160409081528151602083015191909201515b60008054600160a060020a03338116600160a060020a0319928316179092556001805492861692909116919091179055600282905560038190555b5050505b610511806100796000396000f300606060405236156100935763ffffffff60e060020a60003504166302d05d3f811461009557806336bdee74146100c1578063407a6727146100e3578063416ccd02146101055780634c12d8b914610127578063665c0b8e146101555780636be002291461016b578063bbcd5bbe14610197578063be9a6555146101b5578063c851b643146101d7578063cc6da37514610203575bfe5b341561009d57fe5b6100a5610231565b60408051600160a060020a039092168252519081900360200190f35b34156100c957fe5b6100d1610240565b60408051918252519081900360200190f35b34156100eb57fe5b6100d1610246565b60408051918252519081900360200190f35b341561010d57fe5b6100d161024c565b60408051918252519081900360200190f35b341561012f57fe5b6100d1600160a060020a0360043516610252565b60408051918252519081900360200190f35b610169600160a060020a0360043516610264565b005b341561017357fe5b6100a5610450565b60408051600160a060020a039092168252519081900360200190f35b341561019f57fe5b610169600160a060020a036004351661045f565b005b34156101bd57fe5b6100d16104be565b60408051918252519081900360200190f35b34156101df57fe5b6100a56104c4565b60408051600160a060020a039092168252519081900360200190f35b341561020b57fe5b6100d1600160a060020a03600435166104d3565b60408051918252519081900360200190f35b600054600160a060020a031681565b60075481565b60085481565b60035481565b60056020526000908152604090205481565b600454600090600160a060020a0316151561027e57610000565b60025442101561028d57610000565b34151561029957610000565b81600160a060020a03811615806102c1575030600160a060020a031681600160a060020a0316145b156102cb57610000565b600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015156102fe57610000565b600160a060020a03831660009081526005602052604090208054349081019091556007805482019055600254600a9091029250621275004291909103101561034b576009600a83025b0491505b600160a060020a03831660009081526006602052604090208054830190556008805483019081905560035490111561038257610000565b60048054604080517f6039fbdb000000000000000000000000000000000000000000000000000000008152600160a060020a03878116948201949094526024810186905290519290911691636039fbdb9160448082019260009290919082900301818387803b15156103f057fe5b60325a03f115156103fd57fe5b505060408051348152602081018590528151600160a060020a0380881694503316927fa8b57f15ffe511f633f9bd512e6fdb2e692b54ff870617cfcc2f63f1f1b1d326928290030190a35b5b505b5b5050565b600154600160a060020a031681565b60005433600160a060020a0390811691161461047a57610000565b600454600160a060020a03161561049057610000565b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60025481565b600454600160a060020a031681565b600660205260009081526040902054815600a165627a7a723058208505d9e58ccaeadd0054bc5714cc687d0ca8747d26b9e6730637250f8fa00e2a0029000000000000000000000000cb4baa0344065655da9e7d2dde781e5efa25995e0000000000000000000000000000000000000000000000000000000058ade5a1000000000000000000000000000000000000000000000002b5e3af16b1880000

Deployed Bytecode

0x606060405236156100935763ffffffff60e060020a60003504166302d05d3f811461009557806336bdee74146100c1578063407a6727146100e3578063416ccd02146101055780634c12d8b914610127578063665c0b8e146101555780636be002291461016b578063bbcd5bbe14610197578063be9a6555146101b5578063c851b643146101d7578063cc6da37514610203575bfe5b341561009d57fe5b6100a5610231565b60408051600160a060020a039092168252519081900360200190f35b34156100c957fe5b6100d1610240565b60408051918252519081900360200190f35b34156100eb57fe5b6100d1610246565b60408051918252519081900360200190f35b341561010d57fe5b6100d161024c565b60408051918252519081900360200190f35b341561012f57fe5b6100d1600160a060020a0360043516610252565b60408051918252519081900360200190f35b610169600160a060020a0360043516610264565b005b341561017357fe5b6100a5610450565b60408051600160a060020a039092168252519081900360200190f35b341561019f57fe5b610169600160a060020a036004351661045f565b005b34156101bd57fe5b6100d16104be565b60408051918252519081900360200190f35b34156101df57fe5b6100a56104c4565b60408051600160a060020a039092168252519081900360200190f35b341561020b57fe5b6100d1600160a060020a03600435166104d3565b60408051918252519081900360200190f35b600054600160a060020a031681565b60075481565b60085481565b60035481565b60056020526000908152604090205481565b600454600090600160a060020a0316151561027e57610000565b60025442101561028d57610000565b34151561029957610000565b81600160a060020a03811615806102c1575030600160a060020a031681600160a060020a0316145b156102cb57610000565b600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015156102fe57610000565b600160a060020a03831660009081526005602052604090208054349081019091556007805482019055600254600a9091029250621275004291909103101561034b576009600a83025b0491505b600160a060020a03831660009081526006602052604090208054830190556008805483019081905560035490111561038257610000565b60048054604080517f6039fbdb000000000000000000000000000000000000000000000000000000008152600160a060020a03878116948201949094526024810186905290519290911691636039fbdb9160448082019260009290919082900301818387803b15156103f057fe5b60325a03f115156103fd57fe5b505060408051348152602081018590528151600160a060020a0380881694503316927fa8b57f15ffe511f633f9bd512e6fdb2e692b54ff870617cfcc2f63f1f1b1d326928290030190a35b5b505b5b5050565b600154600160a060020a031681565b60005433600160a060020a0390811691161461047a57610000565b600454600160a060020a03161561049057610000565b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60025481565b600454600160a060020a031681565b600660205260009081526040902054815600a165627a7a723058208505d9e58ccaeadd0054bc5714cc687d0ca8747d26b9e6730637250f8fa00e2a0029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000cb4baa0344065655da9e7d2dde781e5efa25995e0000000000000000000000000000000000000000000000000000000058ade5a1000000000000000000000000000000000000000000000002b5e3af16b1880000

-----Decoded View---------------
Arg [0] : _exitAddress (address): 0xcb4BaA0344065655DA9E7D2ddE781E5EfA25995E
Arg [1] : _start (uint256): 1487791521
Arg [2] : _limitVIP (uint256): 50000000000000000000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000cb4baa0344065655da9e7d2dde781e5efa25995e
Arg [1] : 0000000000000000000000000000000000000000000000000000000058ade5a1
Arg [2] : 000000000000000000000000000000000000000000000002b5e3af16b1880000


Swarm Source

bzzr://8505d9e58ccaeadd0054bc5714cc687d0ca8747d26b9e6730637250f8fa00e2a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.