Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x069ff078...Ae5C6186D The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ERC20Token
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-05-06 */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ 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; } /** * @dev Integer division of two numbers, truncating the quotient. */ 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; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ 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. */ constructor() 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 { emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract BasicERC20 { /* Public variables of the token */ string public standard = 'ERC20'; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; bool public isTokenTransferable = true; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); /* Send coins */ function transfer(address _to, uint256 _value) public { assert(isTokenTransferable); assert(balanceOf[msg.sender] >= _value); // Check if the sender has enough if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows balanceOf[msg.sender] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient emit Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place } /* Allow another contract to spend some tokens in your behalf */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /* A contract attempts to get the coins */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { assert(isTokenTransferable || _from == address(0x0)); // allow to transfer for crowdsale if (balanceOf[_from] < _value) throw; // Check if the sender has enough if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows if (_value > allowance[_from][msg.sender]) throw; // Check allowance balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient allowance[_from][msg.sender] -= _value; emit Transfer(_from, _to, _value); return true; } } contract BasicCrowdsale is Ownable { using SafeMath for uint256; BasicERC20 token; address public ownerWallet; uint256 public startTime; uint256 public endTime; uint256 public totalEtherRaised = 0; uint256 public minDepositAmount; uint256 public maxDepositAmount; uint256 public softCapEther; uint256 public hardCapEther; mapping(address => uint256) private deposits; constructor () public { } function () external payable { buy(msg.sender); } function getSettings () view public returns(uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _totalEtherRaised, uint256 _minDepositAmount, uint256 _maxDepositAmount, uint256 _tokensLeft ) { _startTime = startTime; _endTime = endTime; _rate = getRate(); _totalEtherRaised = totalEtherRaised; _minDepositAmount = minDepositAmount; _maxDepositAmount = maxDepositAmount; _tokensLeft = tokensLeft(); } function tokensLeft() view public returns (uint256) { return token.balanceOf(address(0x0)); } function changeMinDepositAmount (uint256 _minDepositAmount) onlyOwner public { minDepositAmount = _minDepositAmount; } function changeMaxDepositAmount (uint256 _maxDepositAmount) onlyOwner public { maxDepositAmount = _maxDepositAmount; } function getRate() view public returns (uint256) { assert(false); } function getTokenAmount(uint256 weiAmount) public view returns(uint256) { return weiAmount.mul(getRate()); } function checkCorrectPurchase() view internal { require(startTime < now && now < endTime); require(msg.value >= minDepositAmount); require(msg.value < maxDepositAmount); require(totalEtherRaised + msg.value < hardCapEther); } function isCrowdsaleFinished() view public returns(bool) { return totalEtherRaised >= hardCapEther || now > endTime; } function buy(address userAddress) public payable { require(userAddress != address(0)); checkCorrectPurchase(); // calculate token amount to be created uint256 tokens = getTokenAmount(msg.value); // update state totalEtherRaised = totalEtherRaised.add(msg.value); token.transferFrom(address(0x0), userAddress, tokens); if (totalEtherRaised >= softCapEther) { ownerWallet.transfer(this.balance); } else { deposits[userAddress] = deposits[userAddress].add(msg.value); } } function getRefundAmount(address userAddress) view public returns (uint256) { if (totalEtherRaised >= softCapEther) return 0; return deposits[userAddress]; } function refund(address userAddress) public { assert(totalEtherRaised < softCapEther && now > endTime); uint256 amount = deposits[userAddress]; deposits[userAddress] = 0; userAddress.transfer(amount); } } contract CrowdsaleCompatible is BasicERC20, Ownable { BasicCrowdsale public crowdsale = BasicCrowdsale(0x0); // anyone can unfreeze tokens when crowdsale is finished function unfreezeTokens() public { assert(now > crowdsale.endTime()); isTokenTransferable = true; } // change owner to 0x0 to lock this function function initializeCrowdsale(address crowdsaleContractAddress, uint256 tokensAmount) onlyOwner public { transfer((address)(0x0), tokensAmount); allowance[(address)(0x0)][crowdsaleContractAddress] = tokensAmount; crowdsale = BasicCrowdsale(crowdsaleContractAddress); isTokenTransferable = false; transferOwnership(0x0); // remove an owner } } contract EditableToken is BasicERC20, Ownable { using SafeMath for uint256; // change owner to 0x0 to lock this function function editTokenProperties(string _name, string _symbol, int256 extraSupplay) onlyOwner public { name = _name; symbol = _symbol; if (extraSupplay > 0) { balanceOf[owner] = balanceOf[owner].add(uint256(extraSupplay)); totalSupply = totalSupply.add(uint256(extraSupplay)); emit Transfer(address(0x0), owner, uint256(extraSupplay)); } else if (extraSupplay < 0) { balanceOf[owner] = balanceOf[owner].sub(uint256(extraSupplay * -1)); totalSupply = totalSupply.sub(uint256(extraSupplay * -1)); emit Transfer(owner, address(0x0), uint256(extraSupplay * -1)); } } } contract ThirdPartyTransferableToken is BasicERC20{ using SafeMath for uint256; struct confidenceInfo { uint256 nonce; mapping (uint256 => bool) operation; } mapping (address => confidenceInfo) _confidence_transfers; function nonceOf(address src) view public returns (uint256) { return _confidence_transfers[src].nonce; } function transferByThirdParty(uint256 nonce, address where, uint256 amount, uint8 v, bytes32 r, bytes32 s) public returns (bool){ assert(where != address(this)); assert(where != address(0x0)); bytes32 hash = sha256(this, nonce, where, amount); address src = ecrecover(keccak256("\x19Ethereum Signed Message:\n32", hash),v,r,s); assert(balanceOf[src] >= amount); assert(nonce == _confidence_transfers[src].nonce+1); assert(_confidence_transfers[src].operation[uint256(hash)]==false); balanceOf[src] = balanceOf[src].sub(amount); balanceOf[where] = balanceOf[where].add(amount); _confidence_transfers[src].nonce += 1; _confidence_transfers[src].operation[uint256(hash)] = true; emit Transfer(src, where, amount); return true; } } contract ERC20Token is CrowdsaleCompatible, EditableToken, ThirdPartyTransferableToken { using SafeMath for uint256; /* Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { balanceOf[0x335FcD9F562590EB4710916D93066df704162250] = uint256(21000000) * 10**18; emit Transfer(address(0x0), 0x335FcD9F562590EB4710916D93066df704162250, balanceOf[0x335FcD9F562590EB4710916D93066df704162250]); transferOwnership(0x335FcD9F562590EB4710916D93066df704162250); totalSupply = 21000000 * 10**18; // Update total supply name = 'AfterICO'; // Set the name for display purposes symbol = 'AICO'; // Set the symbol for display purposes decimals = 18; // Amount of decimals for display purposes } /* This unnamed function is called whenever someone tries to send ether to it */ function () public { assert(false); // Prevents accidental sending of ether } }
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":[{"name":"success","type":"bool"}],"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":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"standard","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"extraSupplay","type":"int256"}],"name":"editTokenProperties","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isTokenTransferable","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"crowdsale","outputs":[{"name":"","type":"address"}],"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":false,"inputs":[{"name":"crowdsaleContractAddress","type":"address"},{"name":"tokensAmount","type":"uint256"}],"name":"initializeCrowdsale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"src","type":"address"}],"name":"nonceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"nonce","type":"uint256"},{"name":"where","type":"address"},{"name":"amount","type":"uint256"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"transferByThirdParty","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unfreezeTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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"}]
Deployed Bytecode
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610117578063095ea7b3146101a157806318160ddd146101d957806323b872dd14610200578063313ce5671461022a5780635a3b7e421461025557806370a082311461026a5780638b969c331461028b5780638da5cb5b14610324578063958222aa1461035557806395d89b411461036a5780639c1e03a01461037f578063a9059cbb14610394578063c1bd8ecb146103b8578063dd62ed3e146103dc578063ed2a2d6414610403578063ee6891af14610424578063f2fde38b14610457578063ffba376c14610478575b34801561011257600080fd5b50fe5b005b34801561012357600080fd5b5061012c61048d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016657818101518382015260200161014e565b50505050905090810190601f1680156101935780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ad57600080fd5b506101c5600160a060020a036004351660243561051a565b604080519115158252519081900360200190f35b3480156101e557600080fd5b506101ee610547565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101c5600160a060020a036004358116906024351660443561054d565b34801561023657600080fd5b5061023f610664565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b5061012c61066d565b34801561027657600080fd5b506101ee600160a060020a03600435166106c8565b34801561029757600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261011594369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375094975050933594506106da9350505050565b34801561033057600080fd5b5061033961085d565b60408051600160a060020a039092168252519081900360200190f35b34801561036157600080fd5b506101c561086c565b34801561037657600080fd5b5061012c610875565b34801561038b57600080fd5b506103396108cd565b3480156103a057600080fd5b50610115600160a060020a03600435166024356108dc565b3480156103c457600080fd5b50610115600160a060020a0360043516602435610981565b3480156103e857600080fd5b506101ee600160a060020a0360043581169060243516610a15565b34801561040f57600080fd5b506101ee600160a060020a0360043516610a32565b34801561043057600080fd5b506101c5600435600160a060020a036024351660443560ff6064351660843560a435610a4d565b34801561046357600080fd5b50610115600160a060020a0360043516610ce5565b34801561048457600080fd5b50610115610d65565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105125780601f106104e757610100808354040283529160200191610512565b820191906000526020600020905b8154815290600101906020018083116104f557829003601f168201915b505050505081565b336000908152600760209081526040808320600160a060020a039590951683529390529190912055600190565b60045481565b60055460009060ff16806105685750600160a060020a038416155b151561057057fe5b600160a060020a03841660009081526006602052604090205482111561059557600080fd5b600160a060020a03831660009081526006602052604090205482810110156105bc57600080fd5b600160a060020a03841660009081526007602090815260408083203384529091529020548211156105ec57600080fd5b600160a060020a038085166000818152600660209081526040808320805488900390559387168083528483208054880190558383526007825284832033845282529184902080548790039055835186815293519193600080516020610ed8833981519152929081900390910190a35060019392505050565b60035460ff1681565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105125780601f106104e757610100808354040283529160200191610512565b60066020526000908152604090205481565b600854600160a060020a031633146106f157600080fd5b8251610704906001906020860190610e3c565b508151610718906002906020850190610e3c565b5060008113156107b757600854600160a060020a031660009081526006602052604090205461074d908263ffffffff610e1416565b600854600160a060020a031660009081526006602052604090205560045461077b908263ffffffff610e1416565b600455600854604080518381529051600160a060020a0390921691600091600080516020610ed8833981519152919081900360200190a3610858565b600081121561085857600854600160a060020a03166000908152600660205260408120546107ed9183900363ffffffff610e2a16565b600854600160a060020a03166000908152600660205260408120919091556004546108209183900363ffffffff610e2a16565b600455600854604080516000848103825291519192600160a060020a031691600080516020610ed88339815191529181900360200190a35b505050565b600854600160a060020a031681565b60055460ff1681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105125780601f106104e757610100808354040283529160200191610512565b600954600160a060020a031681565b60055460ff1615156108ea57fe5b3360009081526006602052604090205481111561090357fe5b600160a060020a038216600090815260066020526040902054818101101561092a57600080fd5b33600081815260066020908152604080832080548690039055600160a060020a0386168084529281902080548601905580518581529051929392600080516020610ed8833981519152929181900390910190a35050565b600854600160a060020a0316331461099857600080fd5b6109a36000826108dc565b600160a060020a03821660008181527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df602052604081208390556009805473ffffffffffffffffffffffffffffffffffffffff19169092179091556005805460ff19169055610a1190610ce5565b5050565b600760209081526000928352604080842090915290825290205481565b600160a060020a03166000908152600a602052604090205490565b60008080600160a060020a038816301415610a6457fe5b600160a060020a0388161515610a7657fe5b604080516c010000000000000000000000003081028252601482018c9052600160a060020a038b1602603482015260488101899052905160029160688082019260209290919082900301816000865af1158015610ad7573d6000803e3d6000fd5b5050506040513d6020811015610aec57600080fd5b5051604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101839052815190819003603c018120600080835260208381018086529290925260ff8b1683850152606083018a905260808301899052925193955060019360a0808401949293601f19830193908390039091019190865af1158015610b81573d6000803e3d6000fd5b505060408051601f190151600160a060020a0381166000908152600660205291909120549092508811159050610bb357fe5b600160a060020a0381166000908152600a60205260409020546001018914610bd757fe5b600160a060020a0381166000908152600a6020908152604080832085845260010190915290205460ff1615610c0857fe5b600160a060020a038116600090815260066020526040902054610c31908863ffffffff610e2a16565b600160a060020a0380831660009081526006602052604080822093909355908a1681522054610c66908863ffffffff610e1416565b600160a060020a03808a16600081815260066020908152604080832095909555928516808252600a8452848220805460019081018255888452908101855291859020805460ff191690921790915583518b8152935191939092600080516020610ed883398151915292918290030190a350600198975050505050505050565b600854600160a060020a03163314610cfc57600080fd5b600854604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600960009054906101000a9004600160a060020a0316600160a060020a0316633197cbb66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610dd157600080fd5b505af1158015610de5573d6000803e3d6000fd5b505050506040513d6020811015610dfb57600080fd5b50514211610e0557fe5b6005805460ff19166001179055565b600082820183811015610e2357fe5b9392505050565b600082821115610e3657fe5b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e7d57805160ff1916838001178555610eaa565b82800160010185558215610eaa579182015b82811115610eaa578251825591602001919060010190610e8f565b50610eb6929150610eba565b5090565b610ed491905b80821115610eb65760008155600101610ec0565b905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058209c518af69a72263e2070729e11fcccb664e42df4a75ee812ab8cef5c69e20edd0029
Swarm Source
bzzr://9c518af69a72263e2070729e11fcccb664e42df4a75ee812ab8cef5c69e20edd
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.