commit 5f69a1d7a12b4993fc5e9c33f9463534319f04d7
parent dd878aa5cd74a90965f3a605e7163de7b221ff02
Author: nolash <dev@holbrook.no>
Date: Mon, 7 Jun 2021 15:32:50 +0200
WIP avoid fractional truncation
Diffstat:
6 files changed, 75 insertions(+), 37 deletions(-)
diff --git a/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin b/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin
@@ -1 +1 @@
-60e06040523480156200001157600080fd5b50604051620032d9380380620032d983398181016040528101906200003791906200043f565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555086600690805190602001906200010a929190620002d8565b50856007908051906020019062000123929190620002d8565b508460ff166008819055504260038190555060035460808181525050603c836200014e919062000715565b60a08181525050620f42406d04ee2d6d415b85acef810000000062000174919062000715565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508360c081815250506000620001d96000620f42406000600162000272640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600a8190555082600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508560ff16600a6200025e9190620005d8565b600b8190555050505050505050506200095c565b60008073fffff00000000000000000000000000000000000608c60ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b828054620002e690620007f7565b90600052602060002090601f0160209004810192826200030a576000855562000356565b82601f106200032557805160ff191683800117855562000356565b8280016001018555821562000356579182015b828111156200035557825182559160200191906001019062000338565b5b50905062000365919062000369565b5090565b5b80821115620003845760008160009055506001016200036a565b5090565b60006200039f620003998462000547565b6200051e565b905082815260208101848484011115620003b857600080fd5b620003c5848285620007c1565b509392505050565b600081519050620003de816200090e565b92915050565b600082601f830112620003f657600080fd5b81516200040884826020860162000388565b91505092915050565b600081519050620004228162000928565b92915050565b600081519050620004398162000942565b92915050565b600080600080600080600060e0888a0312156200045b57600080fd5b600088015167ffffffffffffffff8111156200047657600080fd5b620004848a828b01620003e4565b975050602088015167ffffffffffffffff811115620004a257600080fd5b620004b08a828b01620003e4565b9650506040620004c38a828b0162000428565b9550506060620004d68a828b0162000411565b9450506080620004e98a828b0162000411565b93505060a0620004fc8a828b01620003cd565b92505060c06200050f8a828b0162000411565b91505092959891949750929550565b60006200052a6200053d565b90506200053882826200082d565b919050565b6000604051905090565b600067ffffffffffffffff821115620005655762000564620008c1565b5b6200057082620008f0565b9050602081019050919050565b6000808291508390505b6001851115620005cf57808604811115620005a757620005a662000863565b5b6001851615620005b75780820291505b8081029050620005c78562000901565b945062000587565b94509492505050565b6000620005e582620007aa565b9150620005f283620007aa565b9250620006217fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848462000629565b905092915050565b6000826200063b57600190506200070e565b816200064b57600090506200070e565b81600181146200066457600281146200066f57620006a5565b60019150506200070e565b60ff84111562000684576200068362000863565b5b8360020a9150848211156200069e576200069d62000863565b5b506200070e565b5060208310610133831016604e8410600b8410161715620006df5782820a905083811115620006d957620006d862000863565b5b6200070e565b620006ee84848460016200057d565b9250905081840481111562000708576200070762000863565b5b81810290505b9392505050565b60006200072282620007aa565b91506200072f83620007aa565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156200076b576200076a62000863565b5b828202905092915050565b600062000783826200078a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015620007e1578082015181840152602081019050620007c4565b83811115620007f1576000848401525b50505050565b600060028204905060018216806200081057607f821691505b6020821081141562000827576200082662000892565b5b50919050565b6200083882620008f0565b810181811067ffffffffffffffff821117156200085a5762000859620008c1565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6000600282049050919050565b620009198162000776565b81146200092557600080fd5b50565b6200093381620007aa565b81146200093f57600080fd5b50565b6200094d81620007b4565b81146200095957600080fd5b50565b60805160a05160c05161291c620009bd60003960008181610b9001528181610de1015261195b0152600081816110770152818161190901526119f60152600081816110a30152818161131801528181611a170152611a5c015261291c6000f3fe608060405234801561001057600080fd5b5060043610610244576000357c0100000000000000000000000000000000000000000000000000000000900480636787a9be1161014d57806395d89b41116100d5578063e3ab207a11610099578063e3ab207a1461073b578063e54d63f71461076b578063e80952951461079b578063eda4e6d6146107b9578063f2fde38b146107d757610244565b806395d89b411461066f578063983b2d561461068d5780639da7d8ba146106bd578063a9059cbb146106ed578063b470aade1461071d57610244565b8063731f237c1161011c578063731f237c146105d957806379ba5097146105f75780638da5cb5b146106155780638f1df6bc146106335780638f770ad01461065157610244565b80636787a9be146105195780636a2d094e146105495780636ffa8a051461057957806370a08231146105a957610244565b806331333487116101d057806347a505171161019f57806347a505171461044d5780634abfbba21461047d57806351b4541c146104ad578063573cc507146104dd57806358b2833b146104fb57610244565b8063313334871461039f578063313ce567146103cf57806340452d91146103ed578063449a52f81461041d57610244565b806318160ddd1161021757806318160ddd146102e55780631989c6a814610303578063229ba1971461032157806323b872dd1461033f5780633092afd51461036f57610244565b806301ffc9a71461024957806306fdde0314610279578063095ea7b31461029757806309f28f3c146102c7575b600080fd5b610263600480360381019061025e91906121c7565b610807565b6040516102709190612395565b60405180910390f35b6102816109b2565b60405161028e91906123cb565b60405180910390f35b6102b160048036038101906102ac9190612162565b610a40565b6040516102be9190612395565b60405180910390f35b6102cf610b5a565b6040516102dc919061244d565b60405180910390f35b6102ed610b7c565b6040516102fa9190612483565b60405180910390f35b61030b610b82565b6040516103189190612483565b60405180910390f35b610329610b8e565b6040516103369190612483565b60405180910390f35b61035960048036038101906103549190612113565b610bb2565b6040516103669190612395565b60405180910390f35b610389600480360381019061038491906120ea565b610cd2565b6040516103969190612395565b60405180910390f35b6103b960048036038101906103b49190612242565b610dc5565b6040516103c69190612483565b60405180910390f35b6103d7610e76565b6040516103e49190612483565b60405180910390f35b61040760048036038101906104029190612219565b610e7c565b60405161041491906123b0565b60405180910390f35b61043760048036038101906104329190612162565b610ea0565b6040516104449190612395565b60405180910390f35b610467600480360381019061046291906120ea565b61102a565b6040516104749190612483565b60405180910390f35b61049760048036038101906104929190612219565b611073565b6040516104a49190612483565b60405180910390f35b6104c760048036038101906104c29190612219565b6110d3565b6040516104d49190612483565b60405180910390f35b6104e56110f4565b6040516104f29190612483565b60405180910390f35b6105036110fa565b6040516105109190612483565b60405180910390f35b610533600480360381019061052e9190612219565b611100565b6040516105409190612483565b60405180910390f35b610563600480360381019061055e9190612219565b61116c565b6040516105709190612483565b60405180910390f35b610593600480360381019061058e919061219e565b61118d565b6040516105a09190612483565b60405180910390f35b6105c360048036038101906105be91906120ea565b6111c0565b6040516105d09190612483565b60405180910390f35b6105e1611269565b6040516105ee9190612395565b60405180910390f35b6105ff6113ab565b60405161060c9190612395565b60405180910390f35b61061d611552565b60405161062a919061237a565b60405180910390f35b61063b611578565b6040516106489190612395565b60405180910390f35b6106596116f4565b6040516106669190612483565b60405180910390f35b6106776116fa565b60405161068491906123cb565b60405180910390f35b6106a760048036038101906106a291906120ea565b611788565b6040516106b49190612395565b60405180910390f35b6106d760048036038101906106d2919061219e565b611845565b6040516106e49190612483565b60405180910390f35b61070760048036038101906107029190612162565b611871565b6040516107149190612395565b60405180910390f35b610725611907565b6040516107329190612483565b60405180910390f35b6107556004803603810190610750919061219e565b61192b565b6040516107629190612483565b60405180910390f35b61078560048036038101906107809190612242565b61193f565b6040516107929190612483565b60405180910390f35b6107a36119f0565b6040516107b0919061244d565b60405180910390f35b6107c1611a5a565b6040516107ce9190612483565b60405180910390f35b6107f160048036038101906107ec91906120ea565b611a7e565b6040516107fe9190612395565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561085c57600190506109ad565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156108af57600190506109ad565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561090257600190506109ad565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561095557600190506109ad565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109a857600190506109ad565b600090505b919050565b600680546109bf906126df565b80601f01602080910402602001604051908101604052809291908181526020018280546109eb906126df565b8015610a385780601f10610a0d57610100808354040283529160200191610a38565b820191906000526020600020905b815481529060010190602001808311610a1b57829003601f168201915b505050505081565b600080610a4b611578565b50610a5583611100565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ae391906124ba565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610b479190612483565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60095481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610bbf611578565b50610bc984611100565b915081600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610c5457600080fd5b610c5f868684611b20565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610cbe9190612483565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610d5b57503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610d6457600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000806000620f424091506d04ee2d6d415b85acef81000000007f0000000000000000000000000000000000000000000000000000000000000000610e0a9190612541565b905060005b84811015610e5157620f42408284610e279190612572565b610e319190612541565b83610e3c91906125cc565b92508080610e4990612711565b915050610e0f565b50620f42408583610e629190612572565b610e6c9190612541565b9250505092915050565b60085481565b60008181548110610e8c57600080fd5b906000526020600020016000915090505481565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f269061240d565b60405180910390fd5b600a5460095484610f4091906124ba565b1115610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f78906123ed565b60405180910390fd5b610f89611578565b508290508260096000828254610f9f91906124ba565b92505081905550610fb08482611b61565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f88560405161100e9190612483565b60405180910390a361101e611c26565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000826110a19190612572565b7f00000000000000000000000000000000000000000000000000000000000000006110cc91906124ba565b9050919050565b6000603c82426110e391906125cc565b6110ed9190612541565b9050919050565b600b5481565b60035481565b6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16620f42406d04ee2d6d415b85acef8100000000846111519190612572565b61115b9190612572565b6111659190612541565b9050919050565b6000603c824261117c91906125cc565b6111869190612541565b9050919050565b6000608c60ff1673fffff00000000000000000000000000000000000836001900416908060020a82049150509050919050565b6000806000806111cf8561102a565b92506111dc6003546110d3565b9050611218600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682610dc5565b6fffffffffffffffffffffffffffffffff169150620f42406d04ee2d6d415b85acef81000000006112499190612572565b82846112559190612572565b61125f9190612541565b9350505050919050565b600080600080600061127c6003546110d3565b925060008314156112945760009450505050506113a8565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1691506112d18284610dc5565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c836113169190612572565b7f000000000000000000000000000000000000000000000000000000000000000061134191906124ba565b6003819055508183427fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff166040516113979190612468565b60405180910390a460019450505050505b90565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461140857600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600061158e611d1e565b975060006001028814156115ad576000985050505050505050506116f1565b6115b68861192b565b95506001866115c591906124ba565b90506115d086611073565b91506115da611269565b50600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1694506116178261116c565b9250600083111561164c576d04ee2d6d415b85acef810000000061163b868561193f565b6116459190612541565b9350611669565b6d04ee2d6d415b85acef8100000000856116669190612541565b93505b61167860008560095484611e4e565b965060008790806001815401808255809150506001900390600052602060002001600090919091909150556116ac88611eb4565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d675816040516116dc9190612483565b60405180910390a16001985050505050505050505b90565b600a5481565b60078054611707906126df565b80601f0160208091040260200160405190810160405280929190818152602001828054611733906126df565b80156117805780601f1061175557610100808354040283529160200191611780565b820191906000526020600020905b81548152906001019060200180831161176357829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117e457600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b600080600061187e611578565b5061188884611100565b9150611895338684611b20565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040516118f49190612483565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600063ffffffff8260019004169050919050565b6000806000620f424091506d04ee2d6d415b85acef81000000007f00000000000000000000000000000000000000000000000000000000000000006119849190612541565b905060005b848110156119cb57620f424082846119a19190612572565b6119ab9190612541565b836119b691906124ba565b925080806119c390612711565b915050611989565b50620f424085836119dc9190612572565b6119e69190612541565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611a4191906125cc565b611a4b9190612541565b611a5591906124ba565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ada57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600080611b2d8584611f79565b50611b388484611b61565b50611b416119f0565b6fffffffffffffffffffffffffffffffff16905060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000851415611bbe5760009350505050611c20565b611bc78661102a565b92508483611bd591906124ba565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000611c38600954600161193f565b905060006001600080549050611c4e91906125cc565b81548110611c85577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611cd091906125cc565b81548110611d07577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555060019250505090565b6000806000806001600080549050611d3691906125cc565b81548110611d6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611ddc57600080fd5b505afa158015611df0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1491906121f0565b6fffffffffffffffffffffffffffffffff169050611e318261192b565b8111611e4557600060010292505050611e4b565b81925050505b90565b60008073fffff00000000000000000000000000000000000608c60ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b6000806000611ec284611845565b9150620f4240600260009054906101000a90046fffffffffffffffffffffffffffffffff16611ef19190612510565b6fffffffffffffffffffffffffffffffff166d04ee2d6d415b85acef8100000000611f1c91906125cc565b82611f279190612572565b9050611f6e600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166d04ee2d6d415b85acef810000000083611f699190612541565b611b61565b508092505050919050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000851415611fd6576000935050505061207b565b611fdf8661102a565b925084831015612024576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201b9061242d565b60405180910390fd5b848361203091906125cc565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b60008135905061209081612873565b92915050565b6000813590506120a58161288a565b92915050565b6000813590506120ba816128a1565b92915050565b6000815190506120cf816128b8565b92915050565b6000813590506120e4816128cf565b92915050565b6000602082840312156120fc57600080fd5b600061210a84828501612081565b91505092915050565b60008060006060848603121561212857600080fd5b600061213686828701612081565b935050602061214786828701612081565b9250506040612158868287016120d5565b9150509250925092565b6000806040838503121561217557600080fd5b600061218385828601612081565b9250506020612194858286016120d5565b9150509250929050565b6000602082840312156121b057600080fd5b60006121be84828501612096565b91505092915050565b6000602082840312156121d957600080fd5b60006121e7848285016120ab565b91505092915050565b60006020828403121561220257600080fd5b6000612210848285016120c0565b91505092915050565b60006020828403121561222b57600080fd5b6000612239848285016120d5565b91505092915050565b6000806040838503121561225557600080fd5b6000612263858286016120d5565b9250506020612274858286016120d5565b9150509250929050565b61228781612600565b82525050565b61229681612612565b82525050565b6122a58161261e565b82525050565b60006122b68261249e565b6122c081856124a9565b93506122d08185602086016126ac565b6122d9816127e7565b840191505092915050565b60006122f16007836124a9565b91506122fc826127f8565b602082019050919050565b6000612314600a836124a9565b915061231f82612821565b602082019050919050565b6000612337600d836124a9565b91506123428261284a565b602082019050919050565b61235681612654565b82525050565b6123658161269a565b82525050565b61237481612690565b82525050565b600060208201905061238f600083018461227e565b92915050565b60006020820190506123aa600083018461228d565b92915050565b60006020820190506123c5600083018461229c565b92915050565b600060208201905081810360008301526123e581846122ab565b905092915050565b60006020820190508181036000830152612406816122e4565b9050919050565b6000602082019050818103600083015261242681612307565b9050919050565b600060208201905081810360008301526124468161232a565b9050919050565b6000602082019050612462600083018461234d565b92915050565b600060208201905061247d600083018461235c565b92915050565b6000602082019050612498600083018461236b565b92915050565b600081519050919050565b600082825260208201905092915050565b60006124c582612690565b91506124d083612690565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125055761250461275a565b5b828201905092915050565b600061251b82612654565b915061252683612654565b92508261253657612535612789565b5b828204905092915050565b600061254c82612690565b915061255783612690565b92508261256757612566612789565b5b828204905092915050565b600061257d82612690565b915061258883612690565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125c1576125c061275a565b5b828202905092915050565b60006125d782612690565b91506125e283612690565b9250828210156125f5576125f461275a565b5b828203905092915050565b600061260b82612670565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006126a582612654565b9050919050565b60005b838110156126ca5780820151818401526020810190506126af565b838111156126d9576000848401525b50505050565b600060028204905060018216806126f757607f821691505b6020821081141561270b5761270a6127b8565b5b50919050565b600061271c82612690565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561274f5761274e61275a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f4552525f43415000000000000000000000000000000000000000000000000000600082015250565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b61287c81612600565b811461288757600080fd5b50565b6128938161261e565b811461289e57600080fd5b50565b6128aa81612628565b81146128b557600080fd5b50565b6128c181612654565b81146128cc57600080fd5b50565b6128d881612690565b81146128e357600080fd5b5056fea2646970667358221220df21498e73b8152705b34212597fc6d22bec4cff54111426c874c43e5fd2df6464736f6c63430008040033
-\ No newline at end of file
+60e06040523480156200001157600080fd5b50604051620032da380380620032da83398181016040528101906200003791906200043f565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555086600690805190602001906200010a929190620002d8565b50856007908051906020019062000123929190620002d8565b508460ff166008819055504260038190555060035460808181525050603c836200014e919062000715565b60a08181525050620f42406d04ee2d6d415b85acef810000000062000174919062000715565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508360c081815250506000620001d96000620f42406000600162000272640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600a8190555082600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508560ff16600a6200025e9190620005d8565b600b8190555050505050505050506200095c565b60008073fffff00000000000000000000000000000000000608c60ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b828054620002e690620007f7565b90600052602060002090601f0160209004810192826200030a576000855562000356565b82601f106200032557805160ff191683800117855562000356565b8280016001018555821562000356579182015b828111156200035557825182559160200191906001019062000338565b5b50905062000365919062000369565b5090565b5b80821115620003845760008160009055506001016200036a565b5090565b60006200039f620003998462000547565b6200051e565b905082815260208101848484011115620003b857600080fd5b620003c5848285620007c1565b509392505050565b600081519050620003de816200090e565b92915050565b600082601f830112620003f657600080fd5b81516200040884826020860162000388565b91505092915050565b600081519050620004228162000928565b92915050565b600081519050620004398162000942565b92915050565b600080600080600080600060e0888a0312156200045b57600080fd5b600088015167ffffffffffffffff8111156200047657600080fd5b620004848a828b01620003e4565b975050602088015167ffffffffffffffff811115620004a257600080fd5b620004b08a828b01620003e4565b9650506040620004c38a828b0162000428565b9550506060620004d68a828b0162000411565b9450506080620004e98a828b0162000411565b93505060a0620004fc8a828b01620003cd565b92505060c06200050f8a828b0162000411565b91505092959891949750929550565b60006200052a6200053d565b90506200053882826200082d565b919050565b6000604051905090565b600067ffffffffffffffff821115620005655762000564620008c1565b5b6200057082620008f0565b9050602081019050919050565b6000808291508390505b6001851115620005cf57808604811115620005a757620005a662000863565b5b6001851615620005b75780820291505b8081029050620005c78562000901565b945062000587565b94509492505050565b6000620005e582620007aa565b9150620005f283620007aa565b9250620006217fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848462000629565b905092915050565b6000826200063b57600190506200070e565b816200064b57600090506200070e565b81600181146200066457600281146200066f57620006a5565b60019150506200070e565b60ff84111562000684576200068362000863565b5b8360020a9150848211156200069e576200069d62000863565b5b506200070e565b5060208310610133831016604e8410600b8410161715620006df5782820a905083811115620006d957620006d862000863565b5b6200070e565b620006ee84848460016200057d565b9250905081840481111562000708576200070762000863565b5b81810290505b9392505050565b60006200072282620007aa565b91506200072f83620007aa565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156200076b576200076a62000863565b5b828202905092915050565b600062000783826200078a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015620007e1578082015181840152602081019050620007c4565b83811115620007f1576000848401525b50505050565b600060028204905060018216806200081057607f821691505b6020821081141562000827576200082662000892565b5b50919050565b6200083882620008f0565b810181811067ffffffffffffffff821117156200085a5762000859620008c1565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6000600282049050919050565b620009198162000776565b81146200092557600080fd5b50565b6200093381620007aa565b81146200093f57600080fd5b50565b6200094d81620007b4565b81146200095957600080fd5b50565b60805160a05160c051612924620009b660003960008181610bcb01528181610e1c01526119b50152600081816110b2015281816119630152611a500152600081816110de01528181611a710152611ab601526129246000f3fe608060405234801561001057600080fd5b506004361061024f576000357c0100000000000000000000000000000000000000000000000000000000900480636787a9be1161014d57806395d89b41116100d5578063e3ab207a11610099578063e3ab207a14610776578063e54d63f7146107a6578063e8095295146107d6578063eda4e6d6146107f4578063f2fde38b146108125761024f565b806395d89b41146106aa578063983b2d56146106c85780639da7d8ba146106f8578063a9059cbb14610728578063b470aade146107585761024f565b8063731f237c1161011c578063731f237c1461061457806379ba5097146106325780638da5cb5b146106505780638f1df6bc1461066e5780638f770ad01461068c5761024f565b80636787a9be146105545780636a2d094e146105845780636ffa8a05146105b457806370a08231146105e45761024f565b806331333487116101db5780634abfbba21161019f5780634abfbba21461048857806351b4541c146104b8578063573cc507146104e857806358b2833b146105065780636721d4ef146105245761024f565b806331333487146103aa578063313ce567146103da57806340452d91146103f8578063449a52f81461042857806347a50517146104585761024f565b806318160ddd1161022257806318160ddd146102f05780631989c6a81461030e578063229ba1971461032c57806323b872dd1461034a5780633092afd51461037a5761024f565b806301ffc9a71461025457806306fdde0314610284578063095ea7b3146102a257806309f28f3c146102d2575b600080fd5b61026e60048036038101906102699190612200565b610842565b60405161027b91906123ce565b60405180910390f35b61028c6109ed565b6040516102999190612404565b60405180910390f35b6102bc60048036038101906102b7919061219b565b610a7b565b6040516102c991906123ce565b60405180910390f35b6102da610b95565b6040516102e79190612486565b60405180910390f35b6102f8610bb7565b60405161030591906124bc565b60405180910390f35b610316610bbd565b60405161032391906124bc565b60405180910390f35b610334610bc9565b60405161034191906124bc565b60405180910390f35b610364600480360381019061035f919061214c565b610bed565b60405161037191906123ce565b60405180910390f35b610394600480360381019061038f9190612123565b610d0d565b6040516103a191906123ce565b60405180910390f35b6103c460048036038101906103bf919061227b565b610e00565b6040516103d191906124bc565b60405180910390f35b6103e2610eb1565b6040516103ef91906124bc565b60405180910390f35b610412600480360381019061040d9190612252565b610eb7565b60405161041f91906123e9565b60405180910390f35b610442600480360381019061043d919061219b565b610edb565b60405161044f91906123ce565b60405180910390f35b610472600480360381019061046d9190612123565b611065565b60405161047f91906124bc565b60405180910390f35b6104a2600480360381019061049d9190612252565b6110ae565b6040516104af91906124bc565b60405180910390f35b6104d260048036038101906104cd9190612252565b61110e565b6040516104df91906124bc565b60405180910390f35b6104f061112f565b6040516104fd91906124bc565b60405180910390f35b61050e611135565b60405161051b91906124bc565b60405180910390f35b61053e6004803603810190610539919061227b565b61113b565b60405161054b91906124bc565b60405180910390f35b61056e60048036038101906105699190612252565b611178565b60405161057b91906124bc565b60405180910390f35b61059e60048036038101906105999190612252565b6111e4565b6040516105ab91906124bc565b60405180910390f35b6105ce60048036038101906105c991906121d7565b611205565b6040516105db91906124bc565b60405180910390f35b6105fe60048036038101906105f99190612123565b611238565b60405161060b91906124bc565b60405180910390f35b61061c6112e1565b60405161062991906123ce565b60405180910390f35b61063a611405565b60405161064791906123ce565b60405180910390f35b6106586115ac565b60405161066591906123b3565b60405180910390f35b6106766115d2565b60405161068391906123ce565b60405180910390f35b61069461174e565b6040516106a191906124bc565b60405180910390f35b6106b2611754565b6040516106bf9190612404565b60405180910390f35b6106e260048036038101906106dd9190612123565b6117e2565b6040516106ef91906123ce565b60405180910390f35b610712600480360381019061070d91906121d7565b61189f565b60405161071f91906124bc565b60405180910390f35b610742600480360381019061073d919061219b565b6118cb565b60405161074f91906123ce565b60405180910390f35b610760611961565b60405161076d91906124bc565b60405180910390f35b610790600480360381019061078b91906121d7565b611985565b60405161079d91906124bc565b60405180910390f35b6107c060048036038101906107bb919061227b565b611999565b6040516107cd91906124bc565b60405180910390f35b6107de611a4a565b6040516107eb9190612486565b60405180910390f35b6107fc611ab4565b60405161080991906124bc565b60405180910390f35b61082c60048036038101906108279190612123565b611ad8565b60405161083991906123ce565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561089757600190506109e8565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156108ea57600190506109e8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561093d57600190506109e8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561099057600190506109e8565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109e357600190506109e8565b600090505b919050565b600680546109fa906126e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610a26906126e7565b8015610a735780601f10610a4857610100808354040283529160200191610a73565b820191906000526020600020905b815481529060010190602001808311610a5657829003601f168201915b505050505081565b600080610a866115d2565b50610a9083611178565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e91906124f3565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610b8291906124bc565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60095481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610bfa6115d2565b50610c0484611178565b915081600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610c8f57600080fd5b610c9a868684611b7a565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610cf991906124bc565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610d9657503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610d9f57600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000806000620f424091506d04ee2d6d415b85acef81000000007f0000000000000000000000000000000000000000000000000000000000000000610e459190612549565b905060005b84811015610e8c57620f42408284610e62919061257a565b610e6c9190612549565b83610e7791906125d4565b92508080610e8490612719565b915050610e4a565b50620f42408583610e9d919061257a565b610ea79190612549565b9250505092915050565b60085481565b60008181548110610ec757600080fd5b906000526020600020016000915090505481565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6190612446565b60405180910390fd5b600a5460095484610f7b91906124f3565b1115610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390612426565b60405180910390fd5b610fc46115d2565b508290508260096000828254610fda91906124f3565b92505081905550610feb8482611bbb565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f88560405161104991906124bc565b60405180910390a3611059611c80565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000826110dc919061257a565b7f000000000000000000000000000000000000000000000000000000000000000061110791906124f3565b9050919050565b6000603c824261111e91906125d4565b6111289190612549565b9050919050565b600b5481565b60035481565b6000620f42408261114c9190612549565b6d04ee2d6d415b85acef810000000061116591906125d4565b83611170919061257a565b905092915050565b6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16620f42406d04ee2d6d415b85acef8100000000846111c9919061257a565b6111d3919061257a565b6111dd9190612549565b9050919050565b6000603c82426111f491906125d4565b6111fe9190612549565b9050919050565b6000608c60ff1673fffff00000000000000000000000000000000000836001900416908060020a82049150509050919050565b60008060008061124785611065565b925061125460035461110e565b9050611290600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682610e00565b6fffffffffffffffffffffffffffffffff169150620f42406d04ee2d6d415b85acef81000000006112c1919061257a565b82846112cd919061257a565b6112d79190612549565b9350505050919050565b60008060008060006112f460035461110e565b9250600083141561130c576000945050505050611402565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1691506113498284610e00565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c8361138e919061257a565b60035461139b91906124f3565b6003819055508183427fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff166040516113f191906124a1565b60405180910390a460019450505050505b90565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461146257600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060008060008060006115e8611d78565b975060006001028814156116075760009850505050505050505061174b565b61161088611985565b955060018661161f91906124f3565b905061162a866110ae565b91506116346112e1565b50600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169450611671826111e4565b925060008311156116a6576d04ee2d6d415b85acef81000000006116958685611999565b61169f9190612549565b93506116c3565b6d04ee2d6d415b85acef8100000000856116c09190612549565b93505b6116d260008560095484611ea8565b9650600087908060018154018082558091505060019003906000526020600020016000909190919091505561170688611f0e565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d6758160405161173691906124bc565b60405180910390a16001985050505050505050505b90565b600a5481565b60078054611761906126e7565b80601f016020809104026020016040519081016040528092919081815260200182805461178d906126e7565b80156117da5780601f106117af576101008083540402835291602001916117da565b820191906000526020600020905b8154815290600101906020018083116117bd57829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461183e57600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b60008060006118d86115d2565b506118e284611178565b91506118ef338684611b7a565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161194e91906124bc565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600063ffffffff8260019004169050919050565b6000806000620f424091506d04ee2d6d415b85acef81000000007f00000000000000000000000000000000000000000000000000000000000000006119de9190612549565b905060005b84811015611a2557620f424082846119fb919061257a565b611a059190612549565b83611a1091906124f3565b92508080611a1d90612719565b9150506119e3565b50620f42408583611a36919061257a565b611a409190612549565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611a9b91906125d4565b611aa59190612549565b611aaf91906124f3565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b3457600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600080611b878584611fb2565b50611b928484611bbb565b50611b9b611a4a565b6fffffffffffffffffffffffffffffffff16905060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000851415611c185760009350505050611c7a565b611c2186611065565b92508483611c2f91906124f3565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000611c926009546001611999565b905060006001600080549050611ca891906125d4565b81548110611cdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611d2a91906125d4565b81548110611d61577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555060019250505090565b6000806000806001600080549050611d9091906125d4565b81548110611dc7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611e3657600080fd5b505afa158015611e4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6e9190612229565b6fffffffffffffffffffffffffffffffff169050611e8b82611985565b8111611e9f57600060010292505050611ea5565b81925050505b90565b60008073fffff00000000000000000000000000000000000608c60ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b6000806000611f1c8461189f565b9150611f5882600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661113b565b9050611fa7600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611fa26d04ee2d6d415b85acef810000000084611f9d9190612549565b611178565b611bbb565b508092505050919050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600085141561200f57600093505050506120b4565b61201886611065565b92508483101561205d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205490612466565b60405180910390fd5b848361206991906125d4565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000813590506120c98161287b565b92915050565b6000813590506120de81612892565b92915050565b6000813590506120f3816128a9565b92915050565b600081519050612108816128c0565b92915050565b60008135905061211d816128d7565b92915050565b60006020828403121561213557600080fd5b6000612143848285016120ba565b91505092915050565b60008060006060848603121561216157600080fd5b600061216f868287016120ba565b9350506020612180868287016120ba565b92505060406121918682870161210e565b9150509250925092565b600080604083850312156121ae57600080fd5b60006121bc858286016120ba565b92505060206121cd8582860161210e565b9150509250929050565b6000602082840312156121e957600080fd5b60006121f7848285016120cf565b91505092915050565b60006020828403121561221257600080fd5b6000612220848285016120e4565b91505092915050565b60006020828403121561223b57600080fd5b6000612249848285016120f9565b91505092915050565b60006020828403121561226457600080fd5b60006122728482850161210e565b91505092915050565b6000806040838503121561228e57600080fd5b600061229c8582860161210e565b92505060206122ad8582860161210e565b9150509250929050565b6122c081612608565b82525050565b6122cf8161261a565b82525050565b6122de81612626565b82525050565b60006122ef826124d7565b6122f981856124e2565b93506123098185602086016126b4565b612312816127ef565b840191505092915050565b600061232a6007836124e2565b915061233582612800565b602082019050919050565b600061234d600a836124e2565b915061235882612829565b602082019050919050565b6000612370600d836124e2565b915061237b82612852565b602082019050919050565b61238f8161265c565b82525050565b61239e816126a2565b82525050565b6123ad81612698565b82525050565b60006020820190506123c860008301846122b7565b92915050565b60006020820190506123e360008301846122c6565b92915050565b60006020820190506123fe60008301846122d5565b92915050565b6000602082019050818103600083015261241e81846122e4565b905092915050565b6000602082019050818103600083015261243f8161231d565b9050919050565b6000602082019050818103600083015261245f81612340565b9050919050565b6000602082019050818103600083015261247f81612363565b9050919050565b600060208201905061249b6000830184612386565b92915050565b60006020820190506124b66000830184612395565b92915050565b60006020820190506124d160008301846123a4565b92915050565b600081519050919050565b600082825260208201905092915050565b60006124fe82612698565b915061250983612698565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561253e5761253d612762565b5b828201905092915050565b600061255482612698565b915061255f83612698565b92508261256f5761256e612791565b5b828204905092915050565b600061258582612698565b915061259083612698565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125c9576125c8612762565b5b828202905092915050565b60006125df82612698565b91506125ea83612698565b9250828210156125fd576125fc612762565b5b828203905092915050565b600061261382612678565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006126ad8261265c565b9050919050565b60005b838110156126d25780820151818401526020810190506126b7565b838111156126e1576000848401525b50505050565b600060028204905060018216806126ff57607f821691505b60208210811415612713576127126127c0565b5b50919050565b600061272482612698565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561275757612756612762565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f4552525f43415000000000000000000000000000000000000000000000000000600082015250565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b61288481612608565b811461288f57600080fd5b50565b61289b81612626565b81146128a657600080fd5b50565b6128b281612630565b81146128bd57600080fd5b50565b6128c98161265c565b81146128d457600080fd5b50565b6128e081612698565b81146128eb57600080fd5b5056fea2646970667358221220dacc9738ac01a1784f9699c61cfc619c23340292871ca5a2ece3a59ee2e0c07e64736f6c63430008040033
+\ No newline at end of file
diff --git a/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.json b/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.json
@@ -1 +1 @@
-[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"uint256","name":"_taxLevelMinute","type":"uint256"},{"internalType":"uint256","name":"_periodMinutes","type":"uint256"},{"internalType":"address","name":"_defaultSinkAddress","type":"address"},{"internalType":"uint256","name":"_supplyCap","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":false,"internalType":"bytes32","name":"_foo","type":"bytes32"}],"name":"Debug","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_period","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_periodCount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_oldAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"Decayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_minter","type":"address"},{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_period","type":"uint256"}],"name":"Period","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":true,"internalType":"uint256","name":"_period","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Redistribution","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"},{"inputs":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"actualPeriod","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"addMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"applyDemurrage","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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":"_account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"baseBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changePeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"decayBy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"demurrageAmount","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_target","type":"uint256"}],"name":"demurrageCycles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"demurrageTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lastTimestamp","type":"uint256"}],"name":"getMinutesDelta","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_periodCount","type":"uint256"}],"name":"getPeriodTimeDelta","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"growBy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumParticipantSpend","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redistributionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"redistributions","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"removeMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supplyCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"taxLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"toBaseAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redistribution","type":"bytes32"}],"name":"toRedistributionDemurrageModifier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redistribution","type":"bytes32"}],"name":"toRedistributionPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redistribution","type":"bytes32"}],"name":"toRedistributionSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","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"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
+[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"uint256","name":"_taxLevelMinute","type":"uint256"},{"internalType":"uint256","name":"_periodMinutes","type":"uint256"},{"internalType":"address","name":"_defaultSinkAddress","type":"address"},{"internalType":"uint256","name":"_supplyCap","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":false,"internalType":"bytes32","name":"_foo","type":"bytes32"}],"name":"Debug","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_period","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_periodCount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_oldAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"Decayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_minter","type":"address"},{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_period","type":"uint256"}],"name":"Period","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":true,"internalType":"uint256","name":"_period","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Redistribution","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"},{"inputs":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"actualPeriod","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"addMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"applyDemurrage","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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":"_account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"baseBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"changePeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"decayBy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"demurrageAmount","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_target","type":"uint256"}],"name":"demurrageCycles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"demurrageTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_supply","type":"uint256"},{"internalType":"uint256","name":"_demurrageAmount","type":"uint256"}],"name":"getDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lastTimestamp","type":"uint256"}],"name":"getMinutesDelta","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_periodCount","type":"uint256"}],"name":"getPeriodTimeDelta","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"growBy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumParticipantSpend","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redistributionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"redistributions","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"removeMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supplyCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"taxLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"toBaseAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redistribution","type":"bytes32"}],"name":"toRedistributionDemurrageModifier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redistribution","type":"bytes32"}],"name":"toRedistributionPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"redistribution","type":"bytes32"}],"name":"toRedistributionSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","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"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
diff --git a/python/erc20_demurrage_token/sim/sim.py b/python/erc20_demurrage_token/sim/sim.py
@@ -65,7 +65,17 @@ class DemurrageTokenSimulation:
r = self.rpc.do(o)
if r['status'] != 1:
raise RuntimeError('failed gas transfer to account #{}: {} from {}'.format(i, address, self.accounts[idx]))
- logg.debug('added actor account #{}: {}'.format(i, address))
+ logg.info('added actor account #{}: {} block {}'.format(i, address, r['block_number']))
+
+ c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
+ (tx_hash, o) = c.constructor(self.accounts[0], settings, redistribute=redistribute, cap=cap)
+ self.rpc.do(o)
+ o = receipt(tx_hash)
+ r = self.rpc.do(o)
+ if (r['status'] != 1):
+ raise RuntimeError('contract deployment failed')
+ self.address = r['contract_address']
+ logg.info('deployed contract to {} block {}'.format(self.address, r['block_number']))
o = block_latest()
r = self.rpc.do(o)
@@ -76,25 +86,14 @@ class DemurrageTokenSimulation:
r = self.rpc.do(o)
self.last_timestamp = r['timestamp']
self.start_timestamp = self.last_timestamp
- nonce_oracle = RPCNonceOracle(self.accounts[0], conn=self.rpc)
-
- c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
- (tx_hash, o) = c.constructor(self.accounts[0], settings, redistribute=redistribute, cap=cap)
- self.rpc.do(o)
- o = receipt(tx_hash)
- r = self.rpc.do(o)
- if (r['status'] != 1):
- raise RuntimeError('contract deployment failed')
- self.address = r['contract_address']
+ nonce_oracle = RPCNonceOracle(self.accounts[0], conn=self.rpc)
o = c.decimals(self.address, sender_address=self.accounts[0])
r = self.rpc.do(o)
self.decimals = c.parse_decimals(r)
self.period_seconds = settings.period_minutes * 60
- self.last_block += 1
- self.last_timestamp += 1
self.period = 1
self.period_txs = []
self.period_tx_limit = self.period_seconds - 1
@@ -146,12 +145,15 @@ class DemurrageTokenSimulation:
def get_period(self):
- return self.period
+ o = self.caller_contract.actual_period(self.address, sender_address=self.caller_address)
+ r = self.rpc.do(o)
+ return self.caller_contract.parse_actual_period(r)
def get_demurrage(self):
o = self.caller_contract.demurrage_amount(self.address, sender_address=self.caller_address)
r = self.rpc.do(o)
+ logg.info('demrrage amount {}'.format(r))
return float(self.caller_contract.parse_demurrage_amount(r) / (10 ** 38))
@@ -218,21 +220,54 @@ class DemurrageTokenSimulation:
def next(self):
target_timestamp = self.start_timestamp + (self.period * self.period_seconds)
- logg.debug('warping to {}, {} from start'.format(target_timestamp, target_timestamp - self.start_timestamp))
+ logg.info('warping to {}, {} from start {}'.format(target_timestamp, target_timestamp - self.start_timestamp, self.start_timestamp))
self.last_timestamp = target_timestamp
- self.eth_helper.time_travel(self.last_timestamp)
- self.__next_block()
+ o = block_latest()
+ r = self.rpc.do(o)
+ self.last_block = r
+ o = block_by_number(r)
+ r = self.rpc.do(o)
+ cursor_timestamp = r['timestamp'] + 1
+
+ nonce_oracle = RPCNonceOracle(self.accounts[2], conn=self.rpc)
+ c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle, gas_oracle=self.gas_oracle)
+
+ i = 0
+ while cursor_timestamp < target_timestamp:
+ logg.info('mining block on {}'.format(cursor_timestamp))
+ (tx_hash, o) = c.apply_demurrage(self.address, self.accounts[2])
+ self.rpc.do(o)
+ self.eth_helper.time_travel(cursor_timestamp + 60)
+ self.__next_block()
+ o = receipt(tx_hash)
+ r = self.rpc.do(o)
+ if r['status'] == 0:
+ raise RuntimeError('demurrage fast-forward failed on step {} timestamp {} block timestamp {} target {}'.format(i, cursor_timestamp, target_timestamp))
+ cursor_timestamp += 60*60 # 1 hour
+ o = block_by_number(r['block_number'])
+ b = self.rpc.do(o)
+ logg.info('block mined on timestamp {} (delta {}) block number {}'.format(b['timestamp'], b['timestamp'] - self.start_timestamp, b['number']))
+ i += 1
+
+ (tx_hash, o) = c.apply_demurrage(self.address, self.accounts[2])
+ self.rpc.do(o)
+
+ nonce_oracle = RPCNonceOracle(self.accounts[3], conn=self.rpc)
+ c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle, gas_oracle=self.gas_oracle)
+ (tx_hash, o) = c.change_period(self.address, self.accounts[3])
+ self.rpc.do(o)
+ self.eth_helper.time_travel(target_timestamp + 1)
+ self.__next_block()
+
+ o = block_latest()
+ r = self.rpc.do(o)
o = block_by_number(self.last_block)
r = self.rpc.do(o)
self.last_block = r['number']
block_base = self.last_block
-
- nonce_oracle = RPCNonceOracle(self.accounts[2], conn=self.rpc)
- c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle, gas_oracle=self.gas_oracle)
- (tx_hash, o) = c.change_period(self.address, self.accounts[2])
- self.rpc.do(o)
+ logg.info('block before demurrage execution {} {}'.format(r['timestamp'], r['number']))
if self.redistribute:
for actor in self.actors:
diff --git a/python/examples/sim_noredistribute.py b/python/examples/sim_noredistribute.py
@@ -5,10 +5,10 @@ import logging
from erc20_demurrage_token import DemurrageTokenSettings
from erc20_demurrage_token.sim import DemurrageTokenSimulation
-logging.basicConfig(level=logging.WARNING)
+logging.basicConfig(level=logging.INFO)
logg = logging.getLogger()
-decay_per_minute = 0.000050105908373373 # equals approx 2% per month
+decay_per_minute = 0.00000050105908373373 # equals approx 2% per month
# parameters for simulation object
settings = DemurrageTokenSettings()
@@ -16,7 +16,8 @@ settings.name = 'Simulated Demurrage Token'
settings.symbol = 'SIM'
settings.decimals = 6
settings.demurrage_level = int(decay_per_minute*(10**38))
-settings.period_minutes = 1 # 1 week in minutes
+#settings.period_minutes = 1 # 1 week in minutes
+settings.period_minutes = 60*24*7*4
chain = 'evm:foochain:42'
cap = (10 ** 6) * (10 ** 12)
@@ -49,8 +50,8 @@ print('sink balance: demurraged {:>9d} base {:>9d}'.format(sim.balance(sim.sink
# get times
minutes = sim.get_minutes()
-start = sim.get_now()
-timestamp = sim.get_start()
+timestamp = sim.get_now()
+start = sim.get_start()
period = sim.get_period()
print('start {} now {} period {} minutes passed {}'.format(start, timestamp, period, minutes))
diff --git a/python/tests/test_redistribution_unit.py b/python/tests/test_redistribution_unit.py
@@ -138,7 +138,7 @@ class TestRedistribution(TestDemurrageUnit):
o = c.demurrage_amount(self.address, sender_address=self.accounts[0])
r = self.rpc.do(o)
demurrage = c.parse_demurrage_amount(r)
- logg.debug('\ndemurrage {}\nsupply {}'.format(demurrage, supply))
+ logg.debug('\nrediistribution {}\ndemurrage {}\nsupply {}'.format(redistribution, demurrage, supply))
expected_balance = int(supply * (self.tax_level / 1000000))
expected_balance_tolerance = 1
diff --git a/solidity/DemurrageTokenSingleCap.sol b/solidity/DemurrageTokenSingleCap.sol
@@ -270,15 +270,18 @@ contract DemurrageTokenSingleCap {
return lastRedistribution;
}
+ function getDistribution(uint256 _supply, uint256 _demurrageAmount) public view returns (uint256) {
+ return _supply * (ppmDivider - (_demurrageAmount / 1000000));
+ }
+
// Returns the amount sent to the sink address
function applyDefaultRedistribution(bytes32 _redistribution) private returns (uint256) {
uint256 redistributionSupply;
uint256 unit;
redistributionSupply = toRedistributionSupply(_redistribution);
- unit = redistributionSupply * (ppmDivider - (demurrageAmount / 1000000));
-
- increaseBaseBalance(sinkAddress, unit / ppmDivider);
+ unit = getDistribution(redistributionSupply, demurrageAmount);
+ increaseBaseBalance(sinkAddress, toBaseAmount(unit / ppmDivider));
return unit;
}
@@ -292,7 +295,6 @@ contract DemurrageTokenSingleCap {
uint128 epochPeriodCount;
uint256 periodCount;
uint256 lastDemurrageAmount;
- uint256 newDemurrageAmount;
//epochPeriodCount = actualPeriod();
//periodCount = epochPeriodCount - demurragePeriod;
@@ -304,8 +306,8 @@ contract DemurrageTokenSingleCap {
lastDemurrageAmount = demurrageAmount;
demurrageAmount = uint128(decayBy(lastDemurrageAmount, periodCount));
//demurragePeriod = epochPeriodCount;
- demurrageTimestamp = periodStart + (periodCount * 60);
- emit Decayed(block.timestamp, periodCount, lastDemurrageAmount, demurrageAmount);
+ demurrageTimestamp = demurrageTimestamp + (periodCount * 60);
+ emit Decayed(demurrageTimestamp, periodCount, lastDemurrageAmount, demurrageAmount);
return true;
}