ERC-20
Overview
Max Total Supply
50,008,760.8925899 RPIL
Holders
2,939
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 8 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
RedPillToken
Compiler Version
v0.4.16+commit.d7661dd9
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-09-01 */ pragma solidity ^0.4.11; library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); 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; } function assert(bool assertion) internal { if (!assertion) { throw; } } } contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /* * Pausable * Abstract contract that allows children to implement an * emergency stop mechanism. */ contract Pausable is Ownable { bool public stopped; modifier stopInEmergency { if (stopped) { throw; } _; } modifier onlyInEmergency { if (!stopped) { throw; } _; } // called by the owner on emergency, triggers stopped state function emergencyStop() external onlyOwner { stopped = true; } // called by the owner on end of emergency, returns to normal state function release() external onlyOwner onlyInEmergency { stopped = false; } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint); function transferFrom(address from, address to, uint value); function approve(address spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /* * PullPayment * Base contract supporting async send for pull payments. * Inherit from this contract and use asyncSend instead of send. */ contract PullPayment { using SafeMath for uint; mapping(address => uint) public payments; event LogRefundETH(address to, uint value); /** * Store sent amount as credit to be pulled, called by payer **/ function asyncSend(address dest, uint amount) internal { payments[dest] = payments[dest].add(amount); } // withdraw accumulated balance, called by payee function withdrawPayments() { address payee = msg.sender; uint payment = payments[payee]; if (payment == 0) { throw; } if (this.balance < payment) { throw; } payments[payee] = 0; if (!payee.send(payment)) { throw; } LogRefundETH(payee,payment); } } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /* * Fix for the ERC20 short address attack */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size + 4) { throw; } _; } function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); } function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } function approve(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; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * Red Pill Token token contract. Implements */ contract RedPillToken is StandardToken, Ownable { string public constant name = "RedPill"; string public constant symbol = "RPIL"; uint public constant decimals = 8; // Constructor function RedPillToken() { totalSupply = 20000000000000000; balances[msg.sender] = totalSupply; // Send all tokens to owner } /** * Burn away the specified amount of Red Pill Token tokens */ function burn(uint _value) onlyOwner returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Transfer(msg.sender, 0x0, _value); return true; } } /* Crowdsale Smart Contract for the RedPillToken.org project This smart contract collects ETH, and in return emits RedPillToken tokens to the backers */ contract Crowdsale is Pausable, PullPayment { using SafeMath for uint; struct Backer { uint weiReceived; // Amount of Ether given uint coinSent; } /* * Constants */ /* Minimum number of RedPillToken to sell */ /*uint public constant MIN_CAP = 1000000000000000; // 10,000,000 RedPillTokens (10 millions)*/ uint public constant MIN_CAP = 0; // no minimum cap /* Maximum number of RedPillToken to sell */ uint public constant MAX_CAP = 10000000000000000; // 100,000,000 RedPillTokens (100 millions) /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 40 finney; //0.04 ether /* Crowdsale period */ uint private constant CROWDSALE_PERIOD = 34 days; /*uint private constant CROWDSALE_PERIOD = 1 seconds;*/ /* Number of RedPillTokens per Ether */ uint public constant COIN_PER_ETHER = 536100000000; // 5,361 RedPillTokens 1 eth=5361 RedPillTokens /* * Variables */ /* RedPillToken contract reference */ RedPillToken public coin; /* Multisig contract that will receive the Ether */ address public multisigEther; /* Number of Ether received */ uint public etherReceived; /* Number of RedPillTokens sent to Ether contributors */ uint public coinSentToEther; /* Crowdsale start time */ uint public startTime; /* Crowdsale end time */ uint public endTime; /* Is crowdsale still on going */ bool public crowdsaleClosed; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public backers; /* * Modifiers */ modifier minCapNotReached() { if ((now < endTime) || coinSentToEther >= MIN_CAP ) throw; _; } modifier respectTimeFrame() { if ((now < startTime) || (now > endTime )) throw; _; } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale(address _RedPillTokenAddress, address _to) { coin = RedPillToken(_RedPillTokenAddress); multisigEther = _to; } /* * The fallback function corresponds to a donation in ETH */ function() stopInEmergency respectTimeFrame payable { receiveETH(msg.sender); } /* * To call to start the crowdsale */ function start() onlyOwner { if (startTime != 0) throw; // Crowdsale was already started /*startTime = now ;*/ /*endTime = now + CROWDSALE_PERIOD; */ startTime = 1506484800; endTime = 1506484800 + CROWDSALE_PERIOD; } /* * Receives a donation in Ether */ function receiveETH(address beneficiary) internal { if (msg.value < MIN_INVEST_ETHER) throw; // Don't accept funding under a predefined threshold uint coinToSend = bonus(msg.value.mul(COIN_PER_ETHER).div(1 ether)); // Compute the number of RedPillToken to send if (coinToSend.add(coinSentToEther) > MAX_CAP) throw; Backer backer = backers[beneficiary]; coin.transfer(beneficiary, coinToSend); // Transfer RedPillTokens right now backer.coinSent = backer.coinSent.add(coinToSend); backer.weiReceived = backer.weiReceived.add(msg.value); // Update the total wei collected during the crowdfunding for this backer etherReceived = etherReceived.add(msg.value); // Update the total wei collected during the crowdfunding coinSentToEther = coinSentToEther.add(coinToSend); // Send events LogCoinsEmited(msg.sender ,coinToSend); LogReceivedETH(beneficiary, etherReceived); } /* *Compute the RedPillToken bonus according to the investment period */ function bonus(uint amount) internal constant returns (uint) { /*if (now < startTime.add(2 days)) return amount.add(amount.div(5)); */ // bonus 20% return amount; } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { if (now < endTime) { // Cannot finalise before CROWDSALE_PERIOD or before selling all coins if (coinSentToEther == MAX_CAP) { } else { throw; } } if (coinSentToEther < MIN_CAP && now < endTime + 15 days) throw; // If MIN_CAP is not reached donors have 15days to get refund before we can finalise if (!multisigEther.send(this.balance)) throw; // Move the remaining Ether to the multisig address uint remains = coin.balanceOf(this); if (remains > 0) { // Burn the rest of RedPillTokens if (!coin.burn(remains)) throw ; } crowdsaleClosed = true; } /* * Failsafe drain */ function drain() onlyOwner { if (!owner.send(this.balance)) throw; } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisig(address addr) onlyOwner public { if (addr == address(0)) throw; multisigEther = addr; } /** * Manually back RedPillToken owner address. */ function backRedPillTokenOwner() onlyOwner public { coin.transferOwnership(owner); } /** * Transfer remains to owner in case if impossible to do min invest */ function getRemainCoins() onlyOwner public { var remains = MAX_CAP - coinSentToEther; uint minCoinsToSell = bonus(MIN_INVEST_ETHER.mul(COIN_PER_ETHER) / (1 ether)); if(remains > minCoinsToSell) throw; Backer backer = backers[owner]; coin.transfer(owner, remains); // Transfer RedPillTokens right now backer.coinSent = backer.coinSent.add(remains); coinSentToEther = coinSentToEther.add(remains); // Send events LogCoinsEmited(this ,remains); LogReceivedETH(owner, etherReceived); } /* * When MIN_CAP is not reach: * 1) backer call the "approve" function of the RedPillToken token contract with the amount of all RedPillTokens they got in order to be refund * 2) backer call the "refund" function of the Crowdsale contract with the same amount of RedPillTokens * 3) backer call the "withdrawPayments" function of the Crowdsale contract to get a refund in ETH */ function refund(uint _value) minCapNotReached public { if (_value != backers[msg.sender].coinSent) throw; // compare value from backer balance coin.transferFrom(msg.sender, address(this), _value); // get the token back to the crowdsale contract if (!coin.burn(_value)) throw ; // token sent for refund are burnt uint ETHToSend = backers[msg.sender].weiReceived; backers[msg.sender].weiReceived=0; if (ETHToSend > 0) { asyncSend(msg.sender, ETHToSend); // pull payment to get refund in ETH } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","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":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]
Contract Creation Code
6060604052341561000f57600080fd5b5b5b60038054600160a060020a03191633600160a060020a03161790555b66470de4df8200006000818155600160a060020a0333168152600160205260409020555b5b61085f806100616000396000f300606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100bc578063095ea7b31461014757806318160ddd1461016b57806323b872dd14610190578063313ce567146101ba57806342966c68146101df57806370a08231146102095780638da5cb5b1461023a57806395d89b4114610269578063a9059cbb146102f4578063dd62ed3e14610318578063f2fde38b1461034f575b600080fd5b34156100c757600080fd5b6100cf610370565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610169600160a060020a03600435166024356103a7565b005b341561017657600080fd5b61017e610449565b60405190815260200160405180910390f35b341561019b57600080fd5b610169600160a060020a036004358116906024351660443561044f565b005b34156101c557600080fd5b61017e610572565b60405190815260200160405180910390f35b34156101ea57600080fd5b6101f5600435610577565b604051901515815260200160405180910390f35b341561021457600080fd5b61017e600160a060020a0360043516610637565b60405190815260200160405180910390f35b341561024557600080fd5b61024d610656565b604051600160a060020a03909116815260200160405180910390f35b341561027457600080fd5b6100cf610665565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102ff57600080fd5b610169600160a060020a036004351660243561069c565b005b341561032357600080fd5b61017e600160a060020a0360043581169060243516610769565b60405190815260200160405180910390f35b341561035a57600080fd5b610169600160a060020a0360043516610796565b005b60408051908101604052600781527f52656450696c6c00000000000000000000000000000000000000000000000000602082015281565b80158015906103da5750600160a060020a0333811660009081526002602090815260408083209386168352929052205415155b156103e457600080fd5b600160a060020a03338116600081815260026020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b5050565b60005481565b60006060606436101561046157600080fd5b600160a060020a0380861660009081526002602090815260408083203385168452825280832054938816835260019091529020549092506104a8908463ffffffff6107ee16565b600160a060020a0380861660009081526001602052604080822093909355908716815220546104dd908463ffffffff61080a16565b600160a060020a038616600090815260016020526040902055610506828463ffffffff61080a16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35b5b5050505050565b600881565b60035460009033600160a060020a0390811691161461059557600080fd5b600160a060020a0333166000908152600160205260409020546105be908363ffffffff61080a16565b600160a060020a033316600090815260016020526040812091909155546105eb908363ffffffff61080a16565b6000908155600160a060020a0333167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060015b5b919050565b600160a060020a0381166000908152600160205260409020545b919050565b600354600160a060020a031681565b60408051908101604052600481527f5250494c00000000000000000000000000000000000000000000000000000000602082015281565b604060443610156106ac57600080fd5b600160a060020a0333166000908152600160205260409020546106d5908363ffffffff61080a16565b600160a060020a03338116600090815260016020526040808220939093559085168152205461070a908363ffffffff6107ee16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35b5b505050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a039081169116146107b157600080fd5b600160a060020a038116156107e9576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60008282016107ff84821015610823565b8091505b5092915050565b600061081883831115610823565b508082035b92915050565b8015156107e957600080fd5b5b505600a165627a7a723058202ddb293b01c62985e47f5bede1cd7b62fe20873a953b02b3155a0b31ce93e9020029
Deployed Bytecode
0x606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100bc578063095ea7b31461014757806318160ddd1461016b57806323b872dd14610190578063313ce567146101ba57806342966c68146101df57806370a08231146102095780638da5cb5b1461023a57806395d89b4114610269578063a9059cbb146102f4578063dd62ed3e14610318578063f2fde38b1461034f575b600080fd5b34156100c757600080fd5b6100cf610370565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610169600160a060020a03600435166024356103a7565b005b341561017657600080fd5b61017e610449565b60405190815260200160405180910390f35b341561019b57600080fd5b610169600160a060020a036004358116906024351660443561044f565b005b34156101c557600080fd5b61017e610572565b60405190815260200160405180910390f35b34156101ea57600080fd5b6101f5600435610577565b604051901515815260200160405180910390f35b341561021457600080fd5b61017e600160a060020a0360043516610637565b60405190815260200160405180910390f35b341561024557600080fd5b61024d610656565b604051600160a060020a03909116815260200160405180910390f35b341561027457600080fd5b6100cf610665565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102ff57600080fd5b610169600160a060020a036004351660243561069c565b005b341561032357600080fd5b61017e600160a060020a0360043581169060243516610769565b60405190815260200160405180910390f35b341561035a57600080fd5b610169600160a060020a0360043516610796565b005b60408051908101604052600781527f52656450696c6c00000000000000000000000000000000000000000000000000602082015281565b80158015906103da5750600160a060020a0333811660009081526002602090815260408083209386168352929052205415155b156103e457600080fd5b600160a060020a03338116600081815260026020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b5050565b60005481565b60006060606436101561046157600080fd5b600160a060020a0380861660009081526002602090815260408083203385168452825280832054938816835260019091529020549092506104a8908463ffffffff6107ee16565b600160a060020a0380861660009081526001602052604080822093909355908716815220546104dd908463ffffffff61080a16565b600160a060020a038616600090815260016020526040902055610506828463ffffffff61080a16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35b5b5050505050565b600881565b60035460009033600160a060020a0390811691161461059557600080fd5b600160a060020a0333166000908152600160205260409020546105be908363ffffffff61080a16565b600160a060020a033316600090815260016020526040812091909155546105eb908363ffffffff61080a16565b6000908155600160a060020a0333167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060015b5b919050565b600160a060020a0381166000908152600160205260409020545b919050565b600354600160a060020a031681565b60408051908101604052600481527f5250494c00000000000000000000000000000000000000000000000000000000602082015281565b604060443610156106ac57600080fd5b600160a060020a0333166000908152600160205260409020546106d5908363ffffffff61080a16565b600160a060020a03338116600090815260016020526040808220939093559085168152205461070a908363ffffffff6107ee16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35b5b505050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a039081169116146107b157600080fd5b600160a060020a038116156107e9576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60008282016107ff84821015610823565b8091505b5092915050565b600061081883831115610823565b508082035b92915050565b8015156107e957600080fd5b5b505600a165627a7a723058202ddb293b01c62985e47f5bede1cd7b62fe20873a953b02b3155a0b31ce93e9020029
Swarm Source
bzzr://2ddb293b01c62985e47f5bede1cd7b62fe20873a953b02b3155a0b31ce93e902
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.