From 4f1bd36c129e20ef73177a6961f78560bfafdbf2 Mon Sep 17 00:00:00 2001 From: lash Date: Thu, 5 Jan 2023 13:36:40 +0000 Subject: [PATCH] Add delta allowance, approve sets explicit value --- python/CHANGELOG | 4 +- .../data/DemurrageTokenSingleNocap.bin | 2 +- .../data/DemurrageTokenSingleNocap.json | 2 +- python/erc20_demurrage_token/token.py | 28 +++++++++++ python/setup.cfg | 2 +- python/tests/test_basic.py | 47 ++++++++++++++++++- solidity/DemurrageTokenSingleNocap.sol | 33 ++++++++++++- 7 files changed, 112 insertions(+), 6 deletions(-) diff --git a/python/CHANGELOG b/python/CHANGELOG index 3b61663..6735e2f 100644 --- a/python/CHANGELOG +++ b/python/CHANGELOG @@ -1,7 +1,9 @@ -- 0.1.2 +- 0.2.0 * Add token burn function * Fix gas leak when calculating decay on period change * Remove all but SingleNocap contract in make install + * Make approve explicitly set value + * Add increaseAllowance and decreaseAllowance methods - 0.1.1 * Settable demurrage steps for apply demurrage cli tool - 0.1.0 diff --git a/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.bin b/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.bin index 074389d..4b45ad8 100644 --- a/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.bin +++ b/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.bin @@ -1 +1 @@ -61010060405264e8d4a510006a52b7d2dcc80cd2e400000062000023919062000349565b6080908152503480156200003657600080fd5b50604051620038033803806200380383398181016040528101906200005c919062000648565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550856006908162000128919062000969565b5084600790816200013a919062000969565b508360ff166008819055504260038190555060035460a08181525050603c8262000165919062000349565b60c0818152505060646a52b7d2dcc80cd2e400000062000186919062000a50565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550826fffffffffffffffffffffffffffffffff1660e0818152505060006200022a6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660006001620002a3640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050505062000a96565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620003568262000310565b9150620003638362000310565b9250828202620003738162000310565b915082820484148315176200038d576200038c6200031a565b5b5092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620003fd82620003b2565b810181811067ffffffffffffffff821117156200041f576200041e620003c3565b5b80604052505050565b60006200043462000394565b9050620004428282620003f2565b919050565b600067ffffffffffffffff821115620004655762000464620003c3565b5b6200047082620003b2565b9050602081019050919050565b60005b838110156200049d57808201518184015260208101905062000480565b60008484015250505050565b6000620004c0620004ba8462000447565b62000428565b905082815260208101848484011115620004df57620004de620003ad565b5b620004ec8482856200047d565b509392505050565b600082601f8301126200050c576200050b620003a8565b5b81516200051e848260208601620004a9565b91505092915050565b600060ff82169050919050565b6200053f8162000527565b81146200054b57600080fd5b50565b6000815190506200055f8162000534565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6200058c8162000565565b81146200059857600080fd5b50565b600081519050620005ac8162000581565b92915050565b620005bd8162000310565b8114620005c957600080fd5b50565b600081519050620005dd81620005b2565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200061082620005e3565b9050919050565b620006228162000603565b81146200062e57600080fd5b50565b600081519050620006428162000617565b92915050565b60008060008060008060c087890312156200066857620006676200039e565b5b600087015167ffffffffffffffff811115620006895762000688620003a3565b5b6200069789828a01620004f4565b965050602087015167ffffffffffffffff811115620006bb57620006ba620003a3565b5b620006c989828a01620004f4565b9550506040620006dc89828a016200054e565b9450506060620006ef89828a016200059b565b93505060806200070289828a01620005cc565b92505060a06200071589828a0162000631565b9150509295509295509295565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200077557607f821691505b6020821081036200078b576200078a6200072d565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620007f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007b6565b620008048683620007b6565b95508019841693508086168417925050509392505050565b6000819050919050565b600062000847620008416200083b8462000310565b6200081c565b62000310565b9050919050565b6000819050919050565b620008638362000826565b6200087b62000872826200084e565b848454620007c6565b825550505050565b600090565b6200089262000883565b6200089f81848462000858565b505050565b5b81811015620008c757620008bb60008262000888565b600181019050620008a5565b5050565b601f8211156200091657620008e08162000791565b620008eb84620007a6565b81016020851015620008fb578190505b620009136200090a85620007a6565b830182620008a4565b50505b505050565b60008160020a8304905092915050565b60006200093e600019846008026200091b565b1980831691505092915050565b60006200095983836200092b565b9150826002028217905092915050565b620009748262000722565b67ffffffffffffffff81111562000990576200098f620003c3565b5b6200099c82546200075c565b620009a9828285620008cb565b600060209050601f831160018114620009e15760008415620009cc578287015190505b620009d885826200094b565b86555062000a48565b601f198416620009f18662000791565b60005b8281101562000a1b57848901518255600182019150602085019450602081019050620009f4565b8683101562000a3b578489015162000a37601f8916826200092b565b8355505b6001600288020188555050505b505050505050565b600062000a5d8262000565565b915062000a6a8362000565565b925082820262000a7a8162000565565b915080821462000a8f5762000a8e6200031a565b5b5092915050565b60805160a05160c05160e051612ced62000b1660003960008181610d7a01528181610fca0152611dd70152600081816113480152818161194401528181611c3e0152611e7601526000818161137401528181611e970152611edc0152600081816113e101528181611419015281816114910152611c1a0152612ced6000f3fe608060405234801561001057600080fd5b50600436106102b2576000357c010000000000000000000000000000000000000000000000000000000090048063731f237c11610184578063a9059cbb116100eb578063e3ab207a116100a4578063e3ab207a146108e9578063e54d63f714610919578063e809529514610949578063eda4e6d614610967578063f2fde38b14610985578063f83da35d146109b5576102b2565b8063a9059cbb14610811578063ab28cea014610841578063b470aade1461085f578063c0ab70771461087d578063d340ef8a146108ad578063d89135cd146108cb576102b2565b80638da5cb5b1161013d5780638da5cb5b1461073b5780638f0b2d5d146107595780638f1df6bc1461077557806395d89b4114610793578063983b2d56146107b15780639da7d8ba146107e1576102b2565b8063731f237c1461067557806373f425611461069357806374bedb95146106b157806379ba5097146106cf57806384dde4af146106ed5780638d34855a1461070b576102b2565b806340452d911161022857806358b2833b116101e157806358b2833b146105675780636721d4ef146105855780636787a9be146105b55780636a2d094e146105e55780636ffa8a051461061557806370a0823114610645576102b2565b806340452d911461045b57806342966c681461048b578063449a52f8146104a757806347a50517146104d75780634abfbba21461050757806351b4541c14610537576102b2565b80631989c6a81161027a5780631989c6a814610371578063229ba1971461038f57806323b872dd146103ad5780633092afd5146103dd578063313334871461040d578063313ce5671461043d576102b2565b806301ffc9a7146102b757806306fdde03146102e7578063095ea7b31461030557806309f28f3c1461033557806318160ddd14610353575b600080fd5b6102d160048036038101906102cc919061247f565b6109e5565b6040516102de91906124c7565b60405180910390f35b6102ef610b8b565b6040516102fc9190612572565b60405180910390f35b61031f600480360381019061031a9190612628565b610c19565b60405161032c91906124c7565b60405180910390f35b61033d610d33565b60405161034a9190612693565b60405180910390f35b61035b610d55565b60405161036891906126bd565b60405180910390f35b610379610d6c565b60405161038691906126bd565b60405180910390f35b610397610d78565b6040516103a491906126bd565b60405180910390f35b6103c760048036038101906103c291906126d8565b610d9c565b6040516103d491906124c7565b60405180910390f35b6103f760048036038101906103f2919061272b565b610ebc565b60405161040491906124c7565b60405180910390f35b61042760048036038101906104229190612758565b610faf565b60405161043491906126bd565b60405180910390f35b610445611063565b60405161045291906126bd565b60405180910390f35b61047560048036038101906104709190612798565b611069565b60405161048291906127de565b60405180910390f35b6104a560048036038101906104a09190612798565b61108d565b005b6104c160048036038101906104bc9190612628565b6111bb565b6040516104ce91906124c7565b60405180910390f35b6104f160048036038101906104ec919061272b565b6112fb565b6040516104fe91906126bd565b60405180910390f35b610521600480360381019061051c9190612798565b611344565b60405161052e91906126bd565b60405180910390f35b610551600480360381019061054c9190612798565b6113a4565b60405161055e91906126bd565b60405180910390f35b61056f6113c5565b60405161057c91906126bd565b60405180910390f35b61059f600480360381019061059a9190612758565b6113cb565b6040516105ac91906126bd565b60405180910390f35b6105cf60048036038101906105ca9190612798565b61144c565b6040516105dc91906126bd565b60405180910390f35b6105ff60048036038101906105fa9190612798565b6114cc565b60405161060c91906126bd565b60405180910390f35b61062f600480360381019061062a9190612825565b6114ed565b60405161063c91906126bd565b60405180910390f35b61065f600480360381019061065a919061272b565b611527565b60405161066c91906126bd565b60405180910390f35b61067d6115df565b60405161068a91906124c7565b60405180910390f35b61069b6115f0565b6040516106a891906126bd565b60405180910390f35b6106b96115f6565b6040516106c691906126bd565b60405180910390f35b6106d76115fc565b6040516106e491906124c7565b60405180910390f35b6106f56117a3565b6040516107029190612861565b60405180910390f35b61072560048036038101906107209190612825565b6117c9565b60405161073291906126bd565b60405180910390f35b6107436117f7565b6040516107509190612861565b60405180910390f35b610773600480360381019061076e919061272b565b61181d565b005b61077d6118bb565b60405161078a91906124c7565b60405180910390f35b61079b611a0b565b6040516107a89190612572565b60405180910390f35b6107cb60048036038101906107c6919061272b565b611a99565b6040516107d891906124c7565b60405180910390f35b6107fb60048036038101906107f69190612825565b611b56565b60405161080891906126bd565b60405180910390f35b61082b60048036038101906108269190612628565b611b82565b60405161083891906124c7565b60405180910390f35b610849611c18565b60405161085691906126bd565b60405180910390f35b610867611c3c565b60405161087491906126bd565b60405180910390f35b61089760048036038101906108929190612798565b611c60565b6040516108a491906124c7565b60405180910390f35b6108b5611d98565b6040516108c291906126bd565b60405180910390f35b6108d3611d9e565b6040516108e091906126bd565b60405180910390f35b61090360048036038101906108fe9190612825565b611da8565b60405161091091906126bd565b60405180910390f35b610933600480360381019061092e9190612758565b611dbc565b60405161094091906126bd565b60405180910390f35b610951611e70565b60405161095e9190612693565b60405180910390f35b61096f611eda565b60405161097c91906126bd565b60405180910390f35b61099f600480360381019061099a919061272b565b611efe565b6040516109ac91906124c7565b60405180910390f35b6109cf60048036038101906109ca919061287c565b611fa0565b6040516109dc91906127de565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610a395760019050610b86565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610a8b5760019050610b86565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610add5760019050610b86565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610b2f5760019050610b86565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610b815760019050610b86565b600090505b919050565b60068054610b9890612912565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc490612912565b8015610c115780601f10610be657610100808354040283529160200191610c11565b820191906000526020600020905b815481529060010190602001808311610bf457829003601f168201915b505050505081565b600080610c246118bb565b50610c2e8361144c565b905080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610cbc9190612972565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610d2091906126bd565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b6000600c54600954610d6791906129a6565b905090565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610da96118bb565b50610db38461144c565b915081600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e3e57600080fd5b610e4986868461200d565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610ea891906126bd565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f4557503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610f4e57600080fd5b6000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000610ff39190612a09565b905060005b8481101561103c5764e8d4a5100082846110129190612a3a565b61101c9190612a09565b8361102791906129a6565b9250808061103490612a7c565b915050610ff8565b5064e8d4a51000858361104f9190612a3a565b6110599190612a09565b9250505092915050565b60085481565b6000818154811061107957600080fd5b906000526020600020016000915090505481565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110e357600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561112f57600080fd5b600061113a8261144c565b90506111446115df565b5061114f3382612032565b5081600c60008282546111629190612972565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040516111af91906126bd565b60405180910390a25050565b600080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661124a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124190612b10565b60405180910390fd5b6112526118bb565b5061125c8361144c565b905082600960008282546112709190612972565b925050819055506112818482612139565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f8856040516112df91906126bd565b60405180910390a36112ef6121fd565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000826113729190612a3a565b7f000000000000000000000000000000000000000000000000000000000000000061139d9190612972565b9050919050565b6000603c82426113b491906129a6565b6113be9190612a09565b9050919050565b60035481565b6000806402540be400836113df9190612a3a565b7f000000000000000000000000000000000000000000000000000000000000000061140a91906129a6565b846114159190612a3a565b90507f0000000000000000000000000000000000000000000000000000000000000000816114439190612a09565b91505092915050565b60006402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff1661147d9190612b30565b6fffffffffffffffffffffffffffffffff167f0000000000000000000000000000000000000000000000000000000000000000836114bb9190612a3a565b6114c59190612a09565b9050919050565b6000603c82426114dc91906129a6565b6114e69190612a09565b9050919050565b6000606860ff167affffffffffffffffffffffffffff00000000000000000000000000836001900416908060020a82049150509050919050565b600080600080611536856112fb565b92506115436003546113a4565b905061158f6402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff166115779190612b30565b6fffffffffffffffffffffffffffffffff1682610faf565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e40000006115bf9190612a3a565b82846115cb9190612a3a565b6115d59190612a09565b9350505050919050565b60006115eb6000611c60565b905090565b600c5481565b600b5481565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461165957600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006117d784611b56565b91506117e2846114ed565b90506117ee82826113cb565b92505050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461187757600080fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008060008060008060006118d16115df565b506118da6122a4565b9750600060010288036118f857600098505050505050505050611a08565b6000600a548154811061190e5761190d612b6d565b5b9060005260206000200154935061192488611da8565b95506001866119339190612972565b905061193e846114ed565b9450603c7f000000000000000000000000000000000000000000000000000000000000000061196d9190612a09565b91506119798583610faf565b925061198f600084611989610d55565b84611fa0565b965060008790806001815401808255809150506001900390600052602060002001600090919091909150556119c387612390565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d675816040516119f391906126bd565b60405180910390a16001985050505050505050505b90565b60078054611a1890612912565b80601f0160208091040260200160405190810160405280929190818152602001828054611a4490612912565b8015611a915780601f10611a6657610100808354040283529160200191611a91565b820191906000526020600020905b815481529060010190602001808311611a7457829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611af557600080fd5b6001600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b6000806000611b8f6118bb565b50611b998461144c565b9150611ba633868461200d565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051611c0591906126bd565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000611c706003546113a4565b915060008203611c8557600092505050611d93565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050600084118015611cc757508184105b15611cd0578391505b611cda8183610faf565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c82611d1f9190612a3a565b600354611d2c9190612972565b60038190555080826003547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff16604051611d849190612bd7565b60405180910390a46001925050505b919050565b600a5481565b6000600c54905090565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000611e009190612a09565b905060005b84811015611e495764e8d4a510008284611e1f9190612a3a565b611e299190612a09565b83611e349190612972565b92508080611e4190612a7c565b915050611e05565b5064e8d4a510008583611e5c9190612a3a565b611e669190612a09565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611ec191906129a6565b611ecb9190612a09565b611ed59190612972565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f5a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b60008061201a8584612032565b506120258484612139565b5060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000850361208e5760009350505050612133565b612097866112fb565b9250848310156120dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d390612c3e565b60405180910390fd5b84836120e891906129a6565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000850361219557600093505050506121f7565b61219e866112fb565b925084836121ac9190612972565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b600080600061220a610d55565b90506000600160008054905061222091906129a6565b8154811061223157612230612b6d565b5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a0282179150816001026000600160008054905061227c91906129a6565b8154811061228d5761228c612b6d565b5b906000526020600020018190555060019250505090565b600080600080600a54815481106122be576122bd612b6d565b5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381865afa158015612332573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123569190612c8a565b6fffffffffffffffffffffffffffffffff16905061237382611da8565b81116123875760006001029250505061238d565b81925050505b90565b600080600061239e846117c9565b9150600b546123ac8361144c565b6123b691906129a6565b90506123e4600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682612139565b506001600a60008282546123f89190612972565b9250508190555080600b60008282546124119190612972565b925050819055508192505050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61245c81612427565b811461246757600080fd5b50565b60008135905061247981612453565b92915050565b60006020828403121561249557612494612422565b5b60006124a38482850161246a565b91505092915050565b60008115159050919050565b6124c1816124ac565b82525050565b60006020820190506124dc60008301846124b8565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561251c578082015181840152602081019050612501565b60008484015250505050565b6000601f19601f8301169050919050565b6000612544826124e2565b61254e81856124ed565b935061255e8185602086016124fe565b61256781612528565b840191505092915050565b6000602082019050818103600083015261258c8184612539565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006125bf82612594565b9050919050565b6125cf816125b4565b81146125da57600080fd5b50565b6000813590506125ec816125c6565b92915050565b6000819050919050565b612605816125f2565b811461261057600080fd5b50565b600081359050612622816125fc565b92915050565b6000806040838503121561263f5761263e612422565b5b600061264d858286016125dd565b925050602061265e85828601612613565b9150509250929050565b60006fffffffffffffffffffffffffffffffff82169050919050565b61268d81612668565b82525050565b60006020820190506126a86000830184612684565b92915050565b6126b7816125f2565b82525050565b60006020820190506126d260008301846126ae565b92915050565b6000806000606084860312156126f1576126f0612422565b5b60006126ff868287016125dd565b9350506020612710868287016125dd565b925050604061272186828701612613565b9150509250925092565b60006020828403121561274157612740612422565b5b600061274f848285016125dd565b91505092915050565b6000806040838503121561276f5761276e612422565b5b600061277d85828601612613565b925050602061278e85828601612613565b9150509250929050565b6000602082840312156127ae576127ad612422565b5b60006127bc84828501612613565b91505092915050565b6000819050919050565b6127d8816127c5565b82525050565b60006020820190506127f360008301846127cf565b92915050565b612802816127c5565b811461280d57600080fd5b50565b60008135905061281f816127f9565b92915050565b60006020828403121561283b5761283a612422565b5b600061284984828501612810565b91505092915050565b61285b816125b4565b82525050565b60006020820190506128766000830184612852565b92915050565b6000806000806080858703121561289657612895612422565b5b60006128a487828801612613565b94505060206128b587828801612613565b93505060406128c687828801612613565b92505060606128d787828801612613565b91505092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061292a57607f821691505b60208210810361293d5761293c6128e3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061297d826125f2565b9150612988836125f2565b92508282019050808211156129a05761299f612943565b5b92915050565b60006129b1826125f2565b91506129bc836125f2565b92508282039050818111156129d4576129d3612943565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612a14826125f2565b9150612a1f836125f2565b925082612a2f57612a2e6129da565b5b828204905092915050565b6000612a45826125f2565b9150612a50836125f2565b9250828202612a5e816125f2565b91508282048414831517612a7557612a74612943565b5b5092915050565b6000612a87826125f2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612ab957612ab8612943565b5b600182019050919050565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b6000612afa600a836124ed565b9150612b0582612ac4565b602082019050919050565b60006020820190508181036000830152612b2981612aed565b9050919050565b6000612b3b82612668565b9150612b4683612668565b9250828202612b5481612668565b9150808214612b6657612b65612943565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b6000612bc1612bbc612bb784612668565b612b9c565b6125f2565b9050919050565b612bd181612ba6565b82525050565b6000602082019050612bec6000830184612bc8565b92915050565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b6000612c28600d836124ed565b9150612c3382612bf2565b602082019050919050565b60006020820190508181036000830152612c5781612c1b565b9050919050565b612c6781612668565b8114612c7257600080fd5b50565b600081519050612c8481612c5e565b92915050565b600060208284031215612ca057612c9f612422565b5b6000612cae84828501612c75565b9150509291505056fea2646970667358221220561eb477cd9b849962919a2c765d0ccf0101559653841936793bb9567e44cb4464736f6c63430008110033 \ No newline at end of file +61010060405264e8d4a510006a52b7d2dcc80cd2e400000062000023919062000349565b6080908152503480156200003657600080fd5b5060405162003d6138038062003d6183398181016040528101906200005c919062000648565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550856006908162000128919062000969565b5084600790816200013a919062000969565b508360ff166008819055504260038190555060035460a08181525050603c8262000165919062000349565b60c0818152505060646a52b7d2dcc80cd2e400000062000186919062000a50565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550826fffffffffffffffffffffffffffffffff1660e0818152505060006200022a6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660006001620002a3640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050505062000a96565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620003568262000310565b9150620003638362000310565b9250828202620003738162000310565b915082820484148315176200038d576200038c6200031a565b5b5092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620003fd82620003b2565b810181811067ffffffffffffffff821117156200041f576200041e620003c3565b5b80604052505050565b60006200043462000394565b9050620004428282620003f2565b919050565b600067ffffffffffffffff821115620004655762000464620003c3565b5b6200047082620003b2565b9050602081019050919050565b60005b838110156200049d57808201518184015260208101905062000480565b60008484015250505050565b6000620004c0620004ba8462000447565b62000428565b905082815260208101848484011115620004df57620004de620003ad565b5b620004ec8482856200047d565b509392505050565b600082601f8301126200050c576200050b620003a8565b5b81516200051e848260208601620004a9565b91505092915050565b600060ff82169050919050565b6200053f8162000527565b81146200054b57600080fd5b50565b6000815190506200055f8162000534565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6200058c8162000565565b81146200059857600080fd5b50565b600081519050620005ac8162000581565b92915050565b620005bd8162000310565b8114620005c957600080fd5b50565b600081519050620005dd81620005b2565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200061082620005e3565b9050919050565b620006228162000603565b81146200062e57600080fd5b50565b600081519050620006428162000617565b92915050565b60008060008060008060c087890312156200066857620006676200039e565b5b600087015167ffffffffffffffff811115620006895762000688620003a3565b5b6200069789828a01620004f4565b965050602087015167ffffffffffffffff811115620006bb57620006ba620003a3565b5b620006c989828a01620004f4565b9550506040620006dc89828a016200054e565b9450506060620006ef89828a016200059b565b93505060806200070289828a01620005cc565b92505060a06200071589828a0162000631565b9150509295509295509295565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200077557607f821691505b6020821081036200078b576200078a6200072d565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620007f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007b6565b620008048683620007b6565b95508019841693508086168417925050509392505050565b6000819050919050565b600062000847620008416200083b8462000310565b6200081c565b62000310565b9050919050565b6000819050919050565b620008638362000826565b6200087b62000872826200084e565b848454620007c6565b825550505050565b600090565b6200089262000883565b6200089f81848462000858565b505050565b5b81811015620008c757620008bb60008262000888565b600181019050620008a5565b5050565b601f8211156200091657620008e08162000791565b620008eb84620007a6565b81016020851015620008fb578190505b620009136200090a85620007a6565b830182620008a4565b50505b505050565b60008160020a8304905092915050565b60006200093e600019846008026200091b565b1980831691505092915050565b60006200095983836200092b565b9150826002028217905092915050565b620009748262000722565b67ffffffffffffffff81111562000990576200098f620003c3565b5b6200099c82546200075c565b620009a9828285620008cb565b600060209050601f831160018114620009e15760008415620009cc578287015190505b620009d885826200094b565b86555062000a48565b601f198416620009f18662000791565b60005b8281101562000a1b57848901518255600182019150602085019450602081019050620009f4565b8683101562000a3b578489015162000a37601f8916826200092b565b8355505b6001600288020188555050505b505050505050565b600062000a5d8262000565565b915062000a6a8362000565565b925082820262000a7a8162000565565b915080821462000a8f5762000a8e6200031a565b5b5092915050565b60805160a05160c05160e05161324b62000b1660003960008181610eb70152818161110701526122c901526000818161161b01528181611c170152818161213001526123680152600081816116470152818161238901526123ce0152600081816116b4015281816116ec01528181611764015261210c015261324b6000f3fe608060405234801561001057600080fd5b50600436106102d8576000357c010000000000000000000000000000000000000000000000000000000090048063731f237c1161019f578063a457c2d711610106578063d89135cd116100bf578063e809529511610099578063e8095295146109cf578063eda4e6d6146109ed578063f2fde38b14610a0b578063f83da35d14610a3b576102d8565b8063d89135cd14610951578063e3ab207a1461096f578063e54d63f71461099f576102d8565b8063a457c2d714610867578063a9059cbb14610897578063ab28cea0146108c7578063b470aade146108e5578063c0ab707714610903578063d340ef8a14610933576102d8565b80638da5cb5b116101585780638da5cb5b146107915780638f0b2d5d146107af5780638f1df6bc146107cb57806395d89b41146107e9578063983b2d56146108075780639da7d8ba14610837576102d8565b8063731f237c146106cb57806373f42561146106e957806374bedb951461070757806379ba50971461072557806384dde4af146107435780638d34855a14610761576102d8565b806340452d911161024357806358b2833b116101fc57806358b2833b146105bd5780636721d4ef146105db5780636787a9be1461060b5780636a2d094e1461063b5780636ffa8a051461066b57806370a082311461069b576102d8565b806340452d91146104b157806342966c68146104e1578063449a52f8146104fd57806347a505171461052d5780634abfbba21461055d57806351b4541c1461058d576102d8565b8063229ba19711610295578063229ba197146103b557806323b872dd146103d35780633092afd5146104035780633133348714610433578063313ce567146104635780633950935114610481576102d8565b806301ffc9a7146102dd57806306fdde031461030d578063095ea7b31461032b57806309f28f3c1461035b57806318160ddd146103795780631989c6a814610397575b600080fd5b6102f760048036038101906102f29190612971565b610a6b565b60405161030491906129b9565b60405180910390f35b610315610c11565b6040516103229190612a64565b60405180910390f35b61034560048036038101906103409190612b1a565b610c9f565b60405161035291906129b9565b60405180910390f35b610363610e70565b6040516103709190612b85565b60405180910390f35b610381610e92565b60405161038e9190612baf565b60405180910390f35b61039f610ea9565b6040516103ac9190612baf565b60405180910390f35b6103bd610eb5565b6040516103ca9190612baf565b60405180910390f35b6103ed60048036038101906103e89190612bca565b610ed9565b6040516103fa91906129b9565b60405180910390f35b61041d60048036038101906104189190612c1d565b610ff9565b60405161042a91906129b9565b60405180910390f35b61044d60048036038101906104489190612c4a565b6110ec565b60405161045a9190612baf565b60405180910390f35b61046b6111a0565b6040516104789190612baf565b60405180910390f35b61049b60048036038101906104969190612b1a565b6111a6565b6040516104a891906129b9565b60405180910390f35b6104cb60048036038101906104c69190612c8a565b61133c565b6040516104d89190612cd0565b60405180910390f35b6104fb60048036038101906104f69190612c8a565b611360565b005b61051760048036038101906105129190612b1a565b61148e565b60405161052491906129b9565b60405180910390f35b61054760048036038101906105429190612c1d565b6115ce565b6040516105549190612baf565b60405180910390f35b61057760048036038101906105729190612c8a565b611617565b6040516105849190612baf565b60405180910390f35b6105a760048036038101906105a29190612c8a565b611677565b6040516105b49190612baf565b60405180910390f35b6105c5611698565b6040516105d29190612baf565b60405180910390f35b6105f560048036038101906105f09190612c4a565b61169e565b6040516106029190612baf565b60405180910390f35b61062560048036038101906106209190612c8a565b61171f565b6040516106329190612baf565b60405180910390f35b61065560048036038101906106509190612c8a565b61179f565b6040516106629190612baf565b60405180910390f35b61068560048036038101906106809190612d17565b6117c0565b6040516106929190612baf565b60405180910390f35b6106b560048036038101906106b09190612c1d565b6117fa565b6040516106c29190612baf565b60405180910390f35b6106d36118b2565b6040516106e091906129b9565b60405180910390f35b6106f16118c3565b6040516106fe9190612baf565b60405180910390f35b61070f6118c9565b60405161071c9190612baf565b60405180910390f35b61072d6118cf565b60405161073a91906129b9565b60405180910390f35b61074b611a76565b6040516107589190612d53565b60405180910390f35b61077b60048036038101906107769190612d17565b611a9c565b6040516107889190612baf565b60405180910390f35b610799611aca565b6040516107a69190612d53565b60405180910390f35b6107c960048036038101906107c49190612c1d565b611af0565b005b6107d3611b8e565b6040516107e091906129b9565b60405180910390f35b6107f1611cde565b6040516107fe9190612a64565b60405180910390f35b610821600480360381019061081c9190612c1d565b611d6c565b60405161082e91906129b9565b60405180910390f35b610851600480360381019061084c9190612d17565b611e29565b60405161085e9190612baf565b60405180910390f35b610881600480360381019061087c9190612b1a565b611e55565b60405161088e91906129b9565b60405180910390f35b6108b160048036038101906108ac9190612b1a565b612074565b6040516108be91906129b9565b60405180910390f35b6108cf61210a565b6040516108dc9190612baf565b60405180910390f35b6108ed61212e565b6040516108fa9190612baf565b60405180910390f35b61091d60048036038101906109189190612c8a565b612152565b60405161092a91906129b9565b60405180910390f35b61093b61228a565b6040516109489190612baf565b60405180910390f35b610959612290565b6040516109669190612baf565b60405180910390f35b61098960048036038101906109849190612d17565b61229a565b6040516109969190612baf565b60405180910390f35b6109b960048036038101906109b49190612c4a565b6122ae565b6040516109c69190612baf565b60405180910390f35b6109d7612362565b6040516109e49190612b85565b60405180910390f35b6109f56123cc565b604051610a029190612baf565b60405180910390f35b610a256004803603810190610a209190612c1d565b6123f0565b604051610a3291906129b9565b60405180910390f35b610a556004803603810190610a509190612d6e565b612492565b604051610a629190612cd0565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610abf5760019050610c0c565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610b115760019050610c0c565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610b635760019050610c0c565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610bb55760019050610c0c565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610c075760019050610c0c565b600090505b919050565b60068054610c1e90612e04565b80601f0160208091040260200160405190810160405280929190818152602001828054610c4a90612e04565b8015610c975780601f10610c6c57610100808354040283529160200191610c97565b820191906000526020600020905b815481529060010190602001808311610c7a57829003601f168201915b505050505081565b6000806000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610d6b5760008314610d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6190612e81565b60405180910390fd5b5b610d73611b8e565b50610d7d8361171f565b905080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610e5d9190612baf565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b6000600c54600954610ea49190612ed0565b905090565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610ee6611b8e565b50610ef08461171f565b915081600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610f7b57600080fd5b610f868686846124ff565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610fe59190612baf565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061108257503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b61108b57600080fd5b6000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f00000000000000000000000000000000000000000000000000000000000000006111309190612f33565b905060005b848110156111795764e8d4a51000828461114f9190612f64565b6111599190612f33565b836111649190612ed0565b9250808061117190612fa6565b915050611135565b5064e8d4a51000858361118c9190612f64565b6111969190612f33565b9250505092915050565b60085481565b6000806111b1611b8e565b506111bb8361171f565b905080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112499190612fee565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040516113299190612baf565b60405180910390a3600191505092915050565b6000818154811061134c57600080fd5b906000526020600020016000915090505481565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166113b657600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561140257600080fd5b600061140d8261171f565b90506114176118b2565b506114223382612524565b5081600c60008282546114359190612fee565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040516114829190612baf565b60405180910390a25050565b600080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661151d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115149061306e565b60405180910390fd5b611525611b8e565b5061152f8361171f565b905082600960008282546115439190612fee565b92505081905550611554848261262b565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f8856040516115b29190612baf565b60405180910390a36115c26126ef565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000826116459190612f64565b7f00000000000000000000000000000000000000000000000000000000000000006116709190612fee565b9050919050565b6000603c82426116879190612ed0565b6116919190612f33565b9050919050565b60035481565b6000806402540be400836116b29190612f64565b7f00000000000000000000000000000000000000000000000000000000000000006116dd9190612ed0565b846116e89190612f64565b90507f0000000000000000000000000000000000000000000000000000000000000000816117169190612f33565b91505092915050565b60006402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff16611750919061308e565b6fffffffffffffffffffffffffffffffff167f00000000000000000000000000000000000000000000000000000000000000008361178e9190612f64565b6117989190612f33565b9050919050565b6000603c82426117af9190612ed0565b6117b99190612f33565b9050919050565b6000606860ff167affffffffffffffffffffffffffff00000000000000000000000000836001900416908060020a82049150509050919050565b600080600080611809856115ce565b9250611816600354611677565b90506118626402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff1661184a919061308e565b6fffffffffffffffffffffffffffffffff16826110ec565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e40000006118929190612f64565b828461189e9190612f64565b6118a89190612f33565b9350505050919050565b60006118be6000612152565b905090565b600c5481565b600b5481565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461192c57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000611aaa84611e29565b9150611ab5846117c0565b9050611ac1828261169e565b92505050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b4a57600080fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000806000806000806000611ba46118b2565b50611bad612796565b975060006001028803611bcb57600098505050505050505050611cdb565b6000600a5481548110611be157611be06130cb565b5b90600052602060002001549350611bf78861229a565b9550600186611c069190612fee565b9050611c11846117c0565b9450603c7f0000000000000000000000000000000000000000000000000000000000000000611c409190612f33565b9150611c4c85836110ec565b9250611c62600084611c5c610e92565b84612492565b96506000879080600181540180825580915050600190039060005260206000200160009091909190915055611c9687612882565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d67581604051611cc69190612baf565b60405180910390a16001985050505050505050505b90565b60078054611ceb90612e04565b80601f0160208091040260200160405190810160405280929190818152602001828054611d1790612e04565b8015611d645780601f10611d3957610100808354040283529160200191611d64565b820191906000526020600020905b815481529060010190602001808311611d4757829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611dc857600080fd5b6001600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b600080611e618361171f565b905080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611eec57600080fd5b611ef4611b8e565b5080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611f819190612ed0565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040516120619190612baf565b60405180910390a3600191505092915050565b6000806000612081611b8e565b5061208b8461171f565b91506120983386846124ff565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040516120f79190612baf565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000612162600354611677565b91506000820361217757600092505050612285565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1690506000841180156121b957508184105b156121c2578391505b6121cc81836110ec565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c826122119190612f64565b60035461221e9190612fee565b60038190555080826003547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff166040516122769190613135565b60405180910390a46001925050505b919050565b600a5481565b6000600c54905090565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f00000000000000000000000000000000000000000000000000000000000000006122f29190612f33565b905060005b8481101561233b5764e8d4a5100082846123119190612f64565b61231b9190612f33565b836123269190612fee565b9250808061233390612fa6565b9150506122f7565b5064e8d4a51000858361234e9190612f64565b6123589190612f33565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000426123b39190612ed0565b6123bd9190612f33565b6123c79190612fee565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461244c57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b60008061250c8584612524565b50612517848461262b565b5060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600085036125805760009350505050612625565b612589866115ce565b9250848310156125ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c59061319c565b60405180910390fd5b84836125da9190612ed0565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000850361268757600093505050506126e9565b612690866115ce565b9250848361269e9190612fee565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b60008060006126fc610e92565b9050600060016000805490506127129190612ed0565b81548110612723576127226130cb565b5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a0282179150816001026000600160008054905061276e9190612ed0565b8154811061277f5761277e6130cb565b5b906000526020600020018190555060019250505090565b600080600080600a54815481106127b0576127af6130cb565b5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381865afa158015612824573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061284891906131e8565b6fffffffffffffffffffffffffffffffff1690506128658261229a565b81116128795760006001029250505061287f565b81925050505b90565b600080600061289084611a9c565b9150600b5461289e8361171f565b6128a89190612ed0565b90506128d6600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168261262b565b506001600a60008282546128ea9190612fee565b9250508190555080600b60008282546129039190612fee565b925050819055508192505050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61294e81612919565b811461295957600080fd5b50565b60008135905061296b81612945565b92915050565b60006020828403121561298757612986612914565b5b60006129958482850161295c565b91505092915050565b60008115159050919050565b6129b38161299e565b82525050565b60006020820190506129ce60008301846129aa565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612a0e5780820151818401526020810190506129f3565b60008484015250505050565b6000601f19601f8301169050919050565b6000612a36826129d4565b612a4081856129df565b9350612a508185602086016129f0565b612a5981612a1a565b840191505092915050565b60006020820190508181036000830152612a7e8184612a2b565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ab182612a86565b9050919050565b612ac181612aa6565b8114612acc57600080fd5b50565b600081359050612ade81612ab8565b92915050565b6000819050919050565b612af781612ae4565b8114612b0257600080fd5b50565b600081359050612b1481612aee565b92915050565b60008060408385031215612b3157612b30612914565b5b6000612b3f85828601612acf565b9250506020612b5085828601612b05565b9150509250929050565b60006fffffffffffffffffffffffffffffffff82169050919050565b612b7f81612b5a565b82525050565b6000602082019050612b9a6000830184612b76565b92915050565b612ba981612ae4565b82525050565b6000602082019050612bc46000830184612ba0565b92915050565b600080600060608486031215612be357612be2612914565b5b6000612bf186828701612acf565b9350506020612c0286828701612acf565b9250506040612c1386828701612b05565b9150509250925092565b600060208284031215612c3357612c32612914565b5b6000612c4184828501612acf565b91505092915050565b60008060408385031215612c6157612c60612914565b5b6000612c6f85828601612b05565b9250506020612c8085828601612b05565b9150509250929050565b600060208284031215612ca057612c9f612914565b5b6000612cae84828501612b05565b91505092915050565b6000819050919050565b612cca81612cb7565b82525050565b6000602082019050612ce56000830184612cc1565b92915050565b612cf481612cb7565b8114612cff57600080fd5b50565b600081359050612d1181612ceb565b92915050565b600060208284031215612d2d57612d2c612914565b5b6000612d3b84828501612d02565b91505092915050565b612d4d81612aa6565b82525050565b6000602082019050612d686000830184612d44565b92915050565b60008060008060808587031215612d8857612d87612914565b5b6000612d9687828801612b05565b9450506020612da787828801612b05565b9350506040612db887828801612b05565b9250506060612dc987828801612b05565b91505092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680612e1c57607f821691505b602082108103612e2f57612e2e612dd5565b5b50919050565b7f5a45524f5f464952535400000000000000000000000000000000000000000000600082015250565b6000612e6b600a836129df565b9150612e7682612e35565b602082019050919050565b60006020820190508181036000830152612e9a81612e5e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612edb82612ae4565b9150612ee683612ae4565b9250828203905081811115612efe57612efd612ea1565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612f3e82612ae4565b9150612f4983612ae4565b925082612f5957612f58612f04565b5b828204905092915050565b6000612f6f82612ae4565b9150612f7a83612ae4565b9250828202612f8881612ae4565b91508282048414831517612f9f57612f9e612ea1565b5b5092915050565b6000612fb182612ae4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612fe357612fe2612ea1565b5b600182019050919050565b6000612ff982612ae4565b915061300483612ae4565b925082820190508082111561301c5761301b612ea1565b5b92915050565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b6000613058600a836129df565b915061306382613022565b602082019050919050565b600060208201905081810360008301526130878161304b565b9050919050565b600061309982612b5a565b91506130a483612b5a565b92508282026130b281612b5a565b91508082146130c4576130c3612ea1565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b600061311f61311a61311584612b5a565b6130fa565b612ae4565b9050919050565b61312f81613104565b82525050565b600060208201905061314a6000830184613126565b92915050565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b6000613186600d836129df565b915061319182613150565b602082019050919050565b600060208201905081810360008301526131b581613179565b9050919050565b6131c581612b5a565b81146131d057600080fd5b50565b6000815190506131e2816131bc565b92915050565b6000602082840312156131fe576131fd612914565b5b600061320c848285016131d3565b9150509291505056fea264697066735822122050ac6a09a8e76df2035a31eb401dbc3ee76b89fc7d7643265d034f1b314e76ff64736f6c63430008110033 \ No newline at end of file diff --git a/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.json b/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.json index 907ded8..654f397 100644 --- a/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.json +++ b/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.json @@ -1 +1 @@ -[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"uint128","name":"_taxLevelMinute","type":"uint128"},{"internalType":"uint256","name":"_periodMinutes","type":"uint256"},{"internalType":"address","name":"_defaultSinkAddress","type":"address"}],"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":"_burner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Burn","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":"uint256","name":"_rounds","type":"uint256"}],"name":"applyDemurrageLimited","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":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burned","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":"bytes32","name":"_redistribution","type":"bytes32"}],"name":"getDistributionFromRedistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","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":"lastPeriod","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":"resolutionFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sinkAddress","type":"address"}],"name":"setSinkAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sinkAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"uint256","name":"_participants","type":"uint256"},{"internalType":"uint256","name":"_demurrageModifierPpm","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"toRedistribution","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","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":"totalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSink","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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"},{"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":"uint128","name":"_taxLevelMinute","type":"uint128"},{"internalType":"uint256","name":"_periodMinutes","type":"uint256"},{"internalType":"address","name":"_defaultSinkAddress","type":"address"}],"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":"_burner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Burn","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":"uint256","name":"_rounds","type":"uint256"}],"name":"applyDemurrageLimited","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":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burned","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":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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":"bytes32","name":"_redistribution","type":"bytes32"}],"name":"getDistributionFromRedistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","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":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastPeriod","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":"resolutionFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sinkAddress","type":"address"}],"name":"setSinkAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sinkAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"uint256","name":"_participants","type":"uint256"},{"internalType":"uint256","name":"_demurrageModifierPpm","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"toRedistribution","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","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":"totalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSink","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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"},{"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/token.py b/python/erc20_demurrage_token/token.py index 4994a70..a22448e 100644 --- a/python/erc20_demurrage_token/token.py +++ b/python/erc20_demurrage_token/token.py @@ -117,6 +117,34 @@ class DemurrageToken(ERC20): return DemurrageToken.__bytecode[name] + def increase_allowance(self, contract_address, sender_address, address, value, tx_format=TxFormat.JSONRPC): + enc = ABIContractEncoder() + enc.method('increaseAllowance') + enc.typ(ABIContractType.ADDRESS) + enc.typ(ABIContractType.UINT256) + enc.address(address) + enc.uint256(value) + data = enc.get() + tx = self.template(sender_address, contract_address, use_nonce=True) + tx = self.set_code(tx, data) + tx = self.finalize(tx, tx_format) + return tx + + + def decrease_allowance(self, contract_address, sender_address, address, value, tx_format=TxFormat.JSONRPC): + enc = ABIContractEncoder() + enc.method('decreaseAllowance') + enc.typ(ABIContractType.ADDRESS) + enc.typ(ABIContractType.UINT256) + enc.address(address) + enc.uint256(value) + data = enc.get() + tx = self.template(sender_address, contract_address, use_nonce=True) + tx = self.set_code(tx, data) + tx = self.finalize(tx, tx_format) + return tx + + def add_minter(self, contract_address, sender_address, address, tx_format=TxFormat.JSONRPC): enc = ABIContractEncoder() enc.method('addMinter') diff --git a/python/setup.cfg b/python/setup.cfg index 523be5c..820fb7b 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = erc20-demurrage-token -version = 0.1.2 +version = 0.2.0 description = ERC20 token with redistributed continual demurrage author = Louis Holbrook author_email = dev@holbrook.no diff --git a/python/tests/test_basic.py b/python/tests/test_basic.py index 44fc556..85273ba 100644 --- a/python/tests/test_basic.py +++ b/python/tests/test_basic.py @@ -276,7 +276,52 @@ class TestBasic(TestDemurrageDefault): r = self.rpc.do(o) self.assertEqual(r['status'], 1) - + + def test_approve(self): + nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) + c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], 500) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], 600) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 0) + + (tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], 0) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], 600) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash, o) = c.increase_allowance(self.address, self.accounts[0], self.accounts[1], 200) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash, o) = c.decrease_allowance(self.address, self.accounts[0], self.accounts[1], 800) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], 42) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + def test_transfer_from(self): nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) diff --git a/solidity/DemurrageTokenSingleNocap.sol b/solidity/DemurrageTokenSingleNocap.sol index 5122232..e62f9be 100644 --- a/solidity/DemurrageTokenSingleNocap.sol +++ b/solidity/DemurrageTokenSingleNocap.sol @@ -425,14 +425,45 @@ contract DemurrageTokenSingleCap { function approve(address _spender, uint256 _value) public returns (bool) { uint256 baseValue; + if (allowance[msg.sender][_spender] > 0) { + require(_value == 0, 'ZERO_FIRST'); + } + changePeriod(); baseValue = toBaseAmount(_value); - allowance[msg.sender][_spender] += baseValue; + allowance[msg.sender][_spender] = baseValue; emit Approval(msg.sender, _spender, _value); return true; } + // Reduce allowance by amount + function decreaseAllowance(address _spender, uint256 _value) public returns (bool) { + uint256 baseValue; + + baseValue = toBaseAmount(_value); + require(allowance[msg.sender][_spender] <= baseValue); + + changePeriod(); + + allowance[msg.sender][_spender] -= baseValue; + emit Approval(msg.sender, _spender, allowance[msg.sender][_spender]); + return true; + } + + // Increase allowance by amount + function increaseAllowance(address _spender, uint256 _value) public returns (bool) { + uint256 baseValue; + + changePeriod(); + + baseValue = toBaseAmount(_value); + + allowance[msg.sender][_spender] += baseValue; + emit Approval(msg.sender, _spender, allowance[msg.sender][_spender]); + return true; + } + // Implements ERC20, triggers tax and/or redistribution function transfer(address _to, uint256 _value) public returns (bool) { uint256 baseValue;