UNPKG

@gnosis.pm/conditional-tokens-market-makers

Version:
1 lines 34.8 kB
{"contractName":"Fixed192x64Math","abi":[{"constant":true,"inputs":[],"name":"LN2","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"LOG2_E","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ONE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"int256"}],"name":"exp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"int256"},{"name":"estimationMode","type":"Fixed192x64Math.EstimationMode"}],"name":"pow2","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"int256"}],"name":"pow2Bounds","outputs":[{"name":"lower","type":"uint256"},{"name":"upper","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint256"}],"name":"ln","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint256"},{"name":"estimationMode","type":"Fixed192x64Math.EstimationMode"}],"name":"binaryLog","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint256"}],"name":"log2Bounds","outputs":[{"name":"lower","type":"int256"},{"name":"upper","type":"int256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint256"}],"name":"floorLog2","outputs":[{"name":"lo","type":"int256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"nums","type":"int256[]"}],"name":"max","outputs":[{"name":"maxNum","type":"int256"}],"payable":false,"stateMutability":"pure","type":"function"}],"metadata":"{\"compiler\":{\"version\":\"0.5.10+commit.5a6ea5b1\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"LN2\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"},{\"name\":\"estimationMode\",\"type\":\"Fixed192x64Math.EstimationMode\"}],\"name\":\"binaryLog\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"log2Bounds\",\"outputs\":[{\"name\":\"lower\",\"type\":\"int256\"},{\"name\":\"upper\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"x\",\"type\":\"int256\"},{\"name\":\"estimationMode\",\"type\":\"Fixed192x64Math.EstimationMode\"}],\"name\":\"pow2\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"LOG2_E\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"ln\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"floorLog2\",\"outputs\":[{\"name\":\"lo\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"x\",\"type\":\"int256\"}],\"name\":\"pow2Bounds\",\"outputs\":[{\"name\":\"lower\",\"type\":\"uint256\"},{\"name\":\"upper\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ONE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nums\",\"type\":\"int256[]\"}],\"name\":\"max\",\"outputs\":[{\"name\":\"maxNum\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"x\",\"type\":\"int256\"}],\"name\":\"exp\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Alan Lu - <alan.lu@gnosis.pm>Stefan George - <stefan@gnosis.pm>\",\"methods\":{\"binaryLog(uint256,Fixed192x64Math.EstimationMode)\":{\"details\":\"Returns estimate of binaryLog(x) given x\",\"params\":{\"estimationMode\":\"whether to return a lower bound, upper bound, or a midpoint\",\"x\":\"logarithm argument in fixed point\"},\"return\":\"estimate of binaryLog(x) in fixed point\"},\"exp(int256)\":{\"details\":\"Returns natural exponential function value of given x\",\"params\":{\"x\":\"x\"},\"return\":\"e**x\"},\"floorLog2(uint256)\":{\"details\":\"Returns base 2 logarithm value of given x\",\"params\":{\"x\":\"x\"},\"return\":\"logarithmic value\"},\"ln(uint256)\":{\"details\":\"Returns natural logarithm value of given x\",\"params\":{\"x\":\"x\"},\"return\":\"ln(x)\"},\"log2Bounds(uint256)\":{\"details\":\"Returns bounds for value of binaryLog(x) given x\",\"params\":{\"x\":\"logarithm argument in fixed point\"},\"return\":\"{ \\\"lower\\\": \\\"lower bound of binaryLog(x) in fixed point\\\", \\\"upper\\\": \\\"upper bound of binaryLog(x) in fixed point\\\" }\"},\"max(int256[])\":{\"details\":\"Returns maximum of an array\",\"params\":{\"nums\":\"Numbers to look through\"},\"return\":\"Maximum number\"},\"pow2(int256,Fixed192x64Math.EstimationMode)\":{\"details\":\"Returns estimate of 2**x given x\",\"params\":{\"estimationMode\":\"whether to return a lower bound, upper bound, or a midpoint\",\"x\":\"exponent in fixed point\"},\"return\":\"estimate of 2**x in fixed point\"},\"pow2Bounds(int256)\":{\"details\":\"Returns bounds for value of 2**x given x\",\"params\":{\"x\":\"exponent in fixed point\"},\"return\":\"{ \\\"lower\\\": \\\"lower bound of 2**x in fixed point\\\", \\\"upper\\\": \\\"upper bound of 2**x in fixed point\\\" }\"}},\"title\":\"Fixed192x64Math library - Allows calculation of logarithmic and exponential functions\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol\":\"Fixed192x64Math\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/util-contracts/contracts/Fixed192x64Math.sol\":{\"keccak256\":\"0xad15b641bf8f5862034749b679ab91cb2c330c2ca997da4455863dc169ab82d4\",\"urls\":[\"bzzr://a37b3d23f367b7f0ba4669c417af754260f0dbedad21294079aed622222427f5\",\"dweb:/ipfs/QmScvV8NpQNBNApJXyLFcLAG4hwWExSkwPhWJrJxLqk9x5\"]}},\"version\":1}","bytecode":"0x610969610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100b35760003560e01c806324d4e90a1161007b57806324d4e90a1461015c57806345b8bafc14610179578063c126622714610196578063c2ee3a08146101b3578063ccc13814146101bb578063e46751e31461025e576100b3565b806302780677146100b8578063137bf798146100d25780631427f168146100f85780631d5801231461012e57806324902e2414610154575b600080fd5b6100c061027b565b60408051918252519081900360200190f35b6100c0600480360360408110156100e857600080fd5b508035906020013560ff16610287565b6101156004803603602081101561010e57600080fd5b50356102f8565b6040805192835260208301919091528051918290030190f35b6100c06004803603604081101561014457600080fd5b508035906020013560ff166103ab565b6100c061041a565b6100c06004803603602081101561017257600080fd5b5035610427565b6100c06004803603602081101561018f57600080fd5b503561046a565b610115600480360360208110156101ac57600080fd5b50356104d9565b6100c0610863565b6100c0600480360360208110156101d157600080fd5b8101906020810181356401000000008111156101ec57600080fd5b8201836020820111156101fe57600080fd5b8035906020019184602083028401116401000000008311171561022057600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061086b945050505050565b6100c06004803603602081101561027457600080fd5b50356108cc565b67b17217f7d1cf79ac81565b6000806000610295856102f8565b909250905060008460028111156102a857fe5b14156102b6575090506102f2565b60018460028111156102c457fe5b14156102d35791506102f29050565b60028460028111156102e157fe5b14156100b357600290829003050190505b92915050565b6000806000831161030857600080fd5b6103118361046a565b915060008083121561032b578260000384901b9050610330565b5082821c5b600160401b929092029160015b6040811361039e57600160401b8214156103565761039e565b600160401b8280020491506802000000000000000082106103965780600160401b600082121561038257fe5b901c840193506002828161039257fe5b0491505b60010161033d565b505050600481015b915091565b60008060006103b9856104d9565b909250905060008460028111156103cc57fe5b14156103da575090506102f2565b60018460028111156103e857fe5b14156103f75791506102f29050565b600284600281111561040557fe5b14156100b357600290829003040190506102f2565b680171547652b82fe17781565b6000806000610435846102f8565b91509150680171547652b82fe177600160401b8360028585038161045557fe5b0501028161045f57fe5b05925050505b919050565b603f1960c1608160011d5b818360010112156104d2576000811280156104995750600160401b8160000385901b105b806104b55750600081121580156104b55750600160401b84821c105b156104c2578091506104c6565b8092505b5080820160011d610475565b5050919050565b60008068bfffffffffffffffff8313156104f257600080fd5b683fffffffffffffffff1983121561051057506000905060016103a6565b6000806000851261052d575050600160401b808405908407610546565b6001600160401b8682010503915050600160401b810284035b600081121561055157fe5b679d955b7dd273b94e600160401b82800281900580840282900580850283900593840260061d67f5fdeffc162c754390920260021d67b17217f7d1cf79ab86020167e35846b82505fc599190910260041d0101600160801b01919081840205905060098167aec3ff3c5339888302901d82019150600160401b838202816105d457fe5b059050600c8167a184897c363c3b7a02901d82019150600160401b838202816105f957fe5b05905060108167ffe5fe2c4586343502901d82019150600160401b8382028161061e57fe5b05905060138167b160111d2e411fec02901d82019150600160401b8382028161064357fe5b05905060178167da929e9caf3e1ed202901d82019150600160401b8382028161066857fe5b059050601b8167f267a8ac5c764fb702901d82019150600160401b8382028161068d57fe5b059050601f8167f465639a8dd9260702901d82019150600160401b838202816106b257fe5b05905060238167e1deb287e14c2f1502901d82019150600160401b838202816106d757fe5b05905060278167c0b0c98b3687cb1402901d82019150600160401b838202816106fc57fe5b059050602b816798a4b26ac3c54b9f02901d82019150600160401b8382028161072157fe5b05905060308167e1b7421d82010f3302901d82019150600160401b8382028161074657fe5b059050603481679c744d73cfc59c9102901d82019150600160401b8382028161076b57fe5b05905060398167cc2225a0e12d3eab02901d82019150600160401b8382028161079057fe5b603f1995909501940567fb8bb5eda1b4aeb902603e1d919091019050680800000000000000006000841261082c5783610100038260008212156107cf57fe5b901d61081a57838260008212156107e257fe5b901b9550838160008212156107f357fe5b901b9050858187011061080a578086019450610810565b60001994505b506103a692505050565b5060001994508493506103a692505050565b8360000381600082121561083c57fe5b901d60010190508360000382600082121561085357fe5b901c955085019350505050915091565b600160401b81565b60008082511161087a57600080fd5b50600160ff1b60005b82518110156108c6578183828151811061089957fe5b602002602001015113156108be578281815181106108b357fe5b602002602001015191505b600101610883565b50919050565b600068851591f9dd5b9b40d78213156108e457600080fd5b682c5c85fdf473de6af21982136108fd57506000610465565b60008061091967b17217f7d1cf79ac600160401b8602056104d9565b915091508160028383038161092a57fe5b040194935050505056fea265627a7a72305820ea4753e10284cc276a52ddc4afa9e3f32cf6274d4f51d8b83785eddc7bf1361c64736f6c634300050a0032","deployedBytecode":"0x73000000000000000000000000000000000000000030146080604052600436106100b35760003560e01c806324d4e90a1161007b57806324d4e90a1461015c57806345b8bafc14610179578063c126622714610196578063c2ee3a08146101b3578063ccc13814146101bb578063e46751e31461025e576100b3565b806302780677146100b8578063137bf798146100d25780631427f168146100f85780631d5801231461012e57806324902e2414610154575b600080fd5b6100c061027b565b60408051918252519081900360200190f35b6100c0600480360360408110156100e857600080fd5b508035906020013560ff16610287565b6101156004803603602081101561010e57600080fd5b50356102f8565b6040805192835260208301919091528051918290030190f35b6100c06004803603604081101561014457600080fd5b508035906020013560ff166103ab565b6100c061041a565b6100c06004803603602081101561017257600080fd5b5035610427565b6100c06004803603602081101561018f57600080fd5b503561046a565b610115600480360360208110156101ac57600080fd5b50356104d9565b6100c0610863565b6100c0600480360360208110156101d157600080fd5b8101906020810181356401000000008111156101ec57600080fd5b8201836020820111156101fe57600080fd5b8035906020019184602083028401116401000000008311171561022057600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061086b945050505050565b6100c06004803603602081101561027457600080fd5b50356108cc565b67b17217f7d1cf79ac81565b6000806000610295856102f8565b909250905060008460028111156102a857fe5b14156102b6575090506102f2565b60018460028111156102c457fe5b14156102d35791506102f29050565b60028460028111156102e157fe5b14156100b357600290829003050190505b92915050565b6000806000831161030857600080fd5b6103118361046a565b915060008083121561032b578260000384901b9050610330565b5082821c5b600160401b929092029160015b6040811361039e57600160401b8214156103565761039e565b600160401b8280020491506802000000000000000082106103965780600160401b600082121561038257fe5b901c840193506002828161039257fe5b0491505b60010161033d565b505050600481015b915091565b60008060006103b9856104d9565b909250905060008460028111156103cc57fe5b14156103da575090506102f2565b60018460028111156103e857fe5b14156103f75791506102f29050565b600284600281111561040557fe5b14156100b357600290829003040190506102f2565b680171547652b82fe17781565b6000806000610435846102f8565b91509150680171547652b82fe177600160401b8360028585038161045557fe5b0501028161045f57fe5b05925050505b919050565b603f1960c1608160011d5b818360010112156104d2576000811280156104995750600160401b8160000385901b105b806104b55750600081121580156104b55750600160401b84821c105b156104c2578091506104c6565b8092505b5080820160011d610475565b5050919050565b60008068bfffffffffffffffff8313156104f257600080fd5b683fffffffffffffffff1983121561051057506000905060016103a6565b6000806000851261052d575050600160401b808405908407610546565b6001600160401b8682010503915050600160401b810284035b600081121561055157fe5b679d955b7dd273b94e600160401b82800281900580840282900580850283900593840260061d67f5fdeffc162c754390920260021d67b17217f7d1cf79ab86020167e35846b82505fc599190910260041d0101600160801b01919081840205905060098167aec3ff3c5339888302901d82019150600160401b838202816105d457fe5b059050600c8167a184897c363c3b7a02901d82019150600160401b838202816105f957fe5b05905060108167ffe5fe2c4586343502901d82019150600160401b8382028161061e57fe5b05905060138167b160111d2e411fec02901d82019150600160401b8382028161064357fe5b05905060178167da929e9caf3e1ed202901d82019150600160401b8382028161066857fe5b059050601b8167f267a8ac5c764fb702901d82019150600160401b8382028161068d57fe5b059050601f8167f465639a8dd9260702901d82019150600160401b838202816106b257fe5b05905060238167e1deb287e14c2f1502901d82019150600160401b838202816106d757fe5b05905060278167c0b0c98b3687cb1402901d82019150600160401b838202816106fc57fe5b059050602b816798a4b26ac3c54b9f02901d82019150600160401b8382028161072157fe5b05905060308167e1b7421d82010f3302901d82019150600160401b8382028161074657fe5b059050603481679c744d73cfc59c9102901d82019150600160401b8382028161076b57fe5b05905060398167cc2225a0e12d3eab02901d82019150600160401b8382028161079057fe5b603f1995909501940567fb8bb5eda1b4aeb902603e1d919091019050680800000000000000006000841261082c5783610100038260008212156107cf57fe5b901d61081a57838260008212156107e257fe5b901b9550838160008212156107f357fe5b901b9050858187011061080a578086019450610810565b60001994505b506103a692505050565b5060001994508493506103a692505050565b8360000381600082121561083c57fe5b901d60010190508360000382600082121561085357fe5b901c955085019350505050915091565b600160401b81565b60008082511161087a57600080fd5b50600160ff1b60005b82518110156108c6578183828151811061089957fe5b602002602001015113156108be578281815181106108b357fe5b602002602001015191505b600101610883565b50919050565b600068851591f9dd5b9b40d78213156108e457600080fd5b682c5c85fdf473de6af21982136108fd57506000610465565b60008061091967b17217f7d1cf79ac600160401b8602056104d9565b915091508160028383038161092a57fe5b040194935050505056fea265627a7a72305820ea4753e10284cc276a52ddc4afa9e3f32cf6274d4f51d8b83785eddc7bf1361c64736f6c634300050a0032","sourceMap":"221:8804:17:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24","deployedSourceMap":"221:8804:17:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;446:45;;;:::i;:::-;;;;;;;;;;;;;;;;6517:487;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6517:487:17;;;;;;;;;:::i;7280:744::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7280:744:17;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1508:484;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1508:484:17;;;;;;;;;:::i;497:49::-;;;:::i;6060:200::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6060:200:17;;:::i;8138:488::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8138:488:17;;:::i;2234:3723::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2234:3723:17;;:::i;393:47::-;;;:::i;8748:275::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8748:275:17;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;8748:275:17;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;8748:275:17;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;8748:275:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;8748:275:17;;-1:-1:-1;8748:275:17;;-1:-1:-1;;;;;8748:275:17:i;700:577::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;700:577:17;;:::i;446:45::-;473:18;446:45;:::o;6517:487::-;6620:3;6640:9;6651;6664:13;6675:1;6664:10;:13::i;:::-;6639:38;;-1:-1:-1;6639:38:17;-1:-1:-1;6708:25:17;6690:14;:43;;;;;;;;;6687:85;;;-1:-1:-1;6756:5:17;-1:-1:-1;6749:12:17;;6687:85;6802:25;6784:14;:43;;;;;;;;;6781:85;;;6850:5;-1:-1:-1;6843:12:17;;-1:-1:-1;6843:12:17;6781:85;6896:23;6878:14;:41;;;;;;;;;6875:105;;;6960:1;6943:13;;;;6942:19;:27;;-1:-1:-1;6517:487:17;;;;;:::o;7280:744::-;7353:9;7364;7401:1;7397;:5;7389:14;;;;;;7454:12;7464:1;7454:9;:12::i;:::-;7446:20;;7477:6;7505:1;7497:5;:9;7493:95;;;7535:5;7534:6;;7524:1;:17;;7520:21;;7493:95;;;-1:-1:-1;7572:16:17;;;7493:95;-1:-1:-1;;;7599:17:17;;;;;7752:1;7739:243;7760:2;7755:1;:7;7739:243;;-1:-1:-1;;;7786:1:17;:8;7783:51;;;7814:5;;7783:51;-1:-1:-1;;;7851:5:17;;;:11;;-1:-1:-1;7884:7:17;7879:12;;7876:96;;7931:1;-1:-1:-1;;;7924:8:17;;;;;;;;;;7911:22;;;;7956:1;7951:6;;;;;;;;;7876:96;7764:3;;7739:243;;;-1:-1:-1;;;8015:1:17;8007:9;;7280:744;;;;:::o;1508:484::-;1605:4;1626:10;1638;1652:13;1663:1;1652:10;:13::i;:::-;1625:40;;-1:-1:-1;1625:40:17;-1:-1:-1;1696:25:17;1678:14;:43;;;;;;;;;1675:85;;;-1:-1:-1;1744:5:17;-1:-1:-1;1737:12:17;;1675:85;1790:25;1772:14;:43;;;;;;;;;1769:85;;;1838:5;-1:-1:-1;1831:12:17;;-1:-1:-1;1831:12:17;1769:85;1884:23;1866:14;:41;;;;;;;;;1863:105;;;1948:1;1931:13;;;;1930:19;:27;;-1:-1:-1;1923:34:17;;497:49;527:19;497:49;:::o;6060:200::-;6125:3;6145:9;6156;6169:13;6180:1;6169:10;:13::i;:::-;6144:38;;;;527:19;-1:-1:-1;;;6222:5:17;6218:1;6209:5;6201;:13;6200:19;;;;;;:27;6199:40;:54;;;;;;6192:61;;;;6060:200;;;;:::o;8138:488::-;-1:-1:-1;;8259:3:17;8376:7;8388:1;8375:14;8399:221;8416:2;8406;8411:1;8406:6;8405:13;8399:221;;;8444:1;8438:3;:7;:32;;;;;-1:-1:-1;;;8460:3:17;8459:4;;8449:1;:15;;:21;8438:32;:68;;;;8481:1;8474:3;:8;;:32;;;;-1:-1:-1;;;;8486:14:17;;;:20;8474:32;8434:141;;;8529:3;8524:8;;8434:141;;;8572:3;8567:8;;8434:141;-1:-1:-1;8596:7:17;;;8608:1;8595:14;8399:221;;;8138:488;;;;;:::o;2234:3723::-;2306:10;2318;2479:22;2474:1;:27;;2466:36;;;;;;-1:-1:-1;;2629:1:17;:27;2625:58;;;-1:-1:-1;2678:1:17;;-1:-1:-1;2681:1:17;2670:13;;2625:58;2858:9;2877:5;2901:1;2896;:6;2892:194;;-1:-1:-1;;;;;2926:12:17;;;;2956;;2892:194;;;3034:1;-1:-1:-1;;;3016:3:17;;;3015:16;:20;;-1:-1:-1;;;;;3058:16:17;;3053:22;;2892:194;3107:1;3102;:6;;3095:14;;;;3915:18;-1:-1:-1;;;3688:8:17;;;:19;;;3782:8;;;:19;;;3876:8;;;:19;;;3915:25;;;3945:7;3915:38;3727:18;:25;;;3757:7;3727:38;3646:18;:25;;3717:48;3821:18;:25;;;;3851:7;3821:38;3811:48;3905;-1:-1:-1;;;3905:48:17;;3876:19;3970:8;;;:19;3963:26;;4039:7;4030:4;4009:18;:25;:38;;3999:48;;;;-1:-1:-1;;;4071:1:17;4064:4;:8;:19;;;;;;4057:26;;4133:7;4124:4;4103:18;:25;:38;;4093:48;;;;-1:-1:-1;;;4165:1:17;4158:4;:8;:19;;;;;;4151:26;;4227:7;4218:4;4197:18;:25;:38;;4187:48;;;;-1:-1:-1;;;4259:1:17;4252:4;:8;:19;;;;;;4245:26;;4321:7;4312:4;4291:18;:25;:38;;4281:48;;;;-1:-1:-1;;;4353:1:17;4346:4;:8;:19;;;;;;4339:26;;4415:7;4406:4;4385:18;:25;:38;;4375:48;;;;-1:-1:-1;;;4447:1:17;4440:4;:8;:19;;;;;;4433:26;;4509:7;4500:4;4479:18;:25;:38;;4469:48;;;;-1:-1:-1;;;4541:1:17;4534:4;:8;:19;;;;;;4527:26;;4603:7;4594:4;4573:18;:25;:38;;4563:48;;;;-1:-1:-1;;;4635:1:17;4628:4;:8;:19;;;;;;4621:26;;4697:7;4688:4;4667:18;:25;:38;;4657:48;;;;-1:-1:-1;;;4729:1:17;4722:4;:8;:19;;;;;;4715:26;;4791:8;4782:4;4761:18;:25;:39;;4751:49;;;;-1:-1:-1;;;4824:1:17;4817:4;:8;:19;;;;;;4810:26;;4886:8;4877:4;4856:18;:25;:39;;4846:49;;;;-1:-1:-1;;;4919:1:17;4912:4;:8;:19;;;;;;4905:26;;4981:8;4972:4;4951:18;:25;:39;;4941:49;;;;-1:-1:-1;;;5014:1:17;5007:4;:8;:19;;;;;;5000:26;;5076:8;5067:4;5046:18;:25;:39;;5036:49;;;;-1:-1:-1;;;5109:1:17;5102:4;:8;:19;;;;;;5095:26;;5171:8;5162:4;5141:18;:25;:39;;5131:49;;;;-1:-1:-1;;;5204:1:17;5197:4;:8;:19;;;;;-1:-1:-1;;5336:11:17;;;;;5197:19;5233:18;:25;5263:8;5233:39;5282:14;;;;;-1:-1:-1;5317:7:17;5370:1;5361:10;;5357:446;;5406:5;5402:3;:9;5391:6;:21;;;;;;;;;;5387:405;;5461:5;5450:6;5445:21;;;;;;;;;;5437:29;;5493:5;5484:14;;;;;;;;;;;;;5565:5;5556:4;5543:5;:18;:27;5539:138;;5613:4;5600:5;:18;5592:26;;5539:138;;;-1:-1:-1;;5661:16:17;;5539:138;-1:-1:-1;5695:21:17;;-1:-1:-1;;;5695:21:17;5387:405;-1:-1:-1;;;5773:8:17;-1:-1:-1;5773:8:17;;-1:-1:-1;5765:27:17;;-1:-1:-1;;;5765:27:17;5387:405;5830:5;5829:6;;5820:4;:16;;;;;;;;;;5840:1;5819:22;5812:29;;5877:5;5876:6;;5864;5859:24;;;;;;;;;;;-1:-1:-1;5901:18:17;;;-1:-1:-1;;;;2234:3723:17;;;:::o;393:47::-;-1:-1:-1;;;393:47:17;:::o;8748:275::-;8825:10;8873:1;8859:4;:11;:15;8851:24;;;;;;-1:-1:-1;;;;8916:6:17;8911:105;8932:4;:11;8928:1;:15;8911:105;;;8976:6;8966:4;8971:1;8966:7;;;;;;;;;;;;;;:16;8962:54;;;9009:4;9014:1;9009:7;;;;;;;;;;;;;;9000:16;;8962:54;8945:3;;8911:105;;;;8748:275;;;:::o;700:577::-;765:4;917:22;912:1;:27;;904:36;;;;;;-1:-1:-1;;1064:1:17;:27;1060:53;;-1:-1:-1;1112:1:17;1105:8;;1060:53;1165:10;;1191:35;473:18;-1:-1:-1;;;1202:12:17;;:23;1191:10;:35::i;:::-;1164:62;;;;1265:5;1261:1;1252:5;1244;:13;1243:19;;;;;;:27;;700:577;-1:-1:-1;;;;700:577:17:o","source":"pragma solidity >=0.4.24 ^0.5.1;\n\n\n/// @title Fixed192x64Math library - Allows calculation of logarithmic and exponential functions\n/// @author Alan Lu - <alan.lu@gnosis.pm>\n/// @author Stefan George - <stefan@gnosis.pm>\nlibrary Fixed192x64Math {\n\n enum EstimationMode { LowerBound, UpperBound, Midpoint }\n\n /*\n * Constants\n */\n // This is equal to 1 in our calculations\n uint public constant ONE = 0x10000000000000000;\n uint public constant LN2 = 0xb17217f7d1cf79ac;\n uint public constant LOG2_E = 0x171547652b82fe177;\n\n /*\n * Public functions\n */\n /// @dev Returns natural exponential function value of given x\n /// @param x x\n /// @return e**x\n function exp(int x)\n public\n pure\n returns (uint)\n {\n // revert if x is > MAX_POWER, where\n // MAX_POWER = int(mp.floor(mp.log(mpf(2**256 - 1) / ONE) * ONE))\n require(x <= 2454971259878909886679);\n // return 0 if exp(x) is tiny, using\n // MIN_POWER = int(mp.floor(mp.log(mpf(1) / ONE) * ONE))\n if (x <= -818323753292969962227)\n return 0;\n\n // Transform so that e^x -> 2^x\n (uint lower, uint upper) = pow2Bounds(x * int(ONE) / int(LN2));\n return (upper - lower) / 2 + lower;\n }\n\n /// @dev Returns estimate of 2**x given x\n /// @param x exponent in fixed point\n /// @param estimationMode whether to return a lower bound, upper bound, or a midpoint\n /// @return estimate of 2**x in fixed point\n function pow2(int x, EstimationMode estimationMode)\n public\n pure\n returns (uint)\n {\n (uint lower, uint upper) = pow2Bounds(x);\n if(estimationMode == EstimationMode.LowerBound) {\n return lower;\n }\n if(estimationMode == EstimationMode.UpperBound) {\n return upper;\n }\n if(estimationMode == EstimationMode.Midpoint) {\n return (upper - lower) / 2 + lower;\n }\n revert();\n }\n\n /// @dev Returns bounds for value of 2**x given x\n /// @param x exponent in fixed point\n /// @return {\n /// \"lower\": \"lower bound of 2**x in fixed point\",\n /// \"upper\": \"upper bound of 2**x in fixed point\"\n /// }\n function pow2Bounds(int x)\n public\n pure\n returns (uint lower, uint upper)\n {\n // revert if x is > MAX_POWER, where\n // MAX_POWER = int(mp.floor(mp.log(mpf(2**256 - 1) / ONE, 2) * ONE))\n require(x <= 3541774862152233910271);\n // return 0 if exp(x) is tiny, using\n // MIN_POWER = int(mp.floor(mp.log(mpf(1) / ONE, 2) * ONE))\n if (x < -1180591620717411303424)\n return (0, 1);\n\n // 2^x = 2^(floor(x)) * 2^(x-floor(x))\n // ^^^^^^^^^^^^^^ is a bit shift of ceil(x)\n // so Taylor expand on z = x-floor(x), z in [0, 1)\n int shift;\n int z;\n if (x >= 0) {\n shift = x / int(ONE);\n z = x % int(ONE);\n }\n else {\n shift = (x+1) / int(ONE) - 1;\n z = x - (int(ONE) * shift);\n }\n assert(z >= 0);\n // 2^x = 1 + (ln 2) x + (ln 2)^2/2! x^2 + ...\n //\n // Can generate the z coefficients using mpmath and the following lines\n // >>> from mpmath import mp\n // >>> mp.dps = 100\n // >>> coeffs = [mp.log(2)**i / mp.factorial(i) for i in range(1, 21)]\n // >>> shifts = [64 - int(mp.log(c, 2)) for c in coeffs]\n // >>> print('\\n'.join(hex(int(c * (1 << s))) + ', ' + str(s) for c, s in zip(coeffs, shifts)))\n int result = int(ONE) << 64;\n int zpow = z;\n result += 0xb17217f7d1cf79ab * zpow;\n zpow = zpow * z / int(ONE);\n result += 0xf5fdeffc162c7543 * zpow >> (66 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xe35846b82505fc59 * zpow >> (68 - 64);\n zpow = zpow * z / int(ONE);\n result += 0x9d955b7dd273b94e * zpow >> (70 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xaec3ff3c53398883 * zpow >> (73 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xa184897c363c3b7a * zpow >> (76 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xffe5fe2c45863435 * zpow >> (80 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xb160111d2e411fec * zpow >> (83 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xda929e9caf3e1ed2 * zpow >> (87 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xf267a8ac5c764fb7 * zpow >> (91 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xf465639a8dd92607 * zpow >> (95 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xe1deb287e14c2f15 * zpow >> (99 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xc0b0c98b3687cb14 * zpow >> (103 - 64);\n zpow = zpow * z / int(ONE);\n result += 0x98a4b26ac3c54b9f * zpow >> (107 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xe1b7421d82010f33 * zpow >> (112 - 64);\n zpow = zpow * z / int(ONE);\n result += 0x9c744d73cfc59c91 * zpow >> (116 - 64);\n zpow = zpow * z / int(ONE);\n result += 0xcc2225a0e12d3eab * zpow >> (121 - 64);\n zpow = zpow * z / int(ONE);\n zpow = 0xfb8bb5eda1b4aeb9 * zpow >> (126 - 64);\n result += zpow;\n zpow = int(8 * ONE);\n\n shift -= 64;\n if (shift >= 0) {\n if (result >> (256-shift) == 0) {\n lower = uint(result) << shift;\n zpow <<= shift; // todo: is this safe?\n if (lower + uint(zpow) >= lower)\n upper = lower + uint(zpow);\n else\n upper = 2**256-1;\n return (lower, upper);\n }\n else\n return (2**256-1, 2**256-1);\n }\n zpow = (zpow >> (-shift)) + 1;\n lower = uint(result) >> (-shift);\n upper = lower + uint(zpow);\n return (lower, upper);\n }\n\n /// @dev Returns natural logarithm value of given x\n /// @param x x\n /// @return ln(x)\n function ln(uint x)\n public\n pure\n returns (int)\n {\n (int lower, int upper) = log2Bounds(x);\n return ((upper - lower) / 2 + lower) * int(ONE) / int(LOG2_E);\n }\n\n /// @dev Returns estimate of binaryLog(x) given x\n /// @param x logarithm argument in fixed point\n /// @param estimationMode whether to return a lower bound, upper bound, or a midpoint\n /// @return estimate of binaryLog(x) in fixed point\n function binaryLog(uint x, EstimationMode estimationMode)\n public\n pure\n returns (int)\n {\n (int lower, int upper) = log2Bounds(x);\n if(estimationMode == EstimationMode.LowerBound) {\n return lower;\n }\n if(estimationMode == EstimationMode.UpperBound) {\n return upper;\n }\n if(estimationMode == EstimationMode.Midpoint) {\n return (upper - lower) / 2 + lower;\n }\n revert();\n }\n\n /// @dev Returns bounds for value of binaryLog(x) given x\n /// @param x logarithm argument in fixed point\n /// @return {\n /// \"lower\": \"lower bound of binaryLog(x) in fixed point\",\n /// \"upper\": \"upper bound of binaryLog(x) in fixed point\"\n /// }\n function log2Bounds(uint x)\n public\n pure\n returns (int lower, int upper)\n {\n require(x > 0);\n // compute ⌊log₂x⌋\n lower = floorLog2(x);\n\n uint y;\n if (lower < 0)\n y = x << uint(-lower);\n else\n y = x >> uint(lower);\n\n lower *= int(ONE);\n\n // y = x * 2^(-⌊log₂x⌋)\n // so 1 <= y < 2\n // and log₂x = ⌊log₂x⌋ + log₂y\n for (int m = 1; m <= 64; m++) {\n if(y == ONE) {\n break;\n }\n y = y * y / ONE;\n if(y >= 2 * ONE) {\n lower += int(ONE >> m);\n y /= 2;\n }\n }\n\n return (lower, lower + 4);\n }\n\n /// @dev Returns base 2 logarithm value of given x\n /// @param x x\n /// @return logarithmic value\n function floorLog2(uint x)\n public\n pure\n returns (int lo)\n {\n lo = -64;\n int hi = 193;\n // I use a shift here instead of / 2 because it floors instead of rounding towards 0\n int mid = (hi + lo) >> 1;\n while((lo + 1) < hi) {\n if (mid < 0 && x << uint(-mid) < ONE || mid >= 0 && x >> uint(mid) < ONE)\n hi = mid;\n else\n lo = mid;\n mid = (hi + lo) >> 1;\n }\n }\n\n /// @dev Returns maximum of an array\n /// @param nums Numbers to look through\n /// @return Maximum number\n function max(int[] memory nums)\n public\n pure\n returns (int maxNum)\n {\n require(nums.length > 0);\n maxNum = -2**255;\n for (uint i = 0; i < nums.length; i++)\n if (nums[i] > maxNum)\n maxNum = nums[i];\n }\n}\n","compiler":{"name":"solc","version":"0.5.10+commit.5a6ea5b1.Emscripten.clang"},"networks":{"1":{"events":{},"links":{},"address":"0x75a6D6251511AF081f77F2B531C14808fB3805f3","transactionHash":"0x90ed58d6f44dda2d628c251cb64050eef0fc3fce7ca7896b1956b1e8c2dcc547"},"4":{"events":{},"links":{},"address":"0x81B086d91538fb1826F9D4e91662d4Fdd65Df413","transactionHash":"0xd65d0448076291d18f17d6cc563db55e0153fe171b9e92c0f005fabd3dc6606c"}},"schemaVersion":"3.0.16","updatedAt":"2020-03-16T19:03:53.179Z","devdoc":{"author":"Alan Lu - <alan.lu@gnosis.pm>Stefan George - <stefan@gnosis.pm>","methods":{"binaryLog(uint256,Fixed192x64Math.EstimationMode)":{"details":"Returns estimate of binaryLog(x) given x","params":{"estimationMode":"whether to return a lower bound, upper bound, or a midpoint","x":"logarithm argument in fixed point"},"return":"estimate of binaryLog(x) in fixed point"},"exp(int256)":{"details":"Returns natural exponential function value of given x","params":{"x":"x"},"return":"e**x"},"floorLog2(uint256)":{"details":"Returns base 2 logarithm value of given x","params":{"x":"x"},"return":"logarithmic value"},"ln(uint256)":{"details":"Returns natural logarithm value of given x","params":{"x":"x"},"return":"ln(x)"},"log2Bounds(uint256)":{"details":"Returns bounds for value of binaryLog(x) given x","params":{"x":"logarithm argument in fixed point"},"return":"{ \"lower\": \"lower bound of binaryLog(x) in fixed point\", \"upper\": \"upper bound of binaryLog(x) in fixed point\" }"},"max(int256[])":{"details":"Returns maximum of an array","params":{"nums":"Numbers to look through"},"return":"Maximum number"},"pow2(int256,Fixed192x64Math.EstimationMode)":{"details":"Returns estimate of 2**x given x","params":{"estimationMode":"whether to return a lower bound, upper bound, or a midpoint","x":"exponent in fixed point"},"return":"estimate of 2**x in fixed point"},"pow2Bounds(int256)":{"details":"Returns bounds for value of 2**x given x","params":{"x":"exponent in fixed point"},"return":"{ \"lower\": \"lower bound of 2**x in fixed point\", \"upper\": \"upper bound of 2**x in fixed point\" }"}},"title":"Fixed192x64Math library - Allows calculation of logarithmic and exponential functions"},"userdoc":{"methods":{}}}