erc20-demurrage-token

ERC20 token with redistributed continual demurrage
Log | Files | Refs | README

commit 0dba167af25869d4b9f14b70b90baeb3c056597e
parent e8781a9aa042bff4ebe43c65e80a6a9150e6ce8f
Author: nolash <dev@holbrook.no>
Date:   Tue,  8 Jun 2021 09:45:24 +0200

WIP Improve redistribution precision

Diffstat:
Mpython/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin | 4++--
Mpython/erc20_demurrage_token/token.py | 22++++++++++++++++++++++
Mpython/examples/sim_noredistribute.py | 2+-
Mpython/tests/base.py | 2+-
Mpython/tests/test_basic.py | 2+-
Mpython/tests/test_redistribution_unit.py | 241++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Msolidity/DemurrageTokenSingleCap.sol | 27++++++++++++++++++---------
7 files changed, 173 insertions(+), 127 deletions(-)

diff --git a/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin b/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin @@ -1 +1 @@ -60e06040523480156200001157600080fd5b50604051620032e2380380620032e2833981810160405281019062000037919062000445565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555086600690805190602001906200010a929190620002de565b50856007908051906020019062000123929190620002de565b508460ff166008819055504260038190555060035460808181525050603c836200014e91906200071b565b60a0818152505064e8d4a510006a52b7d2dcc80cd2e40000006200017391906200071b565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508360c081815250506000620001dd6000678ac7230489e800006000600162000276640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600a8190555082600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508560ff16600a620002629190620005de565b600b81905550505050505050505062000962565b600080750ffffffff00000000000000000000000000000000000608c60ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b828054620002ec90620007fd565b90600052602060002090601f0160209004810192826200031057600085556200035c565b82601f106200032b57805160ff19168380011785556200035c565b828001600101855582156200035c579182015b828111156200035b5782518255916020019190600101906200033e565b5b5090506200036b91906200036f565b5090565b5b808211156200038a57600081600090555060010162000370565b5090565b6000620003a56200039f846200054d565b62000524565b905082815260208101848484011115620003be57600080fd5b620003cb848285620007c7565b509392505050565b600081519050620003e48162000914565b92915050565b600082601f830112620003fc57600080fd5b81516200040e8482602086016200038e565b91505092915050565b60008151905062000428816200092e565b92915050565b6000815190506200043f8162000948565b92915050565b600080600080600080600060e0888a0312156200046157600080fd5b600088015167ffffffffffffffff8111156200047c57600080fd5b6200048a8a828b01620003ea565b975050602088015167ffffffffffffffff811115620004a857600080fd5b620004b68a828b01620003ea565b9650506040620004c98a828b016200042e565b9550506060620004dc8a828b0162000417565b9450506080620004ef8a828b0162000417565b93505060a0620005028a828b01620003d3565b92505060c0620005158a828b0162000417565b91505092959891949750929550565b60006200053062000543565b90506200053e828262000833565b919050565b6000604051905090565b600067ffffffffffffffff8211156200056b576200056a620008c7565b5b6200057682620008f6565b9050602081019050919050565b6000808291508390505b6001851115620005d557808604811115620005ad57620005ac62000869565b5b6001851615620005bd5780820291505b8081029050620005cd8562000907565b94506200058d565b94509492505050565b6000620005eb82620007b0565b9150620005f883620007b0565b9250620006277fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846200062f565b905092915050565b60008262000641576001905062000714565b8162000651576000905062000714565b81600181146200066a57600281146200067557620006ab565b600191505062000714565b60ff8411156200068a576200068962000869565b5b8360020a915084821115620006a457620006a362000869565b5b5062000714565b5060208310610133831016604e8410600b8410161715620006e55782820a905083811115620006df57620006de62000869565b5b62000714565b620006f4848484600162000583565b925090508184048111156200070e576200070d62000869565b5b81810290505b9392505050565b60006200072882620007b0565b91506200073583620007b0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161562000771576200077062000869565b5b828202905092915050565b6000620007898262000790565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015620007e7578082015181840152602081019050620007ca565b83811115620007f7576000848401525b50505050565b600060028204905060018216806200081657607f821691505b602082108114156200082d576200082c62000898565b5b50919050565b6200083e82620008f6565b810181811067ffffffffffffffff8211171562000860576200085f620008c7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6000600282049050919050565b6200091f816200077c565b81146200092b57600080fd5b50565b6200093981620007b0565b81146200094557600080fd5b50565b6200095381620007ba565b81146200095f57600080fd5b50565b60805160a05160c051612926620009bc60003960008181610bcb01528181610e1b01526119b40152600081816110b5015281816119630152611a530152600081816110e101528181611a740152611ab901526129266000f3fe608060405234801561001057600080fd5b506004361061024f576000357c0100000000000000000000000000000000000000000000000000000000900480636787a9be1161014d57806395d89b41116100d5578063e3ab207a11610099578063e3ab207a14610776578063e54d63f7146107a6578063e8095295146107d6578063eda4e6d6146107f4578063f2fde38b146108125761024f565b806395d89b41146106aa578063983b2d56146106c85780639da7d8ba146106f8578063a9059cbb14610728578063b470aade146107585761024f565b8063731f237c1161011c578063731f237c1461061457806379ba5097146106325780638da5cb5b146106505780638f1df6bc1461066e5780638f770ad01461068c5761024f565b80636787a9be146105545780636a2d094e146105845780636ffa8a05146105b457806370a08231146105e45761024f565b806331333487116101db5780634abfbba21161019f5780634abfbba21461048857806351b4541c146104b8578063573cc507146104e857806358b2833b146105065780636721d4ef146105245761024f565b806331333487146103aa578063313ce567146103da57806340452d91146103f8578063449a52f81461042857806347a50517146104585761024f565b806318160ddd1161022257806318160ddd146102f05780631989c6a81461030e578063229ba1971461032c57806323b872dd1461034a5780633092afd51461037a5761024f565b806301ffc9a71461025457806306fdde0314610284578063095ea7b3146102a257806309f28f3c146102d2575b600080fd5b61026e60048036038101906102699190612202565b610842565b60405161027b91906123d0565b60405180910390f35b61028c6109ed565b6040516102999190612406565b60405180910390f35b6102bc60048036038101906102b7919061219d565b610a7b565b6040516102c991906123d0565b60405180910390f35b6102da610b95565b6040516102e79190612488565b60405180910390f35b6102f8610bb7565b60405161030591906124be565b60405180910390f35b610316610bbd565b60405161032391906124be565b60405180910390f35b610334610bc9565b60405161034191906124be565b60405180910390f35b610364600480360381019061035f919061214e565b610bed565b60405161037191906123d0565b60405180910390f35b610394600480360381019061038f9190612125565b610d0d565b6040516103a191906123d0565b60405180910390f35b6103c460048036038101906103bf919061227d565b610e00565b6040516103d191906124be565b60405180910390f35b6103e2610eb4565b6040516103ef91906124be565b60405180910390f35b610412600480360381019061040d9190612254565b610eba565b60405161041f91906123eb565b60405180910390f35b610442600480360381019061043d919061219d565b610ede565b60405161044f91906123d0565b60405180910390f35b610472600480360381019061046d9190612125565b611068565b60405161047f91906124be565b60405180910390f35b6104a2600480360381019061049d9190612254565b6110b1565b6040516104af91906124be565b60405180910390f35b6104d260048036038101906104cd9190612254565b611111565b6040516104df91906124be565b60405180910390f35b6104f0611132565b6040516104fd91906124be565b60405180910390f35b61050e611138565b60405161051b91906124be565b60405180910390f35b61053e6004803603810190610539919061227d565b61113e565b60405161054b91906124be565b60405180910390f35b61056e60048036038101906105699190612254565b611180565b60405161057b91906124be565b60405180910390f35b61059e60048036038101906105999190612254565b6111eb565b6040516105ab91906124be565b60405180910390f35b6105ce60048036038101906105c991906121d9565b61120c565b6040516105db91906124be565b60405180910390f35b6105fe60048036038101906105f99190612125565b611241565b60405161060b91906124be565b60405180910390f35b61061c6112e9565b60405161062991906123d0565b60405180910390f35b61063a61140b565b60405161064791906123d0565b60405180910390f35b6106586115b2565b60405161066591906123b5565b60405180910390f35b6106766115d8565b60405161068391906123d0565b60405180910390f35b61069461174e565b6040516106a191906124be565b60405180910390f35b6106b2611754565b6040516106bf9190612406565b60405180910390f35b6106e260048036038101906106dd9190612125565b6117e2565b6040516106ef91906123d0565b60405180910390f35b610712600480360381019061070d91906121d9565b61189f565b60405161071f91906124be565b60405180910390f35b610742600480360381019061073d919061219d565b6118cb565b60405161074f91906123d0565b60405180910390f35b610760611961565b60405161076d91906124be565b60405180910390f35b610790600480360381019061078b91906121d9565b611985565b60405161079d91906124be565b60405180910390f35b6107c060048036038101906107bb919061227d565b611999565b6040516107cd91906124be565b60405180910390f35b6107de611a4d565b6040516107eb9190612488565b60405180910390f35b6107fc611ab7565b60405161080991906124be565b60405180910390f35b61082c60048036038101906108279190612125565b611adb565b60405161083991906123d0565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561089757600190506109e8565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156108ea57600190506109e8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561093d57600190506109e8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561099057600190506109e8565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109e357600190506109e8565b600090505b919050565b600680546109fa906126e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610a26906126e9565b8015610a735780601f10610a4857610100808354040283529160200191610a73565b820191906000526020600020905b815481529060010190602001808311610a5657829003601f168201915b505050505081565b600080610a866115d8565b50610a9083611180565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e91906124f5565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610b8291906124be565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60095481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610bfa6115d8565b50610c0484611180565b915081600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610c8f57600080fd5b610c9a868684611b7d565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610cf991906124be565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610d9657503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610d9f57600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000610e44919061254b565b905060005b84811015610e8d5764e8d4a510008284610e63919061257c565b610e6d919061254b565b83610e7891906125d6565b92508080610e859061271b565b915050610e49565b5064e8d4a510008583610ea0919061257c565b610eaa919061254b565b9250505092915050565b60085481565b60008181548110610eca57600080fd5b906000526020600020016000915090505481565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6490612448565b60405180910390fd5b600a5460095484610f7e91906124f5565b1115610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb690612428565b60405180910390fd5b610fc76115d8565b508290508260096000828254610fdd91906124f5565b92505081905550610fee8482611bbe565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f88560405161104c91906124be565b60405180910390a361105c611c83565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000826110df919061257c565b7f000000000000000000000000000000000000000000000000000000000000000061110a91906124f5565b9050919050565b6000603c824261112191906125d6565b61112b919061254b565b9050919050565b600b5481565b60035481565b60006a52b7d2dcc80cd2e400000082611157919061254b565b6a52b7d2dcc80cd2e400000061116d91906125d6565b83611178919061257c565b905092915050565b6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1664e8d4a510006a52b7d2dcc80cd2e4000000846111d0919061257c565b6111da919061257c565b6111e4919061254b565b9050919050565b6000603c82426111fb91906125d6565b611205919061254b565b9050919050565b6000608c60ff16750ffffffff00000000000000000000000000000000000836001900416908060020a82049150509050919050565b60008060008061125085611068565b925061125d600354611111565b9050611299600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682610e00565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e40000006112c9919061257c565b82846112d5919061257c565b6112df919061254b565b9350505050919050565b6000806000806112fa600354611111565b915060008214156113115760009350505050611408565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16905061134e8183610e00565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c82611393919061257c565b6003546113a091906124f5565b60038190555080826003547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff166040516113f891906124a3565b60405180910390a4600193505050505b90565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461146857600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060008060008060006115ee611d7b565b9750600060010288141561160d5760009850505050505050505061174b565b61161688611985565b955060018661162591906124f5565b9050611630866110b1565b915061163a6112e9565b50600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169450611677826111eb565b925060008311156116a9576a52b7d2dcc80cd2e40000006116988685611999565b6116a2919061254b565b93506116c3565b6a52b7d2dcc80cd2e4000000856116c0919061254b565b93505b6116d260008560095484611eab565b9650600087908060018154018082558091505060019003906000526020600020016000909190919091505561170688611f13565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d6758160405161173691906124be565b60405180910390a16001985050505050505050505b90565b600a5481565b60078054611761906126e9565b80601f016020809104026020016040519081016040528092919081815260200182805461178d906126e9565b80156117da5780601f106117af576101008083540402835291602001916117da565b820191906000526020600020905b8154815290600101906020018083116117bd57829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461183e57600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b60008060006118d86115d8565b506118e284611180565b91506118ef338684611b7d565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161194e91906124be565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f00000000000000000000000000000000000000000000000000000000000000006119dd919061254b565b905060005b84811015611a265764e8d4a5100082846119fc919061257c565b611a06919061254b565b83611a1191906124f5565b92508080611a1e9061271b565b9150506119e2565b5064e8d4a510008583611a39919061257c565b611a43919061254b565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611a9e91906125d6565b611aa8919061254b565b611ab291906124f5565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b3757600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600080611b8a8584611fb4565b50611b958484611bbe565b50611b9e611a4d565b6fffffffffffffffffffffffffffffffff16905060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000851415611c1b5760009350505050611c7d565b611c2486611068565b92508483611c3291906124f5565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000611c956009546001611999565b905060006001600080549050611cab91906125d6565b81548110611ce2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611d2d91906125d6565b81548110611d64577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555060019250505090565b6000806000806001600080549050611d9391906125d6565b81548110611dca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611e3957600080fd5b505afa158015611e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e71919061222b565b6fffffffffffffffffffffffffffffffff169050611e8e82611985565b8111611ea257600060010292505050611ea8565b81925050505b90565b600080750ffffffff00000000000000000000000000000000000608c60ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b6000806000611f218461189f565b9150611f5d82600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1661113e565b9050611fa9600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611fa46a52b7d2dcc80cd2e400000084611f9f919061254b565b611180565b611bbe565b508092505050919050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600085141561201157600093505050506120b6565b61201a86611068565b92508483101561205f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205690612468565b60405180910390fd5b848361206b91906125d6565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000813590506120cb8161287d565b92915050565b6000813590506120e081612894565b92915050565b6000813590506120f5816128ab565b92915050565b60008151905061210a816128c2565b92915050565b60008135905061211f816128d9565b92915050565b60006020828403121561213757600080fd5b6000612145848285016120bc565b91505092915050565b60008060006060848603121561216357600080fd5b6000612171868287016120bc565b9350506020612182868287016120bc565b925050604061219386828701612110565b9150509250925092565b600080604083850312156121b057600080fd5b60006121be858286016120bc565b92505060206121cf85828601612110565b9150509250929050565b6000602082840312156121eb57600080fd5b60006121f9848285016120d1565b91505092915050565b60006020828403121561221457600080fd5b6000612222848285016120e6565b91505092915050565b60006020828403121561223d57600080fd5b600061224b848285016120fb565b91505092915050565b60006020828403121561226657600080fd5b600061227484828501612110565b91505092915050565b6000806040838503121561229057600080fd5b600061229e85828601612110565b92505060206122af85828601612110565b9150509250929050565b6122c28161260a565b82525050565b6122d18161261c565b82525050565b6122e081612628565b82525050565b60006122f1826124d9565b6122fb81856124e4565b935061230b8185602086016126b6565b612314816127f1565b840191505092915050565b600061232c6007836124e4565b915061233782612802565b602082019050919050565b600061234f600a836124e4565b915061235a8261282b565b602082019050919050565b6000612372600d836124e4565b915061237d82612854565b602082019050919050565b6123918161265e565b82525050565b6123a0816126a4565b82525050565b6123af8161269a565b82525050565b60006020820190506123ca60008301846122b9565b92915050565b60006020820190506123e560008301846122c8565b92915050565b600060208201905061240060008301846122d7565b92915050565b6000602082019050818103600083015261242081846122e6565b905092915050565b600060208201905081810360008301526124418161231f565b9050919050565b6000602082019050818103600083015261246181612342565b9050919050565b6000602082019050818103600083015261248181612365565b9050919050565b600060208201905061249d6000830184612388565b92915050565b60006020820190506124b86000830184612397565b92915050565b60006020820190506124d360008301846123a6565b92915050565b600081519050919050565b600082825260208201905092915050565b60006125008261269a565b915061250b8361269a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125405761253f612764565b5b828201905092915050565b60006125568261269a565b91506125618361269a565b92508261257157612570612793565b5b828204905092915050565b60006125878261269a565b91506125928361269a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125cb576125ca612764565b5b828202905092915050565b60006125e18261269a565b91506125ec8361269a565b9250828210156125ff576125fe612764565b5b828203905092915050565b60006126158261267a565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006126af8261265e565b9050919050565b60005b838110156126d45780820151818401526020810190506126b9565b838111156126e3576000848401525b50505050565b6000600282049050600182168061270157607f821691505b60208210811415612715576127146127c2565b5b50919050565b60006127268261269a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561275957612758612764565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f4552525f43415000000000000000000000000000000000000000000000000000600082015250565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b6128868161260a565b811461289157600080fd5b50565b61289d81612628565b81146128a857600080fd5b50565b6128b481612632565b81146128bf57600080fd5b50565b6128cb8161265e565b81146128d657600080fd5b50565b6128e28161269a565b81146128ed57600080fd5b5056fea26469706673582212205e0e50ae787e243cb3c1d47dd27265226da2525193b8e4d9dc82a779a574d91d64736f6c63430008040033 -\ No newline at end of file +61010060405264e8d4a510006a52b7d2dcc80cd2e40000006200002391906200073d565b6080908152503480156200003657600080fd5b50604051620033043803806200330483398181016040528101906200005c919062000467565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555086600690805190602001906200012f92919062000300565b5085600790805190602001906200014892919062000300565b508460ff166008819055504260038190555060035460a08181525050603c836200017391906200073d565b60c081815250506f4b3b4ca85a86c47a098a224000000000600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508360e081815250506000620001f860006a52b7d2dcc80cd2e40000006000600162000291640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600a8190555082600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508560ff16600a6200027d919062000600565b600b81905550505050505050505062000984565b6000807cffffffffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b8280546200030e906200081f565b90600052602060002090601f0160209004810192826200033257600085556200037e565b82601f106200034d57805160ff19168380011785556200037e565b828001600101855582156200037e579182015b828111156200037d57825182559160200191906001019062000360565b5b5090506200038d919062000391565b5090565b5b80821115620003ac57600081600090555060010162000392565b5090565b6000620003c7620003c1846200056f565b62000546565b905082815260208101848484011115620003e057600080fd5b620003ed848285620007e9565b509392505050565b600081519050620004068162000936565b92915050565b600082601f8301126200041e57600080fd5b815162000430848260208601620003b0565b91505092915050565b6000815190506200044a8162000950565b92915050565b60008151905062000461816200096a565b92915050565b600080600080600080600060e0888a0312156200048357600080fd5b600088015167ffffffffffffffff8111156200049e57600080fd5b620004ac8a828b016200040c565b975050602088015167ffffffffffffffff811115620004ca57600080fd5b620004d88a828b016200040c565b9650506040620004eb8a828b0162000450565b9550506060620004fe8a828b0162000439565b9450506080620005118a828b0162000439565b93505060a0620005248a828b01620003f5565b92505060c0620005378a828b0162000439565b91505092959891949750929550565b60006200055262000565565b905062000560828262000855565b919050565b6000604051905090565b600067ffffffffffffffff8211156200058d576200058c620008e9565b5b620005988262000918565b9050602081019050919050565b6000808291508390505b6001851115620005f757808604811115620005cf57620005ce6200088b565b5b6001851615620005df5780820291505b8081029050620005ef8562000929565b9450620005af565b94509492505050565b60006200060d82620007d2565b91506200061a83620007d2565b9250620006497fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848462000651565b905092915050565b60008262000663576001905062000736565b8162000673576000905062000736565b81600181146200068c57600281146200069757620006cd565b600191505062000736565b60ff841115620006ac57620006ab6200088b565b5b8360020a915084821115620006c657620006c56200088b565b5b5062000736565b5060208310610133831016604e8410600b8410161715620007075782820a9050838111156200070157620007006200088b565b5b62000736565b620007168484846001620005a5565b9250905081840481111562000730576200072f6200088b565b5b81810290505b9392505050565b60006200074a82620007d2565b91506200075783620007d2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156200079357620007926200088b565b5b828202905092915050565b6000620007ab82620007b2565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101562000809578082015181840152602081019050620007ec565b8381111562000819576000848401525b50505050565b600060028204905060018216806200083857607f821691505b602082108114156200084f576200084e620008ba565b5b50919050565b620008608262000918565b810181811067ffffffffffffffff82111715620008825762000881620008e9565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6000600282049050919050565b62000941816200079e565b81146200094d57600080fd5b50565b6200095b81620007d2565b81146200096757600080fd5b50565b6200097581620007dc565b81146200098157600080fd5b50565b60805160a05160c05160e05161291c620009e860003960008181610bcb01528181610e1b015261198f0152600081816110b50152818161193e0152611a2e0152600081816110e101528181611a4f0152611a9401526000611f07015261291c6000f3fe608060405234801561001057600080fd5b506004361061024f576000357c0100000000000000000000000000000000000000000000000000000000900480636787a9be1161014d57806395d89b41116100d5578063e3ab207a11610099578063e3ab207a14610776578063e54d63f7146107a6578063e8095295146107d6578063eda4e6d6146107f4578063f2fde38b146108125761024f565b806395d89b41146106aa578063983b2d56146106c85780639da7d8ba146106f8578063a9059cbb14610728578063b470aade146107585761024f565b8063731f237c1161011c578063731f237c1461061457806379ba5097146106325780638da5cb5b146106505780638f1df6bc1461066e5780638f770ad01461068c5761024f565b80636787a9be146105545780636a2d094e146105845780636ffa8a05146105b457806370a08231146105e45761024f565b806331333487116101db5780634abfbba21161019f5780634abfbba21461048857806351b4541c146104b8578063573cc507146104e857806358b2833b146105065780636721d4ef146105245761024f565b806331333487146103aa578063313ce567146103da57806340452d91146103f8578063449a52f81461042857806347a50517146104585761024f565b806318160ddd1161022257806318160ddd146102f05780631989c6a81461030e578063229ba1971461032c57806323b872dd1461034a5780633092afd51461037a5761024f565b806301ffc9a71461025457806306fdde0314610284578063095ea7b3146102a257806309f28f3c146102d2575b600080fd5b61026e600480360381019061026991906121f8565b610842565b60405161027b91906123c6565b60405180910390f35b61028c6109ed565b60405161029991906123fc565b60405180910390f35b6102bc60048036038101906102b79190612193565b610a7b565b6040516102c991906123c6565b60405180910390f35b6102da610b95565b6040516102e7919061247e565b60405180910390f35b6102f8610bb7565b60405161030591906124b4565b60405180910390f35b610316610bbd565b60405161032391906124b4565b60405180910390f35b610334610bc9565b60405161034191906124b4565b60405180910390f35b610364600480360381019061035f9190612144565b610bed565b60405161037191906123c6565b60405180910390f35b610394600480360381019061038f919061211b565b610d0d565b6040516103a191906123c6565b60405180910390f35b6103c460048036038101906103bf9190612273565b610e00565b6040516103d191906124b4565b60405180910390f35b6103e2610eb4565b6040516103ef91906124b4565b60405180910390f35b610412600480360381019061040d919061224a565b610eba565b60405161041f91906123e1565b60405180910390f35b610442600480360381019061043d9190612193565b610ede565b60405161044f91906123c6565b60405180910390f35b610472600480360381019061046d919061211b565b611068565b60405161047f91906124b4565b60405180910390f35b6104a2600480360381019061049d919061224a565b6110b1565b6040516104af91906124b4565b60405180910390f35b6104d260048036038101906104cd919061224a565b611111565b6040516104df91906124b4565b60405180910390f35b6104f0611132565b6040516104fd91906124b4565b60405180910390f35b61050e611138565b60405161051b91906124b4565b60405180910390f35b61053e60048036038101906105399190612273565b61113e565b60405161054b91906124b4565b60405180910390f35b61056e6004803603810190610569919061224a565b611180565b60405161057b91906124b4565b60405180910390f35b61059e6004803603810190610599919061224a565b6111eb565b6040516105ab91906124b4565b60405180910390f35b6105ce60048036038101906105c991906121cf565b61120c565b6040516105db91906124b4565b60405180910390f35b6105fe60048036038101906105f9919061211b565b611248565b60405161060b91906124b4565b60405180910390f35b61061c6112f0565b60405161062991906123c6565b60405180910390f35b61063a611412565b60405161064791906123c6565b60405180910390f35b6106586115b9565b60405161066591906123ab565b60405180910390f35b6106766115df565b60405161068391906123c6565b60405180910390f35b610694611729565b6040516106a191906124b4565b60405180910390f35b6106b261172f565b6040516106bf91906123fc565b60405180910390f35b6106e260048036038101906106dd919061211b565b6117bd565b6040516106ef91906123c6565b60405180910390f35b610712600480360381019061070d91906121cf565b61187a565b60405161071f91906124b4565b60405180910390f35b610742600480360381019061073d9190612193565b6118a6565b60405161074f91906123c6565b60405180910390f35b61076061193c565b60405161076d91906124b4565b60405180910390f35b610790600480360381019061078b91906121cf565b611960565b60405161079d91906124b4565b60405180910390f35b6107c060048036038101906107bb9190612273565b611974565b6040516107cd91906124b4565b60405180910390f35b6107de611a28565b6040516107eb919061247e565b60405180910390f35b6107fc611a92565b60405161080991906124b4565b60405180910390f35b61082c6004803603810190610827919061211b565b611ab6565b60405161083991906123c6565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561089757600190506109e8565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156108ea57600190506109e8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561093d57600190506109e8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561099057600190506109e8565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109e357600190506109e8565b600090505b919050565b600680546109fa906126df565b80601f0160208091040260200160405190810160405280929190818152602001828054610a26906126df565b8015610a735780601f10610a4857610100808354040283529160200191610a73565b820191906000526020600020905b815481529060010190602001808311610a5657829003601f168201915b505050505081565b600080610a866115df565b50610a9083611180565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e91906124eb565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610b8291906124b4565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60095481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610bfa6115df565b50610c0484611180565b915081600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610c8f57600080fd5b610c9a868684611b58565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610cf991906124b4565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610d9657503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610d9f57600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000610e449190612541565b905060005b84811015610e8d5764e8d4a510008284610e639190612572565b610e6d9190612541565b83610e7891906125cc565b92508080610e8590612711565b915050610e49565b5064e8d4a510008583610ea09190612572565b610eaa9190612541565b9250505092915050565b60085481565b60008181548110610eca57600080fd5b906000526020600020016000915090505481565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f649061243e565b60405180910390fd5b600a5460095484610f7e91906124eb565b1115610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb69061241e565b60405180910390fd5b610fc76115df565b508290508260096000828254610fdd91906124eb565b92505081905550610fee8482611b99565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f88560405161104c91906124b4565b60405180910390a361105c611c5e565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000826110df9190612572565b7f000000000000000000000000000000000000000000000000000000000000000061110a91906124eb565b9050919050565b6000603c824261112191906125cc565b61112b9190612541565b9050919050565b600b5481565b60035481565b60006a52b7d2dcc80cd2e4000000826111579190612541565b6a52b7d2dcc80cd2e400000061116d91906125cc565b836111789190612572565b905092915050565b6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1664e8d4a510006a52b7d2dcc80cd2e4000000846111d09190612572565b6111da9190612572565b6111e49190612541565b9050919050565b6000603c82426111fb91906125cc565b6112059190612541565b9050919050565b6000606860ff167cffffffffffffffffffffffffffffffff00000000000000000000000000836001900416908060020a82049150509050919050565b60008060008061125785611068565b9250611264600354611111565b90506112a0600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682610e00565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e40000006112d09190612572565b82846112dc9190612572565b6112e69190612541565b9350505050919050565b600080600080611301600354611111565b91506000821415611318576000935050505061140f565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1690506113558183610e00565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c8261139a9190612572565b6003546113a791906124eb565b60038190555080826003547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff166040516113ff9190612499565b60405180910390a4600193505050505b90565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461146f57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060008060008060006115f5611d4c565b9750600060010288141561161457600098505050505050505050611726565b61161d88611960565b955060018661162c91906124eb565b9050611637866110b1565b91506116416112f0565b50600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16945061167e826111eb565b9250600083111561169a576116938584611974565b935061169e565b8493505b6116ad60008560095484611e7c565b965060008790806001815401808255809150506001900390600052602060002001600090919091909150556116e188611eeb565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d6758160405161171191906124b4565b60405180910390a16001985050505050505050505b90565b600a5481565b6007805461173c906126df565b80601f0160208091040260200160405190810160405280929190818152602001828054611768906126df565b80156117b55780601f1061178a576101008083540402835291602001916117b5565b820191906000526020600020905b81548152906001019060200180831161179857829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461181957600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b60008060006118b36115df565b506118bd84611180565b91506118ca338684611b58565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405161192991906124b4565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f00000000000000000000000000000000000000000000000000000000000000006119b89190612541565b905060005b84811015611a015764e8d4a5100082846119d79190612572565b6119e19190612541565b836119ec91906124eb565b925080806119f990612711565b9150506119bd565b5064e8d4a510008583611a149190612572565b611a1e9190612541565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611a7991906125cc565b611a839190612541565b611a8d91906124eb565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b1257600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b600080611b658584611faa565b50611b708484611b99565b50611b79611a28565b6fffffffffffffffffffffffffffffffff16905060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000851415611bf65760009350505050611c58565b611bff86611068565b92508483611c0d91906124eb565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000600954905060006001600080549050611c7c91906125cc565b81548110611cb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611cfe91906125cc565b81548110611d35577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555060019250505090565b6000806000806001600080549050611d6491906125cc565b81548110611d9b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611e0a57600080fd5b505afa158015611e1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e429190612221565b6fffffffffffffffffffffffffffffffff169050611e5f82611960565b8111611e7357600060010292505050611e79565b81925050505b90565b6000807cffffffffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b600080600080611efa8561187a565b9250611f058561120c565b7f0000000000000000000000000000000000000000000000000000000000000000611f3091906125cc565b91506000821415611f475760009350505050611fa5565b611f51838361113e565b9050611f9d600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611f986a52b7d2dcc80cd2e400000084611f939190612541565b611180565b611b99565b508093505050505b919050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600085141561200757600093505050506120ac565b61201086611068565b925084831015612055576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204c9061245e565b60405180910390fd5b848361206191906125cc565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000813590506120c181612873565b92915050565b6000813590506120d68161288a565b92915050565b6000813590506120eb816128a1565b92915050565b600081519050612100816128b8565b92915050565b600081359050612115816128cf565b92915050565b60006020828403121561212d57600080fd5b600061213b848285016120b2565b91505092915050565b60008060006060848603121561215957600080fd5b6000612167868287016120b2565b9350506020612178868287016120b2565b925050604061218986828701612106565b9150509250925092565b600080604083850312156121a657600080fd5b60006121b4858286016120b2565b92505060206121c585828601612106565b9150509250929050565b6000602082840312156121e157600080fd5b60006121ef848285016120c7565b91505092915050565b60006020828403121561220a57600080fd5b6000612218848285016120dc565b91505092915050565b60006020828403121561223357600080fd5b6000612241848285016120f1565b91505092915050565b60006020828403121561225c57600080fd5b600061226a84828501612106565b91505092915050565b6000806040838503121561228657600080fd5b600061229485828601612106565b92505060206122a585828601612106565b9150509250929050565b6122b881612600565b82525050565b6122c781612612565b82525050565b6122d68161261e565b82525050565b60006122e7826124cf565b6122f181856124da565b93506123018185602086016126ac565b61230a816127e7565b840191505092915050565b60006123226007836124da565b915061232d826127f8565b602082019050919050565b6000612345600a836124da565b915061235082612821565b602082019050919050565b6000612368600d836124da565b91506123738261284a565b602082019050919050565b61238781612654565b82525050565b6123968161269a565b82525050565b6123a581612690565b82525050565b60006020820190506123c060008301846122af565b92915050565b60006020820190506123db60008301846122be565b92915050565b60006020820190506123f660008301846122cd565b92915050565b6000602082019050818103600083015261241681846122dc565b905092915050565b6000602082019050818103600083015261243781612315565b9050919050565b6000602082019050818103600083015261245781612338565b9050919050565b600060208201905081810360008301526124778161235b565b9050919050565b6000602082019050612493600083018461237e565b92915050565b60006020820190506124ae600083018461238d565b92915050565b60006020820190506124c9600083018461239c565b92915050565b600081519050919050565b600082825260208201905092915050565b60006124f682612690565b915061250183612690565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125365761253561275a565b5b828201905092915050565b600061254c82612690565b915061255783612690565b92508261256757612566612789565b5b828204905092915050565b600061257d82612690565b915061258883612690565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125c1576125c061275a565b5b828202905092915050565b60006125d782612690565b91506125e283612690565b9250828210156125f5576125f461275a565b5b828203905092915050565b600061260b82612670565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006126a582612654565b9050919050565b60005b838110156126ca5780820151818401526020810190506126af565b838111156126d9576000848401525b50505050565b600060028204905060018216806126f757607f821691505b6020821081141561270b5761270a6127b8565b5b50919050565b600061271c82612690565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561274f5761274e61275a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f4552525f43415000000000000000000000000000000000000000000000000000600082015250565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b61287c81612600565b811461288757600080fd5b50565b6128938161261e565b811461289e57600080fd5b50565b6128aa81612628565b81146128b557600080fd5b50565b6128c181612654565b81146128cc57600080fd5b50565b6128d881612690565b81146128e357600080fd5b5056fea26469706673582212203739134ea121ca4d8480a7d8b8832366487c122be533e25df8a3f24d3ac147dc64736f6c63430008040033 +\ No newline at end of file diff --git a/python/erc20_demurrage_token/token.py b/python/erc20_demurrage_token/token.py @@ -357,6 +357,23 @@ class DemurrageToken(ERC20): return o + def get_distribution(self, contract_address, supply, demurrage_amount, sender_address=ZERO_ADDRESS): + o = jsonrpc_template() + o['method'] = 'eth_call' + enc = ABIContractEncoder() + enc.method('getDistribution') + enc.typ(ABIContractType.UINT256) + enc.typ(ABIContractType.UINT256) + enc.uint256(supply) + enc.uint256(demurrage_amount) + data = add_0x(enc.get()) + tx = self.template(sender_address, contract_address) + tx = self.set_code(tx, data) + o['params'].append(self.normalize(tx)) + o['params'].append('latest') + return o + + @classmethod def parse_actual_period(self, v): return abi_decode_single(ABIContractType.UINT256, v) @@ -419,3 +436,8 @@ class DemurrageToken(ERC20): @classmethod def parse_decay_by(self, v): return abi_decode_single(ABIContractType.UINT256, v) + + + @classmethod + def parse_get_distribution(self, v): + return abi_decode_single(ABIContractType.UINT256, v) diff --git a/python/examples/sim_noredistribute.py b/python/examples/sim_noredistribute.py @@ -8,7 +8,7 @@ from erc20_demurrage_token.sim import DemurrageTokenSimulation logging.basicConfig(level=logging.INFO) logg = logging.getLogger() -decay_per_minute = 0.00050105908373373 # equals approx 2% per month +decay_per_minute = 0.00000050105908373373 # equals approx 2% per month # parameters for simulation object settings = DemurrageTokenSettings() diff --git a/python/tests/base.py b/python/tests/base.py @@ -60,7 +60,7 @@ class TestDemurrage(EthTesterCase): except TypeError: self.start_time = int(r['timestamp']) - self.default_supply = 1000000000000 + self.default_supply = 10 ** 12 self.default_supply_cap = int(self.default_supply * 10) diff --git a/python/tests/test_basic.py b/python/tests/test_basic.py @@ -55,7 +55,7 @@ class TestBasic(TestDemurrageDefault): def test_apply_demurrage(self): - modifier = 10 * (10 ** 37) + modifier = (10 ** 38) nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) diff --git a/python/tests/test_redistribution_unit.py b/python/tests/test_redistribution_unit.py @@ -31,124 +31,139 @@ testdir = os.path.dirname(__file__) class TestRedistribution(TestDemurrageUnit): - def test_single_step(self): + # TODO: move to "pure" test file when getdistribution is implemented in all contracts + def test_distribution(self): nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) - mint_amount = 100000000 + demurrage = (self.tax_level / 1000000) * (10^38) + supply = self.default_supply - (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], mint_amount) - self.rpc.do(o) - - self.backend.time_travel(self.start_time + self.period_seconds) - - (tx_hash, o) = c.change_period(self.address, self.accounts[0]) - self.rpc.do(o) - - expected_balance = int(mint_amount - ((self.tax_level / 1000000) * mint_amount)) - - o = c.balance_of(self.address, self.accounts[1], sender_address=self.accounts[0]) + o = c.get_distribution(self.address, supply, demurrage, sender_address=self.accounts[0]) r = self.rpc.do(o) - balance = c.parse_balance_of(r) - - self.assertEqual(balance, expected_balance) - - - def test_single_step_multi(self): - nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) - c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) - - mint_amount = 100000000 - - for i in range(3): - (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[i+1], mint_amount) - self.rpc.do(o) - - self.backend.time_travel(self.start_time + self.period_seconds) - - (tx_hash, o) = c.change_period(self.address, self.accounts[0]) - self.rpc.do(o) - - expected_balance = int(mint_amount - ((self.tax_level / 1000000) * mint_amount)) - - for i in range(3): - o = c.balance_of(self.address, self.accounts[i+1], sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance_of(r) - self.assertEqual(balance, expected_balance) - - - def test_single_step_transfer(self): - nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) - c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) - - mint_amount = 100000000 - half_mint_amount = int(mint_amount / 2) - - (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], mint_amount) - self.rpc.do(o) - - (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[2], mint_amount) - self.rpc.do(o) - - nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) - c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) - (tx_hash, o) = c.transfer(self.address, self.accounts[1], self.accounts[3], half_mint_amount) - self.rpc.do(o) - - self.backend.time_travel(self.start_time + self.period_seconds) - - (tx_hash, o) = c.change_period(self.address, self.accounts[1]) - self.rpc.do(o) - o = receipt(tx_hash) - r = self.rpc.do(o) - self.assertEqual(r['status'], 1) - - demurrage_amount = int((self.tax_level / 1000000) * mint_amount) - - expected_balance = mint_amount - demurrage_amount - o = c.balance_of(self.address, self.accounts[2], sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance_of(r) - self.assertEqual(balance, expected_balance) - - half_demurrage_amount = int((self.tax_level / 1000000) * half_mint_amount) - - expected_balance = half_mint_amount - half_demurrage_amount - o = c.balance_of(self.address, self.accounts[1], sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance_of(r) - self.assertEqual(balance, expected_balance) - - o = c.balance_of(self.address, self.accounts[3], sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance_of(r) - self.assertEqual(balance, expected_balance) - - o = c.total_supply(self.address, sender_address=self.accounts[0]) - r = self.rpc.do(o) - supply = c.parse_total_supply(r) - - - o = c.redistributions(self.address, 0, sender_address=self.accounts[0]) - redistribution = self.rpc.do(o) - o = c.to_redistribution_supply(self.address, redistribution, sender_address=self.accounts[0]) - r = self.rpc.do(o) - supply = c.parse_to_redistribution_item(r) - o = c.demurrage_amount(self.address, sender_address=self.accounts[0]) - r = self.rpc.do(o) - demurrage = c.parse_demurrage_amount(r) - logg.debug('\nrediistribution {}\ndemurrage {}\nsupply {}'.format(redistribution, demurrage, supply)) - - expected_balance = int(supply * (self.tax_level / 1000000)) - expected_balance_tolerance = 1 - - o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance_of(r) - self.assertGreaterEqual(balance, expected_balance - expected_balance_tolerance) - self.assertLessEqual(balance, expected_balance) - + distribution = c.parse_get_distribution(r) + expected_distribution = self.default_supply * (self.tax_level / 1000000) + self.assertEqual(distribution, self.default_supply + expected_distribution) + + +# def test_single_step(self): +# nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) +# c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# +# mint_amount = 100000000 +# +# (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], mint_amount) +# self.rpc.do(o) +# +# self.backend.time_travel(self.start_time + self.period_seconds) +# +# (tx_hash, o) = c.change_period(self.address, self.accounts[0]) +# self.rpc.do(o) +# +# expected_balance = int(mint_amount - ((self.tax_level / 1000000) * mint_amount)) +# +# o = c.balance_of(self.address, self.accounts[1], sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance_of(r) +# +# self.assertEqual(balance, expected_balance) +# +# +# def test_single_step_multi(self): +# nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) +# c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# +# mint_amount = 100000000 +# +# for i in range(3): +# (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[i+1], mint_amount) +# self.rpc.do(o) +# +# self.backend.time_travel(self.start_time + self.period_seconds) +# +# (tx_hash, o) = c.change_period(self.address, self.accounts[0]) +# self.rpc.do(o) +# +# expected_balance = int(mint_amount - ((self.tax_level / 1000000) * mint_amount)) +# +# for i in range(3): +# o = c.balance_of(self.address, self.accounts[i+1], sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance_of(r) +# self.assertEqual(balance, expected_balance) +# +# +# def test_single_step_transfer(self): +# nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) +# c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# +# mint_amount = 100000000 +# half_mint_amount = int(mint_amount / 2) +# +# (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], mint_amount) +# self.rpc.do(o) +# +# (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[2], mint_amount) +# self.rpc.do(o) +# +# nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) +# c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash, o) = c.transfer(self.address, self.accounts[1], self.accounts[3], half_mint_amount) +# self.rpc.do(o) +# +# self.backend.time_travel(self.start_time + self.period_seconds) +# +# (tx_hash, o) = c.change_period(self.address, self.accounts[1]) +# self.rpc.do(o) +# o = receipt(tx_hash) +# r = self.rpc.do(o) +# self.assertEqual(r['status'], 1) +# +# demurrage_amount = int((self.tax_level / 1000000) * mint_amount) +# +# expected_balance = mint_amount - demurrage_amount +# o = c.balance_of(self.address, self.accounts[2], sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance_of(r) +# self.assertEqual(balance, expected_balance) +# +# half_demurrage_amount = int((self.tax_level / 1000000) * half_mint_amount) +# +# expected_balance = half_mint_amount - half_demurrage_amount +# o = c.balance_of(self.address, self.accounts[1], sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance_of(r) +# self.assertEqual(balance, expected_balance) +# +# o = c.balance_of(self.address, self.accounts[3], sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance_of(r) +# self.assertEqual(balance, expected_balance) +# +# o = c.total_supply(self.address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# supply = c.parse_total_supply(r) +# +# +# o = c.redistributions(self.address, 0, sender_address=self.accounts[0]) +# redistribution = self.rpc.do(o) +# o = c.to_redistribution_supply(self.address, redistribution, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# supply = c.parse_to_redistribution_item(r) +# o = c.demurrage_amount(self.address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# demurrage = c.parse_demurrage_amount(r) +# logg.debug('\nrediistribution {}\ndemurrage {}\nsupply {}'.format(redistribution, demurrage, supply)) +# +# expected_balance = int(supply * (self.tax_level / 1000000)) +# expected_balance_tolerance = 1 +# +# o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance_of(r) +# self.assertGreaterEqual(balance, expected_balance - expected_balance_tolerance) +# self.assertLessEqual(balance, expected_balance) +# if __name__ == '__main__': unittest.main() diff --git a/solidity/DemurrageTokenSingleCap.sol b/solidity/DemurrageTokenSingleCap.sol @@ -6,13 +6,13 @@ contract DemurrageTokenSingleCap { // Redistribution bit field, with associated shifts and masks // (Uses sub-byte boundaries) - bytes32[] public redistributions; // uint95(unused) | uint20(demurrageModifier) | uint36(participants) | uint72(value) | uint32(period) + bytes32[] public redistributions; // uint51(unused) | uint64(demurrageModifier) | uint36(participants) | uint72(value) | uint32(period) uint8 constant shiftRedistributionPeriod = 0; uint256 constant maskRedistributionPeriod = 0x00000000000000000000000000000000000000000000000000000000ffffffff; // (1 << 32) - 1 uint8 constant shiftRedistributionValue = 32; uint256 constant maskRedistributionValue = 0x00000000000000000000000000000000000000ffffffffffffffffff00000000; // ((1 << 72) - 1) << 32 - uint8 constant shiftRedistributionDemurrage = 140; - uint256 constant maskRedistributionDemurrage = 0x000000000000000000000ffffffff00000000000000000000000000000000000; // ((1 << 20) - 1) << 140 + uint8 constant shiftRedistributionDemurrage = 104; + uint256 constant maskRedistributionDemurrage = 0x000000ffffffffffffffffffffffffffffffff00000000000000000000000000; // ((1 << 20) - 1) << 140 // Account balances mapping (address => uint256) account; @@ -55,6 +55,9 @@ contract DemurrageTokenSingleCap { // remaining decimal positions of nanoDivider to reach 38, equals precision in growth and decay uint256 constant growthResolutionFactor = 1000000000000; + // demurrage decimal width; 38 places + uint256 immutable resolutionFactor = nanoDivider * growthResolutionFactor; + // Timestamp of start of periods (time which contract constructor was called) uint256 public immutable periodStart; @@ -111,10 +114,10 @@ contract DemurrageTokenSingleCap { demurrageTimestamp = block.timestamp; periodStart = demurrageTimestamp; periodDuration = _periodMinutes * 60; - demurrageAmount = uint128(nanoDivider * 1000000000000); // Represents 38 decimal places + demurrageAmount = 100000000000000000000000000000000000000; // Represents 38 decimal places, same as resolutionFactor //demurragePeriod = 1; taxLevel = _taxLevelMinute; // Represents 38 decimal places - bytes32 initialRedistribution = toRedistribution(0, 10000000000000000000, 0, 1); + bytes32 initialRedistribution = toRedistribution(0, nanoDivider, 0, 1); redistributions.push(initialRedistribution); // Misc settings @@ -246,7 +249,8 @@ contract DemurrageTokenSingleCap { uint256 currentRedistribution; uint256 grownSupply; - grownSupply = growBy(totalSupply, 1); + //grownSupply = growBy(totalSupply, 1); + grownSupply = totalSupply; currentRedistribution = uint256(redistributions[redistributions.length-1]); currentRedistribution &= (~maskRedistributionValue); currentRedistribution |= (grownSupply << shiftRedistributionValue); @@ -280,10 +284,15 @@ contract DemurrageTokenSingleCap { // Returns the amount sent to the sink address function applyDefaultRedistribution(bytes32 _redistribution) private returns (uint256) { uint256 redistributionSupply; + uint256 redistributionDemurrage; uint256 unit; redistributionSupply = toRedistributionSupply(_redistribution); - unit = getDistribution(redistributionSupply, demurrageAmount); + redistributionDemurrage = resolutionFactor - toRedistributionDemurrageModifier(_redistribution); + if (redistributionDemurrage == 0) { + return 0; + } + unit = getDistribution(redistributionSupply, redistributionDemurrage); increaseBaseBalance(sinkAddress, toBaseAmount(unit / nanoDivider)); return unit; } @@ -349,9 +358,9 @@ contract DemurrageTokenSingleCap { demurrageCounts = demurrageCycles(periodTimestamp); if (demurrageCounts > 0) { - nextRedistributionDemurrage = growBy(currentDemurrageAmount, demurrageCounts) / nanoDivider; + nextRedistributionDemurrage = growBy(currentDemurrageAmount, demurrageCounts); } else { - nextRedistributionDemurrage = currentDemurrageAmount / nanoDivider; + nextRedistributionDemurrage = currentDemurrageAmount; } nextRedistribution = toRedistribution(0, nextRedistributionDemurrage, totalSupply, nextPeriod);