ERC-20
Overview
Max Total Supply
415 YIN
Holders
415
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 3 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Yineu
Compiler Version
v0.5.13+commit.5b0b510c
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-08-06 */ pragma solidity 0.5.13; //https://www.yineu.me interface Callable { function tokenCallback(address _from, uint256 _tokens, bytes calldata _data) external returns (bool); } contract Yineu { uint256 constant private initial_supply = 1e3; uint256 constant private new_address_supply = 1e3; uint256 constant private precision = 1e3; string constant public name = "Yineu"; string constant public symbol = "YIN"; uint8 constant public decimals = 3; address[] public allAddresses; struct User { uint256 balance; mapping(address => uint256) allowance; } struct Info { uint256 totalSupply; mapping(address => User) users; address admin; } Info private info; event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed owner, address indexed spender, uint256 tokens); constructor() public { info.admin = msg.sender; allAddresses.push(msg.sender); info.totalSupply = initial_supply; info.users[msg.sender].balance = initial_supply; } function totalSupply() public view returns (uint256) { return info.totalSupply; } function balanceOf(address _user) public view returns (uint256) { return info.users[_user].balance; } function allowance(address _user, address _spender) public view returns (uint256) { return info.users[_user].allowance[_spender]; } function allInfoFor(address _user) public view returns (uint256 totalTokenSupply, uint256 userBalance) { return (totalSupply(), balanceOf(_user)); } function approve(address _spender, uint256 _tokens) external returns (bool) { info.users[msg.sender].allowance[_spender] = _tokens; emit Approval(msg.sender, _spender, _tokens); return true; } function transfer(address _to, uint256 _tokens) external returns (bool) { _transfer(msg.sender, _to, _tokens); return true; } function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool) { require(info.users[_from].allowance[msg.sender] >= _tokens); info.users[_from].allowance[msg.sender] -= _tokens; _transfer(_from, _to, _tokens); return true; } function _transfer(address _from, address _to, uint256 _tokens) internal returns (uint256) { require(balanceOf(_from) >= _tokens); bool isNewUser = info.users[_to].balance == 0; info.users[_from].balance -= _tokens; uint256 _transferred = _tokens; info.users[_to].balance += _transferred; if(isNewUser && _tokens > 0){ allAddresses.push(_to); uint256 i = 0; while (i < allAddresses.length) { uint256 addressBalance = info.users[allAddresses[i]].balance; uint256 supplyNow = info.totalSupply; uint256 dividends = (addressBalance * precision) / supplyNow; uint256 _toAdd = (dividends * new_address_supply) / precision; info.users[allAddresses[i]].balance += _toAdd; i += 1; } info.totalSupply = info.totalSupply + new_address_supply; } if(info.users[_from].balance == 0){ uint256 i = 0; while (i < allAddresses.length) { uint256 addressBalance = info.users[allAddresses[i]].balance; uint256 supplyNow = info.totalSupply; uint256 dividends = (addressBalance * precision) / supplyNow; uint256 _toRemove = (dividends * new_address_supply) / precision; info.users[allAddresses[i]].balance -= _toRemove; i += 1; } info.totalSupply = info.totalSupply - new_address_supply; } emit Transfer(_from, _to, _transferred); return _transferred; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"allInfoFor","outputs":[{"internalType":"uint256","name":"totalTokenSupply","type":"uint256"},{"internalType":"uint256","name":"userBalance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_tokens","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokens","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokens","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600380546001600160a01b03199081163390811790925560008054600181810183557f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563909101805490931684179092556103e891829055918252600260205260409091205561077a806100856000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806357f6b8121161007157806357f6b812146101d957806370a082311461021857806395d89b411461023e578063a9059cbb14610246578063dacc537014610272578063dd62ed3e146102ab576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b66102d9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b0381351690602001356102fa565b604080519115158252519081900360200190f35b610173610364565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b0381358116916020810135909116906040013561036a565b6101c36103e0565b6040805160ff9092168252519081900360200190f35b6101ff600480360360208110156101ef57600080fd5b50356001600160a01b03166103e5565b6040805192835260208301919091528051918290030190f35b6101736004803603602081101561022e57600080fd5b50356001600160a01b0316610402565b6100b661041d565b6101576004803603604081101561025c57600080fd5b506001600160a01b03813516906020013561043c565b61028f6004803603602081101561028857600080fd5b5035610453565b604080516001600160a01b039092168252519081900360200190f35b610173600480360360408110156102c157600080fd5b506001600160a01b038135811691602001351661047a565b6040518060400160405280600581526020016459696e657560d81b81525081565b3360008181526002602090815260408083206001600160a01b03871680855260019091018352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6001600160a01b038316600090815260026020908152604080832033845260010190915281205482111561039d57600080fd5b6001600160a01b03841660009081526002602090815260408083203384526001019091529020805483900390556103d58484846104a9565b506001949350505050565b600381565b6000806103f0610364565b6103f984610402565b91509150915091565b6001600160a01b031660009081526002602052604090205490565b604051806040016040528060038152602001622ca4a760e91b81525081565b60006104493384846104a9565b5060019392505050565b6000818154811061046057fe5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0391821660009081526002602090815260408083209390941682526001909201909152205490565b6000816104b585610402565b10156104c057600080fd5b6001600160a01b03808416600081815260026020526040808220805494891683529082208054879003905591905280548401905515828180156105035750600084115b1561061057600080546001810182558180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b0388161790555b60005481101561060457600060018001600080848154811061056f57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181205460015490925090816103e88402816105a857fe5b04905060006103e8808302049050806001800160008088815481106105c957fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020805490910190555050506001919091019050610551565b50600180546103e80190555b6001600160a01b0386166000908152600260205260409020546106f15760005b6000548110156106e457600060018001600080848154811061064e57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181205460015490925090816103e884028161068757fe5b04905060006103e8808302049050806001800160008088815481106106a857fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902080549190910390555050506001919091019050610630565b50600180546103e7190190555b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a39594505050505056fea265627a7a723158204dca773bf23f78419fbdc5381497b12b31f5bc0492ae36629b175ef4bb43391464736f6c634300050d0032
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806357f6b8121161007157806357f6b812146101d957806370a082311461021857806395d89b411461023e578063a9059cbb14610246578063dacc537014610272578063dd62ed3e146102ab576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b66102d9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b0381351690602001356102fa565b604080519115158252519081900360200190f35b610173610364565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b0381358116916020810135909116906040013561036a565b6101c36103e0565b6040805160ff9092168252519081900360200190f35b6101ff600480360360208110156101ef57600080fd5b50356001600160a01b03166103e5565b6040805192835260208301919091528051918290030190f35b6101736004803603602081101561022e57600080fd5b50356001600160a01b0316610402565b6100b661041d565b6101576004803603604081101561025c57600080fd5b506001600160a01b03813516906020013561043c565b61028f6004803603602081101561028857600080fd5b5035610453565b604080516001600160a01b039092168252519081900360200190f35b610173600480360360408110156102c157600080fd5b506001600160a01b038135811691602001351661047a565b6040518060400160405280600581526020016459696e657560d81b81525081565b3360008181526002602090815260408083206001600160a01b03871680855260019091018352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6001600160a01b038316600090815260026020908152604080832033845260010190915281205482111561039d57600080fd5b6001600160a01b03841660009081526002602090815260408083203384526001019091529020805483900390556103d58484846104a9565b506001949350505050565b600381565b6000806103f0610364565b6103f984610402565b91509150915091565b6001600160a01b031660009081526002602052604090205490565b604051806040016040528060038152602001622ca4a760e91b81525081565b60006104493384846104a9565b5060019392505050565b6000818154811061046057fe5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0391821660009081526002602090815260408083209390941682526001909201909152205490565b6000816104b585610402565b10156104c057600080fd5b6001600160a01b03808416600081815260026020526040808220805494891683529082208054879003905591905280548401905515828180156105035750600084115b1561061057600080546001810182558180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b0388161790555b60005481101561060457600060018001600080848154811061056f57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181205460015490925090816103e88402816105a857fe5b04905060006103e8808302049050806001800160008088815481106105c957fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020805490910190555050506001919091019050610551565b50600180546103e80190555b6001600160a01b0386166000908152600260205260409020546106f15760005b6000548110156106e457600060018001600080848154811061064e57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181205460015490925090816103e884028161068757fe5b04905060006103e8808302049050806001800160008088815481106106a857fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902080549190910390555050506001919091019050610630565b50600180546103e7190190555b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a39594505050505056fea265627a7a723158204dca773bf23f78419fbdc5381497b12b31f5bc0492ae36629b175ef4bb43391464736f6c634300050d0032
Deployed Bytecode Sourcemap
184:3652:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;184:3652:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;352:37;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;352:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1568:203;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1568:203:0;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;1066:86;;;:::i;:::-;;;;;;;;;;;;;;;;1914:266;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1914:266:0;;;;;;;;;;;;;;;;;:::i;434:34::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1409:153;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1409:153:0;-1:-1:-1;;;;;1409:153:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1157:106;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1157:106:0;-1:-1:-1;;;;;1157:106:0;;:::i;393:37::-;;;:::i;1776:133::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1776:133:0;;;;;;;;:::i;477:29::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;477:29:0;;:::i;:::-;;;;-1:-1:-1;;;;;477:29:0;;;;;;;;;;;;;;1268:136;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1268:136:0;;;;;;;;;;:::i;352:37::-;;;;;;;;;;;;;;-1:-1:-1;;;352:37:0;;;;:::o;1568:203::-;1660:10;1638:4;1649:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;1649:42:0;;;;;:4;:32;;;:42;;;;;:52;;;1711:39;;;;;;;1638:4;;1649:42;;1660:10;;1711:39;;;;;;;;-1:-1:-1;1762:4:0;1568:203;;;;:::o;1066:86::-;1131:4;:16;1066:86;:::o;1914:266::-;-1:-1:-1;;;;;2018:17:0;;1999:4;2018:17;;;:10;:17;;;;;;;;2046:10;2018:39;;:4;:27;:39;;;;;;:50;-1:-1:-1;2018:50:0;2010:59;;;;;;-1:-1:-1;;;;;2074:17:0;;;;;;:10;:17;;;;;;;;2102:10;2074:39;;:4;:27;:39;;;;;:50;;;;;;;2129:30;2085:5;2146:3;2117:7;2129:9;:30::i;:::-;-1:-1:-1;2171:4:0;;1914:266;-1:-1:-1;;;;1914:266:0:o;434:34::-;467:1;434:34;:::o;1409:153::-;1465:24;1491:19;1525:13;:11;:13::i;:::-;1540:16;1550:5;1540:9;:16::i;:::-;1517:40;;;;1409:153;;;:::o;1157:106::-;-1:-1:-1;;;;;1233:17:0;1212:7;1233:17;;;:10;:17;;;;;:25;;1157:106::o;393:37::-;;;;;;;;;;;;;;-1:-1:-1;;;393:37:0;;;;:::o;1776:133::-;1842:4;1853:35;1863:10;1875:3;1880:7;1853:9;:35::i;:::-;-1:-1:-1;1900:4:0;;1776:133;-1:-1:-1;;;1776:133:0:o;477:29::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;477:29:0;;-1:-1:-1;477:29:0;:::o;1268:136::-;-1:-1:-1;;;;;1362:17:0;;;1341:7;1362:17;;;:10;:17;;;;;;;;:37;;;;;;:4;:27;;;:37;;;;;;1268:136::o;2185:1648::-;2267:7;2309;2289:16;2299:5;2289:9;:16::i;:::-;:27;;2281:36;;;;;;-1:-1:-1;;;;;2345:15:0;;;2328:14;2345:15;;;:10;:15;;;;;;:23;;2385:17;;;;;;;;:36;;;;;;;2461:15;;;:39;;;;;;2345:28;2414:7;2345:28;2512:24;;;;;2535:1;2525:7;:11;2512:24;2509:620;;;2545:12;27:10:-1;;39:1;23:18;;45:23;;2545:22:0;;;;;;;-1:-1:-1;;;;;;2545:22:0;-1:-1:-1;;;;;2545:22:0;;;;;2607:432;2618:12;:19;2614:23;;2607:432;;;2658:22;2683:4;:10;;:27;2694:12;2707:1;2694:15;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2694:15:0;2683:27;;;;;;;;;;;;:35;2694:15;2757:16;2683:35;;-1:-1:-1;2757:16:0;;344:3;2813:26;;2757:16;2812:40;;;;;;-1:-1:-1;2871:14:0;344:3;2889:30;;;2888:44;2871:61;;2992:6;2953:4;:10;;:27;2964:12;2977:1;2964:15;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2964:15:0;2953:27;;;;;;;;;;;;:45;;;;;;;-1:-1:-1;;;2964:15:0;3017:6;;;;;-1:-1:-1;2607:432:0;;;-1:-1:-1;3086:4:0;:16;;300:3;3086:37;3067:56;;2509:620;-1:-1:-1;;;;;3140:17:0;;;;;;:10;:17;;;;;:25;3137:614;;3182:9;3210:451;3221:12;:19;3217:23;;3210:451;;;3261:22;3286:4;:10;;:27;3297:12;3310:1;3297:15;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3297:15:0;3286:27;;;;;;;;;;;;:35;3297:15;3360:16;3286:35;;-1:-1:-1;3360:16:0;;344:3;3416:26;;3360:16;3415:40;;;;;;-1:-1:-1;3474:17:0;344:3;3495:30;;;3494:44;3474:64;;3611:9;3572:4;:10;;:27;3583:12;3596:1;3583:15;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3583:15:0;3572:27;;;;;;;;;;;;:48;;;;;;;;-1:-1:-1;;;3583:15:0;3639:6;;;;;-1:-1:-1;3210:451:0;;;-1:-1:-1;3708:4:0;:16;;-1:-1:-1;;3708:37:0;3689:56;;3137:614;3780:3;-1:-1:-1;;;;;3764:34:0;3773:5;-1:-1:-1;;;;;3764:34:0;;3785:12;3764:34;;;;;;;;;;;;;;;;;;3816:12;2185:1648;-1:-1:-1;;;;;2185:1648:0:o
Swarm Source
bzzr://4dca773bf23f78419fbdc5381497b12b31f5bc0492ae36629b175ef4bb433914
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.