Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
50,000 HALW
Holders
777
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 0 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
HalloweenCollectorToken
Compiler Version
v0.4.17+commit.bdeb9e52
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2017-10-31 */ pragma solidity ^0.4.17; contract ERC20Interface { function totalSupply() public constant returns (uint256); function balanceOf(address _owner) public constant returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function allowance(address _owner, address _spender) public constant returns (uint256); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract SafeMath { function safeMul(uint a, uint b) internal pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } } contract RandomToken { function balanceOf(address _owner) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract HalloweenCollectorToken is ERC20Interface, SafeMath { string constant token_name = "Halloween Limited Edition Token"; string constant token_symbol = "HALW"; uint8 constant token_decimals = 0; uint256 public constant ether_per_token = 0.0035 * 1 ether; uint public constant TOKEN_SWAP_DURATION_HOURS = 1 * 24; uint256 public constant token_airdrop_cnt_max = 1000; uint256 public constant token_airdrop_amount_each = 10; uint256 public constant token_swap_supply = 40000; uint public time_of_token_swap_start; uint public time_of_token_swap_end; uint256 totSupply; uint256 public airdrop_cnt; address owner; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; mapping(address => bool) is_airdropped; modifier onlyOwner() { if (msg.sender != owner) { revert(); } _; } modifier transferAllowed() { _; } modifier purchaseAllowed() { if (now > time_of_token_swap_end) { revert(); } _; } function HalloweenCollectorToken() public { owner = msg.sender; uint256 airdrop_supply = safeMul(token_airdrop_cnt_max, token_airdrop_amount_each); totSupply = safeAdd(token_swap_supply, airdrop_supply); time_of_token_swap_start = now; time_of_token_swap_end = time_of_token_swap_start + TOKEN_SWAP_DURATION_HOURS * 1 hours; airdrop_cnt = 0; balances[owner] = totSupply; } function name() public pure returns (string) { return token_name; } function symbol() public pure returns (string) { return token_symbol; } function decimals() public pure returns (uint8) { return token_decimals; } function totalSupply() public view returns (uint256) { return totSupply; } function balanceOf(address a) public view returns (uint256) { return balances[a]; } function transfer(address _to, uint256 _amount) public transferAllowed returns (bool) { if ( _amount > 0 && balances[msg.sender] >= _amount && balances[_to] + _amount > balances[_to] ) { balances[msg.sender] -= _amount; balances[_to] += _amount; Transfer(msg.sender, _to, _amount); return true; } else { return false; } } function transferFrom( address _from, address _to, uint256 _amount ) public transferAllowed returns (bool) { if ( _amount > 0 && balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && balances[_to] + _amount > balances[_to] ) { balances[_from] -= _amount; allowed[_from][msg.sender] -= _amount; balances[_to] += _amount; Transfer(_from, _to, _amount); return true; } else { return false; } } function approve(address _spender, uint256 _amount) public returns (bool) { allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function() public payable purchaseAllowed { if (msg.value == 0) { if (airdrop_cnt >= token_airdrop_cnt_max || is_airdropped[msg.sender]) { // airdrop already received return; } else { // airdrop airdrop_cnt++; is_airdropped[msg.sender] = true; balances[owner] = safeSub(balances[owner], token_airdrop_amount_each); balances[msg.sender] = safeAdd(balances[msg.sender], token_airdrop_amount_each); Transfer(address(this), msg.sender, token_airdrop_amount_each); } } else { // normal swap uint256 tokenRequested = msg.value / ether_per_token; assert(tokenRequested > 0 && tokenRequested <= balances[owner]); uint256 cost = safeMul(tokenRequested, ether_per_token); uint256 change = safeSub(msg.value, cost); owner.transfer(cost); msg.sender.transfer(change); balances[owner] = safeSub(balances[owner], tokenRequested); balances[msg.sender] = safeAdd(balances[msg.sender], tokenRequested); Transfer(address(this), msg.sender, tokenRequested); } } function withdrawForeignTokens(address _tokenContract) public onlyOwner returns (bool) { RandomToken token = RandomToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"airdrop_cnt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"","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":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"time_of_token_swap_start","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"a","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ether_per_token","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token_swap_supply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token_airdrop_cnt_max","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"time_of_token_swap_end","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenContract","type":"address"}],"name":"withdrawForeignTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token_airdrop_amount_each","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_SWAP_DURATION_HOURS","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"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"},{"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"}]
Contract Creation Code
6060604052341561000f57600080fd5b60048054600160a060020a03191633600160a060020a031617905560006100466103e8600a64010000000061009981026106051704565b9050610061619c40826401000000006105e16100c482021704565b6002819055426000818155620151809091016001556003819055600454600160a060020a0316815260056020526040902055506100de565b60008282028315806100b557508284828115156100b257fe5b04145b15156100bd57fe5b9392505050565b60008282018381108015906100b55750828110156100bd57fe5b610ad4806100ed6000396000f300606060405236156100e05763ffffffff60e060020a6000350416630465a76d811461036457806306fdde0314610389578063095ea7b31461041357806318160ddd1461044957806323b872dd1461045c578063313ce5671461048457806359b350fb146104ad57806370a08231146104c05780638def14f3146104df57806395d89b41146104f2578063a9059cbb14610505578063aca7dcfe14610527578063c24a89081461053a578063ceb6dbc31461054d578063dd62ed3e14610560578063e58fc54c14610585578063e97f6313146105a4578063f531dbbf146105b7575b60008060006001544211156100f457600080fd5b3415156101fe576103e86003541015806101265750600160a060020a03331660009081526007602052604090205460ff165b156101305761035f565b600380546001908101909155600160a060020a033381166000908152600760209081526040808320805460ff191690951790945560045490921681526005909152205461017e90600a6105ca565b600454600160a060020a039081166000908152600560205260408082209390935533909116815220546101b290600a6105e1565b600160a060020a033381166000818152600560205260409081902093909355913090911690600080516020610a8983398151915290600a905190815260200160405180910390a361035f565b660c6f3b40b6c000340492506000831180156102345750600454600160a060020a03166000908152600560205260409020548311155b151561023c57fe5b61024d83660c6f3b40b6c000610605565b915061025934836105ca565b600454909150600160a060020a031682156108fc0283604051600060405180830381858888f19350505050151561028f57600080fd5b600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156102c057600080fd5b600454600160a060020a03166000908152600560205260409020546102e590846105ca565b600454600160a060020a0390811660009081526005602052604080822093909355339091168152205461031890846105e1565b600160a060020a033381166000818152600560205260409081902093909355913090911690600080516020610a898339815191529086905190815260200160405180910390a35b505050005b341561036f57600080fd5b610377610626565b60405190815260200160405180910390f35b341561039457600080fd5b61039c61062c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156103d85780820151838201526020016103c0565b50505050905090810190601f1680156104055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561041e57600080fd5b610435600160a060020a036004351660243561066d565b604051901515815260200160405180910390f35b341561045457600080fd5b6103776106d9565b341561046757600080fd5b610435600160a060020a03600435811690602435166044356106df565b341561048f57600080fd5b6104976107e8565b60405160ff909116815260200160405180910390f35b34156104b857600080fd5b6103776107ed565b34156104cb57600080fd5b610377600160a060020a03600435166107f3565b34156104ea57600080fd5b61037761080e565b34156104fd57600080fd5b61039c610819565b341561051057600080fd5b610435600160a060020a036004351660243561085a565b341561053257600080fd5b610377610911565b341561054557600080fd5b610377610917565b341561055857600080fd5b61037761091d565b341561056b57600080fd5b610377600160a060020a0360043581169060243516610923565b341561059057600080fd5b610435600160a060020a036004351661094e565b34156105af57600080fd5b610377610a6c565b34156105c257600080fd5b610377610a71565b6000828211156105d657fe5b508082035b92915050565b60008282018381108015906105f65750828110155b15156105fe57fe5b9392505050565b60008282028315806105f6575082848281151561061e57fe5b04146105fe57fe5b60035481565b610634610a76565b60408051908101604052601f81527f48616c6c6f7765656e204c696d697465642045646974696f6e20546f6b656e006020820152905090565b600160a060020a03338116600081815260066020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025490565b600080821180156107095750600160a060020a038416600090815260056020526040902054829010155b801561073c5750600160a060020a0380851660009081526006602090815260408083203390941683529290522054829010155b80156107615750600160a060020a038316600090815260056020526040902054828101115b156107de57600160a060020a038085166000818152600560208181526040808420805489900390556006825280842033871685528252808420805489900390559488168084529190529083902080548601905591600080516020610a898339815191529085905190815260200160405180910390a35060016105fe565b5060009392505050565b600090565b60005481565b600160a060020a031660009081526005602052604090205490565b660c6f3b40b6c00081565b610821610a76565b60408051908101604052600481527f48414c57000000000000000000000000000000000000000000000000000000006020820152905090565b600080821180156108845750600160a060020a033316600090815260056020526040902054829010155b80156108a95750600160a060020a038316600090815260056020526040902054828101115b1561090957600160a060020a03338116600081815260056020526040808220805487900390559286168082529083902080548601905591600080516020610a898339815191529085905190815260200160405180910390a35060016105db565b5060006105db565b619c4081565b6103e881565b60015481565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b6004546000908190819033600160a060020a0390811691161461097057600080fd5b83915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156109ca57600080fd5b6102c65a03f115156109db57600080fd5b5050506040518051600454909250600160a060020a03808516925063a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a4a57600080fd5b6102c65a03f11515610a5b57600080fd5b505050604051805195945050505050565b600a81565b601881565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058208697602f3037322292d5b4887ad6d153dde6e0fa11d3c626a569c7bb69b620e90029
Deployed Bytecode
0x606060405236156100e05763ffffffff60e060020a6000350416630465a76d811461036457806306fdde0314610389578063095ea7b31461041357806318160ddd1461044957806323b872dd1461045c578063313ce5671461048457806359b350fb146104ad57806370a08231146104c05780638def14f3146104df57806395d89b41146104f2578063a9059cbb14610505578063aca7dcfe14610527578063c24a89081461053a578063ceb6dbc31461054d578063dd62ed3e14610560578063e58fc54c14610585578063e97f6313146105a4578063f531dbbf146105b7575b60008060006001544211156100f457600080fd5b3415156101fe576103e86003541015806101265750600160a060020a03331660009081526007602052604090205460ff165b156101305761035f565b600380546001908101909155600160a060020a033381166000908152600760209081526040808320805460ff191690951790945560045490921681526005909152205461017e90600a6105ca565b600454600160a060020a039081166000908152600560205260408082209390935533909116815220546101b290600a6105e1565b600160a060020a033381166000818152600560205260409081902093909355913090911690600080516020610a8983398151915290600a905190815260200160405180910390a361035f565b660c6f3b40b6c000340492506000831180156102345750600454600160a060020a03166000908152600560205260409020548311155b151561023c57fe5b61024d83660c6f3b40b6c000610605565b915061025934836105ca565b600454909150600160a060020a031682156108fc0283604051600060405180830381858888f19350505050151561028f57600080fd5b600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156102c057600080fd5b600454600160a060020a03166000908152600560205260409020546102e590846105ca565b600454600160a060020a0390811660009081526005602052604080822093909355339091168152205461031890846105e1565b600160a060020a033381166000818152600560205260409081902093909355913090911690600080516020610a898339815191529086905190815260200160405180910390a35b505050005b341561036f57600080fd5b610377610626565b60405190815260200160405180910390f35b341561039457600080fd5b61039c61062c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156103d85780820151838201526020016103c0565b50505050905090810190601f1680156104055780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561041e57600080fd5b610435600160a060020a036004351660243561066d565b604051901515815260200160405180910390f35b341561045457600080fd5b6103776106d9565b341561046757600080fd5b610435600160a060020a03600435811690602435166044356106df565b341561048f57600080fd5b6104976107e8565b60405160ff909116815260200160405180910390f35b34156104b857600080fd5b6103776107ed565b34156104cb57600080fd5b610377600160a060020a03600435166107f3565b34156104ea57600080fd5b61037761080e565b34156104fd57600080fd5b61039c610819565b341561051057600080fd5b610435600160a060020a036004351660243561085a565b341561053257600080fd5b610377610911565b341561054557600080fd5b610377610917565b341561055857600080fd5b61037761091d565b341561056b57600080fd5b610377600160a060020a0360043581169060243516610923565b341561059057600080fd5b610435600160a060020a036004351661094e565b34156105af57600080fd5b610377610a6c565b34156105c257600080fd5b610377610a71565b6000828211156105d657fe5b508082035b92915050565b60008282018381108015906105f65750828110155b15156105fe57fe5b9392505050565b60008282028315806105f6575082848281151561061e57fe5b04146105fe57fe5b60035481565b610634610a76565b60408051908101604052601f81527f48616c6c6f7765656e204c696d697465642045646974696f6e20546f6b656e006020820152905090565b600160a060020a03338116600081815260066020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025490565b600080821180156107095750600160a060020a038416600090815260056020526040902054829010155b801561073c5750600160a060020a0380851660009081526006602090815260408083203390941683529290522054829010155b80156107615750600160a060020a038316600090815260056020526040902054828101115b156107de57600160a060020a038085166000818152600560208181526040808420805489900390556006825280842033871685528252808420805489900390559488168084529190529083902080548601905591600080516020610a898339815191529085905190815260200160405180910390a35060016105fe565b5060009392505050565b600090565b60005481565b600160a060020a031660009081526005602052604090205490565b660c6f3b40b6c00081565b610821610a76565b60408051908101604052600481527f48414c57000000000000000000000000000000000000000000000000000000006020820152905090565b600080821180156108845750600160a060020a033316600090815260056020526040902054829010155b80156108a95750600160a060020a038316600090815260056020526040902054828101115b1561090957600160a060020a03338116600081815260056020526040808220805487900390559286168082529083902080548601905591600080516020610a898339815191529085905190815260200160405180910390a35060016105db565b5060006105db565b619c4081565b6103e881565b60015481565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b6004546000908190819033600160a060020a0390811691161461097057600080fd5b83915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156109ca57600080fd5b6102c65a03f115156109db57600080fd5b5050506040518051600454909250600160a060020a03808516925063a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a4a57600080fd5b6102c65a03f11515610a5b57600080fd5b505050604051805195945050505050565b600a81565b601881565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058208697602f3037322292d5b4887ad6d153dde6e0fa11d3c626a569c7bb69b620e90029
Swarm Source
bzzr://8697602f3037322292d5b4887ad6d153dde6e0fa11d3c626a569c7bb69b620e9
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.