From e894dcd3cf9be0818020bba824f86afd363d8604 Mon Sep 17 00:00:00 2001 From: nolash Date: Tue, 8 Jun 2021 11:53:51 +0200 Subject: [PATCH] Add mint amounts test --- .../data/DemurrageTokenSingleCap.bin | 2 +- python/setup.cfg | 2 +- python/tests/base.py | 7 ++ python/tests/test_amounts.py | 64 +++++++++++++++++++ python/tests/test_period.py | 1 + solidity/DemurrageTokenSingleCap.sol | 4 +- 6 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 python/tests/test_amounts.py diff --git a/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin b/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin index 2d453bc..35da155 100644 --- a/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin +++ b/python/erc20_demurrage_token/data/DemurrageTokenSingleCap.bin @@ -1 +1 @@ -61010060405264e8d4a510006a52b7d2dcc80cd2e40000006200002391906200078b565b6080908152503480156200003657600080fd5b50604051620034423803806200344283398181016040528101906200005c9190620004b5565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555086600690805190602001906200012f92919062000337565b5085600790805190602001906200014892919062000337565b508460ff166008819055504260038190555060035460a08181525050603c836200017391906200078b565b60c081815250506f4b3b4ca85a86c47a098a224000000000600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836fffffffffffffffffffffffffffffffff1660e0818152505060006200022f6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660006001620002c8640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600a8190555082600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508560ff16600a620002b491906200064e565b600b81905550505050505050505062000a08565b6000807cffffffffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b828054620003459062000889565b90600052602060002090601f016020900481019282620003695760008555620003b5565b82601f106200038457805160ff1916838001178555620003b5565b82800160010185558215620003b5579182015b82811115620003b457825182559160200191906001019062000397565b5b509050620003c49190620003c8565b5090565b5b80821115620003e3576000816000905550600101620003c9565b5090565b6000620003fe620003f884620005bd565b62000594565b9050828152602081018484840111156200041757600080fd5b6200042484828562000853565b509392505050565b6000815190506200043d81620009a0565b92915050565b600082601f8301126200045557600080fd5b815162000467848260208601620003e7565b91505092915050565b6000815190506200048181620009ba565b92915050565b6000815190506200049881620009d4565b92915050565b600081519050620004af81620009ee565b92915050565b600080600080600080600060e0888a031215620004d157600080fd5b600088015167ffffffffffffffff811115620004ec57600080fd5b620004fa8a828b0162000443565b975050602088015167ffffffffffffffff8111156200051857600080fd5b620005268a828b0162000443565b9650506040620005398a828b016200049e565b95505060606200054c8a828b0162000470565b94505060806200055f8a828b0162000487565b93505060a0620005728a828b016200042c565b92505060c0620005858a828b0162000487565b91505092959891949750929550565b6000620005a0620005b3565b9050620005ae8282620008bf565b919050565b6000604051905090565b600067ffffffffffffffff821115620005db57620005da62000953565b5b620005e68262000982565b9050602081019050919050565b6000808291508390505b600185111562000645578086048111156200061d576200061c620008f5565b5b60018516156200062d5780820291505b80810290506200063d8562000993565b9450620005fd565b94509492505050565b60006200065b826200083c565b915062000668836200083c565b9250620006977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846200069f565b905092915050565b600082620006b1576001905062000784565b81620006c1576000905062000784565b8160018114620006da5760028114620006e5576200071b565b600191505062000784565b60ff841115620006fa57620006f9620008f5565b5b8360020a915084821115620007145762000713620008f5565b5b5062000784565b5060208310610133831016604e8410600b8410161715620007555782820a9050838111156200074f576200074e620008f5565b5b62000784565b620007648484846001620005f3565b925090508184048111156200077e576200077d620008f5565b5b81810290505b9392505050565b600062000798826200083c565b9150620007a5836200083c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615620007e157620007e0620008f5565b5b828202905092915050565b6000620007f9826200081c565b9050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156200087357808201518184015260208101905062000856565b8381111562000883576000848401525b50505050565b60006002820490506001821680620008a257607f821691505b60208210811415620008b957620008b862000924565b5b50919050565b620008ca8262000982565b810181811067ffffffffffffffff82111715620008ec57620008eb62000953565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6000600282049050919050565b620009ab81620007ec565b8114620009b757600080fd5b50565b620009c58162000800565b8114620009d157600080fd5b50565b620009df816200083c565b8114620009eb57600080fd5b50565b620009f98162000846565b811462000a0557600080fd5b50565b60805160a05160c05160e0516129c862000a7a60003960008181610c4101528181610e910152611a6701526000818161112b01528181611a160152611b0601526000818161115701528181611b270152611b6c0152600081816111ba015281816111f2015261125a01526129c86000f3fe608060405234801561001057600080fd5b5060043610610265576000357c0100000000000000000000000000000000000000000000000000000000900480636a2d094e11610158578063983b2d56116100d5578063e54d63f711610099578063e54d63f7146107ec578063e80952951461081c578063eda4e6d61461083a578063f2fde38b14610858578063f83da35d1461088857610265565b8063983b2d561461070e5780639da7d8ba1461073e578063a9059cbb1461076e578063b470aade1461079e578063e3ab207a146107bc57610265565b80638d34855a1161011c5780638d34855a146106665780638da5cb5b146106965780638f1df6bc146106b45780638f770ad0146106d257806395d89b41146106f057610265565b80636a2d094e1461059a5780636ffa8a05146105ca57806370a08231146105fa578063731f237c1461062a57806379ba50971461064857610265565b8063313ce567116101e657806351b4541c116101aa57806351b4541c146104ce578063573cc507146104fe57806358b2833b1461051c5780636721d4ef1461053a5780636787a9be1461056a57610265565b8063313ce567146103f057806340452d911461040e578063449a52f81461043e57806347a505171461046e5780634abfbba21461049e57610265565b80631989c6a81161022d5780631989c6a814610324578063229ba1971461034257806323b872dd146103605780633092afd51461039057806331333487146103c057610265565b806301ffc9a71461026a57806306fdde031461029a578063095ea7b3146102b857806309f28f3c146102e857806318160ddd14610306575b600080fd5b610284600480360381019061027f9190612241565b6108b8565b6040516102919190612472565b60405180910390f35b6102a2610a63565b6040516102af91906124a8565b60405180910390f35b6102d260048036038101906102cd91906121dc565b610af1565b6040516102df9190612472565b60405180910390f35b6102f0610c0b565b6040516102fd919061252a565b60405180910390f35b61030e610c2d565b60405161031b9190612560565b60405180910390f35b61032c610c33565b6040516103399190612560565b60405180910390f35b61034a610c3f565b6040516103579190612560565b60405180910390f35b61037a6004803603810190610375919061218d565b610c63565b6040516103879190612472565b60405180910390f35b6103aa60048036038101906103a59190612164565b610d83565b6040516103b79190612472565b60405180910390f35b6103da60048036038101906103d591906122bc565b610e76565b6040516103e79190612560565b60405180910390f35b6103f8610f2a565b6040516104059190612560565b60405180910390f35b61042860048036038101906104239190612293565b610f30565b604051610435919061248d565b60405180910390f35b610458600480360381019061045391906121dc565b610f54565b6040516104659190612472565b60405180910390f35b61048860048036038101906104839190612164565b6110de565b6040516104959190612560565b60405180910390f35b6104b860048036038101906104b39190612293565b611127565b6040516104c59190612560565b60405180910390f35b6104e860048036038101906104e39190612293565b611187565b6040516104f59190612560565b60405180910390f35b6105066111a8565b6040516105139190612560565b60405180910390f35b6105246111ae565b6040516105319190612560565b60405180910390f35b610554600480360381019061054f91906122bc565b6111b4565b6040516105619190612560565b60405180910390f35b610584600480360381019061057f9190612293565b611225565b6040516105919190612560565b60405180910390f35b6105b460048036038101906105af9190612293565b611295565b6040516105c19190612560565b60405180910390f35b6105e460048036038101906105df9190612218565b6112b6565b6040516105f19190612560565b60405180910390f35b610614600480360381019061060f9190612164565b6112f2565b6040516106219190612560565b60405180910390f35b61063261139a565b60405161063f9190612472565b60405180910390f35b6106506114bc565b60405161065d9190612472565b60405180910390f35b610680600480360381019061067b9190612218565b611663565b60405161068d9190612560565b60405180910390f35b61069e611691565b6040516106ab9190612457565b60405180910390f35b6106bc6116b7565b6040516106c99190612472565b60405180910390f35b6106da611801565b6040516106e79190612560565b60405180910390f35b6106f8611807565b60405161070591906124a8565b60405180910390f35b61072860048036038101906107239190612164565b611895565b6040516107359190612472565b60405180910390f35b61075860048036038101906107539190612218565b611952565b6040516107659190612560565b60405180910390f35b610788600480360381019061078391906121dc565b61197e565b6040516107959190612472565b60405180910390f35b6107a6611a14565b6040516107b39190612560565b60405180910390f35b6107d660048036038101906107d19190612218565b611a38565b6040516107e39190612560565b60405180910390f35b610806600480360381019061080191906122bc565b611a4c565b6040516108139190612560565b60405180910390f35b610824611b00565b604051610831919061252a565b60405180910390f35b610842611b6a565b60405161084f9190612560565b60405180910390f35b610872600480360381019061086d9190612164565b611b8e565b60405161087f9190612472565b60405180910390f35b6108a2600480360381019061089d91906122f8565b611c30565b6040516108af919061248d565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561090d5760019050610a5e565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109605760019050610a5e565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109b35760019050610a5e565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610a065760019050610a5e565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610a595760019050610a5e565b600090505b919050565b60068054610a709061278b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a9c9061278b565b8015610ae95780601f10610abe57610100808354040283529160200191610ae9565b820191906000526020600020905b815481529060010190602001808311610acc57829003601f168201915b505050505081565b600080610afc6116b7565b50610b0683611225565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b949190612597565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610bf89190612560565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60095481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610c706116b7565b50610c7a84611225565b915081600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d0557600080fd5b610d10868684611c9f565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610d6f9190612560565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e0c57503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610e1557600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000610eba91906125ed565b905060005b84811015610f035764e8d4a510008284610ed9919061261e565b610ee391906125ed565b83610eee9190612678565b92508080610efb906127bd565b915050610ebf565b5064e8d4a510008583610f16919061261e565b610f2091906125ed565b9250505092915050565b60085481565b60008181548110610f4057600080fd5b906000526020600020016000915090505481565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610fe3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fda906124ea565b60405180910390fd5b600a5460095484610ff49190612597565b1115611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102c906124ca565b60405180910390fd5b61103d6116b7565b5082905082600960008282546110539190612597565b925050819055506110648482611cc4565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f8856040516110c29190612560565b60405180910390a36110d2611d89565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f000000000000000000000000000000000000000000000000000000000000000082611155919061261e565b7f00000000000000000000000000000000000000000000000000000000000000006111809190612597565b9050919050565b6000603c82426111979190612678565b6111a191906125ed565b9050919050565b600b5481565b60035481565b600080827f00000000000000000000000000000000000000000000000000000000000000006111e39190612678565b846111ee919061261e565b90507f00000000000000000000000000000000000000000000000000000000000000008161121c91906125ed565b91505092915050565b6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000083611284919061261e565b61128e91906125ed565b9050919050565b6000603c82426112a59190612678565b6112af91906125ed565b9050919050565b6000606860ff167cffffffffffffffffffffffffffffffff00000000000000000000000000836001900416908060020a82049150509050919050565b600080600080611301856110de565b925061130e600354611187565b905061134a600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682610e76565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e400000061137a919061261e565b8284611386919061261e565b61139091906125ed565b9350505050919050565b6000806000806113ab600354611187565b915060008214156113c257600093505050506114b9565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1690506113ff8183610e76565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c82611444919061261e565b6003546114519190612597565b60038190555080826003547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff166040516114a99190612545565b60405180910390a4600193505050505b90565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461151957600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b600080600061167184611952565b915061167c846112b6565b905061168882826111b4565b92505050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060008060008060006116cd611e77565b975060006001028814156116ec576000985050505050505050506117fe565b6116f588611a38565b95506001866117049190612597565b905061170f86611127565b915061171961139a565b50600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16945061175682611295565b925060008311156117725761176b8584611a4c565b9350611776565b8493505b61178560008560095484611c30565b965060008790806001815401808255809150506001900390600052602060002001600090919091909150556117b988611fa7565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d675816040516117e99190612560565b60405180910390a16001985050505050505050505b90565b600a5481565b600780546118149061278b565b80601f01602080910402602001604051908101604052809291908181526020018280546118409061278b565b801561188d5780601f106118625761010080835404028352916020019161188d565b820191906000526020600020905b81548152906001019060200180831161187057829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118f157600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b600080600061198b6116b7565b5061199584611225565b91506119a2338684611c9f565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051611a019190612560565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000611a9091906125ed565b905060005b84811015611ad95764e8d4a510008284611aaf919061261e565b611ab991906125ed565b83611ac49190612597565b92508080611ad1906127bd565b915050611a95565b5064e8d4a510008583611aec919061261e565b611af691906125ed565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611b519190612678565b611b5b91906125ed565b611b659190612597565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bea57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000807cffffffffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b600080611cac8584611ff3565b50611cb78484611cc4565b5060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000851415611d215760009350505050611d83565b611d2a866110de565b92508483611d389190612597565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000600954905060006001600080549050611da79190612678565b81548110611dde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611e299190612678565b81548110611e60577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555060019250505090565b6000806000806001600080549050611e8f9190612678565b81548110611ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611f3557600080fd5b505afa158015611f49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f6d919061226a565b6fffffffffffffffffffffffffffffffff169050611f8a82611a38565b8111611f9e57600060010292505050611fa4565b81925050505b90565b600080611fb383611663565b9050611fe9600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611fe483611225565b611cc4565b5080915050919050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600085141561205057600093505050506120f5565b612059866110de565b92508483101561209e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120959061250a565b60405180910390fd5b84836120aa9190612678565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b60008135905061210a8161291f565b92915050565b60008135905061211f81612936565b92915050565b6000813590506121348161294d565b92915050565b60008151905061214981612964565b92915050565b60008135905061215e8161297b565b92915050565b60006020828403121561217657600080fd5b6000612184848285016120fb565b91505092915050565b6000806000606084860312156121a257600080fd5b60006121b0868287016120fb565b93505060206121c1868287016120fb565b92505060406121d28682870161214f565b9150509250925092565b600080604083850312156121ef57600080fd5b60006121fd858286016120fb565b925050602061220e8582860161214f565b9150509250929050565b60006020828403121561222a57600080fd5b600061223884828501612110565b91505092915050565b60006020828403121561225357600080fd5b600061226184828501612125565b91505092915050565b60006020828403121561227c57600080fd5b600061228a8482850161213a565b91505092915050565b6000602082840312156122a557600080fd5b60006122b38482850161214f565b91505092915050565b600080604083850312156122cf57600080fd5b60006122dd8582860161214f565b92505060206122ee8582860161214f565b9150509250929050565b6000806000806080858703121561230e57600080fd5b600061231c8782880161214f565b945050602061232d8782880161214f565b935050604061233e8782880161214f565b925050606061234f8782880161214f565b91505092959194509250565b612364816126ac565b82525050565b612373816126be565b82525050565b612382816126ca565b82525050565b60006123938261257b565b61239d8185612586565b93506123ad818560208601612758565b6123b681612893565b840191505092915050565b60006123ce600783612586565b91506123d9826128a4565b602082019050919050565b60006123f1600a83612586565b91506123fc826128cd565b602082019050919050565b6000612414600d83612586565b915061241f826128f6565b602082019050919050565b61243381612700565b82525050565b61244281612746565b82525050565b6124518161273c565b82525050565b600060208201905061246c600083018461235b565b92915050565b6000602082019050612487600083018461236a565b92915050565b60006020820190506124a26000830184612379565b92915050565b600060208201905081810360008301526124c28184612388565b905092915050565b600060208201905081810360008301526124e3816123c1565b9050919050565b60006020820190508181036000830152612503816123e4565b9050919050565b6000602082019050818103600083015261252381612407565b9050919050565b600060208201905061253f600083018461242a565b92915050565b600060208201905061255a6000830184612439565b92915050565b60006020820190506125756000830184612448565b92915050565b600081519050919050565b600082825260208201905092915050565b60006125a28261273c565b91506125ad8361273c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125e2576125e1612806565b5b828201905092915050565b60006125f88261273c565b91506126038361273c565b92508261261357612612612835565b5b828204905092915050565b60006126298261273c565b91506126348361273c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561266d5761266c612806565b5b828202905092915050565b60006126838261273c565b915061268e8361273c565b9250828210156126a1576126a0612806565b5b828203905092915050565b60006126b78261271c565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061275182612700565b9050919050565b60005b8381101561277657808201518184015260208101905061275b565b83811115612785576000848401525b50505050565b600060028204905060018216806127a357607f821691505b602082108114156127b7576127b6612864565b5b50919050565b60006127c88261273c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156127fb576127fa612806565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f4552525f43415000000000000000000000000000000000000000000000000000600082015250565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b612928816126ac565b811461293357600080fd5b50565b61293f816126ca565b811461294a57600080fd5b50565b612956816126d4565b811461296157600080fd5b50565b61296d81612700565b811461297857600080fd5b50565b6129848161273c565b811461298f57600080fd5b5056fea2646970667358221220b663303ed909c4457a08fe9731d5c380990bb9a93c94d0772189bb4ce163879c64736f6c63430008040033 \ No newline at end of file +61010060405264e8d4a510006a52b7d2dcc80cd2e40000006200002391906200078b565b6080908152503480156200003657600080fd5b506040516200344a3803806200344a83398181016040528101906200005c9190620004b5565b33600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555086600690805190602001906200012f92919062000337565b5085600790805190602001906200014892919062000337565b508460ff166008819055504260038190555060035460a08181525050603c836200017391906200078b565b60c081815250506f4b3b4ca85a86c47a098a224000000000600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836fffffffffffffffffffffffffffffffff1660e0818152505060006200022f6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1660006001620002c8640100000000026401000000009004565b9050600081908060018154018082558091505060019003906000526020600020016000909190919091505581600a8190555082600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508560ff16600a620002b491906200064e565b600b81905550505050505050505062000a08565b6000807cffffffffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b828054620003459062000889565b90600052602060002090601f016020900481019282620003695760008555620003b5565b82601f106200038457805160ff1916838001178555620003b5565b82800160010185558215620003b5579182015b82811115620003b457825182559160200191906001019062000397565b5b509050620003c49190620003c8565b5090565b5b80821115620003e3576000816000905550600101620003c9565b5090565b6000620003fe620003f884620005bd565b62000594565b9050828152602081018484840111156200041757600080fd5b6200042484828562000853565b509392505050565b6000815190506200043d81620009a0565b92915050565b600082601f8301126200045557600080fd5b815162000467848260208601620003e7565b91505092915050565b6000815190506200048181620009ba565b92915050565b6000815190506200049881620009d4565b92915050565b600081519050620004af81620009ee565b92915050565b600080600080600080600060e0888a031215620004d157600080fd5b600088015167ffffffffffffffff811115620004ec57600080fd5b620004fa8a828b0162000443565b975050602088015167ffffffffffffffff8111156200051857600080fd5b620005268a828b0162000443565b9650506040620005398a828b016200049e565b95505060606200054c8a828b0162000470565b94505060806200055f8a828b0162000487565b93505060a0620005728a828b016200042c565b92505060c0620005858a828b0162000487565b91505092959891949750929550565b6000620005a0620005b3565b9050620005ae8282620008bf565b919050565b6000604051905090565b600067ffffffffffffffff821115620005db57620005da62000953565b5b620005e68262000982565b9050602081019050919050565b6000808291508390505b600185111562000645578086048111156200061d576200061c620008f5565b5b60018516156200062d5780820291505b80810290506200063d8562000993565b9450620005fd565b94509492505050565b60006200065b826200083c565b915062000668836200083c565b9250620006977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846200069f565b905092915050565b600082620006b1576001905062000784565b81620006c1576000905062000784565b8160018114620006da5760028114620006e5576200071b565b600191505062000784565b60ff841115620006fa57620006f9620008f5565b5b8360020a915084821115620007145762000713620008f5565b5b5062000784565b5060208310610133831016604e8410600b8410161715620007555782820a9050838111156200074f576200074e620008f5565b5b62000784565b620007648484846001620005f3565b925090508184048111156200077e576200077d620008f5565b5b81810290505b9392505050565b600062000798826200083c565b9150620007a5836200083c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615620007e157620007e0620008f5565b5b828202905092915050565b6000620007f9826200081c565b9050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156200087357808201518184015260208101905062000856565b8381111562000883576000848401525b50505050565b60006002820490506001821680620008a257607f821691505b60208210811415620008b957620008b862000924565b5b50919050565b620008ca8262000982565b810181811067ffffffffffffffff82111715620008ec57620008eb62000953565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6000600282049050919050565b620009ab81620007ec565b8114620009b757600080fd5b50565b620009c58162000800565b8114620009d157600080fd5b50565b620009df816200083c565b8114620009eb57600080fd5b50565b620009f98162000846565b811462000a0557600080fd5b50565b60805160a05160c05160e0516129d062000a7a60003960008181610c4101528181610e910152611a6f01526000818161113301528181611a1e0152611b0e01526000818161115f01528181611b2f0152611b740152600081816111c2015281816111fa015261126201526129d06000f3fe608060405234801561001057600080fd5b5060043610610265576000357c0100000000000000000000000000000000000000000000000000000000900480636a2d094e11610158578063983b2d56116100d5578063e54d63f711610099578063e54d63f7146107ec578063e80952951461081c578063eda4e6d61461083a578063f2fde38b14610858578063f83da35d1461088857610265565b8063983b2d561461070e5780639da7d8ba1461073e578063a9059cbb1461076e578063b470aade1461079e578063e3ab207a146107bc57610265565b80638d34855a1161011c5780638d34855a146106665780638da5cb5b146106965780638f1df6bc146106b45780638f770ad0146106d257806395d89b41146106f057610265565b80636a2d094e1461059a5780636ffa8a05146105ca57806370a08231146105fa578063731f237c1461062a57806379ba50971461064857610265565b8063313ce567116101e657806351b4541c116101aa57806351b4541c146104ce578063573cc507146104fe57806358b2833b1461051c5780636721d4ef1461053a5780636787a9be1461056a57610265565b8063313ce567146103f057806340452d911461040e578063449a52f81461043e57806347a505171461046e5780634abfbba21461049e57610265565b80631989c6a81161022d5780631989c6a814610324578063229ba1971461034257806323b872dd146103605780633092afd51461039057806331333487146103c057610265565b806301ffc9a71461026a57806306fdde031461029a578063095ea7b3146102b857806309f28f3c146102e857806318160ddd14610306575b600080fd5b610284600480360381019061027f9190612249565b6108b8565b604051610291919061247a565b60405180910390f35b6102a2610a63565b6040516102af91906124b0565b60405180910390f35b6102d260048036038101906102cd91906121e4565b610af1565b6040516102df919061247a565b60405180910390f35b6102f0610c0b565b6040516102fd9190612532565b60405180910390f35b61030e610c2d565b60405161031b9190612568565b60405180910390f35b61032c610c33565b6040516103399190612568565b60405180910390f35b61034a610c3f565b6040516103579190612568565b60405180910390f35b61037a60048036038101906103759190612195565b610c63565b604051610387919061247a565b60405180910390f35b6103aa60048036038101906103a5919061216c565b610d83565b6040516103b7919061247a565b60405180910390f35b6103da60048036038101906103d591906122c4565b610e76565b6040516103e79190612568565b60405180910390f35b6103f8610f2a565b6040516104059190612568565b60405180910390f35b6104286004803603810190610423919061229b565b610f30565b6040516104359190612495565b60405180910390f35b610458600480360381019061045391906121e4565b610f54565b604051610465919061247a565b60405180910390f35b6104886004803603810190610483919061216c565b6110e6565b6040516104959190612568565b60405180910390f35b6104b860048036038101906104b3919061229b565b61112f565b6040516104c59190612568565b60405180910390f35b6104e860048036038101906104e3919061229b565b61118f565b6040516104f59190612568565b60405180910390f35b6105066111b0565b6040516105139190612568565b60405180910390f35b6105246111b6565b6040516105319190612568565b60405180910390f35b610554600480360381019061054f91906122c4565b6111bc565b6040516105619190612568565b60405180910390f35b610584600480360381019061057f919061229b565b61122d565b6040516105919190612568565b60405180910390f35b6105b460048036038101906105af919061229b565b61129d565b6040516105c19190612568565b60405180910390f35b6105e460048036038101906105df9190612220565b6112be565b6040516105f19190612568565b60405180910390f35b610614600480360381019061060f919061216c565b6112fa565b6040516106219190612568565b60405180910390f35b6106326113a2565b60405161063f919061247a565b60405180910390f35b6106506114c4565b60405161065d919061247a565b60405180910390f35b610680600480360381019061067b9190612220565b61166b565b60405161068d9190612568565b60405180910390f35b61069e611699565b6040516106ab919061245f565b60405180910390f35b6106bc6116bf565b6040516106c9919061247a565b60405180910390f35b6106da611809565b6040516106e79190612568565b60405180910390f35b6106f861180f565b60405161070591906124b0565b60405180910390f35b6107286004803603810190610723919061216c565b61189d565b604051610735919061247a565b60405180910390f35b61075860048036038101906107539190612220565b61195a565b6040516107659190612568565b60405180910390f35b610788600480360381019061078391906121e4565b611986565b604051610795919061247a565b60405180910390f35b6107a6611a1c565b6040516107b39190612568565b60405180910390f35b6107d660048036038101906107d19190612220565b611a40565b6040516107e39190612568565b60405180910390f35b610806600480360381019061080191906122c4565b611a54565b6040516108139190612568565b60405180910390f35b610824611b08565b6040516108319190612532565b60405180910390f35b610842611b72565b60405161084f9190612568565b60405180910390f35b610872600480360381019061086d919061216c565b611b96565b60405161087f919061247a565b60405180910390f35b6108a2600480360381019061089d9190612300565b611c38565b6040516108af9190612495565b60405180910390f35b600063c6bb4b707c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561090d5760019050610a5e565b63449a52f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109605760019050610a5e565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156109b35760019050610a5e565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610a065760019050610a5e565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610a595760019050610a5e565b600090505b919050565b60068054610a7090612793565b80601f0160208091040260200160405190810160405280929190818152602001828054610a9c90612793565b8015610ae95780601f10610abe57610100808354040283529160200191610ae9565b820191906000526020600020905b815481529060010190602001808311610acc57829003601f168201915b505050505081565b600080610afc6116bf565b50610b068361122d565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b94919061259f565b925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92585604051610bf89190612568565b60405180910390a3600191505092915050565b600260009054906101000a90046fffffffffffffffffffffffffffffffff1681565b60095481565b60008080549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000610c706116bf565b50610c7a8461122d565b915081600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d0557600080fd5b610d10868684611ca7565b90508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051610d6f9190612568565b60405180910390a380925050509392505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e0c57503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610e1557600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000610eba91906125f5565b905060005b84811015610f035764e8d4a510008284610ed99190612626565b610ee391906125f5565b83610eee9190612680565b92508080610efb906127c5565b915050610ebf565b5064e8d4a510008583610f169190612626565b610f2091906125f5565b9250505092915050565b60085481565b60008181548110610f4057600080fd5b906000526020600020016000915090505481565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610fe3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fda906124f2565b60405180910390fd5b600a5460095484610ff4919061259f565b1115611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102c906124d2565b60405180910390fd5b61103d6116bf565b506110478361122d565b9050826009600082825461105b919061259f565b9250508190555061106c8482611ccc565b508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f8856040516110ca9190612568565b60405180910390a36110da611d91565b50600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f00000000000000000000000000000000000000000000000000000000000000008261115d9190612626565b7f0000000000000000000000000000000000000000000000000000000000000000611188919061259f565b9050919050565b6000603c824261119f9190612680565b6111a991906125f5565b9050919050565b600b5481565b60035481565b600080827f00000000000000000000000000000000000000000000000000000000000000006111eb9190612680565b846111f69190612626565b90507f00000000000000000000000000000000000000000000000000000000000000008161122491906125f5565b91505092915050565b6000600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff167f00000000000000000000000000000000000000000000000000000000000000008361128c9190612626565b61129691906125f5565b9050919050565b6000603c82426112ad9190612680565b6112b791906125f5565b9050919050565b6000606860ff167cffffffffffffffffffffffffffffffff00000000000000000000000000836001900416908060020a82049150509050919050565b600080600080611309856110e6565b925061131660035461118f565b9050611352600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682610e76565b6fffffffffffffffffffffffffffffffff16915064e8d4a510006a52b7d2dcc80cd2e40000006113829190612626565b828461138e9190612626565b61139891906125f5565b9350505050919050565b6000806000806113b360035461118f565b915060008214156113ca57600093505050506114c1565b600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1690506114078183610e76565b600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550603c8261144c9190612626565b600354611459919061259f565b60038190555080826003547fa0717e54e02bd9829db5e6e998aec0ae9de796b8d150a3cc46a92ab869697755600260009054906101000a90046fffffffffffffffffffffffffffffffff166040516114b1919061254d565b60405180910390a4600193505050505b90565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461152157600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b60008060006116798461195a565b9150611684846112be565b905061169082826111bc565b92505050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060008060008060006116d56113a2565b506116de611e7f565b975060006001028814156116fd57600098505050505050505050611806565b61170688611a40565b9550600186611715919061259f565b90506117208661112f565b9150600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16945061175e8261129d565b9250600083111561177a576117738584611a54565b935061177e565b8493505b61178d60008560095484611c38565b965060008790806001815401808255809150506001900390600052602060002001600090919091909150556117c188611faf565b507f55d243082e019fce4009ccea5368b92e436c17586a1e793c7deda16df4e5d675816040516117f19190612568565b60405180910390a16001985050505050505050505b90565b600a5481565b6007805461181c90612793565b80601f016020809104026020016040519081016040528092919081815260200182805461184890612793565b80156118955780601f1061186a57610100808354040283529160200191611895565b820191906000526020600020905b81548152906001019060200180831161187857829003601f168201915b505050505081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118f957600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000602060ff166cffffffffffffffffff00000000836001900416908060020a82049150509050919050565b60008060006119936116bf565b5061199d8461122d565b91506119aa338684611ca7565b90508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051611a099190612568565b60405180910390a3809250505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600063ffffffff8260019004169050919050565b600080600064e8d4a5100091506a52b7d2dcc80cd2e40000007f0000000000000000000000000000000000000000000000000000000000000000611a9891906125f5565b905060005b84811015611ae15764e8d4a510008284611ab79190612626565b611ac191906125f5565b83611acc919061259f565b92508080611ad9906127c5565b915050611a9d565b5064e8d4a510008583611af49190612626565b611afe91906125f5565b9250505092915050565b600060017f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042611b599190612680565b611b6391906125f5565b611b6d919061259f565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bf257600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000807cffffffffffffffffffffffffffffffff00000000000000000000000000606860ff16869060020a0216600102811790506cffffffffffffffffff00000000602060ff16859060020a02166001028117905063ffffffff83166001028117905080915050949350505050565b600080611cb48584611ffb565b50611cbf8484611ccc565b5060019150509392505050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000851415611d295760009350505050611d8b565b611d32866110e6565b92508483611d40919061259f565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b6000806000600954905060006001600080549050611daf9190612680565b81548110611de6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001546001900491506cffffffffffffffffff000000001982169150602060ff16819060020a02821791508160010260006001600080549050611e319190612680565b81548110611e68577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555060019250505090565b6000806000806001600080549050611e979190612680565b81548110611ece577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015491503073ffffffffffffffffffffffffffffffffffffffff1663e80952956040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b158015611f3d57600080fd5b505afa158015611f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f759190612272565b6fffffffffffffffffffffffffffffffff169050611f9282611a40565b8111611fa657600060010292505050611fac565b81925050505b90565b600080611fbb8361166b565b9050611ff1600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611fec8361122d565b611ccc565b5080915050919050565b600080600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600085141561205857600093505050506120fd565b612061866110e6565b9250848310156120a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209d90612512565b60405180910390fd5b84836120b29190612680565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050505b92915050565b60008135905061211281612927565b92915050565b6000813590506121278161293e565b92915050565b60008135905061213c81612955565b92915050565b6000815190506121518161296c565b92915050565b60008135905061216681612983565b92915050565b60006020828403121561217e57600080fd5b600061218c84828501612103565b91505092915050565b6000806000606084860312156121aa57600080fd5b60006121b886828701612103565b93505060206121c986828701612103565b92505060406121da86828701612157565b9150509250925092565b600080604083850312156121f757600080fd5b600061220585828601612103565b925050602061221685828601612157565b9150509250929050565b60006020828403121561223257600080fd5b600061224084828501612118565b91505092915050565b60006020828403121561225b57600080fd5b60006122698482850161212d565b91505092915050565b60006020828403121561228457600080fd5b600061229284828501612142565b91505092915050565b6000602082840312156122ad57600080fd5b60006122bb84828501612157565b91505092915050565b600080604083850312156122d757600080fd5b60006122e585828601612157565b92505060206122f685828601612157565b9150509250929050565b6000806000806080858703121561231657600080fd5b600061232487828801612157565b945050602061233587828801612157565b935050604061234687828801612157565b925050606061235787828801612157565b91505092959194509250565b61236c816126b4565b82525050565b61237b816126c6565b82525050565b61238a816126d2565b82525050565b600061239b82612583565b6123a5818561258e565b93506123b5818560208601612760565b6123be8161289b565b840191505092915050565b60006123d660078361258e565b91506123e1826128ac565b602082019050919050565b60006123f9600a8361258e565b9150612404826128d5565b602082019050919050565b600061241c600d8361258e565b9150612427826128fe565b602082019050919050565b61243b81612708565b82525050565b61244a8161274e565b82525050565b61245981612744565b82525050565b60006020820190506124746000830184612363565b92915050565b600060208201905061248f6000830184612372565b92915050565b60006020820190506124aa6000830184612381565b92915050565b600060208201905081810360008301526124ca8184612390565b905092915050565b600060208201905081810360008301526124eb816123c9565b9050919050565b6000602082019050818103600083015261250b816123ec565b9050919050565b6000602082019050818103600083015261252b8161240f565b9050919050565b60006020820190506125476000830184612432565b92915050565b60006020820190506125626000830184612441565b92915050565b600060208201905061257d6000830184612450565b92915050565b600081519050919050565b600082825260208201905092915050565b60006125aa82612744565b91506125b583612744565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125ea576125e961280e565b5b828201905092915050565b600061260082612744565b915061260b83612744565b92508261261b5761261a61283d565b5b828204905092915050565b600061263182612744565b915061263c83612744565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126755761267461280e565b5b828202905092915050565b600061268b82612744565b915061269683612744565b9250828210156126a9576126a861280e565b5b828203905092915050565b60006126bf82612724565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061275982612708565b9050919050565b60005b8381101561277e578082015181840152602081019050612763565b8381111561278d576000848401525b50505050565b600060028204905060018216806127ab57607f821691505b602082108114156127bf576127be61286c565b5b50919050565b60006127d082612744565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156128035761280261280e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f4552525f43415000000000000000000000000000000000000000000000000000600082015250565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b7f4552525f4f5645525350454e4400000000000000000000000000000000000000600082015250565b612930816126b4565b811461293b57600080fd5b50565b612947816126d2565b811461295257600080fd5b50565b61295e816126dc565b811461296957600080fd5b50565b61297581612708565b811461298057600080fd5b50565b61298c81612744565b811461299757600080fd5b5056fea2646970667358221220b61b2e6c7209c78117bcb313ec256a60c169548d259f0343f758c90103bf32d864736f6c63430008040033 \ No newline at end of file diff --git a/python/setup.cfg b/python/setup.cfg index 91e3cd6..2ed3a8e 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = erc20-demurrage-token -version = 0.0.1b2 +version = 0.0.1b3 description = ERC20 token with redistributed continual demurrage author = Louis Holbrook author_email = dev@holbrook.no diff --git a/python/tests/base.py b/python/tests/base.py index 3be4525..a194ec1 100644 --- a/python/tests/base.py +++ b/python/tests/base.py @@ -92,6 +92,13 @@ class TestDemurrage(EthTesterCase): logg.debug('contract address {} start block {} start time {}'.format(self.address, self.start_block, self.start_time)) + def assert_within_lower(self, v, target, tolerance_ppm): + lower_target = target - (target * (tolerance_ppm / 1000000)) + self.assertGreaterEqual(v, lower_target) + self.assertLessEqual(v, target) + logg.debug('asserted within lower {} <= {} <= {}'.format(lower_target, v, target)) + + def tearDown(self): pass diff --git a/python/tests/test_amounts.py b/python/tests/test_amounts.py new file mode 100644 index 0000000..cc70d98 --- /dev/null +++ b/python/tests/test_amounts.py @@ -0,0 +1,64 @@ +# standard imports +import os +import unittest +import json +import logging + +# external imports +from chainlib.eth.constant import ZERO_ADDRESS +from chainlib.eth.nonce import RPCNonceOracle +from chainlib.eth.tx import receipt + +# local imports +from erc20_demurrage_token import DemurrageToken + +# test imports +from tests.base import TestDemurrageDefault + +logging.basicConfig(level=logging.DEBUG) +logg = logging.getLogger() + +testdir = os.path.dirname(__file__) + +class TestAmounts(TestDemurrageDefault): + + def test_mints(self): + nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) + c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], 1000) + r = self.rpc.do(o) + + self.backend.time_travel(self.start_time + self.period_seconds) + + (tx_hash, o) = c.apply_demurrage(self.address, self.accounts[0]) + r = self.rpc.do(o) + + 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, 817) + + (tx_hash, o) = c.mint_to(self.address, self.accounts[0], self.accounts[1], 1000) + r = self.rpc.do(o) + + 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.assert_within_lower(balance, 1817, 750) + + self.backend.time_travel(self.start_time + self.period_seconds * 2) + + (tx_hash, o) = c.apply_demurrage(self.address, self.accounts[0]) + r = self.rpc.do(o) + + 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) + + expected_balance = ((1 - self.tax_level / 1000000) ** 10) * 1000 + expected_balance += ((1 - self.tax_level / 1000000) ** 20) * 1000 + self.assert_within_lower(balance, expected_balance, 500) + + +if __name__ == '__main__': + unittest.main() diff --git a/python/tests/test_period.py b/python/tests/test_period.py index c503f06..4ffd61e 100644 --- a/python/tests/test_period.py +++ b/python/tests/test_period.py @@ -102,5 +102,6 @@ class TestPeriod(TestDemurrageDefault): period = int(period) * (10 ** (38 - 9)) self.assertEqual(modifier, period) + if __name__ == '__main__': unittest.main() diff --git a/solidity/DemurrageTokenSingleCap.sol b/solidity/DemurrageTokenSingleCap.sol index 9ee0b24..0cedf1b 100644 --- a/solidity/DemurrageTokenSingleCap.sol +++ b/solidity/DemurrageTokenSingleCap.sol @@ -206,7 +206,7 @@ contract DemurrageTokenSingleCap { require(_amount + totalSupply <= supplyCap, 'ERR_CAP'); changePeriod(); - baseAmount = _amount; + baseAmount = toBaseAmount(_amount); totalSupply += _amount; increaseBaseBalance(_beneficiary, baseAmount); emit Mint(msg.sender, _beneficiary, _amount); @@ -350,6 +350,7 @@ contract DemurrageTokenSingleCap { uint256 periodTimestamp; uint256 nextPeriod; + applyDemurrage(); currentRedistribution = checkPeriod(); if (currentRedistribution == bytes32(0x00)) { return false; @@ -359,7 +360,6 @@ contract DemurrageTokenSingleCap { nextPeriod = currentPeriod + 1; periodTimestamp = getPeriodTimeDelta(currentPeriod); - applyDemurrage(); currentDemurrageAmount = demurrageAmount; demurrageCounts = demurrageCycles(periodTimestamp);