erc20-demurrage-token

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

commit 31faa783469df0e2e064a1f1be77e6e95fa0037e
parent 18ee9c5f9b4046ebab2fd6ffca17b95ccc8cfc47
Author: lash <dev@holbrook.no>
Date:   Fri, 27 May 2022 12:51:10 +0000

Keep cumulative sink total in state and deduct from upcoming demurrage

Diffstat:
Mpython/erc20_demurrage_token/data/DemurrageTokenSingleNocap.bin | 4++--
Mpython/erc20_demurrage_token/data/DemurrageTokenSingleNocap.json | 2+-
Mpython/erc20_demurrage_token/token.py | 4+---
Mpython/tests/test_redistribution_single.py | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------
Mpython/tests/test_redistribution_unit.py | 13+++++--------
Msolidity/DemurrageTokenSingleNocap.sol | 39+++++++++++----------------------------
6 files changed, 108 insertions(+), 85 deletions(-)

diff --git a/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.bin b/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap.bin @@ -1 +1 @@ -61010060405264e8d4a510006a52b7d2dcc80cd2e40000006200002391906200043e565b6080908152503480156200003657600080fd5b50604051620034bf380380620034bf83398181016040528101906200005c91906200075d565b33600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555085600790805190602001906200012f92919062000355565b5084600890805190602001906200014892919062000355565b508360ff166009819055504260048190555060045460a08181525050603c826200017391906200043e565b60c0818152505060646a52b7d2dcc80cd2e400000062000194919062000837565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16600381905550826fffffffffffffffffffffffffffffffff1660e0818152505060006200026f6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660006001620002e8640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050505050620008ec565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b8280546200036390620008b7565b90600052602060002090601f016020900481019282620003875760008555620003d3565b82601f10620003a257805160ff1916838001178555620003d3565b82800160010185558215620003d3579182015b82811115620003d2578251825591602001919060010190620003b5565b5b509050620003e29190620003e6565b5090565b5b8082111562000401576000816000905550600101620003e7565b5090565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200044b8262000405565b9150620004588362000405565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156200049457620004936200040f565b5b828202905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200050882620004bd565b810181811067ffffffffffffffff821117156200052a5762000529620004ce565b5b80604052505050565b60006200053f6200049f565b90506200054d8282620004fd565b919050565b600067ffffffffffffffff82111562000570576200056f620004ce565b5b6200057b82620004bd565b9050602081019050919050565b60005b83811015620005a85780820151818401526020810190506200058b565b83811115620005b8576000848401525b50505050565b6000620005d5620005cf8462000552565b62000533565b905082815260208101848484011115620005f457620005f3620004b8565b5b6200060184828562000588565b509392505050565b600082601f830112620006215762000620620004b3565b5b815162000633848260208601620005be565b91505092915050565b600060ff82169050919050565b62000654816200063c565b81146200066057600080fd5b50565b600081519050620006748162000649565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b620006a1816200067a565b8114620006ad57600080fd5b50565b600081519050620006c18162000696565b92915050565b620006d28162000405565b8114620006de57600080fd5b50565b600081519050620006f281620006c7565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200072582620006f8565b9050919050565b620007378162000718565b81146200074357600080fd5b50565b60008151905062000757816200072c565b92915050565b60008060008060008060c087890312156200077d576200077c620004a9565b5b600087015167ffffffffffffffff8111156200079e576200079d620004ae565b5b620007ac89828a0162000609565b965050602087015167ffffffffffffffff811115620007d057620007cf620004ae565b5b620007de89828a0162000609565b9550506040620007f189828a0162000663565b94505060606200080489828a01620006b0565b93505060806200081789828a01620006e1565b92505060a06200082a89828a0162000746565b9150509295509295509295565b600062000844826200067a565b915062000851836200067a565b9250816fffffffffffffffffffffffffffffffff04831182151516156200087d576200087c6200040f565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620008d057607f821691505b602082108103620008e657620008e562000888565b5b50919050565b60805160a05160c05160e051612b5a6200096560003960008181610ccd01528181610f1d0152611be301526000818161116d015281816119fd0152611c8201526000818161119901528181611ca30152611ce80152600081816112060152818161123e015281816112b601526119d90152612b5a6000f3fe608060405234801561001057600080fd5b5060043610610286576000357c0100000000000000000000000000000000000000000000000000000000900480636ffa8a051161016e578063ab28cea0116100e0578063e3ab207a116100a4578063e3ab207a14610847578063e54d63f714610877578063e8095295146108a7578063eda4e6d6146108c5578063f2fde38b146108e3578063f83da35d1461091357610286565b8063ab28cea01461078d578063b470aade146107ab578063c0ab7077146107c9578063d340ef8a146107f9578063de9b84881461081757610286565b80638f0b2d5d116101325780638f0b2d5d146106a55780638f1df6bc146106c157806395d89b41146106df578063983b2d56146106fd5780639da7d8ba1461072d578063a9059cbb1461075d57610286565b80636ffa8a05146105eb57806370a082311461061b578063731f237c1461064b57806379ba5097146106695780638da5cb5b1461068757610286565b806331333487116102075780634abfbba2116101cb5780634abfbba2146104dd57806351b4541c1461050d57806358b2833b1461053d5780636721d4ef1461055b5780636787a9be1461058b5780636a2d094e146105bb57610286565b806331333487146103ff578063313ce5671461042f57806340452d911461044d578063449a52f81461047d57806347a50517146104ad57610286565b806318160ddd1161024e57806318160ddd146103455780631989c6a814610363578063229ba1971461038157806323b872dd1461039f5780633092afd5146103cf57610286565b806301ffc9a71461028b57806306fdde03146102bb578063095ea7b3146102d957806309f28f3c146103095780630b2472eb14610327575b600080fd5b6102a560048036038101906102a0919061225c565b610943565b6040516102b291906122a4565b60405180910390f35b6102c3610ae9565b6040516102d09190612358565b60405180910390f35b6102f360048036038101906102ee919061240e565b610b77565b60405161030091906122a4565b60405180910390f35b610311610c91565b60405161031e9190612479565b60405180910390f35b61032f610cb3565b60405161033c91906124a3565b60405180910390f35b61034d610cb9565b60405161035a91906124a3565b60405180910390f35b61036b610cbf565b60405161037891906124a3565b60405180910390f35b610389610ccb565b60405161039691906124a3565b60405180910390f35b6103b960048036038101906103b491906124be565b610cef565b6040516103c691906122a4565b60405180910390f35b6103e960048036038101906103e49190612511565b610e0f565b6040516103f691906122a4565b60405180910390f35b6104196004803603810190610414919061253e565b610f02565b60405161042691906124a3565b60405180910390f35b610437610fb6565b60405161044491906124a3565b60405180910390f35b6104676004803603810190610462919061257e565b610fbc565b60405161047491906125c4565b60405180910390f35b6104976004803603810190610492919061240e565b610fe0565b6040516104a491906122a4565b60405180910390f35b6104c760048036038101906104c29190612511565b611120565b6040516104d491906124a3565b60405180910390f35b6104f760048036038101906104f2919061257e565b611169565b60405161050491906124a3565b60405180910390f35b6105276004803603810190610522919061257e565b6111c9565b60405161053491906124a3565b60405180910390f35b6105456111ea565b60405161055291906124a3565b60405180910390f35b6105756004803603810190610570919061253e565b6111f0565b60405161058291906124a3565b60405180910390f35b6105a560048036038101906105a0919061257e565b611271565b6040516105b291906124a3565b60405180910390f35b6105d560048036038101906105d0919061257e565b6112f1565b6040516105e291906124a3565b60405180910390f35b6106056004803603810190610600919061260b565b611312565b60405161061291906124a3565b60405180910390f35b61063560048036038101906106309190612511565b61134c565b60405161064291906124a3565b60405180910390f35b610653611404565b60405161066091906122a4565b60405180910390f35b610671611415565b60405161067e91906122a4565b60405180910390f35b61068f6115bc565b60405161069c9190612647565b60405180910390f35b6106bf60048036038101906106ba9190612511565b6115e2565b005b6106c9611680565b6040516106d691906122a4565b60405180910390f35b6106e76117ca565b6040516106f49190612358565b60405180910390f35b61071760048036038101906107129190612511565b611858565b60405161072491906122a4565b60405180910390f35b6107476004803603810190610742919061260b565b611915565b60405161075491906124a3565b60405180910390f35b6107776004803603810190610772919061240e565b611941565b60405161078491906122a4565b60405180910390f35b6107956119d7565b6040516107a291906124a3565b60405180910390f35b6107b36119fb565b6040516107c091906124a3565b60405180910390f35b6107e360048036038101906107de919061257e565b611a1f565b6040516107f091906122a4565b60405180910390f35b610801611b57565b60405161080e91906124a3565b60405180910390f35b610831600480360381019061082c9190612662565b611b5d565b60405161083e91906124a3565b60405180910390f35b610861600480360381019061085c919061260b565b611bb4565b60405161086e91906124a3565b60405180910390f35b610891600480360381019061088c919061253e565b611bc8565b60405161089e91906124a3565b60405180910390f35b6108af611c7c565b6040516108bc9190612479565b60405180910390f35b6108cd611ce6565b6040516108da91906124a3565b60405180910390f35b6108fd60048036038101906108f89190612511565b611d0a565b60405161090a91906122a4565b60405180910390f35b61092d600480360381019061092891906126a2565b611dac565b60405161093a91906125c4565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036109975760019050610ae4565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036109e95760019050610ae4565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610a3b5760019050610ae4565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610a8d5760019050610ae4565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610adf5760019050610ae4565b600090505b919050565b60078054610af690612738565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2290612738565b8015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b505050505081565b600080610b82611680565b50610b8c83611271565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c1a9190612798565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610c7e91906124a3565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60035481565b600a5481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610cfc611680565b50610d0684611271565b915081600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d9157600080fd5b610d9c868684611e19565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610dfb91906124a3565b60405180910390a380925050509392505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e9857503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610ea157600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000610f46919061281d565b905060005b84811015610f8f5764e8d4a510008284610f65919061284e565b610f6f919061281d565b83610f7a91906128a8565b92508080610f87906128dc565b915050610f4b565b5064e8d4a510008583610fa2919061284e565b610fac919061281d565b9250505092915050565b60095481565b60008181548110610fcc57600080fd5b906000526020600020016000915090505481565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661106f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106690612970565b60405180910390fd5b611077611680565b5061108183611271565b905082600a60008282546110959190612798565b925050819055506110a68482611e3e565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f88560405161110491906124a3565b60405180910390a3611114611f02565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f000000000000000000000000000000000000000000000000000000000000000082611197919061284e565b7f00000000000000000000000000000000000000000000000000000000000000006111c29190612798565b9050919050565b6000603c82426111d991906128a8565b6111e3919061281d565b9050919050565b60045481565b6000806402540be40083611204919061284e565b7f000000000000000000000000000000000000000000000000000000000000000061122f91906128a8565b8461123a919061284e565b90507f000000000000000000000000000000000000000000000000000000000000000081611268919061281d565b91505092915050565b60006402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff166112a29190612990565b6fffffffffffffffffffffffffffffffff167f0000000000000000000000000000000000000000000000000000000000000000836112e0919061284e565b6112ea919061281d565b9050919050565b6000603c824261130191906128a8565b61130b919061281d565b9050919050565b6000606860ff167affffffffffffffffffffffffffff00000000000000000000000000836001900416908060020a82049150509050919050565b60008060008061135b85611120565b92506113686004546111c9565b90506113b46402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff1661139c9190612990565b6fffffffffffffffffffffffffffffffff1682610f02565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e40000006113e4919061284e565b82846113f0919061284e565b6113fa919061281d565b9350505050919050565b60006114106000611a1f565b905090565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461147257600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461163c57600080fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000806000806000806000611696611404565b5061169f611fa4565b9750600060010288036116bd576000985050505050505050506117c7565b6116c688611bb4565b95506001866116d59190612798565b90506116e086611169565b9150600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16945061171e826112f1565b9250600083111561173a576117338584611bc8565b935061173e565b8493505b61174d600085600a5484611dac565b965060008790806001815401808255809150506001900390600052602060002001600090919091909150556117828789612090565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d675816040516117b291906124a3565b60405180910390a16001985050505050505050505b90565b600880546117d790612738565b80601f016020809104026020016040519081016040528092919081815260200182805461180390612738565b80156118505780601f1061182557610100808354040283529160200191611850565b820191906000526020600020905b81548152906001019060200180831161183357829003601f168201915b505050505081565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118b457600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b600080600061194e611680565b5061195884611271565b9150611965338684611e19565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040516119c491906124a3565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000611a2f6004546111c9565b915060008203611a4457600092505050611b52565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050600084118015611a8657508184105b15611a8f578391505b611a998183610f02565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c82611ade919061284e565b600454611aeb9190612798565b60048190555080826004547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff16604051611b439190612a15565b60405180910390a46001925050505b919050565b600b5481565b600080600080611b6c86611915565b9250611b7786611312565b9150611b8285611312565b90508181611b9091906128a8565b600354611b9d91906128a8565b9150611ba983836111f0565b935050505092915050565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000611c0c919061281d565b905060005b84811015611c555764e8d4a510008284611c2b919061284e565b611c35919061281d565b83611c409190612798565b92508080611c4d906128dc565b915050611c11565b5064e8d4a510008583611c68919061284e565b611c72919061281d565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611ccd91906128a8565b611cd7919061281d565b611ce19190612798565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d6657600080fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b600080611e2685846120f8565b50611e318484611e3e565b5060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008503611e9a5760009350505050611efc565b611ea386611120565b92508483611eb19190612798565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000600a54905060006001600080549050611f2091906128a8565b81548110611f3157611f30612a30565b5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611f7c91906128a8565b81548110611f8d57611f8c612a30565b5b906000526020600020018190555060019250505090565b600080600080600b5481548110611fbe57611fbd612a30565b5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381865afa158015612032573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120569190612a8b565b6fffffffffffffffffffffffffffffffff16905061207382611bb4565b81116120875760006001029250505061208d565b81925050505b90565b60008061209d8484611b5d565b90506120d3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166120ce83611271565b611e3e565b506001600b60008282546120e79190612798565b925050819055508091505092915050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000850361215457600093505050506121f9565b61215d86611120565b9250848310156121a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219990612b04565b60405180910390fd5b84836121ae91906128a8565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61223981612204565b811461224457600080fd5b50565b60008135905061225681612230565b92915050565b600060208284031215612272576122716121ff565b5b600061228084828501612247565b91505092915050565b60008115159050919050565b61229e81612289565b82525050565b60006020820190506122b96000830184612295565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122f95780820151818401526020810190506122de565b83811115612308576000848401525b50505050565b6000601f19601f8301169050919050565b600061232a826122bf565b61233481856122ca565b93506123448185602086016122db565b61234d8161230e565b840191505092915050565b60006020820190508181036000830152612372818461231f565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123a58261237a565b9050919050565b6123b58161239a565b81146123c057600080fd5b50565b6000813590506123d2816123ac565b92915050565b6000819050919050565b6123eb816123d8565b81146123f657600080fd5b50565b600081359050612408816123e2565b92915050565b60008060408385031215612425576124246121ff565b5b6000612433858286016123c3565b9250506020612444858286016123f9565b9150509250929050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6124738161244e565b82525050565b600060208201905061248e600083018461246a565b92915050565b61249d816123d8565b82525050565b60006020820190506124b86000830184612494565b92915050565b6000806000606084860312156124d7576124d66121ff565b5b60006124e5868287016123c3565b93505060206124f6868287016123c3565b9250506040612507868287016123f9565b9150509250925092565b600060208284031215612527576125266121ff565b5b6000612535848285016123c3565b91505092915050565b60008060408385031215612555576125546121ff565b5b6000612563858286016123f9565b9250506020612574858286016123f9565b9150509250929050565b600060208284031215612594576125936121ff565b5b60006125a2848285016123f9565b91505092915050565b6000819050919050565b6125be816125ab565b82525050565b60006020820190506125d960008301846125b5565b92915050565b6125e8816125ab565b81146125f357600080fd5b50565b600081359050612605816125df565b92915050565b600060208284031215612621576126206121ff565b5b600061262f848285016125f6565b91505092915050565b6126418161239a565b82525050565b600060208201905061265c6000830184612638565b92915050565b60008060408385031215612679576126786121ff565b5b6000612687858286016125f6565b9250506020612698858286016125f6565b9150509250929050565b600080600080608085870312156126bc576126bb6121ff565b5b60006126ca878288016123f9565b94505060206126db878288016123f9565b93505060406126ec878288016123f9565b92505060606126fd878288016123f9565b91505092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061275057607f821691505b60208210810361276357612762612709565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006127a3826123d8565b91506127ae836123d8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156127e3576127e2612769565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612828826123d8565b9150612833836123d8565b925082612843576128426127ee565b5b828204905092915050565b6000612859826123d8565b9150612864836123d8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561289d5761289c612769565b5b828202905092915050565b60006128b3826123d8565b91506128be836123d8565b9250828210156128d1576128d0612769565b5b828203905092915050565b60006128e7826123d8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361291957612918612769565b5b600182019050919050565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b600061295a600a836122ca565b915061296582612924565b602082019050919050565b600060208201905081810360008301526129898161294d565b9050919050565b600061299b8261244e565b91506129a68361244e565b9250816fffffffffffffffffffffffffffffffff04831182151516156129cf576129ce612769565b5b828202905092915050565b6000819050919050565b60006129ff6129fa6129f58461244e565b6129da565b6123d8565b9050919050565b612a0f816129e4565b82525050565b6000602082019050612a2a6000830184612a06565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b612a688161244e565b8114612a7357600080fd5b50565b600081519050612a8581612a5f565b92915050565b600060208284031215612aa157612aa06121ff565b5b6000612aaf84828501612a76565b91505092915050565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b6000612aee600d836122ca565b9150612af982612ab8565b602082019050919050565b60006020820190508181036000830152612b1d81612ae1565b905091905056fea2646970667358221220e550a23a0a73cec1721ab581b45ec189ebe066e3bf61f6d85aa4f40183a53a2964736f6c634300080d0033 -\ No newline at end of file +61010060405264e8d4a510006a52b7d2dcc80cd2e40000006200002391906200043e565b6080908152503480156200003657600080fd5b50604051620034ae380380620034ae83398181016040528101906200005c91906200075d565b33600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555085600790805190602001906200012f92919062000355565b5084600890805190602001906200014892919062000355565b508360ff166009819055504260048190555060045460a08181525050603c826200017391906200043e565b60c0818152505060646a52b7d2dcc80cd2e400000062000194919062000837565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16600381905550826fffffffffffffffffffffffffffffffff1660e0818152505060006200026f6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660006001620002e8640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050505050620008ec565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b8280546200036390620008b7565b90600052602060002090601f016020900481019282620003875760008555620003d3565b82601f10620003a257805160ff1916838001178555620003d3565b82800160010185558215620003d3579182015b82811115620003d2578251825591602001919060010190620003b5565b5b509050620003e29190620003e6565b5090565b5b8082111562000401576000816000905550600101620003e7565b5090565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200044b8262000405565b9150620004588362000405565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156200049457620004936200040f565b5b828202905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200050882620004bd565b810181811067ffffffffffffffff821117156200052a5762000529620004ce565b5b80604052505050565b60006200053f6200049f565b90506200054d8282620004fd565b919050565b600067ffffffffffffffff82111562000570576200056f620004ce565b5b6200057b82620004bd565b9050602081019050919050565b60005b83811015620005a85780820151818401526020810190506200058b565b83811115620005b8576000848401525b50505050565b6000620005d5620005cf8462000552565b62000533565b905082815260208101848484011115620005f457620005f3620004b8565b5b6200060184828562000588565b509392505050565b600082601f830112620006215762000620620004b3565b5b815162000633848260208601620005be565b91505092915050565b600060ff82169050919050565b62000654816200063c565b81146200066057600080fd5b50565b600081519050620006748162000649565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b620006a1816200067a565b8114620006ad57600080fd5b50565b600081519050620006c18162000696565b92915050565b620006d28162000405565b8114620006de57600080fd5b50565b600081519050620006f281620006c7565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200072582620006f8565b9050919050565b620007378162000718565b81146200074357600080fd5b50565b60008151905062000757816200072c565b92915050565b60008060008060008060c087890312156200077d576200077c620004a9565b5b600087015167ffffffffffffffff8111156200079e576200079d620004ae565b5b620007ac89828a0162000609565b965050602087015167ffffffffffffffff811115620007d057620007cf620004ae565b5b620007de89828a0162000609565b9550506040620007f189828a0162000663565b94505060606200080489828a01620006b0565b93505060806200081789828a01620006e1565b92505060a06200082a89828a0162000746565b9150509295509295509295565b600062000844826200067a565b915062000851836200067a565b9250816fffffffffffffffffffffffffffffffff04831182151516156200087d576200087c6200040f565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620008d057607f821691505b602082108103620008e657620008e562000888565b5b50919050565b60805160a05160c05160e051612b496200096560003960008181610cf601528181610f460152611be801526000818161119601528181611a590152611c870152600081816111c201528181611ca80152611ced01526000818161122f01528181611267015281816112df0152611a350152612b496000f3fe608060405234801561001057600080fd5b5060043610610291576000357c01000000000000000000000000000000000000000000000000000000009004806370a082311161016e578063a9059cbb116100e0578063e3ab207a116100a4578063e3ab207a14610870578063e54d63f7146108a0578063e8095295146108d0578063eda4e6d6146108ee578063f2fde38b1461090c578063f83da35d1461093c57610291565b8063a9059cbb146107b6578063ab28cea0146107e6578063b470aade14610804578063c0ab707714610822578063d340ef8a1461085257610291565b80638da5cb5b116101325780638da5cb5b146106e05780638f0b2d5d146106fe5780638f1df6bc1461071a57806395d89b4114610738578063983b2d56146107565780639da7d8ba1461078657610291565b806370a0823114610626578063731f237c1461065657806374bedb951461067457806379ba5097146106925780638d34855a146106b057610291565b8063313ce5671161020757806351b4541c116101cb57806351b4541c1461051857806358b2833b146105485780636721d4ef146105665780636787a9be146105965780636a2d094e146105c65780636ffa8a05146105f657610291565b8063313ce5671461043a57806340452d9114610458578063449a52f81461048857806347a50517146104b85780634abfbba2146104e857610291565b806318160ddd1161025957806318160ddd146103505780631989c6a81461036e578063229ba1971461038c57806323b872dd146103aa5780633092afd5146103da578063313334871461040a57610291565b806301ffc9a71461029657806306fdde03146102c6578063095ea7b3146102e457806309f28f3c146103145780630b2472eb14610332575b600080fd5b6102b060048036038101906102ab919061228b565b61096c565b6040516102bd91906122d3565b60405180910390f35b6102ce610b12565b6040516102db9190612387565b60405180910390f35b6102fe60048036038101906102f9919061243d565b610ba0565b60405161030b91906122d3565b60405180910390f35b61031c610cba565b60405161032991906124a8565b60405180910390f35b61033a610cdc565b60405161034791906124d2565b60405180910390f35b610358610ce2565b60405161036591906124d2565b60405180910390f35b610376610ce8565b60405161038391906124d2565b60405180910390f35b610394610cf4565b6040516103a191906124d2565b60405180910390f35b6103c460048036038101906103bf91906124ed565b610d18565b6040516103d191906122d3565b60405180910390f35b6103f460048036038101906103ef9190612540565b610e38565b60405161040191906122d3565b60405180910390f35b610424600480360381019061041f919061256d565b610f2b565b60405161043191906124d2565b60405180910390f35b610442610fdf565b60405161044f91906124d2565b60405180910390f35b610472600480360381019061046d91906125ad565b610fe5565b60405161047f91906125f3565b60405180910390f35b6104a2600480360381019061049d919061243d565b611009565b6040516104af91906122d3565b60405180910390f35b6104d260048036038101906104cd9190612540565b611149565b6040516104df91906124d2565b60405180910390f35b61050260048036038101906104fd91906125ad565b611192565b60405161050f91906124d2565b60405180910390f35b610532600480360381019061052d91906125ad565b6111f2565b60405161053f91906124d2565b60405180910390f35b610550611213565b60405161055d91906124d2565b60405180910390f35b610580600480360381019061057b919061256d565b611219565b60405161058d91906124d2565b60405180910390f35b6105b060048036038101906105ab91906125ad565b61129a565b6040516105bd91906124d2565b60405180910390f35b6105e060048036038101906105db91906125ad565b61131a565b6040516105ed91906124d2565b60405180910390f35b610610600480360381019061060b919061263a565b61133b565b60405161061d91906124d2565b60405180910390f35b610640600480360381019061063b9190612540565b611375565b60405161064d91906124d2565b60405180910390f35b61065e61142d565b60405161066b91906122d3565b60405180910390f35b61067c61143e565b60405161068991906124d2565b60405180910390f35b61069a611444565b6040516106a791906122d3565b60405180910390f35b6106ca60048036038101906106c5919061263a565b6115eb565b6040516106d791906124d2565b60405180910390f35b6106e8611619565b6040516106f59190612676565b60405180910390f35b61071860048036038101906107139190612540565b61163f565b005b6107226116dd565b60405161072f91906122d3565b60405180910390f35b610740611826565b60405161074d9190612387565b60405180910390f35b610770600480360381019061076b9190612540565b6118b4565b60405161077d91906122d3565b60405180910390f35b6107a0600480360381019061079b919061263a565b611971565b6040516107ad91906124d2565b60405180910390f35b6107d060048036038101906107cb919061243d565b61199d565b6040516107dd91906122d3565b60405180910390f35b6107ee611a33565b6040516107fb91906124d2565b60405180910390f35b61080c611a57565b60405161081991906124d2565b60405180910390f35b61083c600480360381019061083791906125ad565b611a7b565b60405161084991906122d3565b60405180910390f35b61085a611bb3565b60405161086791906124d2565b60405180910390f35b61088a6004803603810190610885919061263a565b611bb9565b60405161089791906124d2565b60405180910390f35b6108ba60048036038101906108b5919061256d565b611bcd565b6040516108c791906124d2565b60405180910390f35b6108d8611c81565b6040516108e591906124a8565b60405180910390f35b6108f6611ceb565b60405161090391906124d2565b60405180910390f35b61092660048036038101906109219190612540565b611d0f565b60405161093391906122d3565b60405180910390f35b61095660048036038101906109519190612691565b611db1565b60405161096391906125f3565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036109c05760019050610b0d565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610a125760019050610b0d565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610a645760019050610b0d565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610ab65760019050610b0d565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610b085760019050610b0d565b600090505b919050565b60078054610b1f90612727565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4b90612727565b8015610b985780601f10610b6d57610100808354040283529160200191610b98565b820191906000526020600020905b815481529060010190602001808311610b7b57829003601f168201915b505050505081565b600080610bab6116dd565b50610bb58361129a565b905080600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c439190612787565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610ca791906124d2565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60035481565b600a5481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610d256116dd565b50610d2f8461129a565b915081600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610dba57600080fd5b610dc5868684611e1e565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610e2491906124d2565b60405180910390a380925050509392505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ec157503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610eca57600080fd5b6000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000610f6f919061280c565b905060005b84811015610fb85764e8d4a510008284610f8e919061283d565b610f98919061280c565b83610fa39190612897565b92508080610fb0906128cb565b915050610f74565b5064e8d4a510008583610fcb919061283d565b610fd5919061280c565b9250505092915050565b60095481565b60008181548110610ff557600080fd5b906000526020600020016000915090505481565b600080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611098576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108f9061295f565b60405180910390fd5b6110a06116dd565b506110aa8361129a565b905082600a60008282546110be9190612787565b925050819055506110cf8482611e43565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f88560405161112d91906124d2565b60405180910390a361113d611f07565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000826111c0919061283d565b7f00000000000000000000000000000000000000000000000000000000000000006111eb9190612787565b9050919050565b6000603c82426112029190612897565b61120c919061280c565b9050919050565b60045481565b6000806402540be4008361122d919061283d565b7f00000000000000000000000000000000000000000000000000000000000000006112589190612897565b84611263919061283d565b90507f000000000000000000000000000000000000000000000000000000000000000081611291919061280c565b91505092915050565b60006402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff166112cb919061297f565b6fffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000083611309919061283d565b611313919061280c565b9050919050565b6000603c824261132a9190612897565b611334919061280c565b9050919050565b6000606860ff167affffffffffffffffffffffffffff00000000000000000000000000836001900416908060020a82049150509050919050565b60008060008061138485611149565b92506113916004546111f2565b90506113dd6402540be400600260009054906101000a90046fffffffffffffffffffffffffffffffff166113c5919061297f565b6fffffffffffffffffffffffffffffffff1682610f2b565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e400000061140d919061283d565b8284611419919061283d565b611423919061280c565b9350505050919050565b60006114396000611a7b565b905090565b600c5481565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114a157600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b60008060006115f984611971565b91506116048461133b565b90506116108282611219565b92505050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461169957600080fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008060008060008060006116f361142d565b506116fc611fa9565b97506000600102880361171a57600098505050505050505050611823565b61172388611bb9565b95506001866117329190612787565b905061173d86611192565b9150600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16945061177b8261131a565b92506000831115611797576117908584611bcd565b935061179b565b8493505b6117aa600085600a5484611db1565b965060008790806001815401808255809150506001900390600052602060002001600090919091909150556117de87612095565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d6758160405161180e91906124d2565b60405180910390a16001985050505050505050505b90565b6008805461183390612727565b80601f016020809104026020016040519081016040528092919081815260200182805461185f90612727565b80156118ac5780601f10611881576101008083540402835291602001916118ac565b820191906000526020600020905b81548152906001019060200180831161188f57829003601f168201915b505050505081565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461191057600080fd5b6001600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b60008060006119aa6116dd565b506119b48461129a565b91506119c1338684611e1e565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051611a2091906124d2565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000611a8b6004546111f2565b915060008203611aa057600092505050611bae565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050600084118015611ae257508184105b15611aeb578391505b611af58183610f2b565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c82611b3a919061283d565b600454611b479190612787565b60048190555080826004547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff16604051611b9f9190612a04565b60405180910390a46001925050505b919050565b600b5481565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000611c11919061280c565b905060005b84811015611c5a5764e8d4a510008284611c30919061283d565b611c3a919061280c565b83611c459190612787565b92508080611c52906128cb565b915050611c16565b5064e8d4a510008583611c6d919061283d565b611c77919061280c565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611cd29190612897565b611cdc919061280c565b611ce69190612787565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d6b57600080fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000807affffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b600080611e2b8584612127565b50611e368484611e43565b5060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008503611e9f5760009350505050611f01565b611ea886611149565b92508483611eb69190612787565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000600a54905060006001600080549050611f259190612897565b81548110611f3657611f35612a1f565b5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611f819190612897565b81548110611f9257611f91612a1f565b5b906000526020600020018190555060019250505090565b600080600080600b5481548110611fc357611fc2612a1f565b5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381865afa158015612037573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205b9190612a7a565b6fffffffffffffffffffffffffffffffff16905061207882611bb9565b811161208c57600060010292505050612092565b81925050505b90565b60008060006120a3846115eb565b9150600c546120b18361129a565b6120bb9190612897565b90506120e9600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682611e43565b506001600b60008282546120fd9190612787565b9250508190555080600c60008282546121169190612787565b925050819055508192505050919050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600085036121835760009350505050612228565b61218c86611149565b9250848310156121d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c890612af3565b60405180910390fd5b84836121dd9190612897565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61226881612233565b811461227357600080fd5b50565b6000813590506122858161225f565b92915050565b6000602082840312156122a1576122a061222e565b5b60006122af84828501612276565b91505092915050565b60008115159050919050565b6122cd816122b8565b82525050565b60006020820190506122e860008301846122c4565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561232857808201518184015260208101905061230d565b83811115612337576000848401525b50505050565b6000601f19601f8301169050919050565b6000612359826122ee565b61236381856122f9565b935061237381856020860161230a565b61237c8161233d565b840191505092915050565b600060208201905081810360008301526123a1818461234e565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123d4826123a9565b9050919050565b6123e4816123c9565b81146123ef57600080fd5b50565b600081359050612401816123db565b92915050565b6000819050919050565b61241a81612407565b811461242557600080fd5b50565b60008135905061243781612411565b92915050565b600080604083850312156124545761245361222e565b5b6000612462858286016123f2565b925050602061247385828601612428565b9150509250929050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6124a28161247d565b82525050565b60006020820190506124bd6000830184612499565b92915050565b6124cc81612407565b82525050565b60006020820190506124e760008301846124c3565b92915050565b6000806000606084860312156125065761250561222e565b5b6000612514868287016123f2565b9350506020612525868287016123f2565b925050604061253686828701612428565b9150509250925092565b6000602082840312156125565761255561222e565b5b6000612564848285016123f2565b91505092915050565b600080604083850312156125845761258361222e565b5b600061259285828601612428565b92505060206125a385828601612428565b9150509250929050565b6000602082840312156125c3576125c261222e565b5b60006125d184828501612428565b91505092915050565b6000819050919050565b6125ed816125da565b82525050565b600060208201905061260860008301846125e4565b92915050565b612617816125da565b811461262257600080fd5b50565b6000813590506126348161260e565b92915050565b6000602082840312156126505761264f61222e565b5b600061265e84828501612625565b91505092915050565b612670816123c9565b82525050565b600060208201905061268b6000830184612667565b92915050565b600080600080608085870312156126ab576126aa61222e565b5b60006126b987828801612428565b94505060206126ca87828801612428565b93505060406126db87828801612428565b92505060606126ec87828801612428565b91505092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061273f57607f821691505b602082108103612752576127516126f8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061279282612407565b915061279d83612407565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156127d2576127d1612758565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061281782612407565b915061282283612407565b925082612832576128316127dd565b5b828204905092915050565b600061284882612407565b915061285383612407565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561288c5761288b612758565b5b828202905092915050565b60006128a282612407565b91506128ad83612407565b9250828210156128c0576128bf612758565b5b828203905092915050565b60006128d682612407565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361290857612907612758565b5b600182019050919050565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b6000612949600a836122f9565b915061295482612913565b602082019050919050565b600060208201905081810360008301526129788161293c565b9050919050565b600061298a8261247d565b91506129958361247d565b9250816fffffffffffffffffffffffffffffffff04831182151516156129be576129bd612758565b5b828202905092915050565b6000819050919050565b60006129ee6129e96129e48461247d565b6129c9565b612407565b9050919050565b6129fe816129d3565b82525050565b6000602082019050612a1960008301846129f5565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b612a578161247d565b8114612a6257600080fd5b50565b600081519050612a7481612a4e565b92915050565b600060208284031215612a9057612a8f61222e565b5b6000612a9e84828501612a65565b91505092915050565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b6000612add600d836122f9565b9150612ae882612aa7565b602082019050919050565b60006020820190508181036000830152612b0c81612ad0565b905091905056fea2646970667358221220ecba5763a1067c4f87f90ee27874db9cae32767ff5c73b0d52687aa32204573f64736f6c634300080d0033 +\ No newline at end of file diff --git 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":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":[],"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":"demurrageStart","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"},{"internalType":"bytes32","name":"_redistributionPrevious","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":[{"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":"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":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":[],"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":"demurrageStart","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":[{"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":"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 @@ -454,16 +454,14 @@ class DemurrageToken(ERC20): return o - def get_distribution_from_redistribution(self, contract_address, redistribution, redistribution_previous, sender_address=ZERO_ADDRESS, id_generator=None): + def get_distribution_from_redistribution(self, contract_address, redistribution, sender_address=ZERO_ADDRESS, id_generator=None): j = JSONRPCRequest(id_generator) o = j.template() o['method'] = 'eth_call' enc = ABIContractEncoder() enc.method('getDistributionFromRedistribution') enc.typ(ABIContractType.BYTES32) - enc.typ(ABIContractType.BYTES32) enc.bytes32(redistribution) - enc.bytes32(redistribution_previous) data = add_0x(enc.get()) tx = self.template(sender_address, contract_address) tx = self.set_code(tx, data) diff --git a/python/tests/test_redistribution_single.py b/python/tests/test_redistribution_single.py @@ -32,7 +32,7 @@ testdir = os.path.dirname(__file__) class TestRedistribution(TestDemurrageDefault): - def test_redistribution_boundaries(self): + def test_redistribution_periods(self): nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) @@ -42,48 +42,93 @@ class TestRedistribution(TestDemurrageDefault): (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[0], supply) self.rpc.do(o) - o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance(r) - logg.debug('balance before {} supply {}'.format(balance, supply)) - - self.backend.time_travel(self.start_time + self.period_seconds) - (tx_hash, o) = c.change_period(self.address, self.accounts[0]) - r = self.rpc.do(o) - - o = receipt(tx_hash) - r = self.rpc.do(o) - self.assertEqual(r['status'], 1) - - o = c.redistributions(self.address, 1, sender_address=self.accounts[0]) - r = self.rpc.do(o) - oo = c.to_redistribution_supply(self.address, r, sender_address=self.accounts[0]) - rr = self.rpc.do(oo) - oo = c.to_redistribution_demurrage_modifier(self.address, r, sender_address=self.accounts[0]) - rr = self.rpc.do(oo) - - o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance(r) - - self.backend.time_travel(self.start_time + self.period_seconds * 2 + 1) - (tx_hash, o) = c.change_period(self.address, self.accounts[0]) - r = self.rpc.do(o) - - o = receipt(tx_hash) - r = self.rpc.do(o) - self.assertEqual(r['status'], 1) - - o = c.redistributions(self.address, 2, sender_address=self.accounts[0]) - r = self.rpc.do(o) - oo = c.to_redistribution_supply(self.address, r, sender_address=self.accounts[0]) - rr = self.rpc.do(oo) - oo = c.to_redistribution_demurrage_modifier(self.address, r, sender_address=self.accounts[0]) - rr = self.rpc.do(oo) - - o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) - r = self.rpc.do(o) - balance = c.parse_balance(r) + for i in range(1, 10): + logg.debug('execute time travel to period {}'.format(i)) + self.backend.time_travel(self.start_time + (self.period_seconds * i)) + (tx_hash, o) = c.change_period(self.address, self.accounts[0]) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + o = c.redistributions(self.address, i, sender_address=self.accounts[0]) + redistribution = self.rpc.do(o) + + o = c.to_redistribution_demurrage_modifier(self.address, redistribution, sender_address=self.accounts[0]) + r = self.rpc.do(o) + demurrage = c.parse_to_redistribution_item(r) + + o = c.redistributions(self.address, i-1, sender_address=self.accounts[0]) + redistribution = self.rpc.do(o) + + o = c.to_redistribution_demurrage_modifier(self.address, redistribution, sender_address=self.accounts[0]) + r = self.rpc.do(o) + demurrage_previous = c.parse_to_redistribution_item(r) + + o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) + r = self.rpc.do(o) + balance_sink = c.parse_balance(r) + + o = c.balance_of(self.address, self.accounts[0], sender_address=self.accounts[0]) + r = self.rpc.do(o) + balance_minter = c.parse_balance(r) + + logg.debug('testing sink {} mint {} adds up to supply {} with demurrage between {} and {}'.format(balance_sink, balance_minter, supply, demurrage_previous, demurrage)) + + self.assert_within_lower(balance_minter + balance_sink, supply, 0.001) + +# def test_redistribution_boundaries(self): +# nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) +# c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# +# demurrage = (1 - (self.tax_level / 1000000)) * (10**28) +# supply = self.default_supply +# +# (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[0], supply) +# self.rpc.do(o) +# +# o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance(r) +# logg.debug('balance before {} supply {}'.format(balance, supply)) +# +# self.backend.time_travel(self.start_time + self.period_seconds) +# (tx_hash, o) = c.change_period(self.address, self.accounts[0]) +# r = self.rpc.do(o) +# +# o = receipt(tx_hash) +# r = self.rpc.do(o) +# self.assertEqual(r['status'], 1) +# +# o = c.redistributions(self.address, 1, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# oo = c.to_redistribution_supply(self.address, r, sender_address=self.accounts[0]) +# rr = self.rpc.do(oo) +# oo = c.to_redistribution_demurrage_modifier(self.address, r, sender_address=self.accounts[0]) +# rr = self.rpc.do(oo) +# +# o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance(r) +# +# self.backend.time_travel(self.start_time + self.period_seconds * 2 + 1) +# (tx_hash, o) = c.change_period(self.address, self.accounts[0]) +# r = self.rpc.do(o) +# +# o = receipt(tx_hash) +# r = self.rpc.do(o) +# self.assertEqual(r['status'], 1) +# +# o = c.redistributions(self.address, 2, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# oo = c.to_redistribution_supply(self.address, r, sender_address=self.accounts[0]) +# rr = self.rpc.do(oo) +# oo = c.to_redistribution_demurrage_modifier(self.address, r, sender_address=self.accounts[0]) +# rr = self.rpc.do(oo) +# +# o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# balance = c.parse_balance(r) if __name__ == '__main__': diff --git a/python/tests/test_redistribution_unit.py b/python/tests/test_redistribution_unit.py @@ -51,22 +51,19 @@ class TestRedistribution(TestDemurrageUnit): nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) - demurrage_previous = (1 - (self.tax_level / 100000)) * (10**28) - demurrage = (1 - ((self.tax_level * 1.33) / 100000)) * (10**28) + demurrage = (1 - (self.tax_level / 100000)) * (10**28) - logg.debug('demurrage then {} now {}'.format(demurrage_previous, demurrage)) + logg.debug('demurrage {}'.format(demurrage)) supply = self.default_supply - o = c.to_redistribution(self.address, 0, demurrage_previous, supply, 1, sender_address=self.accounts[0]) - redistribution_previous = self.rpc.do(o) - o = c.to_redistribution(self.address, 0, demurrage, supply, 2, sender_address=self.accounts[0]) redistribution = self.rpc.do(o) - o = c.get_distribution_from_redistribution(self.address, redistribution, redistribution_previous, self.accounts[0]) + o = c.get_distribution_from_redistribution(self.address, redistribution, self.accounts[0]) r = self.rpc.do(o) distribution = c.parse_get_distribution(r) - expected_distribution = self.default_supply * (((self.tax_level * 1.33) - self.tax_level) / 100000) + #expected_distribution = self.default_supply * (((self.tax_level * 1.33) - self.tax_level) / 100000) + expected_distribution = (self.default_supply * self.tax_level) / 100000 logg.debug('distribution {} supply {}'.format(distribution, self.default_supply)) self.assert_within_lower(distribution, expected_distribution, 1000) diff --git a/solidity/DemurrageTokenSingleNocap.sol b/solidity/DemurrageTokenSingleNocap.sol @@ -22,8 +22,6 @@ contract DemurrageTokenSingleCap { uint256 public demurrageStart; - // Cached demurrage period; the period for which demurrageAmount was calculated - //uint128 public demurragePeriod; // Cached demurrage timestamp; the timestamp for which demurrageAmount was last calculated uint256 public demurrageTimestamp; @@ -47,8 +45,8 @@ contract DemurrageTokenSingleCap { // Last executed period uint256 public lastPeriod; - // Minimum amount of (demurraged) tokens an account must spend to participate in redistribution for a particular period - //uint256 public minimumParticipantSpend; + // Last sink redistribution amount + uint256 public totalSink; // 128 bit resolution of the demurrage divisor // (this constant x 1000000 is contained within 128 bits) @@ -116,19 +114,14 @@ contract DemurrageTokenSingleCap { demurrageTimestamp = block.timestamp; periodStart = demurrageTimestamp; periodDuration = _periodMinutes * 60; - //demurrageAmount = 100000000000000000000000000000000000000 - _taxLevelMinute; // Represents 38 decimal places, same as resolutionFactor - //demurrageAmount = 100000000000000000000000000000000000000; - //demurrageAmount = 10000000000000000000000000000; demurrageAmount = uint128(nanoDivider) * 100; demurrageStart = demurrageAmount; - //demurragePeriod = 1; taxLevel = _taxLevelMinute; // Represents 38 decimal places bytes32 initialRedistribution = toRedistribution(0, demurrageAmount, 0, 1); redistributions.push(initialRedistribution); // Misc settings sinkAddress = _defaultSinkAddress; - //minimumParticipantSpend = 10 ** uint256(_decimals); } @@ -160,10 +153,8 @@ contract DemurrageTokenSingleCap { baseBalance = baseBalanceOf(_account); - //periodCount = actualPeriod() - demurragePeriod; periodCount = getMinutesDelta(demurrageTimestamp); - //currentDemurragedAmount = uint128(decayBy(demurrageAmount, periodCount)); currentDemurragedAmount = uint128(decayBy(demurrageAmount * 10000000000, periodCount)); return (baseBalance * currentDemurragedAmount) / (nanoDivider * 1000000000000); @@ -281,7 +272,6 @@ contract DemurrageTokenSingleCap { bytes32 lastRedistribution; uint256 currentPeriod; - //lastRedistribution = redistributions[redistributions.length-1]; lastRedistribution = redistributions[lastPeriod]; currentPeriod = this.actualPeriod(); if (currentPeriod <= toRedistributionPeriod(lastRedistribution)) { @@ -293,30 +283,29 @@ contract DemurrageTokenSingleCap { function getDistribution(uint256 _supply, uint256 _demurrageAmount) public view returns (uint256) { uint256 difference; - //difference = _supply * (resolutionFactor - _demurrageAmount); //(nanoDivider - ((resolutionFactor - _demurrageAmount) / nanoDivider)); - difference = _supply * (resolutionFactor - (_demurrageAmount * 10000000000)); //(nanoDivider - ((resolutionFactor - _demurrageAmount) / nanoDivider)); + difference = _supply * (resolutionFactor - (_demurrageAmount * 10000000000)); return difference / resolutionFactor; } - function getDistributionFromRedistribution(bytes32 _redistribution, bytes32 _redistributionPrevious) public returns (uint256) { + function getDistributionFromRedistribution(bytes32 _redistribution) public returns (uint256) { uint256 redistributionSupply; uint256 redistributionDemurrage; - uint256 redistributionDemurragePrevious; redistributionSupply = toRedistributionSupply(_redistribution); redistributionDemurrage = toRedistributionDemurrageModifier(_redistribution); - redistributionDemurragePrevious = toRedistributionDemurrageModifier(_redistributionPrevious); - redistributionDemurrage = demurrageStart - (redistributionDemurragePrevious - redistributionDemurrage); return getDistribution(redistributionSupply, redistributionDemurrage); } // Returns the amount sent to the sink address - function applyDefaultRedistribution(bytes32 _redistribution, bytes32 _redistributionPrevious) private returns (uint256) { + function applyDefaultRedistribution(bytes32 _redistribution) private returns (uint256) { uint256 unit; + uint256 baseUnit; - unit = getDistributionFromRedistribution(_redistribution, _redistributionPrevious); - increaseBaseBalance(sinkAddress, toBaseAmount(unit)); + unit = getDistributionFromRedistribution(_redistribution); + baseUnit = toBaseAmount(unit) - totalSink; + increaseBaseBalance(sinkAddress, baseUnit); lastPeriod += 1; + totalSink += baseUnit; return unit; } @@ -331,13 +320,9 @@ contract DemurrageTokenSingleCap { } function applyDemurrageLimited(uint256 _rounds) public returns (bool) { - //uint128 epochPeriodCount; uint256 periodCount; uint256 lastDemurrageAmount; - //epochPeriodCount = actualPeriod(); - //periodCount = epochPeriodCount - demurragePeriod; - periodCount = getMinutesDelta(demurrageTimestamp); if (periodCount == 0) { return false; @@ -400,7 +385,7 @@ contract DemurrageTokenSingleCap { nextRedistribution = toRedistribution(0, nextRedistributionDemurrage, totalSupply, nextPeriod); redistributions.push(nextRedistribution); - applyDefaultRedistribution(nextRedistribution, currentRedistribution); + applyDefaultRedistribution(nextRedistribution); emit Period(nextPeriod); return true; } @@ -435,7 +420,6 @@ contract DemurrageTokenSingleCap { // Inflates the given amount according to the current demurrage modifier function toBaseAmount(uint256 _value) public view returns (uint256) { - //return (_value * resolutionFactor) / demurrageAmount; return (_value * resolutionFactor) / (demurrageAmount * 10000000000); } @@ -486,7 +470,6 @@ contract DemurrageTokenSingleCap { decreaseBaseBalance(_from, _value); increaseBaseBalance(_to, _value); - //period = actualPeriod(); return true; }