More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 8,855 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim All Tokens | 10541913 | 1583 days ago | IN | 0 ETH | 0.00796456 | ||||
Claim All Tokens | 6921462 | 2168 days ago | IN | 0 ETH | 0.00177382 | ||||
Claim All Tokens | 6866654 | 2177 days ago | IN | 0 ETH | 0.00177382 | ||||
Claim All Tokens | 6731777 | 2199 days ago | IN | 0 ETH | 0.00259584 | ||||
Claim Tokens | 6730819 | 2199 days ago | IN | 0 ETH | 0.00133968 | ||||
Claim All Tokens | 6719658 | 2201 days ago | IN | 0 ETH | 0.00177382 | ||||
Transfer | 6661895 | 2211 days ago | IN | 0 ETH | 0.0000648 | ||||
Claim All Tokens | 6621340 | 2217 days ago | IN | 0 ETH | 0.00043264 | ||||
Claim All Tokens | 6621272 | 2217 days ago | IN | 0 ETH | 0.00049901 | ||||
Claim All Tokens | 6579950 | 2224 days ago | IN | 0 ETH | 0.00177382 | ||||
Claim All Tokens | 6480692 | 2240 days ago | IN | 0 ETH | 0.00034611 | ||||
Claim All Tokens | 6357521 | 2261 days ago | IN | 0 ETH | 0.00177382 | ||||
Claim All Tokens | 6187933 | 2289 days ago | IN | 0 ETH | 0.0009518 | ||||
Finalize Refunds | 6178930 | 2290 days ago | IN | 0 ETH | 0.00004586 | ||||
Finalize Refunds | 6178928 | 2290 days ago | IN | 0 ETH | 0.00005211 | ||||
Claim All Tokens | 6171649 | 2292 days ago | IN | 0 ETH | 0.00004596 | ||||
Claim All Tokens | 6167134 | 2292 days ago | IN | 0 ETH | 0.00209202 | ||||
Claim All Tokens | 6093121 | 2305 days ago | IN | 0 ETH | 0.0002298 | ||||
Claim All Tokens | 6093067 | 2305 days ago | IN | 0 ETH | 0.00051025 | ||||
Claim All Tokens | 6085314 | 2306 days ago | IN | 0 ETH | 0.002041 | ||||
Claim All Tokens | 6080542 | 2307 days ago | IN | 0 ETH | 0.00107152 | ||||
Claim All Tokens | 6070536 | 2309 days ago | IN | 0 ETH | 0.0030615 | ||||
Claim All Tokens | 6062588 | 2310 days ago | IN | 0 ETH | 0.00209202 | ||||
Transfer | 6028687 | 2316 days ago | IN | 0 ETH | 0.0000864 | ||||
Claim All Tokens | 6021323 | 2317 days ago | IN | 0 ETH | 0.00022 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
6178928 | 2290 days ago | 460.25568756 ETH | ||||
6167134 | 2292 days ago | 0.99 ETH | ||||
6093067 | 2305 days ago | 0.57593588 ETH | ||||
6085314 | 2306 days ago | 1 ETH | ||||
6080542 | 2307 days ago | 0.4 ETH | ||||
6070536 | 2309 days ago | 77 ETH | ||||
6062588 | 2310 days ago | 0.10030881 ETH | ||||
6000738 | 2321 days ago | 2 ETH | ||||
5980092 | 2324 days ago | 0.2 ETH | ||||
5976298 | 2325 days ago | 0.99988999 ETH | ||||
5976289 | 2325 days ago | 0.00011 ETH | ||||
5952706 | 2329 days ago | 0.99999999 ETH | ||||
5928907 | 2333 days ago | 64.5 ETH | ||||
5920023 | 2334 days ago | 0.5 ETH | ||||
5915906 | 2335 days ago | 0.26 ETH | ||||
5903250 | 2337 days ago | 0.98761915 ETH | ||||
5899933 | 2338 days ago | 40 ETH | ||||
5899322 | 2338 days ago | 0.55 ETH | ||||
5895887 | 2338 days ago | 0.41777892 ETH | ||||
5887814 | 2340 days ago | 10 ETH | ||||
5883549 | 2341 days ago | 0.217 ETH | ||||
5877939 | 2341 days ago | 0.1 ETH | ||||
5876941 | 2342 days ago | 0.2 ETH | ||||
5873719 | 2342 days ago | 0.13032879 ETH | ||||
5872699 | 2342 days ago | 0.55 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x98cBBe0e...0780eD7e9 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
VITTokenSale
Compiler Version
v0.4.18+commit.9cf6e910
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-02-18 */ pragma solidity 0.4.18; /** * @title Math * @dev Assorted math operations */ library Math { function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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() public { 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) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Contracts that should be able to recover tokens * @author SylTi * @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner. * This will prevent any accidental loss of tokens. */ contract CanReclaimToken is Ownable { using SafeERC20 for ERC20Basic; /** * @dev Reclaim all ERC20Basic compatible tokens * @param token ERC20Basic The address of the token contract */ function reclaimToken(ERC20Basic token) external onlyOwner { uint256 balance = token.balanceOf(this); token.safeTransfer(owner, balance); } } /** * @title Claimable * @dev Extension for the Ownable contract, where the ownership needs to be claimed. * This allows the new owner to accept the transfer. */ contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { pendingOwner = newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } /** * @title Contracts that should not own Contracts * @author Remco Bloemen <remco@2π.com> * @dev Should contracts (anything Ownable) end up being owned by this contract, it allows the owner * of this contract to reclaim ownership of the contracts. */ contract HasNoContracts is Ownable { /** * @dev Reclaim ownership of Ownable contracts * @param contractAddr The address of the Ownable to be reclaimed. */ function reclaimContract(address contractAddr) external onlyOwner { Ownable contractInst = Ownable(contractAddr); contractInst.transferOwnership(owner); } } /** * @title Contracts that should not own Tokens * @author Remco Bloemen <remco@2π.com> * @dev This blocks incoming ERC23 tokens to prevent accidental loss of tokens. * Should tokens (any ERC20Basic compatible) end up in the contract, it allows the * owner to reclaim the tokens. */ contract HasNoTokens is CanReclaimToken { /** * @dev Reject all ERC23 compatible tokens * @param from_ address The address that is transferring the tokens * @param value_ uint256 the amount of the specified token * @param data_ Bytes The data passed from the caller. */ function tokenFallback(address from_, uint256 value_, bytes data_) external { from_; value_; data_; revert(); } } /** * @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 view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view 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); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } contract VITToken is Claimable, HasNoTokens, MintableToken { // solhint-disable const-name-snakecase string public constant name = "Vice"; string public constant symbol = "VIT"; uint8 public constant decimals = 18; // solhint-enable const-name-snakecase modifier cannotMint() { require(mintingFinished); _; } function VITToken() public { } /// @dev Same ERC20 behavior, but reverts if still minting. /// @param _to address The address to transfer to. /// @param _value uint256 The amount to be transferred. function transfer(address _to, uint256 _value) public cannotMint returns (bool) { return super.transfer(_to, _value); } /// @dev Same ERC20 behavior, but reverts if still minting. /// @param _from address The address which you want to send tokens from. /// @param _to address The address which you want to transfer to. /// @param _value uint256 the amount of tokens to be transferred. function transferFrom(address _from, address _to, uint256 _value) public cannotMint returns (bool) { return super.transferFrom(_from, _to, _value); } } /// @title VITToken sale contract. contract VITTokenSale is Claimable { using Math for uint256; using SafeMath for uint256; // VIT token contract. VITToken public vitToken; // Received funds are forwarded to this address. address public fundingRecipient; // VIT token unit. uint256 public constant TOKEN_UNIT = 10 ** 18; // Maximum tokens offered in the sale: 2B. uint256 public constant MAX_TOKENS_SOLD = 2 * 10 ** 9 * TOKEN_UNIT; // VIT to 1 wei ratio. uint256 public vitPerWei; // Sale start and end timestamps. uint256 public constant RESTRICTED_PERIOD_DURATION = 1 days; uint256 public startTime; uint256 public endTime; // Refund data and state. uint256 public refundEndTime; mapping (address => uint256) public refundableEther; mapping (address => uint256) public claimableTokens; uint256 public totalClaimableTokens = 0; bool public finalizedRefund = false; // Amount of tokens sold until now in the sale. uint256 public tokensSold = 0; // Accumulated amount each participant has contributed so far. mapping (address => uint256) public participationHistory; // Maximum amount that each participant is allowed to contribute (in WEI), during the restricted period. mapping (address => uint256) public participationCaps; // Initial allocations. address[20] public strategicPartnersPools; uint256 public constant STRATEGIC_PARTNERS_POOL_ALLOCATION = 100 * 10 ** 6 * TOKEN_UNIT; // 100M event TokensIssued(address indexed to, uint256 tokens); event EtherRefunded(address indexed from, uint256 weiAmount); event TokensClaimed(address indexed from, uint256 tokens); event Finalized(); event FinalizedRefunds(); /// @dev Reverts if called when not during sale. modifier onlyDuringSale() { require(!saleEnded() && now >= startTime); _; } /// @dev Reverts if called before the sale ends. modifier onlyAfterSale() { require(saleEnded()); _; } /// @dev Reverts if called not doing the refund period. modifier onlyDuringRefund() { require(saleDuringRefundPeriod()); _; } modifier onlyAfterRefund() { require(saleAfterRefundPeriod()); _; } /// @dev Constructor that initializes the sale conditions. /// @param _fundingRecipient address The address of the funding recipient. /// @param _startTime uint256 The start time of the token sale. /// @param _endTime uint256 The end time of the token sale. /// @param _refundEndTime uint256 The end time of the refunding period. /// @param _vitPerWei uint256 The exchange rate of VIT for one ETH. /// @param _strategicPartnersPools address[20] The addresses of the 20 strategic partners pools. function VITTokenSale(address _fundingRecipient, uint256 _startTime, uint256 _endTime, uint256 _refundEndTime, uint256 _vitPerWei, address[20] _strategicPartnersPools) public { require(_fundingRecipient != address(0)); require(_startTime > now && _startTime < _endTime && _endTime < _refundEndTime); require(_startTime.add(RESTRICTED_PERIOD_DURATION) < _endTime); require(_vitPerWei > 0); for (uint i = 0; i < _strategicPartnersPools.length; ++i) { require(_strategicPartnersPools[i] != address(0)); } fundingRecipient = _fundingRecipient; startTime = _startTime; endTime = _endTime; refundEndTime = _refundEndTime; vitPerWei = _vitPerWei; strategicPartnersPools = _strategicPartnersPools; // Deploy new VITToken contract. vitToken = new VITToken(); // Grant initial token allocations. grantInitialAllocations(); } /// @dev Fallback function that will delegate the request to create(). function () external payable onlyDuringSale { address recipient = msg.sender; uint256 cappedWeiReceived = msg.value; uint256 weiAlreadyParticipated = participationHistory[recipient]; // If we're during the restricted period, then only the white-listed participants are allowed to participate, if (saleDuringRestrictedPeriod()) { uint256 participationCap = participationCaps[recipient]; cappedWeiReceived = Math.min256(cappedWeiReceived, participationCap.sub(weiAlreadyParticipated)); } require(cappedWeiReceived > 0); // Calculate how much tokens can be sold to this participant. uint256 tokensLeftInSale = MAX_TOKENS_SOLD.sub(tokensSold); uint256 weiLeftInSale = tokensLeftInSale.div(vitPerWei); uint256 weiToParticipate = Math.min256(cappedWeiReceived, weiLeftInSale); participationHistory[recipient] = weiAlreadyParticipated.add(weiToParticipate); // Issue tokens and transfer to recipient. uint256 tokensToIssue = weiToParticipate.mul(vitPerWei); if (tokensLeftInSale.sub(tokensToIssue) < vitPerWei) { // If purchase would cause less than vitPerWei tokens left then nobody could ever buy them, so we'll gift // them to the last buyer. tokensToIssue = tokensLeftInSale; } // Record the both the participate ETH and tokens for future refunds. refundableEther[recipient] = refundableEther[recipient].add(weiToParticipate); claimableTokens[recipient] = claimableTokens[recipient].add(tokensToIssue); // Update token counters. totalClaimableTokens = totalClaimableTokens.add(tokensToIssue); tokensSold = tokensSold.add(tokensToIssue); // Issue the tokens to the token sale smart contract itself, which will hold them for future refunds. issueTokens(address(this), tokensToIssue); // Partial refund if full participation not possible, e.g. due to cap being reached. uint256 refund = msg.value.sub(weiToParticipate); if (refund > 0) { msg.sender.transfer(refund); } } /// @dev Set restricted period participation caps for a list of addresses. /// @param _participants address[] The list of participant addresses. /// @param _cap uint256 The cap amount (in ETH). function setRestrictedParticipationCap(address[] _participants, uint256 _cap) external onlyOwner { for (uint i = 0; i < _participants.length; ++i) { participationCaps[_participants[i]] = _cap; } } /// @dev Finalizes the token sale event, by stopping token minting. function finalize() external onlyAfterSale { // Issue any unsold tokens back to the company. if (tokensSold < MAX_TOKENS_SOLD) { issueTokens(fundingRecipient, MAX_TOKENS_SOLD.sub(tokensSold)); } // Finish minting. Please note, that if minting was already finished - this call will revert(). vitToken.finishMinting(); Finalized(); } function finalizeRefunds() external onlyAfterRefund { require(!finalizedRefund); finalizedRefund = true; // Transfer all the Ether to the beneficiary of the funding. fundingRecipient.transfer(this.balance); FinalizedRefunds(); } /// @dev Reclaim all ERC20 compatible tokens, but not more than the VIT tokens which were reserved for refunds. /// @param token ERC20Basic The address of the token contract. function reclaimToken(ERC20Basic token) external onlyOwner { uint256 balance = token.balanceOf(this); if (token == vitToken) { balance = balance.sub(totalClaimableTokens); } assert(token.transfer(owner, balance)); } /// @dev Allows participants to claim their tokens, which also transfers the Ether to the funding recipient. /// @param _tokensToClaim uint256 The amount of tokens to claim. function claimTokens(uint256 _tokensToClaim) public onlyAfterSale { require(_tokensToClaim != 0); address participant = msg.sender; require(claimableTokens[participant] > 0); uint256 claimableTokensAmount = claimableTokens[participant]; require(_tokensToClaim <= claimableTokensAmount); uint256 refundableEtherAmount = refundableEther[participant]; uint256 etherToClaim = _tokensToClaim.mul(refundableEtherAmount).div(claimableTokensAmount); assert(etherToClaim > 0); refundableEther[participant] = refundableEtherAmount.sub(etherToClaim); claimableTokens[participant] = claimableTokensAmount.sub(_tokensToClaim); totalClaimableTokens = totalClaimableTokens.sub(_tokensToClaim); // Transfer the tokens from the token sale smart contract to the participant. assert(vitToken.transfer(participant, _tokensToClaim)); // Transfer the Ether to the beneficiary of the funding (as long as the refund hasn't finalized yet). if (!finalizedRefund) { fundingRecipient.transfer(etherToClaim); } TokensClaimed(participant, _tokensToClaim); } /// @dev Allows participants to claim all their tokens. function claimAllTokens() public onlyAfterSale { uint256 claimableTokensAmount = claimableTokens[msg.sender]; claimTokens(claimableTokensAmount); } /// @dev Allows participants to claim refund for their purchased tokens. /// @param _etherToClaim uint256 The amount of Ether to claim. function refundEther(uint256 _etherToClaim) public onlyDuringRefund { require(_etherToClaim != 0); address participant = msg.sender; uint256 refundableEtherAmount = refundableEther[participant]; require(_etherToClaim <= refundableEtherAmount); uint256 claimableTokensAmount = claimableTokens[participant]; uint256 tokensToClaim = _etherToClaim.mul(claimableTokensAmount).div(refundableEtherAmount); assert(tokensToClaim > 0); refundableEther[participant] = refundableEtherAmount.sub(_etherToClaim); claimableTokens[participant] = claimableTokensAmount.sub(tokensToClaim); totalClaimableTokens = totalClaimableTokens.sub(tokensToClaim); // Transfer the tokens to the beneficiary of the funding. assert(vitToken.transfer(fundingRecipient, tokensToClaim)); // Transfer the Ether to the participant. participant.transfer(_etherToClaim); EtherRefunded(participant, _etherToClaim); } /// @dev Allows participants to claim refund for all their purchased tokens. function refundAllEther() public onlyDuringRefund { uint256 refundableEtherAmount = refundableEther[msg.sender]; refundEther(refundableEtherAmount); } /// @dev Initialize token grants. function grantInitialAllocations() private onlyOwner { for (uint i = 0; i < strategicPartnersPools.length; ++i) { issueTokens(strategicPartnersPools[i], STRATEGIC_PARTNERS_POOL_ALLOCATION); } } /// @dev Issues tokens for the recipient. /// @param _recipient address The address of the recipient. /// @param _tokens uint256 The amount of tokens to issue. function issueTokens(address _recipient, uint256 _tokens) private { // Request VIT token contract to mint the requested tokens for the buyer. assert(vitToken.mint(_recipient, _tokens)); TokensIssued(_recipient, _tokens); } /// @dev Returns whether the sale has ended. /// @return bool Whether the sale has ended or not. function saleEnded() private view returns (bool) { return tokensSold >= MAX_TOKENS_SOLD || now >= endTime; } /// @dev Returns whether the sale is during its restricted period, where only white-listed participants are allowed /// to participate. /// @return bool Whether the sale is during its restricted period, where only white-listed participants are allowed /// to participate. function saleDuringRestrictedPeriod() private view returns (bool) { return now <= startTime.add(RESTRICTED_PERIOD_DURATION); } /// @dev Returns whether the sale is during its refund period. /// @return bool whether the sale is during its refund period. function saleDuringRefundPeriod() private view returns (bool) { return saleEnded() && now <= refundEndTime; } /// @dev Returns whether the sale is during its refund period. /// @return bool whether the sale is during its refund period. function saleAfterRefundPeriod() private view returns (bool) { return saleEnded() && now > refundEndTime; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"vitToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"refundableEther","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_TOKENS_SOLD","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"}],"name":"reclaimToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"fundingRecipient","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"claimAllTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalClaimableTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"strategicPartnersPools","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"endTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokensToClaim","type":"uint256"}],"name":"claimTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"participationHistory","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"finalize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"claimOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tokensSold","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"refundEndTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"STRATEGIC_PARTNERS_POOL_ALLOCATION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"participationCaps","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"startTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"RESTRICTED_PERIOD_DURATION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"claimableTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vitPerWei","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"finalizeRefunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_UNIT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"refundAllEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"finalizedRefund","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_participants","type":"address[]"},{"name":"_cap","type":"uint256"}],"name":"setRestrictedParticipationCap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pendingOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_etherToClaim","type":"uint256"}],"name":"refundEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_fundingRecipient","type":"address"},{"name":"_startTime","type":"uint256"},{"name":"_endTime","type":"uint256"},{"name":"_refundEndTime","type":"uint256"},{"name":"_vitPerWei","type":"uint256"},{"name":"_strategicPartnersPools","type":"address[20]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"tokens","type":"uint256"}],"name":"TokensIssued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"weiAmount","type":"uint256"}],"name":"EtherRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"tokens","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[],"name":"Finalized","type":"event"},{"anonymous":false,"inputs":[],"name":"FinalizedRefunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Deployed Bytecode
0x6060604052600436106101665763ffffffff60e060020a60003504166303cf678b81146103af57806315fee176146103de57806317f5de951461040f57806317ffc320146104225780631bb534ba146104435780631e4bd42c14610456578063205140c714610469578063309420b21461047c5780633197cbb61461049257806346e04a2f146104a557806349432923146104bb5780634bb278f3146104da5780634e71e0c8146104ed578063518ab2a81461050057806373fddd161461051357806375fd776a1461052657806376e532211461053957806378e979251461055857806380cdc9c91461056b57806384d242261461057e5780638da5cb5b1461059d57806399f49f0d146105b0578063a26329f0146105c3578063a5c9cd82146105d6578063af8c1946146105e9578063c2e5d950146105fc578063e0cfde2214610623578063e30c397814610645578063f2fde38b14610658578063fd53520314610677575b600080600080600080600080600061017c61068d565b15801561018b57506005544210155b151561019657600080fd5b33600160a060020a0381166000908152600d602052604090205490995034985096506101c06106b5565b156101fc57600160a060020a0389166000908152600e602052604090205495506101f9886101f4888a63ffffffff6106d616565b6106e8565b97505b6000881161020957600080fd5b600c54610229906b06765c793fa10079d00000009063ffffffff6106d616565b94506102406004548661070090919063ffffffff16565b935061024c88856106e8565b925061025e878463ffffffff61071c16565b600160a060020a038a166000908152600d602052604090205560045461028b90849063ffffffff61072b16565b6004549092506102a1868463ffffffff6106d616565b10156102ab578491505b600160a060020a0389166000908152600860205260409020546102d4908463ffffffff61071c16565b600160a060020a038a16600090815260086020908152604080832093909355600990522054610309908363ffffffff61071c16565b600160a060020a038a16600090815260096020526040902055600a54610335908363ffffffff61071c16565b600a55600c5461034b908363ffffffff61071c16565b600c556103583083610756565b610368348463ffffffff6106d616565b905060008111156103a457600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156103a457600080fd5b505050505050505050005b34156103ba57600080fd5b6103c2610819565b604051600160a060020a03909116815260200160405180910390f35b34156103e957600080fd5b6103fd600160a060020a0360043516610828565b60405190815260200160405180910390f35b341561041a57600080fd5b6103fd61083a565b341561042d57600080fd5b610441600160a060020a036004351661084a565b005b341561044e57600080fd5b6103c2610995565b341561046157600080fd5b6104416109a4565b341561047457600080fd5b6103fd6109df565b341561048757600080fd5b6103c26004356109e5565b341561049d57600080fd5b6103fd610a02565b34156104b057600080fd5b610441600435610a08565b34156104c657600080fd5b6103fd600160a060020a0360043516610c31565b34156104e557600080fd5b610441610c43565b34156104f857600080fd5b610441610d35565b341561050b57600080fd5b6103fd610dc3565b341561051e57600080fd5b6103fd610dc9565b341561053157600080fd5b6103fd610dcf565b341561054457600080fd5b6103fd600160a060020a0360043516610dde565b341561056357600080fd5b6103fd610df0565b341561057657600080fd5b6103fd610df6565b341561058957600080fd5b6103fd600160a060020a0360043516610dfd565b34156105a857600080fd5b6103c2610e0f565b34156105bb57600080fd5b6103fd610e1e565b34156105ce57600080fd5b610441610e24565b34156105e157600080fd5b6103fd610ebb565b34156105f457600080fd5b610441610ec7565b341561060757600080fd5b61060f610eff565b604051901515815260200160405180910390f35b341561062e57600080fd5b610441602460048035828101929101359035610f08565b341561065057600080fd5b6103c2610f72565b341561066357600080fd5b610441600160a060020a0360043516610f81565b341561068257600080fd5b610441600435610fcb565b6000670de0b6b3a7640000637735940002600c541015806106b057506006544210155b905090565b6005546000906106ce906201518063ffffffff61071c16565b421115905090565b6000828211156106e257fe5b50900390565b60008183106106f757816106f9565b825b9392505050565b600080828481151561070e57fe5b0490508091505b5092915050565b6000828201838110156106f957fe5b60008083151561073e5760009150610715565b5082820282848281151561074e57fe5b04146106f957fe5b600254600160a060020a03166340c10f19838360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156107b557600080fd5b6102c65a03f115156107c657600080fd5b5050506040518051905015156107d857fe5b81600160a060020a03167f21d739f160a7464fddaac4a1d1517d84e76b75618a053943b345c408c4160fe08260405190815260200160405180910390a25050565b600254600160a060020a031681565b60086020526000908152604090205481565b6b06765c793fa10079d000000081565b6000805433600160a060020a0390811691161461086657600080fd5b81600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156108bd57600080fd5b6102c65a03f115156108ce57600080fd5b5050506040518051600254909250600160a060020a0384811691161415905061090857600a5461090590829063ffffffff6106d616565b90505b60008054600160a060020a038085169263a9059cbb929091169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561096e57600080fd5b6102c65a03f1151561097f57600080fd5b50505060405180519050151561099157fe5b5050565b600354600160a060020a031681565b60006109ae61068d565b15156109b957600080fd5b50600160a060020a0333166000908152600960205260409020546109dc81610a08565b50565b600a5481565b600f81601481106109f257fe5b0154600160a060020a0316905081565b60065481565b600080600080610a1661068d565b1515610a2157600080fd5b841515610a2d57600080fd5b33600160a060020a0381166000908152600960205260408120549195509011610a5557600080fd5b600160a060020a038416600090815260096020526040902054925082851115610a7d57600080fd5b600160a060020a0384166000908152600860205260409020549150610ab883610aac878563ffffffff61072b16565b9063ffffffff61070016565b905060008111610ac457fe5b610ad4828263ffffffff6106d616565b600160a060020a038516600090815260086020526040902055610afd838663ffffffff6106d616565b600160a060020a038516600090815260096020526040902055600a54610b29908663ffffffff6106d616565b600a55600254600160a060020a031663a9059cbb858760006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b8b57600080fd5b6102c65a03f11515610b9c57600080fd5b505050604051805190501515610bae57fe5b600b5460ff161515610bed57600354600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610bed57600080fd5b83600160a060020a03167f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e4308660405190815260200160405180910390a25050505050565b600d6020526000908152604090205481565b610c4b61068d565b1515610c5657600080fd5b600c546b06765c793fa10079d0000000901015610ca357600354600c54610ca391600160a060020a031690610c9e906b06765c793fa10079d00000009063ffffffff6106d616565b610756565b600254600160a060020a0316637d64bcb46000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ceb57600080fd5b6102c65a03f11515610cfc57600080fd5b50505060405180519050507f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a1565b60015433600160a060020a03908116911614610d5057600080fd5b600154600054600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600c5481565b60075481565b6a52b7d2dcc80cd2e400000081565b600e6020526000908152604090205481565b60055481565b6201518081565b60096020526000908152604090205481565b600054600160a060020a031681565b60045481565b610e2c6111bd565b1515610e3757600080fd5b600b5460ff1615610e4757600080fd5b600b805460ff19166001179055600354600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610e8d57600080fd5b7fbb1fbac92d7acf22bb7354f794c7f6e7f28dcbc42a720bf7a0f5b4f58fd1d14060405160405180910390a1565b670de0b6b3a764000081565b6000610ed16111d7565b1515610edc57600080fd5b50600160a060020a0333166000908152600860205260409020546109dc81610fcb565b600b5460ff1681565b6000805433600160a060020a03908116911614610f2457600080fd5b5060005b82811015610f6c5781600e6000868685818110610f4157fe5b60209081029290920135600160a060020a031683525081019190915260400160002055600101610f28565b50505050565b600154600160a060020a031681565b60005433600160a060020a03908116911614610f9c57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080600080610fd96111d7565b1515610fe457600080fd5b841515610ff057600080fd5b33600160a060020a03811660009081526008602052604090205490945092508285111561101c57600080fd5b600160a060020a038416600090815260096020526040902054915061104b83610aac878563ffffffff61072b16565b90506000811161105757fe5b611067838663ffffffff6106d616565b600160a060020a038516600090815260086020526040902055611090828263ffffffff6106d616565b600160a060020a038516600090815260096020526040902055600a546110bc908263ffffffff6106d616565b600a55600254600354600160a060020a039182169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561112557600080fd5b6102c65a03f1151561113657600080fd5b50505060405180519050151561114857fe5b600160a060020a03841685156108fc0286604051600060405180830381858888f19350505050151561117957600080fd5b83600160a060020a03167fe0cada2e40ecdab81ff95d6947b1cd2f7ef9d1cb94b6a3cf2480757e3f049aac8660405190815260200160405180910390a25050505050565b60006111c761068d565b80156106b0575050600754421190565b60006111e161068d565b80156106b057505060075442111590565b6000805433600160a060020a0390811691161461120e57600080fd5b5060005b60148110156109dc57611247600f826014811061122b57fe5b0154600160a060020a03166a52b7d2dcc80cd2e4000000610756565b6001016112125600a165627a7a72305820df7658ebd55f5cbc4b2dcbd6a43e89dd78c4c27b3f5dc68b065b1d2186eb999c0029
Swarm Source
bzzr://3fb31a45d5aca375ad8734a96460c2b95dfe55e1c7e140cc01b8bd1b7da6d7ba
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.000526 | 300 | $0.1576 |
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.