eth-erc20

ERC20 interface and example giftable token contract
Log | Files | Refs | LICENSE

commit 04cfd96dbb478d21592856c35f8293823403079d
parent c7b8ccfa622076789602a37bb6f29841c7cfc4d3
Author: lash <dev@holbrook.no>
Date:   Sat, 22 Jan 2022 11:56:07 +0000

Add static token contract

Diffstat:
Mpython/giftable_erc20_token/data/GiftableToken.bin | 4++--
Mpython/setup.cfg | 6+++++-
Apython/static_token/data/StaticToken.bin | 2++
Apython/static_token/data/StaticToken.json | 1+
Msolidity/GiftableToken.bin | 4++--
Msolidity/Makefile | 6+++++-
Asolidity/StaticToken.sol | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 93 insertions(+), 6 deletions(-)

diff --git a/python/giftable_erc20_token/data/GiftableToken.bin b/python/giftable_erc20_token/data/GiftableToken.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b506040516200194c3803806200194c833981810160405281019062000037919062000269565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600290805190602001906200008f92919062000124565b508160039080519060200190620000a892919062000124565b5080600460006101000a81548160ff021916908360ff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050620004ae565b8280546200013290620003a5565b90600052602060002090601f016020900481019282620001565760008555620001a2565b82601f106200017157805160ff1916838001178555620001a2565b82800160010185558215620001a2579182015b82811115620001a157825182559160200191906001019062000184565b5b509050620001b19190620001b5565b5090565b5b80821115620001d0576000816000905550600101620001b6565b5090565b6000620001eb620001e5846200032c565b62000303565b9050828152602081018484840111156200020a576200020962000474565b5b620002178482856200036f565b509392505050565b600082601f8301126200023757620002366200046f565b5b815162000249848260208601620001d4565b91505092915050565b600081519050620002638162000494565b92915050565b6000806000606084860312156200028557620002846200047e565b5b600084015167ffffffffffffffff811115620002a657620002a562000479565b5b620002b4868287016200021f565b935050602084015167ffffffffffffffff811115620002d857620002d762000479565b5b620002e6868287016200021f565b9250506040620002f98682870162000252565b9150509250925092565b60006200030f62000322565b90506200031d8282620003db565b919050565b6000604051905090565b600067ffffffffffffffff8211156200034a576200034962000440565b5b620003558262000483565b9050602081019050919050565b600060ff82169050919050565b60005b838110156200038f57808201518184015260208101905062000372565b838111156200039f576000848401525b50505050565b60006002820490506001821680620003be57607f821691505b60208210811415620003d557620003d462000411565b5b50919050565b620003e68262000483565b810181811067ffffffffffffffff8211171562000408576200040762000440565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b6200049f8162000362565b8114620004ab57600080fd5b50565b61148e80620004be6000396000f3fe608060405234801561001057600080fd5b5060043610610112576000357c010000000000000000000000000000000000000000000000000000000090048063449a52f8116100b4578063983b2d5611610083578063983b2d56146102cd578063a9059cbb146102fd578063dd62ed3e1461032d578063f2fde38b1461035d57610112565b8063449a52f81461023157806370a08231146102615780638da5cb5b1461029157806395d89b41146102af57610112565b806318160ddd116100f057806318160ddd1461019557806323b872dd146101b35780633092afd5146101e3578063313ce5671461021357610112565b806301ffc9a71461011757806306fdde0314610147578063095ea7b314610165575b600080fd5b610131600480360381019061012c91906110e3565b61038d565b60405161013e91906111a0565b60405180910390f35b61014f6104e5565b60405161015c91906111bb565b60405180910390f35b61017f600480360381019061017a91906110a3565b610573565b60405161018c91906111a0565b60405180910390f35b61019d6106f7565b6040516101aa91906111dd565b60405180910390f35b6101cd60048036038101906101c89190611050565b6106fd565b6040516101da91906111a0565b60405180910390f35b6101fd60048036038101906101f89190610fe3565b610a0f565b60405161020a91906111a0565b60405180910390f35b61021b610b01565b60405161022891906111f8565b60405180910390f35b61024b600480360381019061024691906110a3565b610b14565b60405161025891906111a0565b60405180910390f35b61027b60048036038101906102769190610fe3565b610c4a565b60405161028891906111dd565b60405180910390f35b610299610c62565b6040516102a69190611185565b60405180910390f35b6102b7610c86565b6040516102c491906111bb565b60405180910390f35b6102e760048036038101906102e29190610fe3565b610d14565b6040516102f491906111a0565b60405180910390f35b610317600480360381019061031291906110a3565b610dcf565b60405161032491906111a0565b60405180910390f35b61034760048036038101906103429190611010565b610f38565b60405161035491906111dd565b60405180910390f35b61037760048036038101906103729190610fe3565b610f5d565b60405161038491906111a0565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103e257600190506104e0565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561043557600190506104e0565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561048857600190506104e0565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104db57600190506104e0565b600090505b919050565b600280546104f29061136d565b80601f016020809104026020016040519081016040528092919081815260200182805461051e9061136d565b801561056b5780601f106105405761010080835404028352916020019161056b565b820191906000526020600020905b81548152906001019060200180831161054e57829003601f168201915b505050505081565b600080821115610607576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461060657600080fd5b5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516106e591906111dd565b60405180910390a36001905092915050565b60055481565b600081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561078857600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156107d457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461085c9190611285565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461092b9190611285565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610981919061122f565b925050819055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f5f7542858008eeb041631f30e6109ae94b83a58e9a58261dd2c42c508850f939856040516109fc91906111dd565b60405180910390a4600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a9757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610aa057600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600460009054906101000a900460ff1681565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b6c57600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bbb919061122f565b925050819055508160056000828254610bd4919061122f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f884604051610c3891906111dd565b60405180910390a36001905092915050565b60066020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054610c939061136d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbf9061136d565b8015610d0c5780601f10610ce157610100808354040283529160200191610d0c565b820191906000526020600020905b815481529060010190602001808311610cef57829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d6f57600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e1d57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e6c9190611285565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ec2919061122f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f2691906111dd565b60405180910390a36001905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600081359050610fb381611413565b92915050565b600081359050610fc88161142a565b92915050565b600081359050610fdd81611441565b92915050565b600060208284031215610ff957610ff86113fd565b5b600061100784828501610fa4565b91505092915050565b60008060408385031215611027576110266113fd565b5b600061103585828601610fa4565b925050602061104685828601610fa4565b9150509250929050565b600080600060608486031215611069576110686113fd565b5b600061107786828701610fa4565b935050602061108886828701610fa4565b925050604061109986828701610fce565b9150509250925092565b600080604083850312156110ba576110b96113fd565b5b60006110c885828601610fa4565b92505060206110d985828601610fce565b9150509250929050565b6000602082840312156110f9576110f86113fd565b5b600061110784828501610fb9565b91505092915050565b611119816112b9565b82525050565b611128816112cb565b82525050565b600061113982611213565b611143818561121e565b935061115381856020860161133a565b61115c81611402565b840191505092915050565b61117081611323565b82525050565b61117f8161132d565b82525050565b600060208201905061119a6000830184611110565b92915050565b60006020820190506111b5600083018461111f565b92915050565b600060208201905081810360008301526111d5818461112e565b905092915050565b60006020820190506111f26000830184611167565b92915050565b600060208201905061120d6000830184611176565b92915050565b600081519050919050565b600082825260208201905092915050565b600061123a82611323565b915061124583611323565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561127a5761127961139f565b5b828201905092915050565b600061129082611323565b915061129b83611323565b9250828210156112ae576112ad61139f565b5b828203905092915050565b60006112c482611303565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561135857808201518184015260208101905061133d565b83811115611367576000848401525b50505050565b6000600282049050600182168061138557607f821691505b60208210811415611399576113986113ce565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b61141c816112b9565b811461142757600080fd5b50565b611433816112d7565b811461143e57600080fd5b50565b61144a81611323565b811461145557600080fd5b5056fea2646970667358221220ce3898ff49c9441acd20afaa397803cf51558d659599f0063d9e51b92755610664736f6c63430008070033 -\ No newline at end of file +60806040523480156200001157600080fd5b506040516200194c3803806200194c8339818101604052810190620000379190620003af565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600290805190602001906200008f92919062000124565b508160039080519060200190620000a892919062000124565b5080600460006101000a81548160ff021916908360ff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050620004ae565b828054620001329062000478565b90600052602060002090601f016020900481019282620001565760008555620001a2565b82601f106200017157805160ff1916838001178555620001a2565b82800160010185558215620001a2579182015b82811115620001a157825182559160200191906001019062000184565b5b509050620001b19190620001b5565b5090565b5b80821115620001d0576000816000905550600101620001b6565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200023d82620001f2565b810181811067ffffffffffffffff821117156200025f576200025e62000203565b5b80604052505050565b600062000274620001d4565b905062000282828262000232565b919050565b600067ffffffffffffffff821115620002a557620002a462000203565b5b620002b082620001f2565b9050602081019050919050565b60005b83811015620002dd578082015181840152602081019050620002c0565b83811115620002ed576000848401525b50505050565b60006200030a620003048462000287565b62000268565b905082815260208101848484011115620003295762000328620001ed565b5b62000336848285620002bd565b509392505050565b600082601f830112620003565762000355620001e8565b5b815162000368848260208601620002f3565b91505092915050565b600060ff82169050919050565b620003898162000371565b81146200039557600080fd5b50565b600081519050620003a9816200037e565b92915050565b600080600060608486031215620003cb57620003ca620001de565b5b600084015167ffffffffffffffff811115620003ec57620003eb620001e3565b5b620003fa868287016200033e565b935050602084015167ffffffffffffffff8111156200041e576200041d620001e3565b5b6200042c868287016200033e565b92505060406200043f8682870162000398565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200049157607f821691505b60208210811415620004a857620004a762000449565b5b50919050565b61148e80620004be6000396000f3fe608060405234801561001057600080fd5b5060043610610112576000357c010000000000000000000000000000000000000000000000000000000090048063449a52f8116100b4578063983b2d5611610083578063983b2d56146102cd578063a9059cbb146102fd578063dd62ed3e1461032d578063f2fde38b1461035d57610112565b8063449a52f81461023157806370a08231146102615780638da5cb5b1461029157806395d89b41146102af57610112565b806318160ddd116100f057806318160ddd1461019557806323b872dd146101b35780633092afd5146101e3578063313ce5671461021357610112565b806301ffc9a71461011757806306fdde0314610147578063095ea7b314610165575b600080fd5b610131600480360381019061012c9190611001565b61038d565b60405161013e9190611049565b60405180910390f35b61014f6104e5565b60405161015c91906110fd565b60405180910390f35b61017f600480360381019061017a91906111b3565b610573565b60405161018c9190611049565b60405180910390f35b61019d6106f7565b6040516101aa9190611202565b60405180910390f35b6101cd60048036038101906101c8919061121d565b6106fd565b6040516101da9190611049565b60405180910390f35b6101fd60048036038101906101f89190611270565b610a0f565b60405161020a9190611049565b60405180910390f35b61021b610b01565b60405161022891906112b9565b60405180910390f35b61024b600480360381019061024691906111b3565b610b14565b6040516102589190611049565b60405180910390f35b61027b60048036038101906102769190611270565b610c4a565b6040516102889190611202565b60405180910390f35b610299610c62565b6040516102a691906112e3565b60405180910390f35b6102b7610c86565b6040516102c491906110fd565b60405180910390f35b6102e760048036038101906102e29190611270565b610d14565b6040516102f49190611049565b60405180910390f35b610317600480360381019061031291906111b3565b610dcf565b6040516103249190611049565b60405180910390f35b610347600480360381019061034291906112fe565b610f38565b6040516103549190611202565b60405180910390f35b61037760048036038101906103729190611270565b610f5d565b6040516103849190611049565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103e257600190506104e0565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561043557600190506104e0565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561048857600190506104e0565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104db57600190506104e0565b600090505b919050565b600280546104f29061136d565b80601f016020809104026020016040519081016040528092919081815260200182805461051e9061136d565b801561056b5780601f106105405761010080835404028352916020019161056b565b820191906000526020600020905b81548152906001019060200180831161054e57829003601f168201915b505050505081565b600080821115610607576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461060657600080fd5b5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516106e59190611202565b60405180910390a36001905092915050565b60055481565b600081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561078857600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156107d457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461085c91906113ce565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461092b91906113ce565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109819190611402565b925050819055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f5f7542858008eeb041631f30e6109ae94b83a58e9a58261dd2c42c508850f939856040516109fc9190611202565b60405180910390a4600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a9757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610aa057600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600460009054906101000a900460ff1681565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b6c57600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bbb9190611402565b925050819055508160056000828254610bd49190611402565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f884604051610c389190611202565b60405180910390a36001905092915050565b60066020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054610c939061136d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbf9061136d565b8015610d0c5780601f10610ce157610100808354040283529160200191610d0c565b820191906000526020600020905b815481529060010190602001808311610cef57829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d6f57600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e1d57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e6c91906113ce565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ec29190611402565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f269190611202565b60405180910390a36001905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610fde81610fa9565b8114610fe957600080fd5b50565b600081359050610ffb81610fd5565b92915050565b60006020828403121561101757611016610fa4565b5b600061102584828501610fec565b91505092915050565b60008115159050919050565b6110438161102e565b82525050565b600060208201905061105e600083018461103a565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561109e578082015181840152602081019050611083565b838111156110ad576000848401525b50505050565b6000601f19601f8301169050919050565b60006110cf82611064565b6110d9818561106f565b93506110e9818560208601611080565b6110f2816110b3565b840191505092915050565b6000602082019050818103600083015261111781846110c4565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061114a8261111f565b9050919050565b61115a8161113f565b811461116557600080fd5b50565b60008135905061117781611151565b92915050565b6000819050919050565b6111908161117d565b811461119b57600080fd5b50565b6000813590506111ad81611187565b92915050565b600080604083850312156111ca576111c9610fa4565b5b60006111d885828601611168565b92505060206111e98582860161119e565b9150509250929050565b6111fc8161117d565b82525050565b600060208201905061121760008301846111f3565b92915050565b60008060006060848603121561123657611235610fa4565b5b600061124486828701611168565b935050602061125586828701611168565b92505060406112668682870161119e565b9150509250925092565b60006020828403121561128657611285610fa4565b5b600061129484828501611168565b91505092915050565b600060ff82169050919050565b6112b38161129d565b82525050565b60006020820190506112ce60008301846112aa565b92915050565b6112dd8161113f565b82525050565b60006020820190506112f860008301846112d4565b92915050565b6000806040838503121561131557611314610fa4565b5b600061132385828601611168565b925050602061133485828601611168565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061138557607f821691505b602082108114156113995761139861133e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006113d98261117d565b91506113e48361117d565b9250828210156113f7576113f661139f565b5b828203905092915050565b600061140d8261117d565b91506114188361117d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561144d5761144c61139f565b5b82820190509291505056fea26469706673582212201d1f81f5f55b8b47abb964fadf5b1920ad49d753d4c3da588cb8dfa939de298564736f6c634300080b0033 +\ No newline at end of file diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-erc20 -version = 0.1.5 +version = 0.1.7 description = ERC20 interface and simple contract with deployment script that lets any address mint and gift itself tokens. author = Louis Holbrook author_email = dev@holbrook.no @@ -30,11 +30,14 @@ packages = eth_erc20 eth_erc20.data eth_erc20.runnable + static_token.data [options.package_data] * = data/GiftableToken.json data/GiftableToken.bin + data/StaticToken.json + data/StaticToken.bin data/ERC20.json [options.entry_points] @@ -44,3 +47,4 @@ console_scripts = giftable-token-minter = giftable_erc20_token.runnable.minter:main erc20-transfer = eth_erc20.runnable.transfer:main erc20-balance = eth_erc20.runnable.balance:main + erc20-info = eth_erc20.runnable.info:main diff --git a/python/static_token/data/StaticToken.bin b/python/static_token/data/StaticToken.bin @@ -0,0 +1 @@ +60806040523480156200001157600080fd5b506040516200146038038062001460833981810160405281019062000037919062000400565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600290805190602001906200008f9291906200013a565b508260039080519060200190620000a89291906200013a565b5081600460006101000a81548160ff021916908360ff1602179055508060058190555080600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050505062000515565b8280546200014890620004df565b90600052602060002090601f0160209004810192826200016c5760008555620001b8565b82601f106200018757805160ff1916838001178555620001b8565b82800160010185558215620001b8579182015b82811115620001b75782518255916020019190600101906200019a565b5b509050620001c79190620001cb565b5090565b5b80821115620001e6576000816000905550600101620001cc565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620002538262000208565b810181811067ffffffffffffffff8211171562000275576200027462000219565b5b80604052505050565b60006200028a620001ea565b905062000298828262000248565b919050565b600067ffffffffffffffff821115620002bb57620002ba62000219565b5b620002c68262000208565b9050602081019050919050565b60005b83811015620002f3578082015181840152602081019050620002d6565b8381111562000303576000848401525b50505050565b6000620003206200031a846200029d565b6200027e565b9050828152602081018484840111156200033f576200033e62000203565b5b6200034c848285620002d3565b509392505050565b600082601f8301126200036c576200036b620001fe565b5b81516200037e84826020860162000309565b91505092915050565b600060ff82169050919050565b6200039f8162000387565b8114620003ab57600080fd5b50565b600081519050620003bf8162000394565b92915050565b6000819050919050565b620003da81620003c5565b8114620003e657600080fd5b50565b600081519050620003fa81620003cf565b92915050565b600080600080608085870312156200041d576200041c620001f4565b5b600085015167ffffffffffffffff8111156200043e576200043d620001f9565b5b6200044c8782880162000354565b945050602085015167ffffffffffffffff81111562000470576200046f620001f9565b5b6200047e8782880162000354565b93505060406200049187828801620003ae565b9250506060620004a487828801620003e9565b91505092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620004f857607f821691505b602082108114156200050f576200050e620004b0565b5b50919050565b610f3b80620005256000396000f3fe608060405234801561001057600080fd5b50600436106100bb576000357c010000000000000000000000000000000000000000000000000000000090048063313ce56711610083578063313ce5671461018c57806370a08231146101aa57806395d89b41146101da578063a9059cbb146101f8578063dd62ed3e14610228576100bb565b806301ffc9a7146100c057806306fdde03146100f0578063095ea7b31461010e57806318160ddd1461013e57806323b872dd1461015c575b600080fd5b6100da60048036038101906100d59190610ad8565b610258565b6040516100e79190610b20565b60405180910390f35b6100f861030a565b6040516101059190610bd4565b60405180910390f35b61012860048036038101906101239190610c8a565b610398565b6040516101359190610b20565b60405180910390f35b61014661051c565b6040516101539190610cd9565b60405180910390f35b61017660048036038101906101719190610cf4565b610522565b6040516101839190610b20565b60405180910390f35b610194610834565b6040516101a19190610d63565b60405180910390f35b6101c460048036038101906101bf9190610d7e565b610847565b6040516101d19190610cd9565b60405180910390f35b6101e261085f565b6040516101ef9190610bd4565b60405180910390f35b610212600480360381019061020d9190610c8a565b6108ed565b60405161021f9190610b20565b60405180910390f35b610242600480360381019061023d9190610dab565b610a56565b60405161024f9190610cd9565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156102ad5760019050610305565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103005760019050610305565b600090505b919050565b6002805461031790610e1a565b80601f016020809104026020016040519081016040528092919081815260200182805461034390610e1a565b80156103905780601f1061036557610100808354040283529160200191610390565b820191906000526020600020905b81548152906001019060200180831161037357829003601f168201915b505050505081565b60008082111561042c576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461042b57600080fd5b5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161050a9190610cd9565b60405180910390a36001905092915050565b60055481565b600081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156105ad57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156105f957600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106819190610e7b565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107509190610e7b565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107a69190610eaf565b925050819055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f5f7542858008eeb041631f30e6109ae94b83a58e9a58261dd2c42c508850f939856040516108219190610cd9565b60405180910390a4600190509392505050565b600460009054906101000a900460ff1681565b60066020528060005260406000206000915090505481565b6003805461086c90610e1a565b80601f016020809104026020016040519081016040528092919081815260200182805461089890610e1a565b80156108e55780601f106108ba576101008083540402835291602001916108e5565b820191906000526020600020905b8154815290600101906020018083116108c857829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561093b57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461098a9190610e7b565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109e09190610eaf565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a449190610cd9565b60405180910390a36001905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610ab581610a80565b8114610ac057600080fd5b50565b600081359050610ad281610aac565b92915050565b600060208284031215610aee57610aed610a7b565b5b6000610afc84828501610ac3565b91505092915050565b60008115159050919050565b610b1a81610b05565b82525050565b6000602082019050610b356000830184610b11565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610b75578082015181840152602081019050610b5a565b83811115610b84576000848401525b50505050565b6000601f19601f8301169050919050565b6000610ba682610b3b565b610bb08185610b46565b9350610bc0818560208601610b57565b610bc981610b8a565b840191505092915050565b60006020820190508181036000830152610bee8184610b9b565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610c2182610bf6565b9050919050565b610c3181610c16565b8114610c3c57600080fd5b50565b600081359050610c4e81610c28565b92915050565b6000819050919050565b610c6781610c54565b8114610c7257600080fd5b50565b600081359050610c8481610c5e565b92915050565b60008060408385031215610ca157610ca0610a7b565b5b6000610caf85828601610c3f565b9250506020610cc085828601610c75565b9150509250929050565b610cd381610c54565b82525050565b6000602082019050610cee6000830184610cca565b92915050565b600080600060608486031215610d0d57610d0c610a7b565b5b6000610d1b86828701610c3f565b9350506020610d2c86828701610c3f565b9250506040610d3d86828701610c75565b9150509250925092565b600060ff82169050919050565b610d5d81610d47565b82525050565b6000602082019050610d786000830184610d54565b92915050565b600060208284031215610d9457610d93610a7b565b5b6000610da284828501610c3f565b91505092915050565b60008060408385031215610dc257610dc1610a7b565b5b6000610dd085828601610c3f565b9250506020610de185828601610c3f565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610e3257607f821691505b60208210811415610e4657610e45610deb565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610e8682610c54565b9150610e9183610c54565b925082821015610ea457610ea3610e4c565b5b828203905092915050565b6000610eba82610c54565b9150610ec583610c54565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610efa57610ef9610e4c565b5b82820190509291505056fea2646970667358221220dad499c8bdb28617c90c8400a1d456ed1f82f4a74fe3a294264a68af5b07667564736f6c634300080b0033 +\ No newline at end of file diff --git a/python/static_token/data/StaticToken.json b/python/static_token/data/StaticToken.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"uint256","name":"_supply","type":"uint256"}],"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":"_value","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":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"address","name":"_spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"TransferFrom","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/solidity/GiftableToken.bin b/solidity/GiftableToken.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b506040516200194c3803806200194c833981810160405281019062000037919062000269565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600290805190602001906200008f92919062000124565b508160039080519060200190620000a892919062000124565b5080600460006101000a81548160ff021916908360ff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050620004ae565b8280546200013290620003a5565b90600052602060002090601f016020900481019282620001565760008555620001a2565b82601f106200017157805160ff1916838001178555620001a2565b82800160010185558215620001a2579182015b82811115620001a157825182559160200191906001019062000184565b5b509050620001b19190620001b5565b5090565b5b80821115620001d0576000816000905550600101620001b6565b5090565b6000620001eb620001e5846200032c565b62000303565b9050828152602081018484840111156200020a576200020962000474565b5b620002178482856200036f565b509392505050565b600082601f8301126200023757620002366200046f565b5b815162000249848260208601620001d4565b91505092915050565b600081519050620002638162000494565b92915050565b6000806000606084860312156200028557620002846200047e565b5b600084015167ffffffffffffffff811115620002a657620002a562000479565b5b620002b4868287016200021f565b935050602084015167ffffffffffffffff811115620002d857620002d762000479565b5b620002e6868287016200021f565b9250506040620002f98682870162000252565b9150509250925092565b60006200030f62000322565b90506200031d8282620003db565b919050565b6000604051905090565b600067ffffffffffffffff8211156200034a576200034962000440565b5b620003558262000483565b9050602081019050919050565b600060ff82169050919050565b60005b838110156200038f57808201518184015260208101905062000372565b838111156200039f576000848401525b50505050565b60006002820490506001821680620003be57607f821691505b60208210811415620003d557620003d462000411565b5b50919050565b620003e68262000483565b810181811067ffffffffffffffff8211171562000408576200040762000440565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b6200049f8162000362565b8114620004ab57600080fd5b50565b61148e80620004be6000396000f3fe608060405234801561001057600080fd5b5060043610610112576000357c010000000000000000000000000000000000000000000000000000000090048063449a52f8116100b4578063983b2d5611610083578063983b2d56146102cd578063a9059cbb146102fd578063dd62ed3e1461032d578063f2fde38b1461035d57610112565b8063449a52f81461023157806370a08231146102615780638da5cb5b1461029157806395d89b41146102af57610112565b806318160ddd116100f057806318160ddd1461019557806323b872dd146101b35780633092afd5146101e3578063313ce5671461021357610112565b806301ffc9a71461011757806306fdde0314610147578063095ea7b314610165575b600080fd5b610131600480360381019061012c91906110e3565b61038d565b60405161013e91906111a0565b60405180910390f35b61014f6104e5565b60405161015c91906111bb565b60405180910390f35b61017f600480360381019061017a91906110a3565b610573565b60405161018c91906111a0565b60405180910390f35b61019d6106f7565b6040516101aa91906111dd565b60405180910390f35b6101cd60048036038101906101c89190611050565b6106fd565b6040516101da91906111a0565b60405180910390f35b6101fd60048036038101906101f89190610fe3565b610a0f565b60405161020a91906111a0565b60405180910390f35b61021b610b01565b60405161022891906111f8565b60405180910390f35b61024b600480360381019061024691906110a3565b610b14565b60405161025891906111a0565b60405180910390f35b61027b60048036038101906102769190610fe3565b610c4a565b60405161028891906111dd565b60405180910390f35b610299610c62565b6040516102a69190611185565b60405180910390f35b6102b7610c86565b6040516102c491906111bb565b60405180910390f35b6102e760048036038101906102e29190610fe3565b610d14565b6040516102f491906111a0565b60405180910390f35b610317600480360381019061031291906110a3565b610dcf565b60405161032491906111a0565b60405180910390f35b61034760048036038101906103429190611010565b610f38565b60405161035491906111dd565b60405180910390f35b61037760048036038101906103729190610fe3565b610f5d565b60405161038491906111a0565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103e257600190506104e0565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561043557600190506104e0565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561048857600190506104e0565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104db57600190506104e0565b600090505b919050565b600280546104f29061136d565b80601f016020809104026020016040519081016040528092919081815260200182805461051e9061136d565b801561056b5780601f106105405761010080835404028352916020019161056b565b820191906000526020600020905b81548152906001019060200180831161054e57829003601f168201915b505050505081565b600080821115610607576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461060657600080fd5b5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516106e591906111dd565b60405180910390a36001905092915050565b60055481565b600081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561078857600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156107d457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461085c9190611285565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461092b9190611285565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610981919061122f565b925050819055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f5f7542858008eeb041631f30e6109ae94b83a58e9a58261dd2c42c508850f939856040516109fc91906111dd565b60405180910390a4600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a9757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610aa057600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600460009054906101000a900460ff1681565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b6c57600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bbb919061122f565b925050819055508160056000828254610bd4919061122f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f884604051610c3891906111dd565b60405180910390a36001905092915050565b60066020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054610c939061136d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbf9061136d565b8015610d0c5780601f10610ce157610100808354040283529160200191610d0c565b820191906000526020600020905b815481529060010190602001808311610cef57829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d6f57600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e1d57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e6c9190611285565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ec2919061122f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f2691906111dd565b60405180910390a36001905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600081359050610fb381611413565b92915050565b600081359050610fc88161142a565b92915050565b600081359050610fdd81611441565b92915050565b600060208284031215610ff957610ff86113fd565b5b600061100784828501610fa4565b91505092915050565b60008060408385031215611027576110266113fd565b5b600061103585828601610fa4565b925050602061104685828601610fa4565b9150509250929050565b600080600060608486031215611069576110686113fd565b5b600061107786828701610fa4565b935050602061108886828701610fa4565b925050604061109986828701610fce565b9150509250925092565b600080604083850312156110ba576110b96113fd565b5b60006110c885828601610fa4565b92505060206110d985828601610fce565b9150509250929050565b6000602082840312156110f9576110f86113fd565b5b600061110784828501610fb9565b91505092915050565b611119816112b9565b82525050565b611128816112cb565b82525050565b600061113982611213565b611143818561121e565b935061115381856020860161133a565b61115c81611402565b840191505092915050565b61117081611323565b82525050565b61117f8161132d565b82525050565b600060208201905061119a6000830184611110565b92915050565b60006020820190506111b5600083018461111f565b92915050565b600060208201905081810360008301526111d5818461112e565b905092915050565b60006020820190506111f26000830184611167565b92915050565b600060208201905061120d6000830184611176565b92915050565b600081519050919050565b600082825260208201905092915050565b600061123a82611323565b915061124583611323565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561127a5761127961139f565b5b828201905092915050565b600061129082611323565b915061129b83611323565b9250828210156112ae576112ad61139f565b5b828203905092915050565b60006112c482611303565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561135857808201518184015260208101905061133d565b83811115611367576000848401525b50505050565b6000600282049050600182168061138557607f821691505b60208210811415611399576113986113ce565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b61141c816112b9565b811461142757600080fd5b50565b611433816112d7565b811461143e57600080fd5b50565b61144a81611323565b811461145557600080fd5b5056fea2646970667358221220ce3898ff49c9441acd20afaa397803cf51558d659599f0063d9e51b92755610664736f6c63430008070033 -\ No newline at end of file +60806040523480156200001157600080fd5b506040516200194c3803806200194c8339818101604052810190620000379190620003af565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600290805190602001906200008f92919062000124565b508160039080519060200190620000a892919062000124565b5080600460006101000a81548160ff021916908360ff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050620004ae565b828054620001329062000478565b90600052602060002090601f016020900481019282620001565760008555620001a2565b82601f106200017157805160ff1916838001178555620001a2565b82800160010185558215620001a2579182015b82811115620001a157825182559160200191906001019062000184565b5b509050620001b19190620001b5565b5090565b5b80821115620001d0576000816000905550600101620001b6565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200023d82620001f2565b810181811067ffffffffffffffff821117156200025f576200025e62000203565b5b80604052505050565b600062000274620001d4565b905062000282828262000232565b919050565b600067ffffffffffffffff821115620002a557620002a462000203565b5b620002b082620001f2565b9050602081019050919050565b60005b83811015620002dd578082015181840152602081019050620002c0565b83811115620002ed576000848401525b50505050565b60006200030a620003048462000287565b62000268565b905082815260208101848484011115620003295762000328620001ed565b5b62000336848285620002bd565b509392505050565b600082601f830112620003565762000355620001e8565b5b815162000368848260208601620002f3565b91505092915050565b600060ff82169050919050565b620003898162000371565b81146200039557600080fd5b50565b600081519050620003a9816200037e565b92915050565b600080600060608486031215620003cb57620003ca620001de565b5b600084015167ffffffffffffffff811115620003ec57620003eb620001e3565b5b620003fa868287016200033e565b935050602084015167ffffffffffffffff8111156200041e576200041d620001e3565b5b6200042c868287016200033e565b92505060406200043f8682870162000398565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200049157607f821691505b60208210811415620004a857620004a762000449565b5b50919050565b61148e80620004be6000396000f3fe608060405234801561001057600080fd5b5060043610610112576000357c010000000000000000000000000000000000000000000000000000000090048063449a52f8116100b4578063983b2d5611610083578063983b2d56146102cd578063a9059cbb146102fd578063dd62ed3e1461032d578063f2fde38b1461035d57610112565b8063449a52f81461023157806370a08231146102615780638da5cb5b1461029157806395d89b41146102af57610112565b806318160ddd116100f057806318160ddd1461019557806323b872dd146101b35780633092afd5146101e3578063313ce5671461021357610112565b806301ffc9a71461011757806306fdde0314610147578063095ea7b314610165575b600080fd5b610131600480360381019061012c9190611001565b61038d565b60405161013e9190611049565b60405180910390f35b61014f6104e5565b60405161015c91906110fd565b60405180910390f35b61017f600480360381019061017a91906111b3565b610573565b60405161018c9190611049565b60405180910390f35b61019d6106f7565b6040516101aa9190611202565b60405180910390f35b6101cd60048036038101906101c8919061121d565b6106fd565b6040516101da9190611049565b60405180910390f35b6101fd60048036038101906101f89190611270565b610a0f565b60405161020a9190611049565b60405180910390f35b61021b610b01565b60405161022891906112b9565b60405180910390f35b61024b600480360381019061024691906111b3565b610b14565b6040516102589190611049565b60405180910390f35b61027b60048036038101906102769190611270565b610c4a565b6040516102889190611202565b60405180910390f35b610299610c62565b6040516102a691906112e3565b60405180910390f35b6102b7610c86565b6040516102c491906110fd565b60405180910390f35b6102e760048036038101906102e29190611270565b610d14565b6040516102f49190611049565b60405180910390f35b610317600480360381019061031291906111b3565b610dcf565b6040516103249190611049565b60405180910390f35b610347600480360381019061034291906112fe565b610f38565b6040516103549190611202565b60405180910390f35b61037760048036038101906103729190611270565b610f5d565b6040516103849190611049565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103e257600190506104e0565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561043557600190506104e0565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561048857600190506104e0565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104db57600190506104e0565b600090505b919050565b600280546104f29061136d565b80601f016020809104026020016040519081016040528092919081815260200182805461051e9061136d565b801561056b5780601f106105405761010080835404028352916020019161056b565b820191906000526020600020905b81548152906001019060200180831161054e57829003601f168201915b505050505081565b600080821115610607576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461060657600080fd5b5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516106e59190611202565b60405180910390a36001905092915050565b60055481565b600081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561078857600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156107d457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461085c91906113ce565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461092b91906113ce565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109819190611402565b925050819055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f5f7542858008eeb041631f30e6109ae94b83a58e9a58261dd2c42c508850f939856040516109fc9190611202565b60405180910390a4600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a9757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610aa057600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600460009054906101000a900460ff1681565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b6c57600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610bbb9190611402565b925050819055508160056000828254610bd49190611402565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f884604051610c389190611202565b60405180910390a36001905092915050565b60066020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054610c939061136d565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbf9061136d565b8015610d0c5780601f10610ce157610100808354040283529160200191610d0c565b820191906000526020600020905b815481529060010190602001808311610cef57829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d6f57600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e1d57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e6c91906113ce565b9250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ec29190611402565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f269190611202565b60405180910390a36001905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610fde81610fa9565b8114610fe957600080fd5b50565b600081359050610ffb81610fd5565b92915050565b60006020828403121561101757611016610fa4565b5b600061102584828501610fec565b91505092915050565b60008115159050919050565b6110438161102e565b82525050565b600060208201905061105e600083018461103a565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561109e578082015181840152602081019050611083565b838111156110ad576000848401525b50505050565b6000601f19601f8301169050919050565b60006110cf82611064565b6110d9818561106f565b93506110e9818560208601611080565b6110f2816110b3565b840191505092915050565b6000602082019050818103600083015261111781846110c4565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061114a8261111f565b9050919050565b61115a8161113f565b811461116557600080fd5b50565b60008135905061117781611151565b92915050565b6000819050919050565b6111908161117d565b811461119b57600080fd5b50565b6000813590506111ad81611187565b92915050565b600080604083850312156111ca576111c9610fa4565b5b60006111d885828601611168565b92505060206111e98582860161119e565b9150509250929050565b6111fc8161117d565b82525050565b600060208201905061121760008301846111f3565b92915050565b60008060006060848603121561123657611235610fa4565b5b600061124486828701611168565b935050602061125586828701611168565b92505060406112668682870161119e565b9150509250925092565b60006020828403121561128657611285610fa4565b5b600061129484828501611168565b91505092915050565b600060ff82169050919050565b6112b38161129d565b82525050565b60006020820190506112ce60008301846112aa565b92915050565b6112dd8161113f565b82525050565b60006020820190506112f860008301846112d4565b92915050565b6000806040838503121561131557611314610fa4565b5b600061132385828601611168565b925050602061133485828601611168565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061138557607f821691505b602082108114156113995761139861133e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006113d98261117d565b91506113e48361117d565b9250828210156113f7576113f661139f565b5b828203905092915050565b600061140d8261117d565b91506114188361117d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561144d5761144c61139f565b5b82820190509291505056fea26469706673582212201d1f81f5f55b8b47abb964fadf5b1920ad49d753d4c3da588cb8dfa939de298564736f6c634300080b0033 +\ No newline at end of file diff --git a/solidity/Makefile b/solidity/Makefile @@ -4,7 +4,11 @@ all: $(SOLC) --bin GiftableToken.sol --evm-version byzantium | awk 'NR>3' > GiftableToken.bin truncate -s -1 GiftableToken.bin $(SOLC) --abi GiftableToken.sol --evm-version byzantium | awk 'NR>3' > GiftableToken.json + $(SOLC) --bin StaticToken.sol --evm-version byzantium | awk 'NR>3' > StaticToken.bin + truncate -s -1 StaticToken.bin + $(SOLC) --abi StaticToken.sol --evm-version byzantium | awk 'NR>3' > StaticToken.json install: all - cp -v *{json,bin} ../python/giftable_erc20_token/data/ + cp -v Giftable*{json,bin} ../python/giftable_erc20_token/data/ + cp -v Static*{json,bin} ../python/static_token/data/ diff --git a/solidity/StaticToken.sol b/solidity/StaticToken.sol @@ -0,0 +1,76 @@ +pragma solidity >0.6.11; + +// SPDX-License-Identifier: GPL-3.0-or-later + +contract StaticToken { + + address owner; + mapping(address => bool) minters; + + // Implements ERC20 + string public name; + // Implements ERC20 + string public symbol; + // Implements ERC20 + uint8 public decimals; + // Implements ERC20 + uint256 public totalSupply; + // Implements ERC20 + mapping (address => uint256) public balanceOf; + // Implements ERC20 + mapping (address => mapping (address => uint256)) public allowance; + + event Transfer(address indexed _from, address indexed _to, uint256 _value); + event TransferFrom(address indexed _from, address indexed _to, address indexed _spender, uint256 _value); + event Approval(address indexed _owner, address indexed _spender, uint256 _value); + + constructor(string memory _name, string memory _symbol, uint8 _decimals, uint256 _supply) public { + owner = msg.sender; + name = _name; + symbol = _symbol; + decimals = _decimals; + totalSupply = _supply; + balanceOf[owner] = _supply; + } + + // Implements ERC20 + function transfer(address _to, uint256 _value) public returns (bool) { + require(balanceOf[msg.sender] >= _value); + balanceOf[msg.sender] -= _value; + balanceOf[_to] += _value; + emit Transfer(msg.sender, _to, _value); + return true; + } + + // Implements ERC20 + function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { + require(allowance[_from][msg.sender] >= _value); + require(balanceOf[_from] >= _value); + allowance[_from][msg.sender] = allowance[_from][msg.sender] - _value; + balanceOf[_from] -= _value; + balanceOf[_to] += _value; + emit TransferFrom(_from, _to, msg.sender, _value); + return true; + } + + // Implements ERC20 + function approve(address _spender, uint256 _value) public returns (bool) { + if (_value > 0) { + require(allowance[msg.sender][_spender] == 0); + } + allowance[msg.sender][_spender] = _value; + emit Approval(msg.sender, _spender, _value); + return true; + } + + // Implements EIP165 + function supportsInterface(bytes4 _sum) public returns (bool) { + if (_sum == 0xc6bb4b70) { // ERC20 + return true; + } + if (_sum == 0x01ffc9a7) { // EIP165 + return true; + } + return false; + } +}