ERC-20
Overview
Max Total Supply
2,000,000,000 TTB
Holders
11,139
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:
TTBToken
Compiler Version
v0.4.20+commit.3155dd80
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-02-16 */ pragma solidity ^0.4.18; library SafeOpt { 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); uint256 c = a / b; assert(a == b * c); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a - b; assert(b <= a); assert(a == c + b); return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); assert(a == c - b); return c; } } contract TTBTokenIssue { uint256 public lastYearTotalSupply = 15 * 10 ** 26; uint8 public affectedCount = 0; bool public initialYear = true; address public tokenContractAddress; uint16 public preRate = 1000; uint256 public lastBlockNumber; function TTBTokenIssue (address _tokenContractAddress) public{ tokenContractAddress = _tokenContractAddress; lastBlockNumber = block.number; } function returnRate() internal returns (uint256){ if(affectedCount == 10){ if(preRate > 100){ preRate -= 100; } affectedCount = 0; } return SafeOpt.div(preRate, 10); } function issue() public { if(initialYear){ require(SafeOpt.sub(block.number, lastBlockNumber) > 2102400); initialYear = false; } require(SafeOpt.sub(block.number, lastBlockNumber) > 2102400); TTBToken tokenContract = TTBToken(tokenContractAddress); if(affectedCount == 10){ lastYearTotalSupply = tokenContract.totalSupply(); } uint256 amount = SafeOpt.div(SafeOpt.mul(lastYearTotalSupply, returnRate()), 10000); require(amount > 0); tokenContract.issue(amount); lastBlockNumber = block.number; affectedCount += 1; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TTBToken { string public name = 'Tip-Top Block'; string public symbol = 'TTB'; uint8 public decimals = 18; uint256 public totalSupply = 100 * 10 ** 26; address public issueContractAddress; address public owner; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burn(address indexed from, uint256 value); event Issue(uint256 amount); function TTBToken() public { owner = msg.sender; balanceOf[owner] = totalSupply; issueContractAddress = new TTBTokenIssue(address(this)); } function issue(uint256 amount) public { require(msg.sender == issueContractAddress); balanceOf[owner] = SafeOpt.add(balanceOf[owner], amount); totalSupply = SafeOpt.add(totalSupply, amount); Issue(amount); } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } function _transfer(address _from, address _to, uint _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; balanceOf[_from] -= _value; balanceOf[_to] += _value; Transfer(_from, _to, _value); assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } function transfer(address _to, uint256 _value) public returns (bool success){ _transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { require(_value <= balanceOf[msg.sender]); allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } function allowance(address _owner, address _spender) view public returns (uint256 remaining) { return allowance[_owner][_spender]; } function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] -= _value; totalSupply -= _value; Burn(msg.sender, _value); return true; } function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); require(_value <= allowance[_from][msg.sender]); balanceOf[_from] -= _value; allowance[_from][msg.sender] -= _value; totalSupply -= _value; Burn(_from, _value); return true; } }
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":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[{"name":"success","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":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"}],"name":"burnFrom","outputs":[{"name":"success","type":"bool"}],"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":"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":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"issueContractAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"issue","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"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Issue","type":"event"}]
Contract Creation Code
606060405260408051908101604052600d81527f5469702d546f7020426c6f636b000000000000000000000000000000000000006020820152600090805161004b929160200190610146565b5060408051908101604052600381527f545442000000000000000000000000000000000000000000000000000000000060208201526001908051610093929160200190610146565b506002805460ff191660121790556b204fce5e3e2502611000000060035534156100bc57600080fd5b60058054600160a060020a03191633600160a060020a0390811691909117918290556003549116600090815260066020526040902055306100fb6101c4565b600160a060020a039091168152602001604051809103906000f080151561012157600080fd5b60048054600160a060020a031916600160a060020a03929092169190911790556101f1565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061018757805160ff19168380011785556101b4565b828001600101855582156101b4579182015b828111156101b4578251825591602001919060010190610199565b506101c09291506101d4565b5090565b60405161053c80610ca983390190565b6101ee91905b808211156101c057600081556001016101da565b90565b610aa9806102006000396000f3006060604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd1461019f57806323b872dd146101c4578063313ce567146101ec57806342966c681461021557806370a082311461022b57806379cc67901461024a5780638da5cb5b1461026c57806395d89b411461029b578063a9059cbb146102ae578063ae18f5ad146102d0578063cae9ca51146102e3578063cc872b6614610348578063dd62ed3e14610360575b600080fd5b34156100ea57600080fd5b6100f2610385565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561012e578082015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017457600080fd5b61018b600160a060020a0360043516602435610423565b604051901515815260200160405180910390f35b34156101aa57600080fd5b6101b26104b1565b60405190815260200160405180910390f35b34156101cf57600080fd5b61018b600160a060020a03600435811690602435166044356104b7565b34156101f757600080fd5b6101ff61052e565b60405160ff909116815260200160405180910390f35b341561022057600080fd5b61018b600435610537565b341561023657600080fd5b6101b2600160a060020a03600435166105c2565b341561025557600080fd5b61018b600160a060020a03600435166024356105dd565b341561027757600080fd5b61027f6106b9565b604051600160a060020a03909116815260200160405180910390f35b34156102a657600080fd5b6100f26106c8565b34156102b957600080fd5b61018b600160a060020a0360043516602435610733565b34156102db57600080fd5b61027f610749565b34156102ee57600080fd5b61018b60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061075895505050505050565b341561035357600080fd5b61035e60043561088a565b005b341561036b57600080fd5b6101b2600160a060020a036004358116906024351661092b565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561041b5780601f106103f05761010080835404028352916020019161041b565b820191906000526020600020905b8154815290600101906020018083116103fe57829003601f168201915b505050505081565b600160a060020a03331660009081526006602052604081205482111561044857600080fd5b600160a060020a03338116600081815260076020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035481565b600160a060020a038084166000908152600760209081526040808320339094168352929052908120548211156104ec57600080fd5b600160a060020a0380851660009081526007602090815260408083203390941683529290522080548390039055610524848484610956565b5060019392505050565b60025460ff1681565b600160a060020a0333166000908152600660205260408120548290101561055d57600080fd5b600160a060020a03331660008181526006602052604090819020805485900390556003805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b600160a060020a031660009081526006602052604090205490565b600160a060020a0382166000908152600660205260408120548290101561060357600080fd5b600160a060020a038084166000908152600760209081526040808320339094168352929052205482111561063657600080fd5b600160a060020a038084166000818152600660209081526040808320805488900390556007825280832033909516835293905282902080548590039055600380548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b600554600160a060020a031681565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561041b5780601f106103f05761010080835404028352916020019161041b565b6000610740338484610956565b50600192915050565b600454600160a060020a031681565b6000836107658185610423565b156108825780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561081b578082015183820152602001610803565b50505050905090810190601f1680156108485780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561086957600080fd5b6102c65a03f1151561087a57600080fd5b505050600191505b509392505050565b60045433600160a060020a039081169116146108a557600080fd5b600554600160a060020a03166000908152600660205260409020546108ca9082610a5c565b600554600160a060020a03166000908152600660205260409020556003546108f29082610a5c565b6003557fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a8160405190815260200160405180910390a150565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b6000600160a060020a038316151561096d57600080fd5b600160a060020a0384166000908152600660205260409020548290101561099357600080fd5b600160a060020a038316600090815260066020526040902054828101116109b957600080fd5b50600160a060020a0380831660008181526006602052604080822080549488168084528284208054888103909155938590528154870190915591909301927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3600160a060020a03808416600090815260066020526040808220549287168252902054018114610a5657fe5b50505050565b600082820183811015610a6b57fe5b8281038414610a7657fe5b93925050505600a165627a7a72305820377f9bb8c035eb31d37063afd4e1bcdb12b86e589a81ca894fb21a56822e1c69002960606040526b04d8c55aefb8c05b5c0000006000556001805461010061ffff199091161760b060020a61ffff0219167703e800000000000000000000000000000000000000000000179055341561005557600080fd5b60405160208061053c8339810160405280805160018054600160a060020a0390921662010000026201000060b060020a0319909216919091179055505043600255610497806100a56000396000f3006060604052600436106100695763ffffffff60e060020a6000350416632552317c811461006e5780632b0999f3146100935780635199f1de146100ba578063742f79d5146100cd57806382edaf94146100f75780638f754a1e14610133578063d383f6461461015c575b600080fd5b341561007957600080fd5b610081610171565b60405190815260200160405180910390f35b341561009e57600080fd5b6100a6610177565b604051901515815260200160405180910390f35b34156100c557600080fd5b610081610185565b34156100d857600080fd5b6100e061018b565b60405161ffff909116815260200160405180910390f35b341561010257600080fd5b61010a61019c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b341561013e57600080fd5b6101466101be565b60405160ff909116815260200160405180910390f35b341561016757600080fd5b61016f6101c7565b005b60025481565b600154610100900460ff1681565b60005481565b60015460b060020a900461ffff1681565b60015462010000900473ffffffffffffffffffffffffffffffffffffffff1681565b60015460ff1681565b6001546000908190610100900460ff161561020257622014806101ec4360025461036a565b116101f657600080fd5b6001805461ff00191690555b622014806102124360025461036a565b1161021c57600080fd5b60015462010000810473ffffffffffffffffffffffffffffffffffffffff16925060ff16600a14156102b9578173ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561029b57600080fd5b6102c65a03f115156102ac57600080fd5b5050506040518051600055505b6102d76102cf6000546102ca61038f565b61041b565b612710610446565b9050600081116102e657600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663cc872b668260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561033957600080fd5b6102c65a03f1151561034a57600080fd5b50504360025550506001805460ff80821683011660ff1990911617905550565b60008183038383111561037957fe5b808301841461038457fe5b8091505b5092915050565b60015460009060ff16600a14156103fd57600154606460b060020a90910461ffff1611156103f2576001805460631961ffff60b060020a808404821692909201160277ffff00000000000000000000000000000000000000000000199091161790555b6001805460ff191690555b6001546104169060b060020a900461ffff16600a610446565b905090565b60008083151561042e5760009150610388565b5082820282848281151561043e57fe5b041461038457fe5b60008080831161045257fe5b828481151561045d57fe5b049050828102841461038457fe00a165627a7a723058208f99930d9e95bd214bac3cffd95522cbab5e96bb403a69f616b93416e35a74360029
Deployed Bytecode
0x6060604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd1461019f57806323b872dd146101c4578063313ce567146101ec57806342966c681461021557806370a082311461022b57806379cc67901461024a5780638da5cb5b1461026c57806395d89b411461029b578063a9059cbb146102ae578063ae18f5ad146102d0578063cae9ca51146102e3578063cc872b6614610348578063dd62ed3e14610360575b600080fd5b34156100ea57600080fd5b6100f2610385565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561012e578082015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017457600080fd5b61018b600160a060020a0360043516602435610423565b604051901515815260200160405180910390f35b34156101aa57600080fd5b6101b26104b1565b60405190815260200160405180910390f35b34156101cf57600080fd5b61018b600160a060020a03600435811690602435166044356104b7565b34156101f757600080fd5b6101ff61052e565b60405160ff909116815260200160405180910390f35b341561022057600080fd5b61018b600435610537565b341561023657600080fd5b6101b2600160a060020a03600435166105c2565b341561025557600080fd5b61018b600160a060020a03600435166024356105dd565b341561027757600080fd5b61027f6106b9565b604051600160a060020a03909116815260200160405180910390f35b34156102a657600080fd5b6100f26106c8565b34156102b957600080fd5b61018b600160a060020a0360043516602435610733565b34156102db57600080fd5b61027f610749565b34156102ee57600080fd5b61018b60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061075895505050505050565b341561035357600080fd5b61035e60043561088a565b005b341561036b57600080fd5b6101b2600160a060020a036004358116906024351661092b565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561041b5780601f106103f05761010080835404028352916020019161041b565b820191906000526020600020905b8154815290600101906020018083116103fe57829003601f168201915b505050505081565b600160a060020a03331660009081526006602052604081205482111561044857600080fd5b600160a060020a03338116600081815260076020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035481565b600160a060020a038084166000908152600760209081526040808320339094168352929052908120548211156104ec57600080fd5b600160a060020a0380851660009081526007602090815260408083203390941683529290522080548390039055610524848484610956565b5060019392505050565b60025460ff1681565b600160a060020a0333166000908152600660205260408120548290101561055d57600080fd5b600160a060020a03331660008181526006602052604090819020805485900390556003805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b600160a060020a031660009081526006602052604090205490565b600160a060020a0382166000908152600660205260408120548290101561060357600080fd5b600160a060020a038084166000908152600760209081526040808320339094168352929052205482111561063657600080fd5b600160a060020a038084166000818152600660209081526040808320805488900390556007825280832033909516835293905282902080548590039055600380548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b600554600160a060020a031681565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561041b5780601f106103f05761010080835404028352916020019161041b565b6000610740338484610956565b50600192915050565b600454600160a060020a031681565b6000836107658185610423565b156108825780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561081b578082015183820152602001610803565b50505050905090810190601f1680156108485780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561086957600080fd5b6102c65a03f1151561087a57600080fd5b505050600191505b509392505050565b60045433600160a060020a039081169116146108a557600080fd5b600554600160a060020a03166000908152600660205260409020546108ca9082610a5c565b600554600160a060020a03166000908152600660205260409020556003546108f29082610a5c565b6003557fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a8160405190815260200160405180910390a150565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b6000600160a060020a038316151561096d57600080fd5b600160a060020a0384166000908152600660205260409020548290101561099357600080fd5b600160a060020a038316600090815260066020526040902054828101116109b957600080fd5b50600160a060020a0380831660008181526006602052604080822080549488168084528284208054888103909155938590528154870190915591909301927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3600160a060020a03808416600090815260066020526040808220549287168252902054018114610a5657fe5b50505050565b600082820183811015610a6b57fe5b8281038414610a7657fe5b93925050505600a165627a7a72305820377f9bb8c035eb31d37063afd4e1bcdb12b86e589a81ca894fb21a56822e1c690029
Swarm Source
bzzr://8f99930d9e95bd214bac3cffd95522cbab5e96bb403a69f616b93416e35a7436
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.