ERC-20
Overview
Max Total Supply
1,000,000,000 PTC
Holders
679
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
PortalToken
Compiler Version
v0.4.22-nightly.2018.3.13+commit.f2614be9
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-03-14 */ pragma solidity ^0.4.18; // https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs#transferable-fungibles-see-erc-20-for-the-latest contract ERC20Token { // Triggered when tokens are transferred. event Transfer(address indexed _from, address indexed _to, uint256 _value); // Triggered whenever approve(address _spender, uint256 _value) is called. event Approval(address indexed _owner, address indexed _spender, uint256 _value); // Get the total token supply function totalSupply() constant public returns (uint256 supply); // Get the account `balance` of another account with address `_owner` function balanceOf(address _owner) constant public returns (uint256 balance); // Send `_value` amount of tokens to address `_to` function transfer(address _to, uint256 _value) public returns (bool success); // Send `_value` amount of tokens from address `_from` to address `_to` // The `transferFrom` method is used for a withdraw workflow, allowing contracts to send tokens on your behalf, // for example to "deposit" to a contract address and/or to charge fees in sub-currencies; // the command should fail unless the `_from` account has deliberately authorized the sender of the message // via some mechanism; we propose these standardized APIs for `approval`: function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); // Allow _spender to withdraw from your account, multiple times, up to the _value amount. // If this function is called again it overwrites the current allowance with _value. function approve(address _spender, uint256 _value) public returns (bool success); // Returns the amount which _spender is still allowed to withdraw from _owner function allowance(address _owner, address _spender) constant public returns (uint256 remaining); } contract PortalToken is ERC20Token { address public initialOwner; uint256 public supply = 1000000000 * 10 ** 18; // 100, 000, 000 string public name = 'PortalToken'; uint8 public decimals = 18; string public symbol = 'PTC'; string public version = 'v0.1'; bool public transfersEnabled = true; uint public creationBlock; uint public creationTime; mapping (address => uint256) balance; mapping (address => mapping (address => uint256)) m_allowance; mapping (address => uint) jail; mapping (address => uint256) jailAmount; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function PortalToken() public{ initialOwner = msg.sender; balance[msg.sender] = supply; creationBlock = block.number; creationTime = block.timestamp; } function balanceOf(address _account) constant public returns (uint) { return balance[_account]; } function jailAmountOf(address _account) constant public returns (uint256) { return jailAmount[_account]; } function totalSupply() constant public returns (uint) { return supply; } function transfer(address _to, uint256 _value) public returns (bool success) { // `revert()` | `throw` // http://solidity.readthedocs.io/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions // https://ethereum.stackexchange.com/questions/20978/why-do-throw-and-revert-create-different-bytecodes/20981 if (!transfersEnabled) revert(); if ( jail[msg.sender] >= block.timestamp ) revert(); if ( balance[msg.sender] - _value < jailAmount[msg.sender]) revert(); return doTransfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { if (!transfersEnabled) revert(); if ( jail[msg.sender] >= block.timestamp || jail[_to] >= block.timestamp || jail[_from] >= block.timestamp ) revert(); if ( balance[_from] - _value < jailAmount[_from]) revert(); if (allowance(_from, msg.sender) < _value) revert(); m_allowance[_from][msg.sender] -= _value; if ( !(doTransfer(_from, _to, _value)) ) { m_allowance[_from][msg.sender] += _value; return false; } else { return true; } } function doTransfer(address _from, address _to, uint _value) internal returns (bool success) { if (balance[_from] >= _value && balance[_to] + _value >= balance[_to]) { balance[_from] -= _value; balance[_to] += _value; Transfer(_from, _to, _value); return true; } else { return false; } } function approve(address _spender, uint256 _value) public returns (bool success) { if (!transfersEnabled) revert(); if ( jail[msg.sender] >= block.timestamp || jail[_spender] >= block.timestamp ) revert(); if ( balance[msg.sender] - _value < jailAmount[msg.sender]) revert(); // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 if ( (_value != 0) && (allowance(msg.sender, _spender) != 0) ) revert(); m_allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { if (!transfersEnabled) revert(); return m_allowance[_owner][_spender]; } function enableTransfers(bool _transfersEnabled) public returns (bool) { if (msg.sender != initialOwner) revert(); transfersEnabled = _transfersEnabled; return transfersEnabled; } function catchYou(address _target, uint _timestamp, uint256 _amount) public returns (uint) { if (msg.sender != initialOwner) revert(); if (!transfersEnabled) revert(); jail[_target] = _timestamp; jailAmount[_target] = _amount; return jail[_target]; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"supply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"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":"creationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"initialOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_account","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_account","type":"address"}],"name":"jailAmountOf","outputs":[{"name":"","type":"uint256"}],"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":"_target","type":"address"},{"name":"_timestamp","type":"uint256"},{"name":"_amount","type":"uint256"}],"name":"catchYou","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"transfersEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"creationTime","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":"_transfersEnabled","type":"bool"}],"name":"enableTransfers","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"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
60606040526b033b2e3c9fd0803ce800000060015560408051908101604052600b81527f506f7274616c546f6b656e0000000000000000000000000000000000000000006020820152600290805161005b92916020019061014c565b506003805460ff1916601217905560408051908101604052600381527f5054430000000000000000000000000000000000000000000000000000000000602082015260049080516100b092916020019061014c565b5060408051908101604052600481527f76302e3100000000000000000000000000000000000000000000000000000000602082015260059080516100f892916020019061014c565b506006805460ff19166001179055341561011157600080fd5b60008054600160a060020a03191633600160a060020a03169081178255600154908252600960205260409091205543600755426008556101e7565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061018d57805160ff19168380011785556101ba565b828001600101855582156101ba579182015b828111156101ba57825182559160200191906001019061019f565b506101c69291506101ca565b5090565b6101e491905b808211156101c657600081556001016101d0565b90565b610a15806101f66000396000f3006060604052600436106100fb5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663047fc9aa811461010057806306fdde0314610125578063095ea7b3146101af57806317634514146101e557806318160ddd146101f857806323b872dd1461020b57806329ba7bb214610233578063313ce5671461026257806354fd4d501461028b57806370a082311461029e5780638745ddb3146102bd57806395d89b41146102dc578063a6cb4654146102ef578063a9059cbb14610314578063bef97c8714610336578063d8270dce14610349578063dd62ed3e1461035c578063f41e60c514610381575b600080fd5b341561010b57600080fd5b610113610399565b60405190815260200160405180910390f35b341561013057600080fd5b61013861039f565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017457808201518382015260200161015c565b50505050905090810190601f1680156101a15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ba57600080fd5b6101d1600160a060020a036004351660243561043d565b604051901515815260200160405180910390f35b34156101f057600080fd5b610113610559565b341561020357600080fd5b61011361055f565b341561021657600080fd5b6101d1600160a060020a0360043581169060243516604435610565565b341561023e57600080fd5b6102466106ae565b604051600160a060020a03909116815260200160405180910390f35b341561026d57600080fd5b6102756106bd565b60405160ff909116815260200160405180910390f35b341561029657600080fd5b6101386106c6565b34156102a957600080fd5b610113600160a060020a0360043516610731565b34156102c857600080fd5b610113600160a060020a036004351661074c565b34156102e757600080fd5b610138610767565b34156102fa57600080fd5b610113600160a060020a03600435166024356044356107d2565b341561031f57600080fd5b6101d1600160a060020a0360043516602435610830565b341561034157600080fd5b6101d16108a7565b341561035457600080fd5b6101136108b0565b341561036757600080fd5b610113600160a060020a03600435811690602435166108b6565b341561038c57600080fd5b6101d160043515156108f6565b60015481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104355780601f1061040a57610100808354040283529160200191610435565b820191906000526020600020905b81548152906001019060200180831161041857829003601f168201915b505050505081565b60065460009060ff16151561045157600080fd5b600160a060020a0333166000908152600b602052604090205442901015806104925750600160a060020a0383166000908152600b6020526040902054429010155b1561049c57600080fd5b600160a060020a0333166000908152600c602090815260408083205460099092529091205483900310156104cf57600080fd5b81158015906104e657506104e333846108b6565b15155b156104f057600080fd5b600160a060020a033381166000818152600a6020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60075481565b60015490565b60065460009060ff16151561057957600080fd5b600160a060020a0333166000908152600b602052604090205442901015806105ba5750600160a060020a0383166000908152600b6020526040902054429010155b806105de5750600160a060020a0384166000908152600b6020526040902054429010155b156105e857600080fd5b600160a060020a0384166000908152600c6020908152604080832054600990925290912054839003101561061b57600080fd5b8161062685336108b6565b101561063157600080fd5b600160a060020a038085166000908152600a60209081526040808320339094168352929052208054839003905561066984848461092c565b15156106a35750600160a060020a038084166000908152600a602090815260408083203390941683529290529081208054830190556106a7565b5060015b9392505050565b600054600160a060020a031681565b60035460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104355780601f1061040a57610100808354040283529160200191610435565b600160a060020a031660009081526009602052604090205490565b600160a060020a03166000908152600c602052604090205490565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104355780601f1061040a57610100808354040283529160200191610435565b6000805433600160a060020a039081169116146107ee57600080fd5b60065460ff1615156107ff57600080fd5b50600160a060020a0383166000908152600b60208181526040808420868155600c8352932084905552549392505050565b60065460009060ff16151561084457600080fd5b600160a060020a0333166000908152600b602052604090205442901061086957600080fd5b600160a060020a0333166000908152600c6020908152604080832054600990925290912054839003101561089c57600080fd5b6106a733848461092c565b60065460ff1681565b60085481565b60065460009060ff1615156108ca57600080fd5b50600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000805433600160a060020a0390811691161461091257600080fd5b506006805460ff1916911515919091179081905560ff1690565b600160a060020a03831660009081526009602052604081205482901080159061096f5750600160a060020a03831660009081526009602052604090205482810110155b156109e157600160a060020a038085166000818152600960205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060016106a7565b5060006106a75600a165627a7a72305820184c8aee1d9af8399ed4cd068a643bb0233b3edd527eece14df5c684ff08a1530029
Deployed Bytecode
0x6060604052600436106100fb5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663047fc9aa811461010057806306fdde0314610125578063095ea7b3146101af57806317634514146101e557806318160ddd146101f857806323b872dd1461020b57806329ba7bb214610233578063313ce5671461026257806354fd4d501461028b57806370a082311461029e5780638745ddb3146102bd57806395d89b41146102dc578063a6cb4654146102ef578063a9059cbb14610314578063bef97c8714610336578063d8270dce14610349578063dd62ed3e1461035c578063f41e60c514610381575b600080fd5b341561010b57600080fd5b610113610399565b60405190815260200160405180910390f35b341561013057600080fd5b61013861039f565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017457808201518382015260200161015c565b50505050905090810190601f1680156101a15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ba57600080fd5b6101d1600160a060020a036004351660243561043d565b604051901515815260200160405180910390f35b34156101f057600080fd5b610113610559565b341561020357600080fd5b61011361055f565b341561021657600080fd5b6101d1600160a060020a0360043581169060243516604435610565565b341561023e57600080fd5b6102466106ae565b604051600160a060020a03909116815260200160405180910390f35b341561026d57600080fd5b6102756106bd565b60405160ff909116815260200160405180910390f35b341561029657600080fd5b6101386106c6565b34156102a957600080fd5b610113600160a060020a0360043516610731565b34156102c857600080fd5b610113600160a060020a036004351661074c565b34156102e757600080fd5b610138610767565b34156102fa57600080fd5b610113600160a060020a03600435166024356044356107d2565b341561031f57600080fd5b6101d1600160a060020a0360043516602435610830565b341561034157600080fd5b6101d16108a7565b341561035457600080fd5b6101136108b0565b341561036757600080fd5b610113600160a060020a03600435811690602435166108b6565b341561038c57600080fd5b6101d160043515156108f6565b60015481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104355780601f1061040a57610100808354040283529160200191610435565b820191906000526020600020905b81548152906001019060200180831161041857829003601f168201915b505050505081565b60065460009060ff16151561045157600080fd5b600160a060020a0333166000908152600b602052604090205442901015806104925750600160a060020a0383166000908152600b6020526040902054429010155b1561049c57600080fd5b600160a060020a0333166000908152600c602090815260408083205460099092529091205483900310156104cf57600080fd5b81158015906104e657506104e333846108b6565b15155b156104f057600080fd5b600160a060020a033381166000818152600a6020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60075481565b60015490565b60065460009060ff16151561057957600080fd5b600160a060020a0333166000908152600b602052604090205442901015806105ba5750600160a060020a0383166000908152600b6020526040902054429010155b806105de5750600160a060020a0384166000908152600b6020526040902054429010155b156105e857600080fd5b600160a060020a0384166000908152600c6020908152604080832054600990925290912054839003101561061b57600080fd5b8161062685336108b6565b101561063157600080fd5b600160a060020a038085166000908152600a60209081526040808320339094168352929052208054839003905561066984848461092c565b15156106a35750600160a060020a038084166000908152600a602090815260408083203390941683529290529081208054830190556106a7565b5060015b9392505050565b600054600160a060020a031681565b60035460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104355780601f1061040a57610100808354040283529160200191610435565b600160a060020a031660009081526009602052604090205490565b600160a060020a03166000908152600c602052604090205490565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104355780601f1061040a57610100808354040283529160200191610435565b6000805433600160a060020a039081169116146107ee57600080fd5b60065460ff1615156107ff57600080fd5b50600160a060020a0383166000908152600b60208181526040808420868155600c8352932084905552549392505050565b60065460009060ff16151561084457600080fd5b600160a060020a0333166000908152600b602052604090205442901061086957600080fd5b600160a060020a0333166000908152600c6020908152604080832054600990925290912054839003101561089c57600080fd5b6106a733848461092c565b60065460ff1681565b60085481565b60065460009060ff1615156108ca57600080fd5b50600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000805433600160a060020a0390811691161461091257600080fd5b506006805460ff1916911515919091179081905560ff1690565b600160a060020a03831660009081526009602052604081205482901080159061096f5750600160a060020a03831660009081526009602052604090205482810110155b156109e157600160a060020a038085166000818152600960205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060016106a7565b5060006106a75600a165627a7a72305820184c8aee1d9af8399ed4cd068a643bb0233b3edd527eece14df5c684ff08a1530029
Swarm Source
bzzr://184c8aee1d9af8399ed4cd068a643bb0233b3edd527eece14df5c684ff08a153
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.