From 3aed7cc9cddf59ec4c79eb1988558a1ff3778a27 Mon Sep 17 00:00:00 2001 From: Kallol Borah Date: Sun, 29 Oct 2023 21:30:10 +0530 Subject: [PATCH] updated margin trading pool --- abis/MarginTradingPool.json | 17 +- abis/MarginTradingPoolFactory.json | 4 +- abis/PrimaryIssuePool.json | 10 +- abis/PrimaryIssuePoolFactory.json | 4 +- generated/EventEmitter/EventEmitter.ts | 318 ++ generated/MarginTradingPoolFactory/ERC20.ts | 543 +++ .../MarginTradingPool.ts | 2057 ++++++++ .../MarginTradingPoolFactory.ts | 489 ++ generated/MarginTradingPoolFactory/Vault.ts | 1544 ++++++ .../MarginTradingPoolFactory/WeightedPool.ts | 1981 ++++++++ .../OffchainSecondariesPoolFactory/ERC20.ts | 543 +++ .../OffchainSecondariesPool.ts | 1964 ++++++++ .../OffchainSecondariesPoolFactory.ts | 450 ++ .../OffchainSecondariesPoolFactory/Vault.ts | 1544 ++++++ .../WeightedPool.ts | 1981 ++++++++ generated/PrimaryIssuePoolFactory/ERC20.ts | 543 +++ .../PrimaryIssuePool.ts | 2080 +++++++++ .../PrimaryIssuePoolFactory.ts | 489 ++ generated/PrimaryIssuePoolFactory/Vault.ts | 1544 ++++++ .../PrimaryIssuePoolFactory/WeightedPool.ts | 1981 ++++++++ generated/SecondaryIssuePoolFactory/ERC20.ts | 543 +++ .../SecondaryIssuePool.ts | 1964 ++++++++ .../SecondaryIssuePoolFactory.ts | 447 ++ generated/SecondaryIssuePoolFactory/Vault.ts | 1544 ++++++ .../SecondaryIssuePoolFactory/WeightedPool.ts | 1981 ++++++++ generated/Vault/ERC20.ts | 543 +++ generated/Vault/FXPool.ts | 2234 +++++++++ generated/Vault/StablePool.ts | 1860 ++++++++ generated/Vault/Vault.ts | 1544 ++++++ generated/Vault/WeightedPool.ts | 1981 ++++++++ generated/Vault/WeightedPoolFactory.ts | 455 ++ generated/schema.ts | 4126 +++++++++++++++++ generated/templates.ts | 283 ++ .../ConvergentCurvePool.ts | 1413 ++++++ generated/templates/FXPool/FXPool.ts | 2234 +++++++++ generated/templates/Gyro2Pool/Gyro2Pool.ts | 2621 +++++++++++ generated/templates/Gyro3Pool/Gyro3Pool.ts | 2193 +++++++++ generated/templates/GyroEPool/GyroEPool.ts | 3061 ++++++++++++ .../InvestmentPool/InvestmentPool.ts | 2156 +++++++++ generated/templates/LinearPool/LinearPool.ts | 1721 +++++++ .../LiquidityBootstrappingPool.ts | 1872 ++++++++ .../MarginTradingPool/MarginTradingPool.ts | 2057 ++++++++ .../MarginTradingPool/WeightedPool.ts | 1981 ++++++++ .../MetaStablePool/MetaStablePool.ts | 2530 ++++++++++ .../templates/MetaStablePool/StablePool.ts | 1860 ++++++++ .../AccessControlledOffchainAggregator.ts | 2007 ++++++++ .../OffchainSecondariesPool.ts | 1964 ++++++++ .../OffchainSecondariesPool/WeightedPool.ts | 1981 ++++++++ .../PrimaryIssuePool/PrimaryIssuePool.ts | 2080 +++++++++ .../PrimaryIssuePool/WeightedPool.ts | 1981 ++++++++ .../SecondaryIssuePool/SecondaryIssuePool.ts | 1964 ++++++++ .../SecondaryIssuePool/WeightedPool.ts | 1981 ++++++++ .../StablePhantomPool/StablePhantomPool.ts | 2438 ++++++++++ .../templates/StablePhantomPool/StablePool.ts | 1860 ++++++++ .../ComposableStablePool.ts | 2561 ++++++++++ .../StablePhantomPoolV2/StablePool.ts | 1860 ++++++++ generated/templates/StablePool/StablePool.ts | 1860 ++++++++ .../templates/WeightedPool/WeightedPool.ts | 1981 ++++++++ .../WeightedPool2Tokens.ts | 1974 ++++++++ .../WeightedPoolV2/WeightedPoolV2.ts | 2151 +++++++++ manifest.template.yaml | 2 +- networks.yaml | 8 +- subgraph.yaml | 10 +- 63 files changed, 95929 insertions(+), 24 deletions(-) create mode 100644 generated/EventEmitter/EventEmitter.ts create mode 100644 generated/MarginTradingPoolFactory/ERC20.ts create mode 100644 generated/MarginTradingPoolFactory/MarginTradingPool.ts create mode 100644 generated/MarginTradingPoolFactory/MarginTradingPoolFactory.ts create mode 100644 generated/MarginTradingPoolFactory/Vault.ts create mode 100644 generated/MarginTradingPoolFactory/WeightedPool.ts create mode 100644 generated/OffchainSecondariesPoolFactory/ERC20.ts create mode 100644 generated/OffchainSecondariesPoolFactory/OffchainSecondariesPool.ts create mode 100644 generated/OffchainSecondariesPoolFactory/OffchainSecondariesPoolFactory.ts create mode 100644 generated/OffchainSecondariesPoolFactory/Vault.ts create mode 100644 generated/OffchainSecondariesPoolFactory/WeightedPool.ts create mode 100644 generated/PrimaryIssuePoolFactory/ERC20.ts create mode 100644 generated/PrimaryIssuePoolFactory/PrimaryIssuePool.ts create mode 100644 generated/PrimaryIssuePoolFactory/PrimaryIssuePoolFactory.ts create mode 100644 generated/PrimaryIssuePoolFactory/Vault.ts create mode 100644 generated/PrimaryIssuePoolFactory/WeightedPool.ts create mode 100644 generated/SecondaryIssuePoolFactory/ERC20.ts create mode 100644 generated/SecondaryIssuePoolFactory/SecondaryIssuePool.ts create mode 100644 generated/SecondaryIssuePoolFactory/SecondaryIssuePoolFactory.ts create mode 100644 generated/SecondaryIssuePoolFactory/Vault.ts create mode 100644 generated/SecondaryIssuePoolFactory/WeightedPool.ts create mode 100644 generated/Vault/ERC20.ts create mode 100644 generated/Vault/FXPool.ts create mode 100644 generated/Vault/StablePool.ts create mode 100644 generated/Vault/Vault.ts create mode 100644 generated/Vault/WeightedPool.ts create mode 100644 generated/Vault/WeightedPoolFactory.ts create mode 100644 generated/schema.ts create mode 100644 generated/templates.ts create mode 100644 generated/templates/ConvergentCurvePool/ConvergentCurvePool.ts create mode 100644 generated/templates/FXPool/FXPool.ts create mode 100644 generated/templates/Gyro2Pool/Gyro2Pool.ts create mode 100644 generated/templates/Gyro3Pool/Gyro3Pool.ts create mode 100644 generated/templates/GyroEPool/GyroEPool.ts create mode 100644 generated/templates/InvestmentPool/InvestmentPool.ts create mode 100644 generated/templates/LinearPool/LinearPool.ts create mode 100644 generated/templates/LiquidityBootstrappingPool/LiquidityBootstrappingPool.ts create mode 100644 generated/templates/MarginTradingPool/MarginTradingPool.ts create mode 100644 generated/templates/MarginTradingPool/WeightedPool.ts create mode 100644 generated/templates/MetaStablePool/MetaStablePool.ts create mode 100644 generated/templates/MetaStablePool/StablePool.ts create mode 100644 generated/templates/OffchainAggregator/AccessControlledOffchainAggregator.ts create mode 100644 generated/templates/OffchainSecondariesPool/OffchainSecondariesPool.ts create mode 100644 generated/templates/OffchainSecondariesPool/WeightedPool.ts create mode 100644 generated/templates/PrimaryIssuePool/PrimaryIssuePool.ts create mode 100644 generated/templates/PrimaryIssuePool/WeightedPool.ts create mode 100644 generated/templates/SecondaryIssuePool/SecondaryIssuePool.ts create mode 100644 generated/templates/SecondaryIssuePool/WeightedPool.ts create mode 100644 generated/templates/StablePhantomPool/StablePhantomPool.ts create mode 100644 generated/templates/StablePhantomPool/StablePool.ts create mode 100644 generated/templates/StablePhantomPoolV2/ComposableStablePool.ts create mode 100644 generated/templates/StablePhantomPoolV2/StablePool.ts create mode 100644 generated/templates/StablePool/StablePool.ts create mode 100644 generated/templates/WeightedPool/WeightedPool.ts create mode 100644 generated/templates/WeightedPool2Tokens/WeightedPool2Tokens.ts create mode 100644 generated/templates/WeightedPoolV2/WeightedPoolV2.ts diff --git a/abis/MarginTradingPool.json b/abis/MarginTradingPool.json index 927477d6c..8debd1348 100644 --- a/abis/MarginTradingPool.json +++ b/abis/MarginTradingPool.json @@ -567,6 +567,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "getMargin", @@ -1273,8 +1286,8 @@ "type": "function" } ], - "bytecode": "0x6103406040523480156200001257600080fd5b50604051620077a5380380620077a5833981016040819052620000359162000c0f565b846000856000015186602001516200005d88604001518960800151306200057060201b60201c565b60408051600380825260808201909252906020820160608036833701905050896101200151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000ce92919062000a91565b508051620000e490600490602084019062000a91565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016290506276a7008311156101946200063f565b6200017662278d008211156101956200063f565b429091016101408190520161016052855162000198906002111560c86200063f565b620001b2620001a662000654565b8751111560c96200063f565b620001c8866200065960201b620028961760201c565b620001d38462000665565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000204908d9060040162000e82565b602060405180830381600087803b1580156200021f57600080fd5b505af115801562000234573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025a919062000bd7565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028f9084908b908b9060040162000da2565b600060405180830381600087803b158015620002aa57600080fd5b505af1158015620002bf573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030657600080fd5b505afa1580156200031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000341919062000bf0565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083608001516001600160a01b03166101e0816001600160a01b031660601b8152505084600a60006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000806000620003f48760400151886080015130620006f960201b60201c565b6102c08190526102e083905261030082905260408a015192955090935091506200041e90620007ef565b6102005260808701516200043290620007ef565b6102205260e0870151610240526101008701516102605260c0870151610280526101208701516102a0526001600160601b0319606085901b16610320526040808801516080890151915186929030906200048c9062000b16565b6200049b949392919062000d77565b604051809103906000f080158015620004b8573d6000803e3d6000fd5b50600960006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086604001516001600160a01b03167f3d3c4c037711d546c8299d521821c31f3d622836675303d87dce53bb231a863688606001518960c001518a608001518b60e001518c61010001518d60a00151600960009054906101000a90046001600160a01b03168c6040516200055a98979695949392919062000e3e565b60405180910390a2505050505050505062000ee9565b60606000808062000583878787620006f9565b6040805160038082526080820190925293965091945092506020820160608036833701905050935086848481518110620005b957fe5b60200260200101906001600160a01b031690816001600160a01b03168152505085848381518110620005e757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200061557fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b8162000650576200065081620008c3565b5050565b600390565b806200065081620008d8565b6200067e6200067362000964565b82101560cb6200063f565b620006976200068c6200096d565b82111560ca6200063f565b620006b98160c0603f6008546200097960201b620028a017909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90620006ee90839062000e97565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200078257836001600160a01b0316856001600160a01b0316101562000745575060009150600190506002620007e6565b836001600160a01b0316866001600160a01b0316101562000771575060009150600290506001620007e6565b5060019150600290506000620007e6565b846001600160a01b0316846001600160a01b03161015620007ae575060029150600190506000620007e6565b856001600160a01b0316846001600160a01b03161015620007da575060029150600090506001620007e6565b50600191506000905060025b93509350939050565b60006001600160a01b038216301415620008135750670de0b6b3a7640000620008be565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200084f57600080fd5b505afa15801562000864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200088a919062000d54565b60ff1690506000620008a96012836200099e60201b620028c31760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b620008d5816210905360ea1b620009bb565b50565b600281511015620008e957620008d5565b600081600081518110620008f957fe5b602002602001015190506000600190505b82518110156200095f5760008382815181106200092357fe5b6020026020010151905062000954816001600160a01b0316846001600160a01b03161060656200063f60201b60201c565b91506001016200090a565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200098884848462000a1c565b506001901b60001901811b1992909216911b1790565b6000620009b08383111560016200063f565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b62000a2d610100831060646200063f565b62000a666001821015801562000a5e575062000a5a60ff846101000362000a7760201b620028d91760201c565b8211155b60646200063f565b6200095f83821c156101b46200063f565b600081831062000a88578162000a8a565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000ad457805160ff191683800117855562000b04565b8280016001018555821562000b04579182015b8281111562000b0457825182559160200191906001019062000ae7565b5062000b1292915062000b24565b5090565b6119128062005e9383390190565b5b8082111562000b12576000815560010162000b25565b8051620009b58162000ed3565b600082601f83011262000b59578081fd5b81516001600160401b0381111562000b6f578182fd5b602062000b85601f8301601f1916820162000ea0565b9250818352848183860101111562000b9c57600080fd5b60005b8281101562000bbc57848101820151848201830152810162000b9f565b8281111562000bce5760008284860101525b50505092915050565b60006020828403121562000be9578081fd5b5051919050565b60006020828403121562000c02578081fd5b815162000a8a8162000ed3565b600080600080600060a0868803121562000c27578081fd5b855162000c348162000ed3565b60208701519095506001600160401b038082111562000c51578283fd5b818801915061014080838b03121562000c68578384fd5b62000c738162000ea0565b905082518281111562000c84578485fd5b62000c928b82860162000b48565b82525060208301518281111562000ca7578485fd5b62000cb58b82860162000b48565b60208301525062000cca8a6040850162000b3b565b60408201526060830151606082015262000ce88a6080850162000b3b565b608082015260a083015160a082015260c083015160c082015260e083015160e08201526101009150818301518282015261012091508183015182820152809650505050604086015192506060860151915062000d48876080880162000b3b565b90509295509295909350565b60006020828403121562000d66578081fd5b815160ff8116811462000a8a578182fd5b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000dee5762000ddb855162000ec7565b8352938301939183019160010162000dc6565b505084810360408601528551808252908201925081860190845b8181101562000e305762000e1d835162000ec7565b8552938301939183019160010162000e08565b509298975050505050505050565b97885260208801969096526001600160a01b0394851660408801526060870193909352608086019190915260a0850152811660c08401521660e08201526101000190565b602081016003831062000e9157fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000ebf57600080fd5b604052919050565b6001600160a01b031690565b6001600160a01b0381168114620008d557600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e051610300516103205160601c614dbe620010d5600039806134ef52508061089f52806129d9528061355b52806135b552508061096b5280612973525080610a095280611bb55280611d5d5280611d9a5280611dd85280612a2e52505080611c4b528061228c52508061173852806117c752806118b352806119f15280611a8f5280611e435280611ee152806122f352508061171752806117a6528061189252806119d05280611a6e5280611e225280611ec052806121a25250806113585280612a01528061358e525080611324528061299b52508061065552806106eb52806108435280610b625280610dc05280610e6b52806112d952806114f852806116c952806118445280611a205280611ce85280611e72528061234e525080610694528061072b528061090f5280610c155280610d1d5280610ee85280610f7052806114b95280611ca952806121c6525080612670525080612219525080612c7a525080612c565250806125495250806125255250806124af5250806136465250806136885250806136675250614dbe6000f3fe608060405234801561001057600080fd5b50600436106102f45760003560e01c806370a0823111610191578063a9059cbb116100e3578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e14610580578063ed24911d14610593578063fd19cac81461059b576102f4565b8063d2946c2b14610552578063d505accf1461055a578063d5c096c41461056d576102f4565b8063ab63c607116100c8578063ab63c6071461053a578063b35056b814610542578063b7b814fc1461054a576102f4565b8063a9059cbb1461051f578063aaabadc514610532576102f4565b806387ec68171161014557806390193b7c1161011f57806390193b7c146104f157806395d89b4114610504578063a457c2d71461050c576102f4565b806387ec6817146104ce578063893d20e8146104e15780638d928af8146104e9576102f4565b80637ecebe00116101765780637ecebe00146104a05780638456cb59146104b3578063851c1bb3146104bb576102f4565b806370a082311461046c57806374f3b0091461047f576102f4565b806338e9922e1161024a57806350dd6ed9116101fe5780635c1548fb116101d85780635c1548fb1461043b5780636028bfd4146104435780636945c1fd14610464576102f4565b806350dd6ed91461041857806354a844ba1461042b57806355c6762814610433576102f4565b8063395093511161022f57806339509351146103f55780633f4ba83a146104085780634d6d0fd014610410576102f4565b806338e9922e146103d857806338fff2d0146103ed576102f4565b80631dd746ea116102ac5780632541897f116102865780632541897f146103a6578063313ce567146103bb5780633644e515146103d0576102f4565b80631dd746ea1461037657806323b872dd1461038b57806325117b721461039e576102f4565b8063095ea7b3116102dd578063095ea7b31461033757806318160ddd146103575780631c0de0511461035f576102f4565b806301ec954a146102f957806306fdde0314610322575b600080fd5b61030c610307366004614346565b6105a3565b60405161031991906148c7565b60405180910390f35b61032a612041565b6040516103199190614a05565b61034a610345366004614080565b6120d7565b60405161031991906148a4565b61030c6120ee565b6103676120f4565b604051610319939291906148af565b61037e61211d565b6040516103199190614863565b61034a610399366004613fd0565b61212c565b61030c6121a0565b6103ae6121c4565b60405161031991906147ef565b6103c36121e8565b6040516103199190614d02565b61030c6121f1565b6103eb6103e6366004614545565b6121fb565b005b61030c612217565b61034a610403366004614080565b61223b565b6103eb612276565b61030c61228a565b6103eb610426366004614205565b6122ae565b6103eb6122cc565b61030c6122de565b61030c6122f1565b6104566104513660046140e3565b612315565b604051610319929190614ce9565b6103ae61234c565b61030c61047a366004613f7c565b612370565b61049261048d3660046140e3565b61238b565b604051610319929190614876565b61030c6104ae366004613f7c565b61248e565b6103eb612499565b61030c6104c93660046141a9565b6124ab565b6104566104dc3660046140e3565b6124fd565b6103ae612523565b6103ae612547565b61030c6104ff366004613f7c565b61256b565b61032a612586565b61034a61051a366004614080565b6125e7565b61034a61052d366004614080565b612625565b6103ae612632565b6103ae61263c565b61034a61264b565b6103eb61265c565b6103ae61266e565b6103eb610568366004614010565b612692565b61049261057b3660046140e3565b61271d565b61030c61058e366004613f98565b612840565b61030c61287d565b6103ae612887565b600084608001516105d06105b5612547565b6001600160a01b0316336001600160a01b03161460cd6128f1565b6105e56105db612217565b82146101f46128f1565b6105ed6128ff565b6000865160018111156105fc57fe5b1480610614575060018651600181111561061257fe5b145b610653576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614b51565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b031614806106cc57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b0316145b806106e3575060408601516001600160a01b031630145b8061072357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061076357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061077a575060208601516001600160a01b031630145b6107b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a18565b60606107ba612912565b90506107c68682612a85565b6107ce613e25565b6000808080808c5160018111156107e157fe5b1415610812576108088c60600151878c815181106107fb57fe5b6020026020010151612af4565b60608d0152610841565b60018c51600181111561082157fe5b14156108415761083b8c60600151878b815181106107fb57fe5b60608d01525b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316148015610892575060008c51600181111561089057fe5b145b1561090d578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106108c857fe5b60200260200101511015610908576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614abd565b610a72565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b031614801561095e575060008c51600181111561095c57fe5b145b156109d4578b606001518b7f00000000000000000000000000000000000000000000000000000000000000008151811061099457fe5b60200260200101511015610908576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614b88565b60208c01516001600160a01b0316301480156109fc575060008c5160018111156109fa57fe5b145b15610a72578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110610a3257fe5b60200260200101511015610a72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a86565b6101008c01515115611c3e578b6101000151806020019051810190610a979190614186565b90945092508361142057610aa9613e3c565b60095460c08e01516040517fca142f750000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163ca142f7591610af791889060040161484a565b60c06040518083038186803b158015610b0f57600080fd5b505afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4791906144df565b60208101519091506001600160a01b0316158015610b9a57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316145b8015610bb2575060208d01516001600160a01b031630145b8015610bca575060008d516001811115610bc857fe5b145b15610bfe57610bf08d60600151888c81518110610be357fe5b6020026020010151612b00565b985050505050505050612038565b60095460c08e015160208301516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811693811692635778472a928216911614610c53578360400151610c56565b83515b6040518263ffffffff1660e01b8152600401610c7291906148c7565b60a06040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc29190614465565b516001600160a01b031614610cf7577f63757272656e6379000000000000000000000000000000000000000000000000610d19565b7f73656375726974790000000000000000000000000000000000000000000000005b94507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610d6c575060008d516001811115610d6a57fe5b145b15610dbe57806080015191508c606001518160a0015114610db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614c1c565b610e67565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610e0f575060008d516001811115610e0d57fe5b145b15610e5c578060a0015191508c60600151816080015114610db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614bbf565b610e67610163612b0c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610eba575060208e01516001600160a01b031630145b15610ee657507f53656c6c00000000000000000000000000000000000000000000000000000000610f6e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610f37575060208e01516001600160a01b031630145b15610f6357507f4275790000000000000000000000000000000000000000000000000000000000610f6e565b610f6e610163612b0c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f73d5870ecc5c28466106f013bf012d6be5b211d5e969d565d4e1cf583d3e56f98f60c001516001600160a01b031684602001516001600160a01b031614610fe4578360400151610fe7565b83515b7f736563757269747900000000000000000000000000000000000000000000000089146110b35760095460408087015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a9161105a916004016148c7565b60a06040518083038186803b15801561107257600080fd5b505afa158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190614465565b60600151611151565b60095485516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916110fc916004016148c7565b60a06040518083038186803b15801561111457600080fd5b505afa158015611128573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114c9190614465565b606001515b7f63757272656e63790000000000000000000000000000000000000000000000008a1461121d5760095460408088015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111c4916004016148c7565b60a06040518083038186803b1580156111dc57600080fd5b505afa1580156111f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112149190614465565b606001516112bb565b60095486516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a91611266916004016148c7565b60a06040518083038186803b15801561127e57600080fd5b505afa158015611292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b69190614465565b606001515b856112d788608001518960a00151612b3690919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000008a8a606001516040516113129897969594939291906148ef565b60405180910390a261134882608001517f0000000000000000000000000000000000000000000000000000000000000000612b00565b608083015260a082015161137c907f0000000000000000000000000000000000000000000000000000000000000000612b00565b60a083015260095460c08f01516040517fd729cf6c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163d729cf6c916113cf91899060040161484a565b600060405180830381600087803b1580156113e957600080fd5b505af11580156113fd573d6000803e3d6000fd5b5050505061141183898d81518110610be357fe5b99505050505050505050612038565b60405160200161142f906147c6565b604051602081830303815290604052805190602001208414801561145257508215155b1561147457604080518082019091528060015b81526020018490529450611c39565b60405160200161148390614767565b604051602081830303815290604052805190602001208414156114b25760408051808201909152806000611465565b826116c1577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316148061153057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316145b8015611548575060208c01516001600160a01b031630145b8015611560575060008c51600181111561155e57fe5b145b156116b1576009546040517f7489ec230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690637489ec23906115ae9087906004016148c7565b602060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160091906140cb565b90508b60600151811461163f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614af4565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b60405161168c989796959493929190614803565b60405180910390a16116a481878b81518110610be357fe5b9750505050505050612038565b6116bc610163612b0c565b611c39565b8215611c2e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316141561176c5760608c0151611766906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b612b99565b6128c3565b60608d01525b60208c01516001600160a01b031630148015611794575060008c51600181111561179257fe5b145b15611994576117eb836117618561175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b60405161183a989796959493929190614803565b60405180910390a17f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b031614156118dd5760608c01516118d7906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608d01525b600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b81526004016119209291906149ce565b602060405180830381600087803b15801561193a57600080fd5b505af115801561194e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197291906140cb565b9050611982818d606001516128c3565b90506116a481878b81518110610be357fe5b60408c01516001600160a01b0316301480156119bc575060008c5160018111156119ba57fe5b145b156116b1576000611a15846117618661175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90508c6060015192507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d602001516001600160a01b03161415611ab95760608d0151611ab3906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608e01525b600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4868f6040518363ffffffff1660e01b8152600401611afc9291906149ce565b602060405180830381600087803b158015611b1657600080fd5b505af1158015611b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4e91906140cb565b9150611b5e8d6060015183612b87565b91507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378d60c001518e602001518f60400151858886428c604051611ba9989796959493929190614803565b60405180910390a1828c7f000000000000000000000000000000000000000000000000000000000000000081518110611bde57fe5b60200260200101511015611c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614c79565b610bf083888c81518110610be357fe5b611c39610163612b0c565b611c49565b611c49610163612b0c565b7f00000000000000000000000000000000000000000000000000000000000000008c606001511015611ca7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a4f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480611d2057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316145b8015611d38575060408c01516001600160a01b031630145b8015611d50575060008c516001811115611d4e57fe5b145b15611fbf578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110611d8657fe5b60200260200101511115611faf57611dd58b7f000000000000000000000000000000000000000000000000000000000000000081518110611dc357fe5b60200260200101518d606001516128c3565b8b7f000000000000000000000000000000000000000000000000000000000000000081518110611e0157fe5b602002602001018181525050611e678560200151611761876020015161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90508b6060015191507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161415611f0b5760608c0151611f05906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608d01525b6009546040517f5487e8cf0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690635487e8cf90611f56908f908990600401614cb0565b602060405180830381600087803b158015611f7057600080fd5b505af1158015611f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa891906140cb565b9350611fba565b611fba610201612b0c565b611fca565b611fca610163612b0c565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e6040015185896020015186428b604051612017989796959493929190614803565b60405180910390a161202f82878b81518110610be357fe5b97505050505050505b50949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156120cd5780601f106120a2576101008083540402835291602001916120cd565b820191906000526020600020905b8154815290600101906020018083116120b057829003601f168201915b5050505050905090565b60006120e4338484612bcf565b5060015b92915050565b60025490565b6000806000612101612c37565b15925061210c612c54565b9150612116612c78565b9050909192565b6060612127612912565b905090565b6000806121398533612840565b905061215d336001600160a01b03871614806121555750838210155b61019e6128f1565b612168858585612c9c565b336001600160a01b0386161480159061218357506000198114155b15612195576121958533858403612bcf565b506001949350505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b600061212761287d565b612203612d7c565b61220b6128ff565b61221481612dc2565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916120e49185906122719086612b87565b612bcf565b61227e612d7c565b6122886000612e3b565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b6122b6612d7c565b6122be6128ff565b6122c88282612ecc565b5050565b6122d4612d7c565b6122886001612fda565b6008546000906121279060c0603f613031565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000606061232b8651612326613040565b613045565b612340898989898989896130526130a461310d565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b6060808861239a6105b5612547565b6123a56105db612217565b606060006123b2866132c2565b156123da576123bf6132f1565b6123d1896123cb6120ee565b88613304565b9250905061242c565b6123e2613330565b60606123ec612912565b90506123f88a82612a85565b61241c8d8d8d8d8d61240861264b565b612412578d612415565b60005b878e613052565b9350915061242a83826130a4565b505b6124368b82613338565b81895167ffffffffffffffff8111801561244f57600080fd5b50604051908082528060200260200182016040528015612479578160200160208202803683370190505b509450945050505b5097509795505050505050565b60006120e88261256b565b6124a1612d7c565b6122886001612e3b565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016124e0929190614727565b604051602081830303815290604052805190602001209050919050565b6000606061250e8651612326613040565b6123408989898989898961334261335e61310d565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156120cd5780601f106120a2576101008083540402835291602001916120cd565b6000806125f43385612840565b905080831061260e5761260933856000612bcf565b61261b565b61261b3385858403612bcf565b5060019392505050565b60006120e4338484612c9c565b60006121276133c7565b6009546001600160a01b031690565b6008546000906121279060ff613441565b612664612d7c565b6122886000612fda565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886126c18c61256b565b896040516020016126d796959493929190614936565b60405160208183030381529060405280519060200120905061270888826126ff87878761344b565b886101f861348a565b612713888888612bcf565b5050505050505050565b6060808861272c6105b5612547565b6127376105db612217565b61273f613330565b6060612749612912565b90506127536120ee565b61280057600060606127688d8d8d868b6134e1565b91509150612781612777613606565b83101560cc6128f1565b612793600061278e613606565b61360d565b6127a68b61279f613606565b840361360d565b6127b0818461335e565b808a5167ffffffffffffffff811180156127c957600080fd5b506040519080825280602002602001820160405280156127f3578160200160208202803683370190505b5095509550505050612481565b61280a8882612a85565b600060606128328d8d8d8d8d61281e61264b565b612828578d61282b565b60005b898e613342565b915091506127a68b8361360d565b600061284a612547565b6001600160a01b0316826001600160a01b0316141561286c57506000196120e8565b6128768383613617565b90506120e8565b6000612127613642565b6009546001600160a01b031681565b806122c8816136df565b60006128ad84848461375d565b506001901b60001901811b1992909216911b1790565b60006128d38383111560016128f1565b50900390565b60008183106128e857816128ea565b825b9392505050565b816122c8576122c881612b0c565b61228861290a612c37565b6101926128f1565b6060600061291e613040565b905060608167ffffffffffffffff8111801561293957600080fd5b50604051908082528060200260200182016040528015612963578160200160208202803683370190505b50905060005b82811015612a7e577f00000000000000000000000000000000000000000000000000000000000000008114156129d7577f00000000000000000000000000000000000000000000000000000000000000008282815181106129c657fe5b602002602001018181525050612a76565b7f0000000000000000000000000000000000000000000000000000000000000000811415612a2c577f00000000000000000000000000000000000000000000000000000000000000008282815181106129c657fe5b7f0000000000000000000000000000000000000000000000000000000000000000811415612a7657670de0b6b3a7640000828281518110612a6957fe5b6020026020010181815250505b600101612969565b5091505090565b81518151612a94908290613045565b60005b81811015612aee57612acf848281518110612aae57fe5b6020026020010151848381518110612ac257fe5b6020026020010151612b99565b848281518110612adb57fe5b6020908102919091010152600101612a97565b50505050565b60006128ea8383612b99565b60006128ea8383612b36565b612214817f42414c00000000000000000000000000000000000000000000000000000000006137a4565b6000612b4582151560046128f1565b82612b52575060006120e8565b670de0b6b3a764000083810290612b7590858381612b6c57fe5b041460056128f1565b828181612b7e57fe5b049150506120e8565b60008282016128ea84821015836128f1565b6000828202612bbd841580612bb6575083858381612bb357fe5b04145b60036128f1565b670de0b6b3a764000090049392505050565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590612c2a9085906148c7565b60405180910390a3505050565b6000612c41612c78565b42118061212757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b612cb36001600160a01b03841615156101986128f1565b612cca6001600160a01b03831615156101996128f1565b612cd5838383613758565b6001600160a01b038316600090815260208190526040902054612cfb90826101a061381f565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612d2a9082612b87565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612c2a9085906148c7565b6000612dab6000357fffffffff00000000000000000000000000000000000000000000000000000000166124ab565b9050612214612dba8233613835565b6101916128f1565b612dd7612dcd61391e565b82101560cb6128f1565b612dec612de2613927565b82111560ca6128f1565b600854612dfd908260c0603f6128a0565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90612e309083906148c7565b60405180910390a150565b8015612e5b57612e56612e4c612c54565b42106101936128f1565b612e70565b612e70612e66612c78565b42106101a96128f1565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490612e309083906148a4565b6000612ed6612217565b90506000612ee2612547565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401612f0f9291906149b7565b60806040518083038186803b158015612f2757600080fd5b505afa158015612f3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f5f919061455d565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d49250612fac915085908790600401614996565b600060405180830381600087803b158015612fc657600080fd5b505af1158015612713573d6000803e3d6000fd5b600854612fe9908260ff613933565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c89061301c9083906148a4565b60405180910390a18061221457612214612288565b6001901b6000190191901c1690565b600390565b6122c881831460676128f1565b6000606060006130618461395a565b9050600181600181111561307157fe5b1461308657613081610163612b0c565b613096565b6130908885613970565b90935091505b509850989650505050505050565b815181516130b3908290613045565b60005b81811015612aee576130ee8482815181106130cd57fe5b60200260200101518483815181106130e157fe5b6020026020010151612b36565b8482815181106130fa57fe5b60209081029190910101526001016130b6565b3330146131fc576000306001600160a01b0316600036604051613131929190614757565b6000604051808303816000865af19150503d806000811461316e576040519150601f19603f3d011682016040523d82523d6000602084013e613173565b606091505b50509050806000811461318257fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb0000000000000000000000000000000000000000000000000000000081146131de573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b613204613330565b606061320e612912565b905061321a8782612a85565b600060606132328c8c8c8c8c8c898d8d63ffffffff16565b9150915061324481848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b60008082511180156120e8575060ff8016828060200190518101906132e7919061459d565b60ff161492915050565b6122886132fc61264b565b6101b66128f1565b60006060600061331384613a13565b90506060613322878784613a29565b919791965090945050505050565b6122886128ff565b6122c88282613ad8565b60006060613351610163612b0c565b9850989650505050505050565b8151815161336d908290613045565b60005b81811015612aee576133a884828151811061338757fe5b602002602001015184838151811061339b57fe5b6020026020010151613ba4565b8482815181106133b457fe5b6020908102919091010152600101613370565b60006133d1612547565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561340957600080fd5b505afa15801561341d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212791906141e9565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b600061349585613bf2565b90506134ab6134a5878387613c0e565b836128f1565b6134ba428410156101b86128f1565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b600060606134ed6128ff565b7f00000000000000000000000000000000000000000000000000000000000000006135286001600160a01b03888116908316146101566128f1565b613548816001600160a01b0316876001600160a01b0316146101566128f1565b606061355385613cdb565b90506135b2817f00000000000000000000000000000000000000000000000000000000000000008151811061358457fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000612af4565b817f0000000000000000000000000000000000000000000000000000000000000000815181106135de57fe5b60209081029190910101526dffffffffffffffffffffffffffff999098509650505050505050565b620f424090565b6122c88282613cf1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006136af613d84565b306040516020016136c495949392919061496a565b60405160208183030381529060405280519060200120905090565b6002815110156136ee57612214565b6000816000815181106136fd57fe5b602002602001015190506000600190505b825181101561375857600083828151811061372557fe5b6020026020010151905061374e816001600160a01b0316846001600160a01b03161060656128f1565b915060010161370e565b505050565b61376c610100831060646128f1565b6137956001821015801561378e575061378a60ff84610100036128d9565b8211155b60646128f1565b61375883821c156101b46128f1565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600061382e84841115836128f1565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b613854612523565b6001600160a01b03161415801561386f575061386f83613d88565b156138975761387c612523565b6001600160a01b0316336001600160a01b03161490506120e8565b61389f6133c7565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016138ce939291906148d0565b60206040518083038186803b1580156138e657600080fd5b505afa1580156138fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061287691906140ab565b64e8d4a5100090565b67016345785d8a000090565b60006001821b198416828461394957600061394c565b60015b60ff16901b17949350505050565b6000818060200190518101906120e89190614253565b60006060600061397f84613df6565b90506060855167ffffffffffffffff8111801561399b57600080fd5b506040519080825280602002602001820160405280156139c5578160200160208202803683370190505b50905060005b8651811015613a07578681815181106139e057fe5b60200260200101518282815181106139f457fe5b60209081029190910101526001016139cb565b50909590945092505050565b6000818060200190518101906128ea91906145b9565b60606000613a378385612b36565b9050845167ffffffffffffffff81118015613a5157600080fd5b50604051908082528060200260200182016040528015613a7b578160200160208202803683370190505b50915060005b8551811015613acf57613ab082878381518110613a9a57fe5b6020026020010151612b9990919063ffffffff16565b838281518110613abc57fe5b6020908102919091010152600101613a81565b50509392505050565b613aef6001600160a01b038316151561019b6128f1565b613afb82600083613758565b6001600160a01b038216600090815260208190526040902054613b2190826101b261381f565b6001600160a01b038316600090815260208190526040902055613b54613b4f82613b496120ee565b90613e0c565b613e1a565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613b9891906148c7565b60405180910390a35050565b6000613bb382151560046128f1565b82613bc0575060006120e8565b670de0b6b3a764000083810290613bda90858381612b6c57fe5b826001820381613be657fe5b046001019150506120e8565b6000613bfc613642565b826040516020016124e0929190614790565b6000613c2082516041146101b96128f1565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613c599089908590889088906149e7565b6020604051602081039080840390855afa158015613c7b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b03811615801590613ccf5750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906128ea919061429c565b613cfd60008383613758565b613d12613b4f82613d0c6120ee565b90612b87565b6001600160a01b038216600090815260208190526040902054613d359082612b87565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613b989085906148c7565b4690565b6000613db37f38e9922e000000000000000000000000000000000000000000000000000000006124ab565b821480613de75750613de47f50dd6ed9000000000000000000000000000000000000000000000000000000006124ab565b82145b806120e857506120e882613e1f565b6000818060200190518101906128ea919061426f565b60006128ea8383600161381f565b600255565b50600090565b604080518082019091526000808252602082015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356120e881614d57565b600082601f830112613e8c578081fd5b8135613e9f613e9a82614d37565b614d10565b818152915060208083019084810181840286018201871015613ec057600080fd5b60005b84811015613edf57813584529282019290820190600101613ec3565b505050505092915050565b600082601f830112613efa578081fd5b813567ffffffffffffffff811115613f10578182fd5b613f4160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614d10565b9150808252836020828501011115613f5857600080fd5b8060208401602084013760009082016020015292915050565b80356120e881614d6c565b600060208284031215613f8d578081fd5b81356128ea81614d57565b60008060408385031215613faa578081fd5b8235613fb581614d57565b91506020830135613fc581614d57565b809150509250929050565b600080600060608486031215613fe4578081fd5b8335613fef81614d57565b92506020840135613fff81614d57565b929592945050506040919091013590565b600080600080600080600060e0888a03121561402a578485fd5b873561403581614d57565b9650602088013561404581614d57565b95506040880135945060608801359350608088013561406381614d79565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215614092578182fd5b823561409d81614d57565b946020939093013593505050565b6000602082840312156140bc578081fd5b815180151581146128ea578182fd5b6000602082840312156140dc578081fd5b5051919050565b600080600080600080600060e0888a0312156140fd578081fd5b87359650602088013561410f81614d57565b9550604088013561411f81614d57565b9450606088013567ffffffffffffffff8082111561413b578283fd5b6141478b838c01613e7c565b955060808a0135945060a08a0135935060c08a013591508082111561416a578283fd5b506141778a828b01613eea565b91505092959891949750929550565b60008060408385031215614198578182fd5b505080516020909101519092909150565b6000602082840312156141ba578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146128ea578182fd5b6000602082840312156141fa578081fd5b81516128ea81614d57565b60008060408385031215614217578182fd5b823561422281614d57565b9150602083013567ffffffffffffffff81111561423d578182fd5b61424985828601613eea565b9150509250929050565b600060208284031215614264578081fd5b81516128ea81614d6c565b60008060408385031215614281578182fd5b825161428c81614d6c565b6020939093015192949293505050565b600080604083850312156142ae578182fd5b8251600481106142bc578283fd5b8092505060208084015167ffffffffffffffff8111156142da578283fd5b8401601f810186136142ea578283fd5b80516142f8613e9a82614d37565b81815283810190838501858402850186018a1015614314578687fd5b8694505b83851015614336578051835260019490940193918501918501614318565b5080955050505050509250929050565b6000806000806080858703121561435b578182fd5b843567ffffffffffffffff80821115614372578384fd5b818701915061012080838a031215614388578485fd5b61439181614d10565b905061439d8984613f71565b81526143ac8960208501613e71565b60208201526143be8960408501613e71565b6040820152606083013560608201526080830135608082015260a083013560a08201526143ee8960c08501613e71565b60c08201526144008960e08501613e71565b60e08201526101008084013583811115614418578687fd5b6144248b828701613eea565b828401525050809650506020870135915080821115614441578384fd5b5061444e87828801613e7c565b949794965050505060408301359260600135919050565b600060a08284031215614476578081fd5b61448060a0614d10565b825161448b81614d57565b815260208301516003811061449e578283fd5b60208201526040830151600581106144b4578283fd5b604082015260608301516144c781614d57565b60608201526080928301519281019290925250919050565b600060c082840312156144f0578081fd5b6144fa60c0614d10565b82518152602083015161450c81614d57565b8060208301525060408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b600060208284031215614556578081fd5b5035919050565b60008060008060808587031215614572578182fd5b845193506020850151925060408501519150606085015161459281614d57565b939692955090935050565b6000602082840312156145ae578081fd5b81516128ea81614d79565b600080604083850312156145cb578182fd5b825161428c81614d79565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015614612578151875295820195908201906001016145f6565b509495945050505050565b60008151808452815b8181101561464257602081850181015186830182015201614626565b818111156146535782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012082516002811061469757fe5b8085525060208301516146ad60208601826145d6565b5060408301516146c060408601826145d6565b50606083015160608501526080830151608085015260a083015160a085015260c08301516146f160c08601826145d6565b5060e083015161470460e08601826145d6565b5061010080840151828287015261471d8387018261461d565b9695505050505050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f4d61726b65740000000000000000000000000000000000000000000000000000815260060190565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b7f4c696d6974000000000000000000000000000000000000000000000000000000815260050190565b6001600160a01b0391909116815260200190565b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015260a083015260c082019290925260e08101919091526101000190565b6001600160a01b03929092168252602082015260400190565b6000602082526128ea60208301846145e3565b60006040825261488960408301856145e3565b828103602084015261489b81856145e3565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9788526001600160a01b03968716602089015294861660408801526060870193909352608086019190915290921660a084015260c083019190915260e08201526101000190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b6000838252604060208301526149af604083018461461d565b949350505050565b9182526001600160a01b0316602082015260400190565b6000838252604060208301526149af6040830184614686565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526128ea602083018461461d565b60208082526016908201527f496e76616c6964207377617070656420746f6b656e7300000000000000000000604082015260600190565b60208082526018908201527f4f726465722062656c6f77206d696e696d756d2073697a650000000000000000604082015260600190565b6020808252601f908201527f496e73756666696369656e7420706f6f6c20746f6b656e2062616c616e636500604082015260600190565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526023908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e0000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600c908201527f496e76616c696420737761700000000000000000000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f722063757272656e637900000000000000000000000000000000606082015260800190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f7220736563757269747900000000000000000000000000000000606082015260800190565b6020808252601d908201527f494e53554646494349454e545f494e5445524e414c5f42414c414e4345000000604082015260600190565b600060608252614cc36060830185614686565b9050825160038110614cd157fe5b80602084015250602083015160408301529392505050565b6000838252604060208301526149af60408301846145e3565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715614d2f57600080fd5b604052919050565b600067ffffffffffffffff821115614d4d578081fd5b5060209081020190565b6001600160a01b038116811461221457600080fd5b6002811061221457600080fd5b60ff8116811461221457600080fdfea26469706673582212204023d8be5f78011358098636c25b2ce13aa73bbd223f75aecfda22e4c24fe54f64736f6c63430007010033608060405260006001553480156200001657600080fd5b506040516200191238038062001912833981016040819052620000399162000106565b620000443362000098565b600980546001600160a01b039586166001600160a01b03199182161790915560078054948616948216949094179093556008805492851692841692909217909155600a805491909316911617905562000166565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200010057600080fd5b92915050565b600080600080608085870312156200011c578384fd5b620001288686620000e8565b9350620001398660208701620000e8565b92506200014a8660408701620000e8565b91506200015b8660608701620000e8565b905092959194509250565b61179c80620001766000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063ca142f7511610066578063ca142f75146101c8578063d729cf6c146101e8578063e43372e9146101fb578063f2fde38b14610203576100f5565b8063715018a6146101905780637489ec231461019a5780638da5cb5b146101ad578063c49f3fe3146101b5576100f5565b806346b8b730116100d357806346b8b730146101405780635487e8cf146101555780635778472a146101685780636945c1fd14610188576100f5565b8063014d92b4146100fa5780632541897f1461012357806338fff2d014610138575b600080fd5b61010d6101083660046113fa565b610216565b60405161011a9190611564565b60405180910390f35b61012b610395565b60405161011a919061150c565b61010d6103a4565b610148610433565b60405161011a9190611520565b61010d61016336600461143f565b61056b565b61017b610176366004611399565b6107d6565b60405161011a9190611680565b61012b61092c565b61019861093b565b005b61010d6101a8366004611399565b610953565b61012b610ad7565b6101986101c33660046113c9565b610ae6565b6101db6101d636600461136e565b610e5f565b60405161011a91906116dd565b6101986101f636600461136e565b610f38565b610148610fdc565b610198610211366004611352565b61103d565b600061023633610224610ad7565b6001600160a01b0316146101aa61106c565b60026000848152600260205260409020547501000000000000000000000000000000000000000000900460ff16600481111561026e57fe5b146102ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115db565b60405180910390fd5b6000838152600260205260409020600101546001600160a01b03163314610301576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115a4565b600083815260026020818152604090922001546007549184015190916001600160a01b0391821691161480610348575060085460208401516001600160a01b039081169116145b156103735761035b83606001518261107e565b6000858152600260208190526040909120015561038c565b6060830151600085815260026020819052604090912001555b90505b92915050565b6007546001600160a01b031690565b600080600a60009054906101000a90046001600160a01b03166001600160a01b03166338fff2d06040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f557600080fd5b505afa158015610409573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042d91906113b1565b91505090565b600354606090819067ffffffffffffffff8111801561045157600080fd5b5060405190808252806020026020018201604052801561047b578160200160208202803683370190505b5090506000805b60035481101561056357336001600160a01b031660026000600384815481106104a757fe5b600091825260208083209091015483528201929092526040019020600101546001600160a01b031614801561052057506002806000600384815481106104e957fe5b9060005260206000200154815260200190815260200160002060000160159054906101000a900460ff16600481111561051e57fe5b145b1561055b576003818154811061053257fe5b906000526020600020015483838151811061054957fe5b60209081029190910101526001909101905b600101610482565b509091505090565b600061057933610224610ad7565b60008251600281111561058857fe5b14806105a0575060018251600281111561059e57fe5b145b6105a957600080fd5b6001544214156105c05760018054810190556105c5565b426001555b60008360c001516001546040516020016105e09291906114d7565b604051602081830303815290604052805190602001209050610600611187565b6040518060a0016040528086602001516001600160a01b031681526020018560000151600281111561062e57fe5b81526020016002815260c08701516001600160a01b03908116602080840191909152606089015160409384015260008681526002808352939020845181547fffffffffffffffffffffffff000000000000000000000000000000000000000016931692909217808355908401519394508493919283917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690740100000000000000000000000000000000000000009084908111156106e957fe5b02179055506040820151815482907fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000083600481111561073c57fe5b02179055506060820151600182810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0390931692909217909155608090920151600290910155600380546000858152600460205260408120829055928101825591527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01829055509392505050565b6107de611187565b6107e6610ad7565b6001600160a01b0316336001600160a01b0316148061080f57506009546001600160a01b031633145b8061083357506000828152600260205260409020600101546001600160a01b031633145b610869576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a59061156d565b600082815260026020818152604092839020835160a0810190945280546001600160a01b03811685529092918401917401000000000000000000000000000000000000000090910460ff16908111156108be57fe5b60028111156108c957fe5b815281546020909101907501000000000000000000000000000000000000000000900460ff1660048111156108fa57fe5b600481111561090557fe5b815260018201546001600160a01b0316602082015260029091015460409091015292915050565b6008546001600160a01b031690565b61094733610224610ad7565b6109516000611090565b565b600061096133610224610ad7565b60026000838152600260205260409020547501000000000000000000000000000000000000000000900460ff16600481111561099957fe5b146109d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115db565b6000828152600260205260409020600101546001600160a01b03163314610a23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115a4565b600082815260026020908152604080832080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750300000000000000000000000000000000000000000017905560049091529020546003805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01908110610aab57fe5b906000526020600020016000905560026000838152602001908152602001600020600201549050919050565b6000546001600160a01b031690565b6009546001600160a01b03163314610b2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a590611612565b60008481526002602052604080822080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff90811690915585835291208054909116905560018054810190819055610b806111b7565b6040518060c001604052808781526020016002600089815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b031681526020018681526020018381526020018581526020018481525090508060056000600260008a815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060008481526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015590505080600560006002600089815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060008481526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050155905050600660006002600089815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081606001519080600181540180825580915050600190039060005260206000200160009091909190915055600660006002600088815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081606001519080600181540180825580915050600190039060005260206000200160009091909190915055505050505050565b610e676111b7565b610e6f610ad7565b6001600160a01b0316336001600160a01b03161480610e965750336001600160a01b038416145b610ecc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a590611649565b506001600160a01b03918216600090815260056020818152604080842094845293815291839020835160c081018552815481526001820154909516928501929092526002820154928401929092526003810154606084015260048101546080840152015460a082015290565b610f4433610224610ad7565b60005b6001600160a01b038316600090815260066020526040902054811015610fd7576001600160a01b0383166000908152600660205260409020805483919083908110610f8e57fe5b90600052602060002001541415610fcf576001600160a01b0383166000908152600660205260409020805482908110610fc357fe5b60009182526020822001555b600101610f47565b505050565b3360009081526006602090815260409182902080548351818402810184019094528084526060939283018282801561103357602002820191906000526020600020905b81548152602001906001019080831161101f575b5050505050905090565b61104933610224610ad7565b6110606001600160a01b03821615156101ab61106c565b61106981611090565b50565b8161107a5761107a816110f8565b5050565b600082820161038c848210158361106c565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b604452611069917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b6040805160a081019091526000808252602082019081526020016000815260006020820181905260409091015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b803561038f81611751565b600082601f830112611207578081fd5b813567ffffffffffffffff81111561121d578182fd5b61124e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161172a565b915080825283602082850101111561126557600080fd5b8060208401602084013760009082016020015292915050565b80356002811061038f57600080fd5b60006101208083850312156112a0578182fd5b6112a98161172a565b9150506112b6838361127e565b81526112c583602084016111ec565b60208201526112d783604084016111ec565b6040820152606082013560608201526080820135608082015260a082013560a08201526113078360c084016111ec565b60c08201526113198360e084016111ec565b60e08201526101008083013567ffffffffffffffff81111561133a57600080fd5b611346858286016111f7565b82840152505092915050565b600060208284031215611363578081fd5b813561038c81611751565b60008060408385031215611380578081fd5b823561138b81611751565b946020939093013593505050565b6000602082840312156113aa578081fd5b5035919050565b6000602082840312156113c2578081fd5b5051919050565b600080600080608085870312156113de578182fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561140c578182fd5b82359150602083013567ffffffffffffffff811115611429578182fd5b6114358582860161128d565b9150509250929050565b6000808284036060811215611452578283fd5b833567ffffffffffffffff811115611468578384fd5b6114748682870161128d565b93505060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156114a6578182fd5b506114b1604061172a565b6020840135600381106114c2578283fd5b81526040939093013560208401525092909150565b60609290921b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000168252601482015260340190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156115585783518352928401929184019160010161153c565b50909695505050505050565b90815260200190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f206f7264657273000000604082015260600190565b6020808252601b908201527f53656e646572206973206e6f74206f726465722063726561746f720000000000604082015260600190565b60208082526017908201527f4f7264657220697320616c72656164792066696c6c6564000000000000000000604082015260600190565b6020808252601c908201527f556e617574686f72697a656420746f207265706f727420747261646500000000604082015260600190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f20747261646573000000604082015260600190565b600060a0820190506001600160a01b038084511683526020840151600381106116a557fe5b60208401526040840151600581106116b957fe5b80604085015250806060850151166060840152506080830151608083015292915050565b600060c082019050825182526001600160a01b03602084015116602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b60405181810167ffffffffffffffff8111828210171561174957600080fd5b604052919050565b6001600160a01b038116811461106957600080fdfea2646970667358221220765cd68ea5a59c3e41197cab7f1c30d8bfc5f816e6f20b319305d43e06857a9564736f6c63430007010033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102f45760003560e01c806370a0823111610191578063a9059cbb116100e3578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e14610580578063ed24911d14610593578063fd19cac81461059b576102f4565b8063d2946c2b14610552578063d505accf1461055a578063d5c096c41461056d576102f4565b8063ab63c607116100c8578063ab63c6071461053a578063b35056b814610542578063b7b814fc1461054a576102f4565b8063a9059cbb1461051f578063aaabadc514610532576102f4565b806387ec68171161014557806390193b7c1161011f57806390193b7c146104f157806395d89b4114610504578063a457c2d71461050c576102f4565b806387ec6817146104ce578063893d20e8146104e15780638d928af8146104e9576102f4565b80637ecebe00116101765780637ecebe00146104a05780638456cb59146104b3578063851c1bb3146104bb576102f4565b806370a082311461046c57806374f3b0091461047f576102f4565b806338e9922e1161024a57806350dd6ed9116101fe5780635c1548fb116101d85780635c1548fb1461043b5780636028bfd4146104435780636945c1fd14610464576102f4565b806350dd6ed91461041857806354a844ba1461042b57806355c6762814610433576102f4565b8063395093511161022f57806339509351146103f55780633f4ba83a146104085780634d6d0fd014610410576102f4565b806338e9922e146103d857806338fff2d0146103ed576102f4565b80631dd746ea116102ac5780632541897f116102865780632541897f146103a6578063313ce567146103bb5780633644e515146103d0576102f4565b80631dd746ea1461037657806323b872dd1461038b57806325117b721461039e576102f4565b8063095ea7b3116102dd578063095ea7b31461033757806318160ddd146103575780631c0de0511461035f576102f4565b806301ec954a146102f957806306fdde0314610322575b600080fd5b61030c610307366004614346565b6105a3565b60405161031991906148c7565b60405180910390f35b61032a612041565b6040516103199190614a05565b61034a610345366004614080565b6120d7565b60405161031991906148a4565b61030c6120ee565b6103676120f4565b604051610319939291906148af565b61037e61211d565b6040516103199190614863565b61034a610399366004613fd0565b61212c565b61030c6121a0565b6103ae6121c4565b60405161031991906147ef565b6103c36121e8565b6040516103199190614d02565b61030c6121f1565b6103eb6103e6366004614545565b6121fb565b005b61030c612217565b61034a610403366004614080565b61223b565b6103eb612276565b61030c61228a565b6103eb610426366004614205565b6122ae565b6103eb6122cc565b61030c6122de565b61030c6122f1565b6104566104513660046140e3565b612315565b604051610319929190614ce9565b6103ae61234c565b61030c61047a366004613f7c565b612370565b61049261048d3660046140e3565b61238b565b604051610319929190614876565b61030c6104ae366004613f7c565b61248e565b6103eb612499565b61030c6104c93660046141a9565b6124ab565b6104566104dc3660046140e3565b6124fd565b6103ae612523565b6103ae612547565b61030c6104ff366004613f7c565b61256b565b61032a612586565b61034a61051a366004614080565b6125e7565b61034a61052d366004614080565b612625565b6103ae612632565b6103ae61263c565b61034a61264b565b6103eb61265c565b6103ae61266e565b6103eb610568366004614010565b612692565b61049261057b3660046140e3565b61271d565b61030c61058e366004613f98565b612840565b61030c61287d565b6103ae612887565b600084608001516105d06105b5612547565b6001600160a01b0316336001600160a01b03161460cd6128f1565b6105e56105db612217565b82146101f46128f1565b6105ed6128ff565b6000865160018111156105fc57fe5b1480610614575060018651600181111561061257fe5b145b610653576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614b51565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b031614806106cc57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b0316145b806106e3575060408601516001600160a01b031630145b8061072357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061076357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061077a575060208601516001600160a01b031630145b6107b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a18565b60606107ba612912565b90506107c68682612a85565b6107ce613e25565b6000808080808c5160018111156107e157fe5b1415610812576108088c60600151878c815181106107fb57fe5b6020026020010151612af4565b60608d0152610841565b60018c51600181111561082157fe5b14156108415761083b8c60600151878b815181106107fb57fe5b60608d01525b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316148015610892575060008c51600181111561089057fe5b145b1561090d578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106108c857fe5b60200260200101511015610908576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614abd565b610a72565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b031614801561095e575060008c51600181111561095c57fe5b145b156109d4578b606001518b7f00000000000000000000000000000000000000000000000000000000000000008151811061099457fe5b60200260200101511015610908576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614b88565b60208c01516001600160a01b0316301480156109fc575060008c5160018111156109fa57fe5b145b15610a72578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110610a3257fe5b60200260200101511015610a72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a86565b6101008c01515115611c3e578b6101000151806020019051810190610a979190614186565b90945092508361142057610aa9613e3c565b60095460c08e01516040517fca142f750000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163ca142f7591610af791889060040161484a565b60c06040518083038186803b158015610b0f57600080fd5b505afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4791906144df565b60208101519091506001600160a01b0316158015610b9a57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316145b8015610bb2575060208d01516001600160a01b031630145b8015610bca575060008d516001811115610bc857fe5b145b15610bfe57610bf08d60600151888c81518110610be357fe5b6020026020010151612b00565b985050505050505050612038565b60095460c08e015160208301516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811693811692635778472a928216911614610c53578360400151610c56565b83515b6040518263ffffffff1660e01b8152600401610c7291906148c7565b60a06040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc29190614465565b516001600160a01b031614610cf7577f63757272656e6379000000000000000000000000000000000000000000000000610d19565b7f73656375726974790000000000000000000000000000000000000000000000005b94507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610d6c575060008d516001811115610d6a57fe5b145b15610dbe57806080015191508c606001518160a0015114610db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614c1c565b610e67565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610e0f575060008d516001811115610e0d57fe5b145b15610e5c578060a0015191508c60600151816080015114610db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614bbf565b610e67610163612b0c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610eba575060208e01516001600160a01b031630145b15610ee657507f53656c6c00000000000000000000000000000000000000000000000000000000610f6e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610f37575060208e01516001600160a01b031630145b15610f6357507f4275790000000000000000000000000000000000000000000000000000000000610f6e565b610f6e610163612b0c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f73d5870ecc5c28466106f013bf012d6be5b211d5e969d565d4e1cf583d3e56f98f60c001516001600160a01b031684602001516001600160a01b031614610fe4578360400151610fe7565b83515b7f736563757269747900000000000000000000000000000000000000000000000089146110b35760095460408087015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a9161105a916004016148c7565b60a06040518083038186803b15801561107257600080fd5b505afa158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190614465565b60600151611151565b60095485516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916110fc916004016148c7565b60a06040518083038186803b15801561111457600080fd5b505afa158015611128573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114c9190614465565b606001515b7f63757272656e63790000000000000000000000000000000000000000000000008a1461121d5760095460408088015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111c4916004016148c7565b60a06040518083038186803b1580156111dc57600080fd5b505afa1580156111f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112149190614465565b606001516112bb565b60095486516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a91611266916004016148c7565b60a06040518083038186803b15801561127e57600080fd5b505afa158015611292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b69190614465565b606001515b856112d788608001518960a00151612b3690919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000008a8a606001516040516113129897969594939291906148ef565b60405180910390a261134882608001517f0000000000000000000000000000000000000000000000000000000000000000612b00565b608083015260a082015161137c907f0000000000000000000000000000000000000000000000000000000000000000612b00565b60a083015260095460c08f01516040517fd729cf6c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163d729cf6c916113cf91899060040161484a565b600060405180830381600087803b1580156113e957600080fd5b505af11580156113fd573d6000803e3d6000fd5b5050505061141183898d81518110610be357fe5b99505050505050505050612038565b60405160200161142f906147c6565b604051602081830303815290604052805190602001208414801561145257508215155b1561147457604080518082019091528060015b81526020018490529450611c39565b60405160200161148390614767565b604051602081830303815290604052805190602001208414156114b25760408051808201909152806000611465565b826116c1577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316148061153057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316145b8015611548575060208c01516001600160a01b031630145b8015611560575060008c51600181111561155e57fe5b145b156116b1576009546040517f7489ec230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690637489ec23906115ae9087906004016148c7565b602060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160091906140cb565b90508b60600151811461163f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614af4565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b60405161168c989796959493929190614803565b60405180910390a16116a481878b81518110610be357fe5b9750505050505050612038565b6116bc610163612b0c565b611c39565b8215611c2e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316141561176c5760608c0151611766906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b612b99565b6128c3565b60608d01525b60208c01516001600160a01b031630148015611794575060008c51600181111561179257fe5b145b15611994576117eb836117618561175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b60405161183a989796959493929190614803565b60405180910390a17f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b031614156118dd5760608c01516118d7906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608d01525b600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b81526004016119209291906149ce565b602060405180830381600087803b15801561193a57600080fd5b505af115801561194e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197291906140cb565b9050611982818d606001516128c3565b90506116a481878b81518110610be357fe5b60408c01516001600160a01b0316301480156119bc575060008c5160018111156119ba57fe5b145b156116b1576000611a15846117618661175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90508c6060015192507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d602001516001600160a01b03161415611ab95760608d0151611ab3906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608e01525b600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4868f6040518363ffffffff1660e01b8152600401611afc9291906149ce565b602060405180830381600087803b158015611b1657600080fd5b505af1158015611b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4e91906140cb565b9150611b5e8d6060015183612b87565b91507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378d60c001518e602001518f60400151858886428c604051611ba9989796959493929190614803565b60405180910390a1828c7f000000000000000000000000000000000000000000000000000000000000000081518110611bde57fe5b60200260200101511015611c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614c79565b610bf083888c81518110610be357fe5b611c39610163612b0c565b611c49565b611c49610163612b0c565b7f00000000000000000000000000000000000000000000000000000000000000008c606001511015611ca7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a4f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480611d2057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316145b8015611d38575060408c01516001600160a01b031630145b8015611d50575060008c516001811115611d4e57fe5b145b15611fbf578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110611d8657fe5b60200260200101511115611faf57611dd58b7f000000000000000000000000000000000000000000000000000000000000000081518110611dc357fe5b60200260200101518d606001516128c3565b8b7f000000000000000000000000000000000000000000000000000000000000000081518110611e0157fe5b602002602001018181525050611e678560200151611761876020015161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90508b6060015191507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161415611f0b5760608c0151611f05906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608d01525b6009546040517f5487e8cf0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690635487e8cf90611f56908f908990600401614cb0565b602060405180830381600087803b158015611f7057600080fd5b505af1158015611f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa891906140cb565b9350611fba565b611fba610201612b0c565b611fca565b611fca610163612b0c565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e6040015185896020015186428b604051612017989796959493929190614803565b60405180910390a161202f82878b81518110610be357fe5b97505050505050505b50949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156120cd5780601f106120a2576101008083540402835291602001916120cd565b820191906000526020600020905b8154815290600101906020018083116120b057829003601f168201915b5050505050905090565b60006120e4338484612bcf565b5060015b92915050565b60025490565b6000806000612101612c37565b15925061210c612c54565b9150612116612c78565b9050909192565b6060612127612912565b905090565b6000806121398533612840565b905061215d336001600160a01b03871614806121555750838210155b61019e6128f1565b612168858585612c9c565b336001600160a01b0386161480159061218357506000198114155b15612195576121958533858403612bcf565b506001949350505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b600061212761287d565b612203612d7c565b61220b6128ff565b61221481612dc2565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916120e49185906122719086612b87565b612bcf565b61227e612d7c565b6122886000612e3b565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b6122b6612d7c565b6122be6128ff565b6122c88282612ecc565b5050565b6122d4612d7c565b6122886001612fda565b6008546000906121279060c0603f613031565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000606061232b8651612326613040565b613045565b612340898989898989896130526130a461310d565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b6060808861239a6105b5612547565b6123a56105db612217565b606060006123b2866132c2565b156123da576123bf6132f1565b6123d1896123cb6120ee565b88613304565b9250905061242c565b6123e2613330565b60606123ec612912565b90506123f88a82612a85565b61241c8d8d8d8d8d61240861264b565b612412578d612415565b60005b878e613052565b9350915061242a83826130a4565b505b6124368b82613338565b81895167ffffffffffffffff8111801561244f57600080fd5b50604051908082528060200260200182016040528015612479578160200160208202803683370190505b509450945050505b5097509795505050505050565b60006120e88261256b565b6124a1612d7c565b6122886001612e3b565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016124e0929190614727565b604051602081830303815290604052805190602001209050919050565b6000606061250e8651612326613040565b6123408989898989898961334261335e61310d565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156120cd5780601f106120a2576101008083540402835291602001916120cd565b6000806125f43385612840565b905080831061260e5761260933856000612bcf565b61261b565b61261b3385858403612bcf565b5060019392505050565b60006120e4338484612c9c565b60006121276133c7565b6009546001600160a01b031690565b6008546000906121279060ff613441565b612664612d7c565b6122886000612fda565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886126c18c61256b565b896040516020016126d796959493929190614936565b60405160208183030381529060405280519060200120905061270888826126ff87878761344b565b886101f861348a565b612713888888612bcf565b5050505050505050565b6060808861272c6105b5612547565b6127376105db612217565b61273f613330565b6060612749612912565b90506127536120ee565b61280057600060606127688d8d8d868b6134e1565b91509150612781612777613606565b83101560cc6128f1565b612793600061278e613606565b61360d565b6127a68b61279f613606565b840361360d565b6127b0818461335e565b808a5167ffffffffffffffff811180156127c957600080fd5b506040519080825280602002602001820160405280156127f3578160200160208202803683370190505b5095509550505050612481565b61280a8882612a85565b600060606128328d8d8d8d8d61281e61264b565b612828578d61282b565b60005b898e613342565b915091506127a68b8361360d565b600061284a612547565b6001600160a01b0316826001600160a01b0316141561286c57506000196120e8565b6128768383613617565b90506120e8565b6000612127613642565b6009546001600160a01b031681565b806122c8816136df565b60006128ad84848461375d565b506001901b60001901811b1992909216911b1790565b60006128d38383111560016128f1565b50900390565b60008183106128e857816128ea565b825b9392505050565b816122c8576122c881612b0c565b61228861290a612c37565b6101926128f1565b6060600061291e613040565b905060608167ffffffffffffffff8111801561293957600080fd5b50604051908082528060200260200182016040528015612963578160200160208202803683370190505b50905060005b82811015612a7e577f00000000000000000000000000000000000000000000000000000000000000008114156129d7577f00000000000000000000000000000000000000000000000000000000000000008282815181106129c657fe5b602002602001018181525050612a76565b7f0000000000000000000000000000000000000000000000000000000000000000811415612a2c577f00000000000000000000000000000000000000000000000000000000000000008282815181106129c657fe5b7f0000000000000000000000000000000000000000000000000000000000000000811415612a7657670de0b6b3a7640000828281518110612a6957fe5b6020026020010181815250505b600101612969565b5091505090565b81518151612a94908290613045565b60005b81811015612aee57612acf848281518110612aae57fe5b6020026020010151848381518110612ac257fe5b6020026020010151612b99565b848281518110612adb57fe5b6020908102919091010152600101612a97565b50505050565b60006128ea8383612b99565b60006128ea8383612b36565b612214817f42414c00000000000000000000000000000000000000000000000000000000006137a4565b6000612b4582151560046128f1565b82612b52575060006120e8565b670de0b6b3a764000083810290612b7590858381612b6c57fe5b041460056128f1565b828181612b7e57fe5b049150506120e8565b60008282016128ea84821015836128f1565b6000828202612bbd841580612bb6575083858381612bb357fe5b04145b60036128f1565b670de0b6b3a764000090049392505050565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590612c2a9085906148c7565b60405180910390a3505050565b6000612c41612c78565b42118061212757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b612cb36001600160a01b03841615156101986128f1565b612cca6001600160a01b03831615156101996128f1565b612cd5838383613758565b6001600160a01b038316600090815260208190526040902054612cfb90826101a061381f565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612d2a9082612b87565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612c2a9085906148c7565b6000612dab6000357fffffffff00000000000000000000000000000000000000000000000000000000166124ab565b9050612214612dba8233613835565b6101916128f1565b612dd7612dcd61391e565b82101560cb6128f1565b612dec612de2613927565b82111560ca6128f1565b600854612dfd908260c0603f6128a0565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90612e309083906148c7565b60405180910390a150565b8015612e5b57612e56612e4c612c54565b42106101936128f1565b612e70565b612e70612e66612c78565b42106101a96128f1565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490612e309083906148a4565b6000612ed6612217565b90506000612ee2612547565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401612f0f9291906149b7565b60806040518083038186803b158015612f2757600080fd5b505afa158015612f3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f5f919061455d565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d49250612fac915085908790600401614996565b600060405180830381600087803b158015612fc657600080fd5b505af1158015612713573d6000803e3d6000fd5b600854612fe9908260ff613933565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c89061301c9083906148a4565b60405180910390a18061221457612214612288565b6001901b6000190191901c1690565b600390565b6122c881831460676128f1565b6000606060006130618461395a565b9050600181600181111561307157fe5b1461308657613081610163612b0c565b613096565b6130908885613970565b90935091505b509850989650505050505050565b815181516130b3908290613045565b60005b81811015612aee576130ee8482815181106130cd57fe5b60200260200101518483815181106130e157fe5b6020026020010151612b36565b8482815181106130fa57fe5b60209081029190910101526001016130b6565b3330146131fc576000306001600160a01b0316600036604051613131929190614757565b6000604051808303816000865af19150503d806000811461316e576040519150601f19603f3d011682016040523d82523d6000602084013e613173565b606091505b50509050806000811461318257fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb0000000000000000000000000000000000000000000000000000000081146131de573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b613204613330565b606061320e612912565b905061321a8782612a85565b600060606132328c8c8c8c8c8c898d8d63ffffffff16565b9150915061324481848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b60008082511180156120e8575060ff8016828060200190518101906132e7919061459d565b60ff161492915050565b6122886132fc61264b565b6101b66128f1565b60006060600061331384613a13565b90506060613322878784613a29565b919791965090945050505050565b6122886128ff565b6122c88282613ad8565b60006060613351610163612b0c565b9850989650505050505050565b8151815161336d908290613045565b60005b81811015612aee576133a884828151811061338757fe5b602002602001015184838151811061339b57fe5b6020026020010151613ba4565b8482815181106133b457fe5b6020908102919091010152600101613370565b60006133d1612547565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561340957600080fd5b505afa15801561341d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212791906141e9565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b600061349585613bf2565b90506134ab6134a5878387613c0e565b836128f1565b6134ba428410156101b86128f1565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b600060606134ed6128ff565b7f00000000000000000000000000000000000000000000000000000000000000006135286001600160a01b03888116908316146101566128f1565b613548816001600160a01b0316876001600160a01b0316146101566128f1565b606061355385613cdb565b90506135b2817f00000000000000000000000000000000000000000000000000000000000000008151811061358457fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000612af4565b817f0000000000000000000000000000000000000000000000000000000000000000815181106135de57fe5b60209081029190910101526dffffffffffffffffffffffffffff999098509650505050505050565b620f424090565b6122c88282613cf1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006136af613d84565b306040516020016136c495949392919061496a565b60405160208183030381529060405280519060200120905090565b6002815110156136ee57612214565b6000816000815181106136fd57fe5b602002602001015190506000600190505b825181101561375857600083828151811061372557fe5b6020026020010151905061374e816001600160a01b0316846001600160a01b03161060656128f1565b915060010161370e565b505050565b61376c610100831060646128f1565b6137956001821015801561378e575061378a60ff84610100036128d9565b8211155b60646128f1565b61375883821c156101b46128f1565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600061382e84841115836128f1565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b613854612523565b6001600160a01b03161415801561386f575061386f83613d88565b156138975761387c612523565b6001600160a01b0316336001600160a01b03161490506120e8565b61389f6133c7565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016138ce939291906148d0565b60206040518083038186803b1580156138e657600080fd5b505afa1580156138fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061287691906140ab565b64e8d4a5100090565b67016345785d8a000090565b60006001821b198416828461394957600061394c565b60015b60ff16901b17949350505050565b6000818060200190518101906120e89190614253565b60006060600061397f84613df6565b90506060855167ffffffffffffffff8111801561399b57600080fd5b506040519080825280602002602001820160405280156139c5578160200160208202803683370190505b50905060005b8651811015613a07578681815181106139e057fe5b60200260200101518282815181106139f457fe5b60209081029190910101526001016139cb565b50909590945092505050565b6000818060200190518101906128ea91906145b9565b60606000613a378385612b36565b9050845167ffffffffffffffff81118015613a5157600080fd5b50604051908082528060200260200182016040528015613a7b578160200160208202803683370190505b50915060005b8551811015613acf57613ab082878381518110613a9a57fe5b6020026020010151612b9990919063ffffffff16565b838281518110613abc57fe5b6020908102919091010152600101613a81565b50509392505050565b613aef6001600160a01b038316151561019b6128f1565b613afb82600083613758565b6001600160a01b038216600090815260208190526040902054613b2190826101b261381f565b6001600160a01b038316600090815260208190526040902055613b54613b4f82613b496120ee565b90613e0c565b613e1a565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613b9891906148c7565b60405180910390a35050565b6000613bb382151560046128f1565b82613bc0575060006120e8565b670de0b6b3a764000083810290613bda90858381612b6c57fe5b826001820381613be657fe5b046001019150506120e8565b6000613bfc613642565b826040516020016124e0929190614790565b6000613c2082516041146101b96128f1565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613c599089908590889088906149e7565b6020604051602081039080840390855afa158015613c7b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b03811615801590613ccf5750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906128ea919061429c565b613cfd60008383613758565b613d12613b4f82613d0c6120ee565b90612b87565b6001600160a01b038216600090815260208190526040902054613d359082612b87565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613b989085906148c7565b4690565b6000613db37f38e9922e000000000000000000000000000000000000000000000000000000006124ab565b821480613de75750613de47f50dd6ed9000000000000000000000000000000000000000000000000000000006124ab565b82145b806120e857506120e882613e1f565b6000818060200190518101906128ea919061426f565b60006128ea8383600161381f565b600255565b50600090565b604080518082019091526000808252602082015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356120e881614d57565b600082601f830112613e8c578081fd5b8135613e9f613e9a82614d37565b614d10565b818152915060208083019084810181840286018201871015613ec057600080fd5b60005b84811015613edf57813584529282019290820190600101613ec3565b505050505092915050565b600082601f830112613efa578081fd5b813567ffffffffffffffff811115613f10578182fd5b613f4160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614d10565b9150808252836020828501011115613f5857600080fd5b8060208401602084013760009082016020015292915050565b80356120e881614d6c565b600060208284031215613f8d578081fd5b81356128ea81614d57565b60008060408385031215613faa578081fd5b8235613fb581614d57565b91506020830135613fc581614d57565b809150509250929050565b600080600060608486031215613fe4578081fd5b8335613fef81614d57565b92506020840135613fff81614d57565b929592945050506040919091013590565b600080600080600080600060e0888a03121561402a578485fd5b873561403581614d57565b9650602088013561404581614d57565b95506040880135945060608801359350608088013561406381614d79565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215614092578182fd5b823561409d81614d57565b946020939093013593505050565b6000602082840312156140bc578081fd5b815180151581146128ea578182fd5b6000602082840312156140dc578081fd5b5051919050565b600080600080600080600060e0888a0312156140fd578081fd5b87359650602088013561410f81614d57565b9550604088013561411f81614d57565b9450606088013567ffffffffffffffff8082111561413b578283fd5b6141478b838c01613e7c565b955060808a0135945060a08a0135935060c08a013591508082111561416a578283fd5b506141778a828b01613eea565b91505092959891949750929550565b60008060408385031215614198578182fd5b505080516020909101519092909150565b6000602082840312156141ba578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146128ea578182fd5b6000602082840312156141fa578081fd5b81516128ea81614d57565b60008060408385031215614217578182fd5b823561422281614d57565b9150602083013567ffffffffffffffff81111561423d578182fd5b61424985828601613eea565b9150509250929050565b600060208284031215614264578081fd5b81516128ea81614d6c565b60008060408385031215614281578182fd5b825161428c81614d6c565b6020939093015192949293505050565b600080604083850312156142ae578182fd5b8251600481106142bc578283fd5b8092505060208084015167ffffffffffffffff8111156142da578283fd5b8401601f810186136142ea578283fd5b80516142f8613e9a82614d37565b81815283810190838501858402850186018a1015614314578687fd5b8694505b83851015614336578051835260019490940193918501918501614318565b5080955050505050509250929050565b6000806000806080858703121561435b578182fd5b843567ffffffffffffffff80821115614372578384fd5b818701915061012080838a031215614388578485fd5b61439181614d10565b905061439d8984613f71565b81526143ac8960208501613e71565b60208201526143be8960408501613e71565b6040820152606083013560608201526080830135608082015260a083013560a08201526143ee8960c08501613e71565b60c08201526144008960e08501613e71565b60e08201526101008084013583811115614418578687fd5b6144248b828701613eea565b828401525050809650506020870135915080821115614441578384fd5b5061444e87828801613e7c565b949794965050505060408301359260600135919050565b600060a08284031215614476578081fd5b61448060a0614d10565b825161448b81614d57565b815260208301516003811061449e578283fd5b60208201526040830151600581106144b4578283fd5b604082015260608301516144c781614d57565b60608201526080928301519281019290925250919050565b600060c082840312156144f0578081fd5b6144fa60c0614d10565b82518152602083015161450c81614d57565b8060208301525060408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b600060208284031215614556578081fd5b5035919050565b60008060008060808587031215614572578182fd5b845193506020850151925060408501519150606085015161459281614d57565b939692955090935050565b6000602082840312156145ae578081fd5b81516128ea81614d79565b600080604083850312156145cb578182fd5b825161428c81614d79565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015614612578151875295820195908201906001016145f6565b509495945050505050565b60008151808452815b8181101561464257602081850181015186830182015201614626565b818111156146535782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012082516002811061469757fe5b8085525060208301516146ad60208601826145d6565b5060408301516146c060408601826145d6565b50606083015160608501526080830151608085015260a083015160a085015260c08301516146f160c08601826145d6565b5060e083015161470460e08601826145d6565b5061010080840151828287015261471d8387018261461d565b9695505050505050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f4d61726b65740000000000000000000000000000000000000000000000000000815260060190565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b7f4c696d6974000000000000000000000000000000000000000000000000000000815260050190565b6001600160a01b0391909116815260200190565b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015260a083015260c082019290925260e08101919091526101000190565b6001600160a01b03929092168252602082015260400190565b6000602082526128ea60208301846145e3565b60006040825261488960408301856145e3565b828103602084015261489b81856145e3565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9788526001600160a01b03968716602089015294861660408801526060870193909352608086019190915290921660a084015260c083019190915260e08201526101000190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b6000838252604060208301526149af604083018461461d565b949350505050565b9182526001600160a01b0316602082015260400190565b6000838252604060208301526149af6040830184614686565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526128ea602083018461461d565b60208082526016908201527f496e76616c6964207377617070656420746f6b656e7300000000000000000000604082015260600190565b60208082526018908201527f4f726465722062656c6f77206d696e696d756d2073697a650000000000000000604082015260600190565b6020808252601f908201527f496e73756666696369656e7420706f6f6c20746f6b656e2062616c616e636500604082015260600190565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526023908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e0000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600c908201527f496e76616c696420737761700000000000000000000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f722063757272656e637900000000000000000000000000000000606082015260800190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f7220736563757269747900000000000000000000000000000000606082015260800190565b6020808252601d908201527f494e53554646494349454e545f494e5445524e414c5f42414c414e4345000000604082015260600190565b600060608252614cc36060830185614686565b9050825160038110614cd157fe5b80602084015250602083015160408301529392505050565b6000838252604060208301526149af60408301846145e3565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715614d2f57600080fd5b604052919050565b600067ffffffffffffffff821115614d4d578081fd5b5060209081020190565b6001600160a01b038116811461221457600080fd5b6002811061221457600080fd5b60ff8116811461221457600080fdfea26469706673582212204023d8be5f78011358098636c25b2ce13aa73bbd223f75aecfda22e4c24fe54f64736f6c63430007010033", + "bytecode": "0x6103406040523480156200001257600080fd5b506040516200753d3803806200753d833981016040819052620000359162000c0f565b846000856000015186602001516200005d88604001518960800151306200057060201b60201c565b60408051600380825260808201909252906020820160608036833701905050896101200151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000ce92919062000a91565b508051620000e490600490602084019062000a91565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016290506276a7008311156101946200063f565b6200017662278d008211156101956200063f565b429091016101408190520161016052855162000198906002111560c86200063f565b620001b2620001a662000654565b8751111560c96200063f565b620001c8866200065960201b620025901760201c565b620001d38462000665565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000204908d9060040162000e82565b602060405180830381600087803b1580156200021f57600080fd5b505af115801562000234573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025a919062000bd7565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028f9084908b908b9060040162000da2565b600060405180830381600087803b158015620002aa57600080fd5b505af1158015620002bf573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030657600080fd5b505afa1580156200031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000341919062000bf0565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083608001516001600160a01b03166101e0816001600160a01b031660601b8152505084600a60006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000806000620003f48760400151886080015130620006f960201b60201c565b6102c08190526102e083905261030082905260408a015192955090935091506200041e90620007ef565b6102005260808701516200043290620007ef565b6102205260e0870151610240526101008701516102605260c0870151610280526101208701516102a0526001600160601b0319606085901b16610320526040808801516080890151915186929030906200048c9062000b16565b6200049b949392919062000d77565b604051809103906000f080158015620004b8573d6000803e3d6000fd5b50600960006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086604001516001600160a01b03167f3d3c4c037711d546c8299d521821c31f3d622836675303d87dce53bb231a863688606001518960c001518a608001518b60e001518c61010001518d60a00151600960009054906101000a90046001600160a01b03168c6040516200055a98979695949392919062000e3e565b60405180910390a2505050505050505062000ee9565b60606000808062000583878787620006f9565b6040805160038082526080820190925293965091945092506020820160608036833701905050935086848481518110620005b957fe5b60200260200101906001600160a01b031690816001600160a01b03168152505085848381518110620005e757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200061557fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b8162000650576200065081620008c3565b5050565b600390565b806200065081620008d8565b6200067e6200067362000964565b82101560cb6200063f565b620006976200068c6200096d565b82111560ca6200063f565b620006b98160c0603f6008546200097960201b6200259a17909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90620006ee90839062000e97565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200078257836001600160a01b0316856001600160a01b0316101562000745575060009150600190506002620007e6565b836001600160a01b0316866001600160a01b0316101562000771575060009150600290506001620007e6565b5060019150600290506000620007e6565b846001600160a01b0316846001600160a01b03161015620007ae575060029150600190506000620007e6565b856001600160a01b0316846001600160a01b03161015620007da575060029150600090506001620007e6565b50600191506000905060025b93509350939050565b60006001600160a01b038216301415620008135750670de0b6b3a7640000620008be565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200084f57600080fd5b505afa15801562000864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200088a919062000d54565b60ff1690506000620008a96012836200099e60201b620025bd1760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b620008d5816210905360ea1b620009bb565b50565b600281511015620008e957620008d5565b600081600081518110620008f957fe5b602002602001015190506000600190505b82518110156200095f5760008382815181106200092357fe5b6020026020010151905062000954816001600160a01b0316846001600160a01b03161060656200063f60201b60201c565b91506001016200090a565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200098884848462000a1c565b506001901b60001901811b1992909216911b1790565b6000620009b08383111560016200063f565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b62000a2d610100831060646200063f565b62000a666001821015801562000a5e575062000a5a60ff846101000362000a7760201b620025d31760201c565b8211155b60646200063f565b6200095f83821c156101b46200063f565b600081831062000a88578162000a8a565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000ad457805160ff191683800117855562000b04565b8280016001018555821562000b04579182015b8281111562000b0457825182559160200191906001019062000ae7565b5062000b1292915062000b24565b5090565b611a3e8062005aff83390190565b5b8082111562000b12576000815560010162000b25565b8051620009b58162000ed3565b600082601f83011262000b59578081fd5b81516001600160401b0381111562000b6f578182fd5b602062000b85601f8301601f1916820162000ea0565b9250818352848183860101111562000b9c57600080fd5b60005b8281101562000bbc57848101820151848201830152810162000b9f565b8281111562000bce5760008284860101525b50505092915050565b60006020828403121562000be9578081fd5b5051919050565b60006020828403121562000c02578081fd5b815162000a8a8162000ed3565b600080600080600060a0868803121562000c27578081fd5b855162000c348162000ed3565b60208701519095506001600160401b038082111562000c51578283fd5b818801915061014080838b03121562000c68578384fd5b62000c738162000ea0565b905082518281111562000c84578485fd5b62000c928b82860162000b48565b82525060208301518281111562000ca7578485fd5b62000cb58b82860162000b48565b60208301525062000cca8a6040850162000b3b565b60408201526060830151606082015262000ce88a6080850162000b3b565b608082015260a083015160a082015260c083015160c082015260e083015160e08201526101009150818301518282015261012091508183015182820152809650505050604086015192506060860151915062000d48876080880162000b3b565b90509295509295909350565b60006020828403121562000d66578081fd5b815160ff8116811462000a8a578182fd5b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000dee5762000ddb855162000ec7565b8352938301939183019160010162000dc6565b505084810360408601528551808252908201925081860190845b8181101562000e305762000e1d835162000ec7565b8552938301939183019160010162000e08565b509298975050505050505050565b97885260208801969096526001600160a01b0394851660408801526060870193909352608086019190915260a0850152811660c08401521660e08201526101000190565b602081016003831062000e9157fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000ebf57600080fd5b604052919050565b6001600160a01b031690565b6001600160a01b0381168114620008d557600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e051610300516103205160601c614a6662001099600039806131e95250806108b252806126d3528061325552806132af52508061097e528061266d525080610a1c52806118c55280611ace5280611b0b5280611b4952806127285250806123465250806119bc5280611f6252508061164d52806117f05280611bb45280611fc952508061162c52806117cf5280611b935280611e785250806112b952806126fb5280613288525080611285528061269552508061066852806106fe52806108565280610d215280610dcc528061123a52806114235280611a5952806120245250806106a7528061073e52806109225280610b745280610c7e5280610e495280610ed152806113e45280611a1a5280611e9c52508061236a525080611eef52508061297452508061295052508061221f5250806121fb5250806121855250806133405250806133825250806133615250614a666000f3fe608060405234801561001057600080fd5b50600436106102ff5760003560e01c806370a082311161019c578063a9059cbb116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e14610593578063ed24911d146105a6578063fd19cac8146105ae576102ff565b8063d2946c2b14610565578063d505accf1461056d578063d5c096c414610580576102ff565b8063b35056b8116100c8578063b35056b81461054d578063b7b814fc14610555578063ced72f871461055d576102ff565b8063a9059cbb1461052a578063aaabadc51461053d578063ab63c60714610545576102ff565b806387ec68171161015057806390193b7c1161012a57806390193b7c146104fc57806395d89b411461050f578063a457c2d714610517576102ff565b806387ec6817146104d9578063893d20e8146104ec5780638d928af8146104f4576102ff565b80637ecebe00116101815780637ecebe00146104ab5780638456cb59146104be578063851c1bb3146104c6576102ff565b806370a082311461047757806374f3b0091461048a576102ff565b806338e9922e1161025557806350dd6ed9116102095780635c1548fb116101e35780635c1548fb146104465780636028bfd41461044e5780636945c1fd1461046f576102ff565b806350dd6ed91461042357806354a844ba1461043657806355c676281461043e576102ff565b8063395093511161023a57806339509351146104005780633f4ba83a146104135780634d6d0fd01461041b576102ff565b806338e9922e146103e357806338fff2d0146103f8576102ff565b80631dd746ea116102b75780632541897f116102915780632541897f146103b1578063313ce567146103c65780633644e515146103db576102ff565b80631dd746ea1461038157806323b872dd1461039657806325117b72146103a9576102ff565b8063095ea7b3116102e8578063095ea7b31461034257806318160ddd146103625780631c0de0511461036a576102ff565b806301ec954a1461030457806306fdde031461032d575b600080fd5b610317610312366004614040565b6105b6565b604051610324919061456f565b60405180910390f35b610335611d17565b60405161032491906146ad565b610355610350366004613d7a565b611dad565b604051610324919061454c565b610317611dc4565b610372611dca565b60405161032493929190614557565b610389611df3565b604051610324919061450b565b6103556103a4366004613cca565b611e02565b610317611e76565b6103b9611e9a565b6040516103249190614497565b6103ce611ebe565b60405161032491906149aa565b610317611ec7565b6103f66103f136600461423f565b611ed1565b005b610317611eed565b61035561040e366004613d7a565b611f11565b6103f6611f4c565b610317611f60565b6103f6610431366004613eff565b611f84565b6103f6611fa2565b610317611fb4565b610317611fc7565b61046161045c366004613ddd565b611feb565b604051610324929190614991565b6103b9612022565b610317610485366004613c76565b612046565b61049d610498366004613ddd565b612061565b60405161032492919061451e565b6103176104b9366004613c76565b612164565b6103f661216f565b6103176104d4366004613ea3565b612181565b6104616104e7366004613ddd565b6121d3565b6103b96121f9565b6103b961221d565b61031761050a366004613c76565b612241565b61033561225c565b610355610525366004613d7a565b6122bd565b610355610538366004613d7a565b6122fb565b6103b9612308565b6103b9612312565b610355612321565b6103f6612332565b610317612344565b6103b9612368565b6103f661057b366004613d0a565b61238c565b61049d61058e366004613ddd565b612417565b6103176105a1366004613c92565b61253a565b610317612577565b6103b9612581565b600084608001516105e36105c861221d565b6001600160a01b0316336001600160a01b03161460cd6125eb565b6105f86105ee611eed565b82146101f46125eb565b6106006125f9565b60008651600181111561060f57fe5b1480610627575060018651600181111561062557fe5b145b610666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906147f9565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b031614806106df57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b0316145b806106f6575060408601516001600160a01b031630145b8061073657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061077657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061078d575060208601516001600160a01b031630145b6107c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906146c0565b60606107cd61260c565b90506107d9868261277f565b6107e1613b1f565b6000808080808c5160018111156107f457fe5b14156108255761081b8c60600151878c8151811061080e57fe5b60200260200101516127ee565b60608d0152610854565b60018c51600181111561083457fe5b14156108545761084e8c60600151878b8151811061080e57fe5b60608d01525b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480156108a5575060008c5160018111156108a357fe5b145b15610920578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106108db57fe5b6020026020010151101561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614765565b610a85565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316148015610971575060008c51600181111561096f57fe5b145b156109e7578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106109a757fe5b6020026020010151101561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614830565b60208c01516001600160a01b031630148015610a0f575060008c516001811115610a0d57fe5b145b15610a85578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110610a4557fe5b60200260200101511015610a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d9061472e565b6101008c015151156119a3578b6101000151806020019051810190610aaa9190613e80565b90945092508361138e57610abc613b36565b60095460c08e01516040517fca142f750000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163ca142f7591610b0a9188906004016144f2565b60c06040518083038186803b158015610b2257600080fd5b505afa158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5a91906141d9565b60095460c08f015160208301519293506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169392811692635778472a92908216911614610bb4578360400151610bb7565b83515b6040518263ffffffff1660e01b8152600401610bd3919061456f565b60a06040518083038186803b158015610beb57600080fd5b505afa158015610bff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c23919061415f565b516001600160a01b031614610c58577f63757272656e6379000000000000000000000000000000000000000000000000610c7a565b7f73656375726974790000000000000000000000000000000000000000000000005b94507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610ccd575060008d516001811115610ccb57fe5b145b15610d1f57806080015191508c606001518160a0015114610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906148c4565b610dc8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610d70575060008d516001811115610d6e57fe5b145b15610dbd578060a0015191508c60600151816080015114610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614867565b610dc86101646127fa565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610e1b575060208e01516001600160a01b031630145b15610e4757507f53656c6c00000000000000000000000000000000000000000000000000000000610ecf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610e98575060208e01516001600160a01b031630145b15610ec457507f4275790000000000000000000000000000000000000000000000000000000000610ecf565b610ecf6101646127fa565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f73d5870ecc5c28466106f013bf012d6be5b211d5e969d565d4e1cf583d3e56f98f60c001516001600160a01b031684602001516001600160a01b031614610f45578360400151610f48565b83515b7f736563757269747900000000000000000000000000000000000000000000000089146110145760095460408087015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a91610fbb9160040161456f565b60a06040518083038186803b158015610fd357600080fd5b505afa158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b919061415f565b606001516110b2565b60095485516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a9161105d9160040161456f565b60a06040518083038186803b15801561107557600080fd5b505afa158015611089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ad919061415f565b606001515b7f63757272656e63790000000000000000000000000000000000000000000000008a1461117e5760095460408088015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111259160040161456f565b60a06040518083038186803b15801561113d57600080fd5b505afa158015611151573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611175919061415f565b6060015161121c565b60095486516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111c79160040161456f565b60a06040518083038186803b1580156111df57600080fd5b505afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611217919061415f565b606001515b8561123888608001518960a0015161282490919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000008a8a60600151604051611273989796959493929190614597565b60405180910390a26112a982608001517f0000000000000000000000000000000000000000000000000000000000000000612875565b608083015260a08201516112dd907f0000000000000000000000000000000000000000000000000000000000000000612875565b60a083015260095460c08f01516040517fd729cf6c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163d729cf6c916113309189906004016144f2565b600060405180830381600087803b15801561134a57600080fd5b505af115801561135e573d6000803e3d6000fd5b5050505061137f83898d8151811061137257fe5b6020026020010151612875565b99505050505050505050611d0e565b837f4c696d69740000000000000000000000000000000000000000000000000000001480156113bc57508215155b156113dd57604080518082019091528060018152602001849052945061199e565b826115ec577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316148061145b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316145b8015611473575060208c01516001600160a01b031630145b801561148b575060008c51600181111561148957fe5b145b156115dc576009546040517f7489ec230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690637489ec23906114d990879060040161456f565b602060405180830381600087803b1580156114f357600080fd5b505af1158015611507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152b9190613dc5565b90508b60600151811461156a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d9061479c565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b6040516115b79897969594939291906144ab565b60405180910390a16115cf81878b8151811061137257fe5b9750505050505050611d0e565b6115e76101646127fa565b61199e565b82156119935760208c01516001600160a01b03163014801561161a575060008c51600181111561161857fe5b145b156117895761167b83611676856116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b612893565b6125bd565b90507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b6040516116ca9897969594939291906144ab565b60405180910390a1600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b8152600401611715929190614676565b602060405180830381600087803b15801561172f57600080fd5b505af1158015611743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117679190613dc5565b9050611777818d606001516125bd565b90506115cf81878b8151811061137257fe5b60408c01516001600160a01b0316301480156117b1575060008c5160018111156117af57fe5b145b80156117bd5750600083115b156115dc5761181483611676856116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b9150600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b8152600401611859929190614676565b602060405180830381600087803b15801561187357600080fd5b505af1158015611887573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ab9190613dc5565b90506118bb8c6060015182612881565b90508b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106118ee57fe5b6020026020010151101561192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614921565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e60400151848787428b6040516119779897969594939291906144ab565b60405180910390a16115cf8c60600151878b8151811061137257fe5b61199e6101646127fa565b6119ba565b604080518082019091526000808252602082015294505b7f00000000000000000000000000000000000000000000000000000000000000008c606001511015611a18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906146f7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480611a9157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316145b8015611aa9575060408c01516001600160a01b031630145b8015611ac1575060008c516001811115611abf57fe5b145b15611c8d578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110611af757fe5b60200260200101511115611c7d57611b468b7f000000000000000000000000000000000000000000000000000000000000000081518110611b3457fe5b60200260200101518d606001516125bd565b8b7f000000000000000000000000000000000000000000000000000000000000000081518110611b7257fe5b602002602001018181525050611bd8856020015161167687602001516116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b6009546040517f5487e8cf0000000000000000000000000000000000000000000000000000000081529192506001600160a01b031690635487e8cf90611c24908f908990600401614958565b602060405180830381600087803b158015611c3e57600080fd5b505af1158015611c52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c769190613dc5565b9350611c88565b611c886102016127fa565b611c98565b611c986101646127fa565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f60600151896020015186428b604051611ce99897969594939291906144ab565b60405180910390a1611d058c60600151878b8151811061137257fe5b97505050505050505b50949350505050565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611da35780601f10611d7857610100808354040283529160200191611da3565b820191906000526020600020905b815481529060010190602001808311611d8657829003601f168201915b5050505050905090565b6000611dba3384846128c9565b5060015b92915050565b60025490565b6000806000611dd7612931565b159250611de261294e565b9150611dec612972565b9050909192565b6060611dfd61260c565b905090565b600080611e0f853361253a565b9050611e33336001600160a01b0387161480611e2b5750838210155b61019e6125eb565b611e3e858585612996565b336001600160a01b03861614801590611e5957506000198114155b15611e6b57611e6b85338584036128c9565b506001949350505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b6000611dfd612577565b611ed9612a76565b611ee16125f9565b611eea81612abc565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091611dba918590611f479086612881565b6128c9565b611f54612a76565b611f5e6000612b35565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b611f8c612a76565b611f946125f9565b611f9e8282612bc6565b5050565b611faa612a76565b611f5e6001612cd4565b600854600090611dfd9060c0603f612d2b565b7f000000000000000000000000000000000000000000000000000000000000000090565b600060606120018651611ffc612d3a565b612d3f565b61201689898989898989612d4c612d9e612e07565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b606080886120706105c861221d565b61207b6105ee611eed565b6060600061208886612fbc565b156120b057612095612feb565b6120a7896120a1611dc4565b88612ffe565b92509050612102565b6120b861302a565b60606120c261260c565b90506120ce8a8261277f565b6120f28d8d8d8d8d6120de612321565b6120e8578d6120eb565b60005b878e612d4c565b935091506121008382612d9e565b505b61210c8b82613032565b81895167ffffffffffffffff8111801561212557600080fd5b5060405190808252806020026020018201604052801561214f578160200160208202803683370190505b509450945050505b5097509795505050505050565b6000611dbe82612241565b612177612a76565b611f5e6001612b35565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016121b6929190614421565b604051602081830303815290604052805190602001209050919050565b600060606121e48651611ffc612d3a565b6120168989898989898961303c613058612e07565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611da35780601f10611d7857610100808354040283529160200191611da3565b6000806122ca338561253a565b90508083106122e4576122df338560006128c9565b6122f1565b6122f133858584036128c9565b5060019392505050565b6000611dba338484612996565b6000611dfd6130c1565b6009546001600160a01b031690565b600854600090611dfd9060ff61313b565b61233a612a76565b611f5e6000612cd4565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886123bb8c612241565b896040516020016123d1969594939291906145de565b60405160208183030381529060405280519060200120905061240288826123f9878787613145565b886101f8613184565b61240d8888886128c9565b5050505050505050565b606080886124266105c861221d565b6124316105ee611eed565b61243961302a565b606061244361260c565b905061244d611dc4565b6124fa57600060606124628d8d8d868b6131db565b9150915061247b612471613300565b83101560cc6125eb565b61248d6000612488613300565b613307565b6124a08b612499613300565b8403613307565b6124aa8184613058565b808a5167ffffffffffffffff811180156124c357600080fd5b506040519080825280602002602001820160405280156124ed578160200160208202803683370190505b5095509550505050612157565b612504888261277f565b6000606061252c8d8d8d8d8d612518612321565b612522578d612525565b60005b898e61303c565b915091506124a08b83613307565b600061254461221d565b6001600160a01b0316826001600160a01b031614156125665750600019611dbe565b6125708383613311565b9050611dbe565b6000611dfd61333c565b6009546001600160a01b031681565b80611f9e816133d9565b60006125a7848484613457565b506001901b60001901811b1992909216911b1790565b60006125cd8383111560016125eb565b50900390565b60008183106125e257816125e4565b825b9392505050565b81611f9e57611f9e816127fa565b611f5e612604612931565b6101926125eb565b60606000612618612d3a565b905060608167ffffffffffffffff8111801561263357600080fd5b5060405190808252806020026020018201604052801561265d578160200160208202803683370190505b50905060005b82811015612778577f00000000000000000000000000000000000000000000000000000000000000008114156126d1577f00000000000000000000000000000000000000000000000000000000000000008282815181106126c057fe5b602002602001018181525050612770565b7f0000000000000000000000000000000000000000000000000000000000000000811415612726577f00000000000000000000000000000000000000000000000000000000000000008282815181106126c057fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561277057670de0b6b3a764000082828151811061276357fe5b6020026020010181815250505b600101612663565b5091505090565b8151815161278e908290612d3f565b60005b818110156127e8576127c98482815181106127a857fe5b60200260200101518483815181106127bc57fe5b6020026020010151612893565b8482815181106127d557fe5b6020908102919091010152600101612791565b50505050565b60006125e48383612893565b611eea817f42414c000000000000000000000000000000000000000000000000000000000061349e565b600061283382151560046125eb565b8261284057506000611dbe565b670de0b6b3a7640000838102906128639085838161285a57fe5b041460056125eb565b82818161286c57fe5b04915050611dbe565b60006125e48383612824565b60008282016125e484821015836125eb565b60008282026128b78415806128b05750838583816128ad57fe5b04145b60036125eb565b670de0b6b3a764000090049392505050565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061292490859061456f565b60405180910390a3505050565b600061293b612972565b421180611dfd57505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6129ad6001600160a01b03841615156101986125eb565b6129c46001600160a01b03831615156101996125eb565b6129cf838383613452565b6001600160a01b0383166000908152602081905260409020546129f590826101a0613519565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612a249082612881565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061292490859061456f565b6000612aa56000357fffffffff0000000000000000000000000000000000000000000000000000000016612181565b9050611eea612ab4823361352f565b6101916125eb565b612ad1612ac7613618565b82101560cb6125eb565b612ae6612adc613621565b82111560ca6125eb565b600854612af7908260c0603f61259a565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90612b2a90839061456f565b60405180910390a150565b8015612b5557612b50612b4661294e565b42106101936125eb565b612b6a565b612b6a612b60612972565b42106101a96125eb565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490612b2a90839061454c565b6000612bd0611eed565b90506000612bdc61221d565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401612c0992919061465f565b60806040518083038186803b158015612c2157600080fd5b505afa158015612c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c599190614257565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d49250612ca691508590879060040161463e565b600060405180830381600087803b158015612cc057600080fd5b505af115801561240d573d6000803e3d6000fd5b600854612ce3908260ff61362d565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890612d1690839061454c565b60405180910390a180611eea57611eea611f5e565b6001901b6000190191901c1690565b600390565b611f9e81831460676125eb565b600060606000612d5b84613654565b90506001816001811115612d6b57fe5b14612d8057612d7b6101646127fa565b612d90565b612d8a888561366a565b90935091505b509850989650505050505050565b81518151612dad908290612d3f565b60005b818110156127e857612de8848281518110612dc757fe5b6020026020010151848381518110612ddb57fe5b6020026020010151612824565b848281518110612df457fe5b6020908102919091010152600101612db0565b333014612ef6576000306001600160a01b0316600036604051612e2b929190614451565b6000604051808303816000865af19150503d8060008114612e68576040519150601f19603f3d011682016040523d82523d6000602084013e612e6d565b606091505b505090508060008114612e7c57fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb000000000000000000000000000000000000000000000000000000008114612ed8573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b612efe61302a565b6060612f0861260c565b9050612f14878261277f565b60006060612f2c8c8c8c8c8c8c898d8d63ffffffff16565b91509150612f3e81848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b6000808251118015611dbe575060ff801682806020019051810190612fe19190614297565b60ff161492915050565b611f5e612ff6612321565b6101b66125eb565b60006060600061300d8461370d565b9050606061301c878784613723565b919791965090945050505050565b611f5e6125f9565b611f9e82826137d2565b6000606061304b6101646127fa565b9850989650505050505050565b81518151613067908290612d3f565b60005b818110156127e8576130a284828151811061308157fe5b602002602001015184838151811061309557fe5b602002602001015161389e565b8482815181106130ae57fe5b602090810291909101015260010161306a565b60006130cb61221d565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561310357600080fd5b505afa158015613117573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd9190613ee3565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b600061318f856138ec565b90506131a561319f878387613908565b836125eb565b6131b4428410156101b86125eb565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b600060606131e76125f9565b7f00000000000000000000000000000000000000000000000000000000000000006132226001600160a01b03888116908316146101566125eb565b613242816001600160a01b0316876001600160a01b0316146101566125eb565b606061324d856139d5565b90506132ac817f00000000000000000000000000000000000000000000000000000000000000008151811061327e57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006127ee565b817f0000000000000000000000000000000000000000000000000000000000000000815181106132d857fe5b60209081029190910101526dffffffffffffffffffffffffffff999098509650505050505050565b620f424090565b611f9e82826139eb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006133a9613a7e565b306040516020016133be959493929190614612565b60405160208183030381529060405280519060200120905090565b6002815110156133e857611eea565b6000816000815181106133f757fe5b602002602001015190506000600190505b825181101561345257600083828151811061341f57fe5b60200260200101519050613448816001600160a01b0316846001600160a01b03161060656125eb565b9150600101613408565b505050565b613466610100831060646125eb565b61348f60018210158015613488575061348460ff84610100036125d3565b8211155b60646125eb565b61345283821c156101b46125eb565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600061352884841115836125eb565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b61354e6121f9565b6001600160a01b031614158015613569575061356983613a82565b15613591576135766121f9565b6001600160a01b0316336001600160a01b0316149050611dbe565b6135996130c1565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016135c893929190614578565b60206040518083038186803b1580156135e057600080fd5b505afa1580156135f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125709190613da5565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284613643576000613646565b60015b60ff16901b17949350505050565b600081806020019051810190611dbe9190613f4d565b60006060600061367984613af0565b90506060855167ffffffffffffffff8111801561369557600080fd5b506040519080825280602002602001820160405280156136bf578160200160208202803683370190505b50905060005b8651811015613701578681815181106136da57fe5b60200260200101518282815181106136ee57fe5b60209081029190910101526001016136c5565b50909590945092505050565b6000818060200190518101906125e491906142b3565b606060006137318385612824565b9050845167ffffffffffffffff8111801561374b57600080fd5b50604051908082528060200260200182016040528015613775578160200160208202803683370190505b50915060005b85518110156137c9576137aa8287838151811061379457fe5b602002602001015161289390919063ffffffff16565b8382815181106137b657fe5b602090810291909101015260010161377b565b50509392505050565b6137e96001600160a01b038316151561019b6125eb565b6137f582600083613452565b6001600160a01b03821660009081526020819052604090205461381b90826101b2613519565b6001600160a01b03831660009081526020819052604090205561384e61384982613843611dc4565b90613b06565b613b14565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613892919061456f565b60405180910390a35050565b60006138ad82151560046125eb565b826138ba57506000611dbe565b670de0b6b3a7640000838102906138d49085838161285a57fe5b8260018203816138e057fe5b04600101915050611dbe565b60006138f661333c565b826040516020016121b6929190614461565b600061391a82516041146101b96125eb565b60208281015160408085015160608601518251600080825295019283905292939092811a9160019061395390899085908890889061468f565b6020604051602081039080840390855afa158015613975573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b038116158015906139c95750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906125e49190613f96565b6139f760008383613452565b613a0c61384982613a06611dc4565b90612881565b6001600160a01b038216600090815260208190526040902054613a2f9082612881565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061389290859061456f565b4690565b6000613aad7f38e9922e00000000000000000000000000000000000000000000000000000000612181565b821480613ae15750613ade7f50dd6ed900000000000000000000000000000000000000000000000000000000612181565b82145b80611dbe5750611dbe82613b19565b6000818060200190518101906125e49190613f69565b60006125e483836001613519565b600255565b50600090565b604080518082019091526000808252602082015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b8035611dbe816149ff565b600082601f830112613b86578081fd5b8135613b99613b94826149df565b6149b8565b818152915060208083019084810181840286018201871015613bba57600080fd5b60005b84811015613bd957813584529282019290820190600101613bbd565b505050505092915050565b600082601f830112613bf4578081fd5b813567ffffffffffffffff811115613c0a578182fd5b613c3b60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016149b8565b9150808252836020828501011115613c5257600080fd5b8060208401602084013760009082016020015292915050565b8035611dbe81614a14565b600060208284031215613c87578081fd5b81356125e4816149ff565b60008060408385031215613ca4578081fd5b8235613caf816149ff565b91506020830135613cbf816149ff565b809150509250929050565b600080600060608486031215613cde578081fd5b8335613ce9816149ff565b92506020840135613cf9816149ff565b929592945050506040919091013590565b600080600080600080600060e0888a031215613d24578485fd5b8735613d2f816149ff565b96506020880135613d3f816149ff565b955060408801359450606088013593506080880135613d5d81614a21565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215613d8c578182fd5b8235613d97816149ff565b946020939093013593505050565b600060208284031215613db6578081fd5b815180151581146125e4578182fd5b600060208284031215613dd6578081fd5b5051919050565b600080600080600080600060e0888a031215613df7578081fd5b873596506020880135613e09816149ff565b95506040880135613e19816149ff565b9450606088013567ffffffffffffffff80821115613e35578283fd5b613e418b838c01613b76565b955060808a0135945060a08a0135935060c08a0135915080821115613e64578283fd5b50613e718a828b01613be4565b91505092959891949750929550565b60008060408385031215613e92578182fd5b505080516020909101519092909150565b600060208284031215613eb4578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146125e4578182fd5b600060208284031215613ef4578081fd5b81516125e4816149ff565b60008060408385031215613f11578182fd5b8235613f1c816149ff565b9150602083013567ffffffffffffffff811115613f37578182fd5b613f4385828601613be4565b9150509250929050565b600060208284031215613f5e578081fd5b81516125e481614a14565b60008060408385031215613f7b578182fd5b8251613f8681614a14565b6020939093015192949293505050565b60008060408385031215613fa8578182fd5b825160048110613fb6578283fd5b8092505060208084015167ffffffffffffffff811115613fd4578283fd5b8401601f81018613613fe4578283fd5b8051613ff2613b94826149df565b81815283810190838501858402850186018a101561400e578687fd5b8694505b83851015614030578051835260019490940193918501918501614012565b5080955050505050509250929050565b60008060008060808587031215614055578182fd5b843567ffffffffffffffff8082111561406c578384fd5b818701915061012080838a031215614082578485fd5b61408b816149b8565b90506140978984613c6b565b81526140a68960208501613b6b565b60208201526140b88960408501613b6b565b6040820152606083013560608201526080830135608082015260a083013560a08201526140e88960c08501613b6b565b60c08201526140fa8960e08501613b6b565b60e08201526101008084013583811115614112578687fd5b61411e8b828701613be4565b82840152505080965050602087013591508082111561413b578384fd5b5061414887828801613b76565b949794965050505060408301359260600135919050565b600060a08284031215614170578081fd5b61417a60a06149b8565b8251614185816149ff565b8152602083015160038110614198578283fd5b60208201526040830151600581106141ae578283fd5b604082015260608301516141c1816149ff565b60608201526080928301519281019290925250919050565b600060c082840312156141ea578081fd5b6141f460c06149b8565b825181526020830151614206816149ff565b8060208301525060408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b600060208284031215614250578081fd5b5035919050565b6000806000806080858703121561426c578182fd5b845193506020850151925060408501519150606085015161428c816149ff565b939692955090935050565b6000602082840312156142a8578081fd5b81516125e481614a21565b600080604083850312156142c5578182fd5b8251613f8681614a21565b6001600160a01b03169052565b6000815180845260208085019450808401835b8381101561430c578151875295820195908201906001016142f0565b509495945050505050565b60008151808452815b8181101561433c57602081850181015186830182015201614320565b8181111561434d5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012082516002811061439157fe5b8085525060208301516143a760208601826142d0565b5060408301516143ba60408601826142d0565b50606083015160608501526080830151608085015260a083015160a085015260c08301516143eb60c08601826142d0565b5060e08301516143fe60e08601826142d0565b5061010080840151828287015261441783870182614317565b9695505050505050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015260a083015260c082019290925260e08101919091526101000190565b6001600160a01b03929092168252602082015260400190565b6000602082526125e460208301846142dd565b60006040825261453160408301856142dd565b828103602084015261454381856142dd565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9788526001600160a01b03968716602089015294861660408801526060870193909352608086019190915290921660a084015260c083019190915260e08201526101000190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b6000838252604060208301526146576040830184614317565b949350505050565b9182526001600160a01b0316602082015260400190565b6000838252604060208301526146576040830184614380565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526125e46020830184614317565b60208082526016908201527f496e76616c6964207377617070656420746f6b656e7300000000000000000000604082015260600190565b60208082526018908201527f4f726465722062656c6f77206d696e696d756d2073697a650000000000000000604082015260600190565b6020808252601f908201527f496e73756666696369656e7420706f6f6c20746f6b656e2062616c616e636500604082015260600190565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526023908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e0000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600c908201527f496e76616c696420737761700000000000000000000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f722063757272656e637900000000000000000000000000000000606082015260800190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f7220736563757269747900000000000000000000000000000000606082015260800190565b6020808252601d908201527f494e53554646494349454e545f494e5445524e414c5f42414c414e4345000000604082015260600190565b60006060825261496b6060830185614380565b905082516003811061497957fe5b80602084015250602083015160408301529392505050565b60008382526040602083015261465760408301846142dd565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156149d757600080fd5b604052919050565b600067ffffffffffffffff8211156149f5578081fd5b5060209081020190565b6001600160a01b0381168114611eea57600080fd5b60028110611eea57600080fd5b60ff81168114611eea57600080fdfea2646970667358221220ae7da2d668586f6857a25427cc16ebfc2ba40f06c673f6665785abbdb0c701e064736f6c63430007010033608060405260006001553480156200001657600080fd5b5060405162001a3e38038062001a3e833981016040819052620000399162000106565b620000443362000098565b600980546001600160a01b039586166001600160a01b03199182161790915560078054948616948216949094179093556008805492851692841692909217909155600a805491909316911617905562000166565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200010057600080fd5b92915050565b600080600080608085870312156200011c578384fd5b620001288686620000e8565b9350620001398660208701620000e8565b92506200014a8660408701620000e8565b91506200015b8660608701620000e8565b905092959194509250565b6118c880620001766000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063ca142f7511610066578063ca142f75146101c8578063d729cf6c146101e8578063e43372e9146101fb578063f2fde38b14610203576100f5565b8063715018a6146101905780637489ec231461019a5780638da5cb5b146101ad578063c49f3fe3146101b5576100f5565b806346b8b730116100d357806346b8b730146101405780635487e8cf146101555780635778472a146101685780636945c1fd14610188576100f5565b8063014d92b4146100fa5780632541897f1461012357806338fff2d014610138575b600080fd5b61010d6101083660046114f2565b610216565b60405161011a9190611669565b60405180910390f35b61012b6103c9565b60405161011a9190611604565b61010d6103e5565b61014861048e565b60405161011a9190611625565b61010d610163366004611537565b6105e0565b61017b610176366004611491565b610872565b60405161011a9190611785565b61012b610a16565b610198610a32565b005b61010d6101a8366004611491565b610a4a565b61012b610bdb565b6101986101c33660046114c1565b610bf7565b6101db6101d6366004611466565b610ee2565b60405161011a91906117ef565b6101986101f6366004611466565b610fef565b6101486110ba565b61019861021136600461144a565b61111b565b600061024333610224610bdb565b73ffffffffffffffffffffffffffffffffffffffff16146101aa611157565b60026000848152600260205260409020547501000000000000000000000000000000000000000000900460ff16600481111561027b57fe5b146102bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116e0565b60405180910390fd5b60008381526002602052604090206001015473ffffffffffffffffffffffffffffffffffffffff16331461031b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116a9565b6000838152600260208181526040909220015460075491840151909173ffffffffffffffffffffffffffffffffffffffff9182169116148061037c5750600854602084015173ffffffffffffffffffffffffffffffffffffffff9081169116145b156103a75761038f836060015182611169565b600085815260026020819052604090912001556103c0565b6060830151600085815260026020819052604090912001555b90505b92915050565b60075473ffffffffffffffffffffffffffffffffffffffff1690565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338fff2d06040518163ffffffff1660e01b815260040160206040518083038186803b15801561045057600080fd5b505afa158015610464573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048891906114a9565b91505090565b600354606090819067ffffffffffffffff811180156104ac57600080fd5b506040519080825280602002602001820160405280156104d6578160200160208202803683370190505b5090506000805b6003548110156105d8573373ffffffffffffffffffffffffffffffffffffffff16600260006003848154811061050f57fe5b6000918252602080832090910154835282019290925260400190206001015473ffffffffffffffffffffffffffffffffffffffff16148015610595575060028060006003848154811061055e57fe5b9060005260206000200154815260200190815260200160002060000160159054906101000a900460ff16600481111561059357fe5b145b156105d057600381815481106105a757fe5b90600052602060002001548383815181106105be57fe5b60209081029190910101526001909101905b6001016104dd565b509091505090565b60006105ee33610224610bdb565b6000825160028111156105fd57fe5b1480610615575060018251600281111561061357fe5b145b61061e57600080fd5b60015442141561063557600180548101905561063a565b426001555b60008360c001516001546040516020016106559291906115cf565b60405160208183030381529060405280519060200120905061067561127f565b6040518060a00160405280866020015173ffffffffffffffffffffffffffffffffffffffff168152602001856000015160028111156106b057fe5b81526020016002815260c087015173ffffffffffffffffffffffffffffffffffffffff908116602080840191909152606089015160409384015260008681526002808352939020845181547fffffffffffffffffffffffff000000000000000000000000000000000000000016931692909217808355908401519394508493919283917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16907401000000000000000000000000000000000000000090849081111561077857fe5b02179055506040820151815482907fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000008360048111156107cb57fe5b02179055506060820151600182810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155608090920151600290910155600380546000858152600460205260408120829055928101825591527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01829055509392505050565b61087a61127f565b610882610bdb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108d2575060095473ffffffffffffffffffffffffffffffffffffffff1633145b80610903575060008281526002602052604090206001015473ffffffffffffffffffffffffffffffffffffffff1633145b610939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b290611672565b600082815260026020818152604092839020835160a08101909452805473ffffffffffffffffffffffffffffffffffffffff811685529092918401917401000000000000000000000000000000000000000090910460ff169081111561099b57fe5b60028111156109a657fe5b815281546020909101907501000000000000000000000000000000000000000000900460ff1660048111156109d757fe5b60048111156109e257fe5b8152600182015473ffffffffffffffffffffffffffffffffffffffff16602082015260029091015460409091015292915050565b60085473ffffffffffffffffffffffffffffffffffffffff1690565b610a3e33610224610bdb565b610a48600061117b565b565b6000610a5833610224610bdb565b60026000838152600260205260409020547501000000000000000000000000000000000000000000900460ff166004811115610a9057fe5b14610ac7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116e0565b60008281526002602052604090206001015473ffffffffffffffffffffffffffffffffffffffff163314610b27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116a9565b600082815260026020908152604080832080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750300000000000000000000000000000000000000000017905560049091529020546003805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01908110610baf57fe5b906000526020600020016000905560026000838152602001908152602001600020600201549050919050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60095473ffffffffffffffffffffffffffffffffffffffff163314610c48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b290611717565b600084815260026020526040902080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1690558215610cb757600083815260026020526040902080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1690555b60018054810190819055610cc96112af565b506040805160c08101825286815260008781526002602081815284832060019081015473ffffffffffffffffffffffffffffffffffffffff9081168387018181528789018d8152606089018b815260808a018e815260a08b018e8152948a5260058089528c8b208e8c529098529a90982089518155915194820180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169590941694909417909255915193810193909355925160038301559351600482015590519201919091558415610e3957600085815260026020818152604080842060019081015473ffffffffffffffffffffffffffffffffffffffff90811686526005808552838720898852855295839020875181559387015191840180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169290911691909117905584015191810191909155606083015160038201556080830151600482015560a08301519101555b600086815260026020908152604080832060019081015473ffffffffffffffffffffffffffffffffffffffff1684526006835290832060608501518154928301825590845291909220909101558415610eda57600085815260026020908152604080832060019081015473ffffffffffffffffffffffffffffffffffffffff1684526006835290832060608501518154928301825590845291909220909101555b505050505050565b610eea6112af565b610ef2610bdb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f4057503373ffffffffffffffffffffffffffffffffffffffff8416145b610f76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b29061174e565b5073ffffffffffffffffffffffffffffffffffffffff918216600090815260056020818152604080842094845293815291839020835160c081018552815481526001820154909516928501929092526002820154928401929092526003810154606084015260048101546080840152015460a082015290565b610ffb33610224610bdb565b60005b73ffffffffffffffffffffffffffffffffffffffff83166000908152600660205260409020548110156110b55773ffffffffffffffffffffffffffffffffffffffff8316600090815260066020526040902080548391908390811061105f57fe5b906000526020600020015414156110ad5773ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604090208054829081106110a157fe5b60009182526020822001555b600101610ffe565b505050565b3360009081526006602090815260409182902080548351818402810184019094528084526060939283018282801561111157602002820191906000526020600020905b8154815260200190600101908083116110fd575b5050505050905090565b61112733610224610bdb565b61114b73ffffffffffffffffffffffffffffffffffffffff821615156101ab611157565b6111548161117b565b50565b8161116557611165816111f0565b5050565b60008282016103c08482101583611157565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b604452611154917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b6040805160a081019091526000808252602082019081526020016000815260006020820181905260409091015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356103c381611870565b600082601f8301126112ff578081fd5b813567ffffffffffffffff811115611315578182fd5b61134660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611849565b915080825283602082850101111561135d57600080fd5b8060208401602084013760009082016020015292915050565b8035600281106103c357600080fd5b6000610120808385031215611398578182fd5b6113a181611849565b9150506113ae8383611376565b81526113bd83602084016112e4565b60208201526113cf83604084016112e4565b6040820152606082013560608201526080820135608082015260a082013560a08201526113ff8360c084016112e4565b60c08201526114118360e084016112e4565b60e08201526101008083013567ffffffffffffffff81111561143257600080fd5b61143e858286016112ef565b82840152505092915050565b60006020828403121561145b578081fd5b81356103c081611870565b60008060408385031215611478578081fd5b823561148381611870565b946020939093013593505050565b6000602082840312156114a2578081fd5b5035919050565b6000602082840312156114ba578081fd5b5051919050565b600080600080608085870312156114d6578182fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611504578182fd5b82359150602083013567ffffffffffffffff811115611521578182fd5b61152d85828601611385565b9150509250929050565b600080828403606081121561154a578283fd5b833567ffffffffffffffff811115611560578384fd5b61156c86828701611385565b93505060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08201121561159e578182fd5b506115a96040611849565b6020840135600381106115ba578283fd5b81526040939093013560208401525092909150565b60609290921b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000168252601482015260340190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561165d57835183529284019291840191600101611641565b50909695505050505050565b90815260200190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f206f7264657273000000604082015260600190565b6020808252601b908201527f53656e646572206973206e6f74206f726465722063726561746f720000000000604082015260600190565b60208082526017908201527f4f7264657220697320616c72656164792066696c6c6564000000000000000000604082015260600190565b6020808252601c908201527f556e617574686f72697a656420746f207265706f727420747261646500000000604082015260600190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f20747261646573000000604082015260600190565b600060a08201905073ffffffffffffffffffffffffffffffffffffffff8084511683526020840151600381106117b757fe5b60208401526040840151600581106117cb57fe5b80604085015250806060850151166060840152506080830151608083015292915050565b600060c0820190508251825273ffffffffffffffffffffffffffffffffffffffff602084015116602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b60405181810167ffffffffffffffff8111828210171561186857600080fd5b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461115457600080fdfea26469706673582212208fca6a74b683eb7e8f87a927f50fb59fcae94a24cc79504f3e4ba11818259dbb64736f6c63430007010033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102ff5760003560e01c806370a082311161019c578063a9059cbb116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e14610593578063ed24911d146105a6578063fd19cac8146105ae576102ff565b8063d2946c2b14610565578063d505accf1461056d578063d5c096c414610580576102ff565b8063b35056b8116100c8578063b35056b81461054d578063b7b814fc14610555578063ced72f871461055d576102ff565b8063a9059cbb1461052a578063aaabadc51461053d578063ab63c60714610545576102ff565b806387ec68171161015057806390193b7c1161012a57806390193b7c146104fc57806395d89b411461050f578063a457c2d714610517576102ff565b806387ec6817146104d9578063893d20e8146104ec5780638d928af8146104f4576102ff565b80637ecebe00116101815780637ecebe00146104ab5780638456cb59146104be578063851c1bb3146104c6576102ff565b806370a082311461047757806374f3b0091461048a576102ff565b806338e9922e1161025557806350dd6ed9116102095780635c1548fb116101e35780635c1548fb146104465780636028bfd41461044e5780636945c1fd1461046f576102ff565b806350dd6ed91461042357806354a844ba1461043657806355c676281461043e576102ff565b8063395093511161023a57806339509351146104005780633f4ba83a146104135780634d6d0fd01461041b576102ff565b806338e9922e146103e357806338fff2d0146103f8576102ff565b80631dd746ea116102b75780632541897f116102915780632541897f146103b1578063313ce567146103c65780633644e515146103db576102ff565b80631dd746ea1461038157806323b872dd1461039657806325117b72146103a9576102ff565b8063095ea7b3116102e8578063095ea7b31461034257806318160ddd146103625780631c0de0511461036a576102ff565b806301ec954a1461030457806306fdde031461032d575b600080fd5b610317610312366004614040565b6105b6565b604051610324919061456f565b60405180910390f35b610335611d17565b60405161032491906146ad565b610355610350366004613d7a565b611dad565b604051610324919061454c565b610317611dc4565b610372611dca565b60405161032493929190614557565b610389611df3565b604051610324919061450b565b6103556103a4366004613cca565b611e02565b610317611e76565b6103b9611e9a565b6040516103249190614497565b6103ce611ebe565b60405161032491906149aa565b610317611ec7565b6103f66103f136600461423f565b611ed1565b005b610317611eed565b61035561040e366004613d7a565b611f11565b6103f6611f4c565b610317611f60565b6103f6610431366004613eff565b611f84565b6103f6611fa2565b610317611fb4565b610317611fc7565b61046161045c366004613ddd565b611feb565b604051610324929190614991565b6103b9612022565b610317610485366004613c76565b612046565b61049d610498366004613ddd565b612061565b60405161032492919061451e565b6103176104b9366004613c76565b612164565b6103f661216f565b6103176104d4366004613ea3565b612181565b6104616104e7366004613ddd565b6121d3565b6103b96121f9565b6103b961221d565b61031761050a366004613c76565b612241565b61033561225c565b610355610525366004613d7a565b6122bd565b610355610538366004613d7a565b6122fb565b6103b9612308565b6103b9612312565b610355612321565b6103f6612332565b610317612344565b6103b9612368565b6103f661057b366004613d0a565b61238c565b61049d61058e366004613ddd565b612417565b6103176105a1366004613c92565b61253a565b610317612577565b6103b9612581565b600084608001516105e36105c861221d565b6001600160a01b0316336001600160a01b03161460cd6125eb565b6105f86105ee611eed565b82146101f46125eb565b6106006125f9565b60008651600181111561060f57fe5b1480610627575060018651600181111561062557fe5b145b610666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906147f9565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b031614806106df57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b0316145b806106f6575060408601516001600160a01b031630145b8061073657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061077657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061078d575060208601516001600160a01b031630145b6107c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906146c0565b60606107cd61260c565b90506107d9868261277f565b6107e1613b1f565b6000808080808c5160018111156107f457fe5b14156108255761081b8c60600151878c8151811061080e57fe5b60200260200101516127ee565b60608d0152610854565b60018c51600181111561083457fe5b14156108545761084e8c60600151878b8151811061080e57fe5b60608d01525b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480156108a5575060008c5160018111156108a357fe5b145b15610920578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106108db57fe5b6020026020010151101561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614765565b610a85565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316148015610971575060008c51600181111561096f57fe5b145b156109e7578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106109a757fe5b6020026020010151101561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614830565b60208c01516001600160a01b031630148015610a0f575060008c516001811115610a0d57fe5b145b15610a85578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110610a4557fe5b60200260200101511015610a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d9061472e565b6101008c015151156119a3578b6101000151806020019051810190610aaa9190613e80565b90945092508361138e57610abc613b36565b60095460c08e01516040517fca142f750000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163ca142f7591610b0a9188906004016144f2565b60c06040518083038186803b158015610b2257600080fd5b505afa158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5a91906141d9565b60095460c08f015160208301519293506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169392811692635778472a92908216911614610bb4578360400151610bb7565b83515b6040518263ffffffff1660e01b8152600401610bd3919061456f565b60a06040518083038186803b158015610beb57600080fd5b505afa158015610bff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c23919061415f565b516001600160a01b031614610c58577f63757272656e6379000000000000000000000000000000000000000000000000610c7a565b7f73656375726974790000000000000000000000000000000000000000000000005b94507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610ccd575060008d516001811115610ccb57fe5b145b15610d1f57806080015191508c606001518160a0015114610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906148c4565b610dc8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610d70575060008d516001811115610d6e57fe5b145b15610dbd578060a0015191508c60600151816080015114610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614867565b610dc86101646127fa565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610e1b575060208e01516001600160a01b031630145b15610e4757507f53656c6c00000000000000000000000000000000000000000000000000000000610ecf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610e98575060208e01516001600160a01b031630145b15610ec457507f4275790000000000000000000000000000000000000000000000000000000000610ecf565b610ecf6101646127fa565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f73d5870ecc5c28466106f013bf012d6be5b211d5e969d565d4e1cf583d3e56f98f60c001516001600160a01b031684602001516001600160a01b031614610f45578360400151610f48565b83515b7f736563757269747900000000000000000000000000000000000000000000000089146110145760095460408087015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a91610fbb9160040161456f565b60a06040518083038186803b158015610fd357600080fd5b505afa158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b919061415f565b606001516110b2565b60095485516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a9161105d9160040161456f565b60a06040518083038186803b15801561107557600080fd5b505afa158015611089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ad919061415f565b606001515b7f63757272656e63790000000000000000000000000000000000000000000000008a1461117e5760095460408088015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111259160040161456f565b60a06040518083038186803b15801561113d57600080fd5b505afa158015611151573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611175919061415f565b6060015161121c565b60095486516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111c79160040161456f565b60a06040518083038186803b1580156111df57600080fd5b505afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611217919061415f565b606001515b8561123888608001518960a0015161282490919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000008a8a60600151604051611273989796959493929190614597565b60405180910390a26112a982608001517f0000000000000000000000000000000000000000000000000000000000000000612875565b608083015260a08201516112dd907f0000000000000000000000000000000000000000000000000000000000000000612875565b60a083015260095460c08f01516040517fd729cf6c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163d729cf6c916113309189906004016144f2565b600060405180830381600087803b15801561134a57600080fd5b505af115801561135e573d6000803e3d6000fd5b5050505061137f83898d8151811061137257fe5b6020026020010151612875565b99505050505050505050611d0e565b837f4c696d69740000000000000000000000000000000000000000000000000000001480156113bc57508215155b156113dd57604080518082019091528060018152602001849052945061199e565b826115ec577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316148061145b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316145b8015611473575060208c01516001600160a01b031630145b801561148b575060008c51600181111561148957fe5b145b156115dc576009546040517f7489ec230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690637489ec23906114d990879060040161456f565b602060405180830381600087803b1580156114f357600080fd5b505af1158015611507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152b9190613dc5565b90508b60600151811461156a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d9061479c565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b6040516115b79897969594939291906144ab565b60405180910390a16115cf81878b8151811061137257fe5b9750505050505050611d0e565b6115e76101646127fa565b61199e565b82156119935760208c01516001600160a01b03163014801561161a575060008c51600181111561161857fe5b145b156117895761167b83611676856116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b612893565b6125bd565b90507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b6040516116ca9897969594939291906144ab565b60405180910390a1600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b8152600401611715929190614676565b602060405180830381600087803b15801561172f57600080fd5b505af1158015611743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117679190613dc5565b9050611777818d606001516125bd565b90506115cf81878b8151811061137257fe5b60408c01516001600160a01b0316301480156117b1575060008c5160018111156117af57fe5b145b80156117bd5750600083115b156115dc5761181483611676856116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b9150600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b8152600401611859929190614676565b602060405180830381600087803b15801561187357600080fd5b505af1158015611887573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ab9190613dc5565b90506118bb8c6060015182612881565b90508b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106118ee57fe5b6020026020010151101561192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614921565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e60400151848787428b6040516119779897969594939291906144ab565b60405180910390a16115cf8c60600151878b8151811061137257fe5b61199e6101646127fa565b6119ba565b604080518082019091526000808252602082015294505b7f00000000000000000000000000000000000000000000000000000000000000008c606001511015611a18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906146f7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480611a9157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316145b8015611aa9575060408c01516001600160a01b031630145b8015611ac1575060008c516001811115611abf57fe5b145b15611c8d578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110611af757fe5b60200260200101511115611c7d57611b468b7f000000000000000000000000000000000000000000000000000000000000000081518110611b3457fe5b60200260200101518d606001516125bd565b8b7f000000000000000000000000000000000000000000000000000000000000000081518110611b7257fe5b602002602001018181525050611bd8856020015161167687602001516116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b6009546040517f5487e8cf0000000000000000000000000000000000000000000000000000000081529192506001600160a01b031690635487e8cf90611c24908f908990600401614958565b602060405180830381600087803b158015611c3e57600080fd5b505af1158015611c52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c769190613dc5565b9350611c88565b611c886102016127fa565b611c98565b611c986101646127fa565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f60600151896020015186428b604051611ce99897969594939291906144ab565b60405180910390a1611d058c60600151878b8151811061137257fe5b97505050505050505b50949350505050565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611da35780601f10611d7857610100808354040283529160200191611da3565b820191906000526020600020905b815481529060010190602001808311611d8657829003601f168201915b5050505050905090565b6000611dba3384846128c9565b5060015b92915050565b60025490565b6000806000611dd7612931565b159250611de261294e565b9150611dec612972565b9050909192565b6060611dfd61260c565b905090565b600080611e0f853361253a565b9050611e33336001600160a01b0387161480611e2b5750838210155b61019e6125eb565b611e3e858585612996565b336001600160a01b03861614801590611e5957506000198114155b15611e6b57611e6b85338584036128c9565b506001949350505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b6000611dfd612577565b611ed9612a76565b611ee16125f9565b611eea81612abc565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091611dba918590611f479086612881565b6128c9565b611f54612a76565b611f5e6000612b35565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b611f8c612a76565b611f946125f9565b611f9e8282612bc6565b5050565b611faa612a76565b611f5e6001612cd4565b600854600090611dfd9060c0603f612d2b565b7f000000000000000000000000000000000000000000000000000000000000000090565b600060606120018651611ffc612d3a565b612d3f565b61201689898989898989612d4c612d9e612e07565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b606080886120706105c861221d565b61207b6105ee611eed565b6060600061208886612fbc565b156120b057612095612feb565b6120a7896120a1611dc4565b88612ffe565b92509050612102565b6120b861302a565b60606120c261260c565b90506120ce8a8261277f565b6120f28d8d8d8d8d6120de612321565b6120e8578d6120eb565b60005b878e612d4c565b935091506121008382612d9e565b505b61210c8b82613032565b81895167ffffffffffffffff8111801561212557600080fd5b5060405190808252806020026020018201604052801561214f578160200160208202803683370190505b509450945050505b5097509795505050505050565b6000611dbe82612241565b612177612a76565b611f5e6001612b35565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016121b6929190614421565b604051602081830303815290604052805190602001209050919050565b600060606121e48651611ffc612d3a565b6120168989898989898961303c613058612e07565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611da35780601f10611d7857610100808354040283529160200191611da3565b6000806122ca338561253a565b90508083106122e4576122df338560006128c9565b6122f1565b6122f133858584036128c9565b5060019392505050565b6000611dba338484612996565b6000611dfd6130c1565b6009546001600160a01b031690565b600854600090611dfd9060ff61313b565b61233a612a76565b611f5e6000612cd4565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886123bb8c612241565b896040516020016123d1969594939291906145de565b60405160208183030381529060405280519060200120905061240288826123f9878787613145565b886101f8613184565b61240d8888886128c9565b5050505050505050565b606080886124266105c861221d565b6124316105ee611eed565b61243961302a565b606061244361260c565b905061244d611dc4565b6124fa57600060606124628d8d8d868b6131db565b9150915061247b612471613300565b83101560cc6125eb565b61248d6000612488613300565b613307565b6124a08b612499613300565b8403613307565b6124aa8184613058565b808a5167ffffffffffffffff811180156124c357600080fd5b506040519080825280602002602001820160405280156124ed578160200160208202803683370190505b5095509550505050612157565b612504888261277f565b6000606061252c8d8d8d8d8d612518612321565b612522578d612525565b60005b898e61303c565b915091506124a08b83613307565b600061254461221d565b6001600160a01b0316826001600160a01b031614156125665750600019611dbe565b6125708383613311565b9050611dbe565b6000611dfd61333c565b6009546001600160a01b031681565b80611f9e816133d9565b60006125a7848484613457565b506001901b60001901811b1992909216911b1790565b60006125cd8383111560016125eb565b50900390565b60008183106125e257816125e4565b825b9392505050565b81611f9e57611f9e816127fa565b611f5e612604612931565b6101926125eb565b60606000612618612d3a565b905060608167ffffffffffffffff8111801561263357600080fd5b5060405190808252806020026020018201604052801561265d578160200160208202803683370190505b50905060005b82811015612778577f00000000000000000000000000000000000000000000000000000000000000008114156126d1577f00000000000000000000000000000000000000000000000000000000000000008282815181106126c057fe5b602002602001018181525050612770565b7f0000000000000000000000000000000000000000000000000000000000000000811415612726577f00000000000000000000000000000000000000000000000000000000000000008282815181106126c057fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561277057670de0b6b3a764000082828151811061276357fe5b6020026020010181815250505b600101612663565b5091505090565b8151815161278e908290612d3f565b60005b818110156127e8576127c98482815181106127a857fe5b60200260200101518483815181106127bc57fe5b6020026020010151612893565b8482815181106127d557fe5b6020908102919091010152600101612791565b50505050565b60006125e48383612893565b611eea817f42414c000000000000000000000000000000000000000000000000000000000061349e565b600061283382151560046125eb565b8261284057506000611dbe565b670de0b6b3a7640000838102906128639085838161285a57fe5b041460056125eb565b82818161286c57fe5b04915050611dbe565b60006125e48383612824565b60008282016125e484821015836125eb565b60008282026128b78415806128b05750838583816128ad57fe5b04145b60036125eb565b670de0b6b3a764000090049392505050565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061292490859061456f565b60405180910390a3505050565b600061293b612972565b421180611dfd57505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6129ad6001600160a01b03841615156101986125eb565b6129c46001600160a01b03831615156101996125eb565b6129cf838383613452565b6001600160a01b0383166000908152602081905260409020546129f590826101a0613519565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612a249082612881565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061292490859061456f565b6000612aa56000357fffffffff0000000000000000000000000000000000000000000000000000000016612181565b9050611eea612ab4823361352f565b6101916125eb565b612ad1612ac7613618565b82101560cb6125eb565b612ae6612adc613621565b82111560ca6125eb565b600854612af7908260c0603f61259a565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90612b2a90839061456f565b60405180910390a150565b8015612b5557612b50612b4661294e565b42106101936125eb565b612b6a565b612b6a612b60612972565b42106101a96125eb565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490612b2a90839061454c565b6000612bd0611eed565b90506000612bdc61221d565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401612c0992919061465f565b60806040518083038186803b158015612c2157600080fd5b505afa158015612c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c599190614257565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d49250612ca691508590879060040161463e565b600060405180830381600087803b158015612cc057600080fd5b505af115801561240d573d6000803e3d6000fd5b600854612ce3908260ff61362d565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890612d1690839061454c565b60405180910390a180611eea57611eea611f5e565b6001901b6000190191901c1690565b600390565b611f9e81831460676125eb565b600060606000612d5b84613654565b90506001816001811115612d6b57fe5b14612d8057612d7b6101646127fa565b612d90565b612d8a888561366a565b90935091505b509850989650505050505050565b81518151612dad908290612d3f565b60005b818110156127e857612de8848281518110612dc757fe5b6020026020010151848381518110612ddb57fe5b6020026020010151612824565b848281518110612df457fe5b6020908102919091010152600101612db0565b333014612ef6576000306001600160a01b0316600036604051612e2b929190614451565b6000604051808303816000865af19150503d8060008114612e68576040519150601f19603f3d011682016040523d82523d6000602084013e612e6d565b606091505b505090508060008114612e7c57fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb000000000000000000000000000000000000000000000000000000008114612ed8573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b612efe61302a565b6060612f0861260c565b9050612f14878261277f565b60006060612f2c8c8c8c8c8c8c898d8d63ffffffff16565b91509150612f3e81848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b6000808251118015611dbe575060ff801682806020019051810190612fe19190614297565b60ff161492915050565b611f5e612ff6612321565b6101b66125eb565b60006060600061300d8461370d565b9050606061301c878784613723565b919791965090945050505050565b611f5e6125f9565b611f9e82826137d2565b6000606061304b6101646127fa565b9850989650505050505050565b81518151613067908290612d3f565b60005b818110156127e8576130a284828151811061308157fe5b602002602001015184838151811061309557fe5b602002602001015161389e565b8482815181106130ae57fe5b602090810291909101015260010161306a565b60006130cb61221d565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561310357600080fd5b505afa158015613117573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd9190613ee3565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b600061318f856138ec565b90506131a561319f878387613908565b836125eb565b6131b4428410156101b86125eb565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b600060606131e76125f9565b7f00000000000000000000000000000000000000000000000000000000000000006132226001600160a01b03888116908316146101566125eb565b613242816001600160a01b0316876001600160a01b0316146101566125eb565b606061324d856139d5565b90506132ac817f00000000000000000000000000000000000000000000000000000000000000008151811061327e57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006127ee565b817f0000000000000000000000000000000000000000000000000000000000000000815181106132d857fe5b60209081029190910101526dffffffffffffffffffffffffffff999098509650505050505050565b620f424090565b611f9e82826139eb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006133a9613a7e565b306040516020016133be959493929190614612565b60405160208183030381529060405280519060200120905090565b6002815110156133e857611eea565b6000816000815181106133f757fe5b602002602001015190506000600190505b825181101561345257600083828151811061341f57fe5b60200260200101519050613448816001600160a01b0316846001600160a01b03161060656125eb565b9150600101613408565b505050565b613466610100831060646125eb565b61348f60018210158015613488575061348460ff84610100036125d3565b8211155b60646125eb565b61345283821c156101b46125eb565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600061352884841115836125eb565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b61354e6121f9565b6001600160a01b031614158015613569575061356983613a82565b15613591576135766121f9565b6001600160a01b0316336001600160a01b0316149050611dbe565b6135996130c1565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016135c893929190614578565b60206040518083038186803b1580156135e057600080fd5b505afa1580156135f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125709190613da5565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284613643576000613646565b60015b60ff16901b17949350505050565b600081806020019051810190611dbe9190613f4d565b60006060600061367984613af0565b90506060855167ffffffffffffffff8111801561369557600080fd5b506040519080825280602002602001820160405280156136bf578160200160208202803683370190505b50905060005b8651811015613701578681815181106136da57fe5b60200260200101518282815181106136ee57fe5b60209081029190910101526001016136c5565b50909590945092505050565b6000818060200190518101906125e491906142b3565b606060006137318385612824565b9050845167ffffffffffffffff8111801561374b57600080fd5b50604051908082528060200260200182016040528015613775578160200160208202803683370190505b50915060005b85518110156137c9576137aa8287838151811061379457fe5b602002602001015161289390919063ffffffff16565b8382815181106137b657fe5b602090810291909101015260010161377b565b50509392505050565b6137e96001600160a01b038316151561019b6125eb565b6137f582600083613452565b6001600160a01b03821660009081526020819052604090205461381b90826101b2613519565b6001600160a01b03831660009081526020819052604090205561384e61384982613843611dc4565b90613b06565b613b14565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613892919061456f565b60405180910390a35050565b60006138ad82151560046125eb565b826138ba57506000611dbe565b670de0b6b3a7640000838102906138d49085838161285a57fe5b8260018203816138e057fe5b04600101915050611dbe565b60006138f661333c565b826040516020016121b6929190614461565b600061391a82516041146101b96125eb565b60208281015160408085015160608601518251600080825295019283905292939092811a9160019061395390899085908890889061468f565b6020604051602081039080840390855afa158015613975573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b038116158015906139c95750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906125e49190613f96565b6139f760008383613452565b613a0c61384982613a06611dc4565b90612881565b6001600160a01b038216600090815260208190526040902054613a2f9082612881565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061389290859061456f565b4690565b6000613aad7f38e9922e00000000000000000000000000000000000000000000000000000000612181565b821480613ae15750613ade7f50dd6ed900000000000000000000000000000000000000000000000000000000612181565b82145b80611dbe5750611dbe82613b19565b6000818060200190518101906125e49190613f69565b60006125e483836001613519565b600255565b50600090565b604080518082019091526000808252602082015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b8035611dbe816149ff565b600082601f830112613b86578081fd5b8135613b99613b94826149df565b6149b8565b818152915060208083019084810181840286018201871015613bba57600080fd5b60005b84811015613bd957813584529282019290820190600101613bbd565b505050505092915050565b600082601f830112613bf4578081fd5b813567ffffffffffffffff811115613c0a578182fd5b613c3b60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016149b8565b9150808252836020828501011115613c5257600080fd5b8060208401602084013760009082016020015292915050565b8035611dbe81614a14565b600060208284031215613c87578081fd5b81356125e4816149ff565b60008060408385031215613ca4578081fd5b8235613caf816149ff565b91506020830135613cbf816149ff565b809150509250929050565b600080600060608486031215613cde578081fd5b8335613ce9816149ff565b92506020840135613cf9816149ff565b929592945050506040919091013590565b600080600080600080600060e0888a031215613d24578485fd5b8735613d2f816149ff565b96506020880135613d3f816149ff565b955060408801359450606088013593506080880135613d5d81614a21565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215613d8c578182fd5b8235613d97816149ff565b946020939093013593505050565b600060208284031215613db6578081fd5b815180151581146125e4578182fd5b600060208284031215613dd6578081fd5b5051919050565b600080600080600080600060e0888a031215613df7578081fd5b873596506020880135613e09816149ff565b95506040880135613e19816149ff565b9450606088013567ffffffffffffffff80821115613e35578283fd5b613e418b838c01613b76565b955060808a0135945060a08a0135935060c08a0135915080821115613e64578283fd5b50613e718a828b01613be4565b91505092959891949750929550565b60008060408385031215613e92578182fd5b505080516020909101519092909150565b600060208284031215613eb4578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146125e4578182fd5b600060208284031215613ef4578081fd5b81516125e4816149ff565b60008060408385031215613f11578182fd5b8235613f1c816149ff565b9150602083013567ffffffffffffffff811115613f37578182fd5b613f4385828601613be4565b9150509250929050565b600060208284031215613f5e578081fd5b81516125e481614a14565b60008060408385031215613f7b578182fd5b8251613f8681614a14565b6020939093015192949293505050565b60008060408385031215613fa8578182fd5b825160048110613fb6578283fd5b8092505060208084015167ffffffffffffffff811115613fd4578283fd5b8401601f81018613613fe4578283fd5b8051613ff2613b94826149df565b81815283810190838501858402850186018a101561400e578687fd5b8694505b83851015614030578051835260019490940193918501918501614012565b5080955050505050509250929050565b60008060008060808587031215614055578182fd5b843567ffffffffffffffff8082111561406c578384fd5b818701915061012080838a031215614082578485fd5b61408b816149b8565b90506140978984613c6b565b81526140a68960208501613b6b565b60208201526140b88960408501613b6b565b6040820152606083013560608201526080830135608082015260a083013560a08201526140e88960c08501613b6b565b60c08201526140fa8960e08501613b6b565b60e08201526101008084013583811115614112578687fd5b61411e8b828701613be4565b82840152505080965050602087013591508082111561413b578384fd5b5061414887828801613b76565b949794965050505060408301359260600135919050565b600060a08284031215614170578081fd5b61417a60a06149b8565b8251614185816149ff565b8152602083015160038110614198578283fd5b60208201526040830151600581106141ae578283fd5b604082015260608301516141c1816149ff565b60608201526080928301519281019290925250919050565b600060c082840312156141ea578081fd5b6141f460c06149b8565b825181526020830151614206816149ff565b8060208301525060408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b600060208284031215614250578081fd5b5035919050565b6000806000806080858703121561426c578182fd5b845193506020850151925060408501519150606085015161428c816149ff565b939692955090935050565b6000602082840312156142a8578081fd5b81516125e481614a21565b600080604083850312156142c5578182fd5b8251613f8681614a21565b6001600160a01b03169052565b6000815180845260208085019450808401835b8381101561430c578151875295820195908201906001016142f0565b509495945050505050565b60008151808452815b8181101561433c57602081850181015186830182015201614320565b8181111561434d5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012082516002811061439157fe5b8085525060208301516143a760208601826142d0565b5060408301516143ba60408601826142d0565b50606083015160608501526080830151608085015260a083015160a085015260c08301516143eb60c08601826142d0565b5060e08301516143fe60e08601826142d0565b5061010080840151828287015261441783870182614317565b9695505050505050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015260a083015260c082019290925260e08101919091526101000190565b6001600160a01b03929092168252602082015260400190565b6000602082526125e460208301846142dd565b60006040825261453160408301856142dd565b828103602084015261454381856142dd565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9788526001600160a01b03968716602089015294861660408801526060870193909352608086019190915290921660a084015260c083019190915260e08201526101000190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b6000838252604060208301526146576040830184614317565b949350505050565b9182526001600160a01b0316602082015260400190565b6000838252604060208301526146576040830184614380565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526125e46020830184614317565b60208082526016908201527f496e76616c6964207377617070656420746f6b656e7300000000000000000000604082015260600190565b60208082526018908201527f4f726465722062656c6f77206d696e696d756d2073697a650000000000000000604082015260600190565b6020808252601f908201527f496e73756666696369656e7420706f6f6c20746f6b656e2062616c616e636500604082015260600190565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526023908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e0000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600c908201527f496e76616c696420737761700000000000000000000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f722063757272656e637900000000000000000000000000000000606082015260800190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f7220736563757269747900000000000000000000000000000000606082015260800190565b6020808252601d908201527f494e53554646494349454e545f494e5445524e414c5f42414c414e4345000000604082015260600190565b60006060825261496b6060830185614380565b905082516003811061497957fe5b80602084015250602083015160408301529392505050565b60008382526040602083015261465760408301846142dd565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156149d757600080fd5b604052919050565b600067ffffffffffffffff8211156149f5578081fd5b5060209081020190565b6001600160a01b0381168114611eea57600080fd5b60028110611eea57600080fd5b60ff81168114611eea57600080fdfea2646970667358221220ae7da2d668586f6857a25427cc16ebfc2ba40f06c673f6665785abbdb0c701e064736f6c63430007010033", "linkReferences": {}, "deployedLinkReferences": {} } \ No newline at end of file diff --git a/abis/MarginTradingPoolFactory.json b/abis/MarginTradingPoolFactory.json index 8fe3cbffb..48ba8873b 100644 --- a/abis/MarginTradingPoolFactory.json +++ b/abis/MarginTradingPoolFactory.json @@ -256,8 +256,8 @@ "type": "function" } ], - "bytecode": "0x6101806040523480156200001257600080fd5b506040516200881a3803806200881a8339810160408190526200003591620001fc565b8181604051806020016200004990620001ee565b601f1982820381018352601f90910116604052805183903090839060006002820460a081905280830360e08190528185529091508362000095816200010f602090811b6200047a17901c565b60601b6001600160601b0319166080528285018051838252620000c4826200010f602090811b6200047a17901c565b6001600160601b0319606091821b811660c05296909352905261010095909552505092821b831661012052509290921b90911661014052505050426276a70001610160525062000250565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506200015d6001600160a01b03831615156101ac62000163565b50919050565b816200017457620001748162000178565b5050565b6200018a816210905360ea1b6200018d565b50565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b6177a5806200107583390190565b600080604083850312156200020f578182fd5b82516200021c816200023a565b60208401519092506200022f816200023a565b809150509250929050565b6001600160a01b03811681146200018a57600080fd5b60805160601c60a05160c05160601c60e051610100516101205160601c6101405160601c61016051610dac620002c96000398061025c528061028552508061035b5250806103d15250806103815250806104e1525080610233528061055d52508061050252508061021252806105395250610dac6000f3fe608060405234801561001057600080fd5b50600436106100c85760003560e01c80636634b75311610081578063851c1bb31161005b578063851c1bb3146101715780638d928af814610191578063aaabadc514610199576100c8565b80636634b753146101415780636c57f5a914610161578063739238d614610169576100c8565b8063174481fa116100b2578063174481fa1461010b5780632da47c40146101215780632f2770db14610137576100c8565b8062c194db146100cd57806309f3a67e146100eb575b600080fd5b6100d56101a1565b6040516100e29190610c01565b60405180910390f35b6100fe6100f93660046109d0565b6101c0565b6040516100e29190610b79565b610113610210565b6040516100e2929190610b9a565b610129610256565b6040516100e2929190610d1f565b61013f6102c0565b005b61015461014f366004610938565b610325565b6040516100e29190610bc1565b610154610350565b6100fe610359565b61018461017f366004610974565b61037d565b6040516100e29190610bcc565b6100fe6103cf565b6100fe6103f3565b60606101bb604051806020016040528060008152506104d9565b905090565b60008060006101cd610256565b915091506102086101dc6103cf565b858484336040516020016101f4959493929190610c14565b6040516020818303038152906040526105b2565b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156102b257807f000000000000000000000000000000000000000000000000000000000000000003925062278d0091506102bb565b60009250600091505b509091565b6102c8610646565b6102d061068f565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103b2929190610b49565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103fd6103cf565b73ffffffffffffffffffffffffffffffffffffffff1663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561044257600080fd5b505afa158015610456573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bb91906109b4565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506104d373ffffffffffffffffffffffffffffffffffffffff831615156101ac6106a4565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c50602089810190898501016105a48183866106b6565b505050505050505050919050565b60006105bc61068f565b60006105c783610730565b73ffffffffffffffffffffffffffffffffffffffff811660008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006106756000357fffffffff000000000000000000000000000000000000000000000000000000001661037d565b905061068c6106848233610778565b6101916106a4565b50565b6106a261069a610350565b1560d36106a4565b565b816106b2576106b281610817565b5050565b5b602081106106f45781518352602092830192909101907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0016106b7565b905182516020929092036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199091169116179052565b6000606061073d836104d9565b905060008151602083016000f0905073ffffffffffffffffffffffffffffffffffffffff8116610771573d6000803e3d6000fd5b9392505050565b60006107826103f3565b73ffffffffffffffffffffffffffffffffffffffff16639be2a8848484306040518463ffffffff1660e01b81526004016107be93929190610bd5565b60206040518083038186803b1580156107d657600080fd5b505afa1580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190610954565b90505b92915050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b60445261068c917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b803561081181610d54565b600082601f8301126108c1578081fd5b813567ffffffffffffffff8111156108d7578182fd5b61090860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610d2d565b915080825283602082850101111561091f57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610949578081fd5b813561077181610d54565b600060208284031215610965578081fd5b81518015158114610771578182fd5b600060208284031215610985578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610771578182fd5b6000602082840312156109c5578081fd5b815161077181610d54565b6000602082840312156109e1578081fd5b813567ffffffffffffffff808211156109f8578283fd5b8184019150610140808387031215610a0e578384fd5b610a1781610d2d565b9050823582811115610a27578485fd5b610a33878286016108b1565b825250602083013582811115610a47578485fd5b610a53878286016108b1565b602083015250610a6686604085016108a6565b604082015260608301356060820152610a8286608085016108a6565b608082015260a0838101359082015260c0808401359082015260e0808401359082015261010080840135908201526101209283013592810192909252509392505050565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452815b81811015610b0557602081850181015186830182015201610ae9565b81811115610b165782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b901515815260200190565b90815260200190565b92835273ffffffffffffffffffffffffffffffffffffffff918216602084015216604082015260600190565b60006020825261080e6020830184610ae0565b600073ffffffffffffffffffffffffffffffffffffffff8716825260a0602083015285516101408060a0850152610c4f6101e0850183610ae0565b915060208801517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608584030160c0860152610c8a8382610ae0565b9250506040880151610c9f60e0860182610ac6565b506060880151610100818187015260808a01519150610120610cc381880184610ac6565b60a08b01519387019390935260c08a015161016087015260e08a01516101808701528901516101a0860152508701516101c084015260408301869052606083018590529050610d156080830184610ac6565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610d4c57600080fd5b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461068c57600080fdfea2646970667358221220ee5f1dffb46aad59dac7b1369875bd4b4bf4c134e3dd4aeb7ceefb01f4610d6764736f6c634300070100336103406040523480156200001257600080fd5b50604051620077a5380380620077a5833981016040819052620000359162000c0f565b846000856000015186602001516200005d88604001518960800151306200057060201b60201c565b60408051600380825260808201909252906020820160608036833701905050896101200151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000ce92919062000a91565b508051620000e490600490602084019062000a91565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016290506276a7008311156101946200063f565b6200017662278d008211156101956200063f565b429091016101408190520161016052855162000198906002111560c86200063f565b620001b2620001a662000654565b8751111560c96200063f565b620001c8866200065960201b620028961760201c565b620001d38462000665565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000204908d9060040162000e82565b602060405180830381600087803b1580156200021f57600080fd5b505af115801562000234573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025a919062000bd7565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028f9084908b908b9060040162000da2565b600060405180830381600087803b158015620002aa57600080fd5b505af1158015620002bf573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030657600080fd5b505afa1580156200031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000341919062000bf0565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083608001516001600160a01b03166101e0816001600160a01b031660601b8152505084600a60006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000806000620003f48760400151886080015130620006f960201b60201c565b6102c08190526102e083905261030082905260408a015192955090935091506200041e90620007ef565b6102005260808701516200043290620007ef565b6102205260e0870151610240526101008701516102605260c0870151610280526101208701516102a0526001600160601b0319606085901b16610320526040808801516080890151915186929030906200048c9062000b16565b6200049b949392919062000d77565b604051809103906000f080158015620004b8573d6000803e3d6000fd5b50600960006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086604001516001600160a01b03167f3d3c4c037711d546c8299d521821c31f3d622836675303d87dce53bb231a863688606001518960c001518a608001518b60e001518c61010001518d60a00151600960009054906101000a90046001600160a01b03168c6040516200055a98979695949392919062000e3e565b60405180910390a2505050505050505062000ee9565b60606000808062000583878787620006f9565b6040805160038082526080820190925293965091945092506020820160608036833701905050935086848481518110620005b957fe5b60200260200101906001600160a01b031690816001600160a01b03168152505085848381518110620005e757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200061557fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b8162000650576200065081620008c3565b5050565b600390565b806200065081620008d8565b6200067e6200067362000964565b82101560cb6200063f565b620006976200068c6200096d565b82111560ca6200063f565b620006b98160c0603f6008546200097960201b620028a017909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90620006ee90839062000e97565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200078257836001600160a01b0316856001600160a01b0316101562000745575060009150600190506002620007e6565b836001600160a01b0316866001600160a01b0316101562000771575060009150600290506001620007e6565b5060019150600290506000620007e6565b846001600160a01b0316846001600160a01b03161015620007ae575060029150600190506000620007e6565b856001600160a01b0316846001600160a01b03161015620007da575060029150600090506001620007e6565b50600191506000905060025b93509350939050565b60006001600160a01b038216301415620008135750670de0b6b3a7640000620008be565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200084f57600080fd5b505afa15801562000864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200088a919062000d54565b60ff1690506000620008a96012836200099e60201b620028c31760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b620008d5816210905360ea1b620009bb565b50565b600281511015620008e957620008d5565b600081600081518110620008f957fe5b602002602001015190506000600190505b82518110156200095f5760008382815181106200092357fe5b6020026020010151905062000954816001600160a01b0316846001600160a01b03161060656200063f60201b60201c565b91506001016200090a565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200098884848462000a1c565b506001901b60001901811b1992909216911b1790565b6000620009b08383111560016200063f565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b62000a2d610100831060646200063f565b62000a666001821015801562000a5e575062000a5a60ff846101000362000a7760201b620028d91760201c565b8211155b60646200063f565b6200095f83821c156101b46200063f565b600081831062000a88578162000a8a565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000ad457805160ff191683800117855562000b04565b8280016001018555821562000b04579182015b8281111562000b0457825182559160200191906001019062000ae7565b5062000b1292915062000b24565b5090565b6119128062005e9383390190565b5b8082111562000b12576000815560010162000b25565b8051620009b58162000ed3565b600082601f83011262000b59578081fd5b81516001600160401b0381111562000b6f578182fd5b602062000b85601f8301601f1916820162000ea0565b9250818352848183860101111562000b9c57600080fd5b60005b8281101562000bbc57848101820151848201830152810162000b9f565b8281111562000bce5760008284860101525b50505092915050565b60006020828403121562000be9578081fd5b5051919050565b60006020828403121562000c02578081fd5b815162000a8a8162000ed3565b600080600080600060a0868803121562000c27578081fd5b855162000c348162000ed3565b60208701519095506001600160401b038082111562000c51578283fd5b818801915061014080838b03121562000c68578384fd5b62000c738162000ea0565b905082518281111562000c84578485fd5b62000c928b82860162000b48565b82525060208301518281111562000ca7578485fd5b62000cb58b82860162000b48565b60208301525062000cca8a6040850162000b3b565b60408201526060830151606082015262000ce88a6080850162000b3b565b608082015260a083015160a082015260c083015160c082015260e083015160e08201526101009150818301518282015261012091508183015182820152809650505050604086015192506060860151915062000d48876080880162000b3b565b90509295509295909350565b60006020828403121562000d66578081fd5b815160ff8116811462000a8a578182fd5b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000dee5762000ddb855162000ec7565b8352938301939183019160010162000dc6565b505084810360408601528551808252908201925081860190845b8181101562000e305762000e1d835162000ec7565b8552938301939183019160010162000e08565b509298975050505050505050565b97885260208801969096526001600160a01b0394851660408801526060870193909352608086019190915260a0850152811660c08401521660e08201526101000190565b602081016003831062000e9157fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000ebf57600080fd5b604052919050565b6001600160a01b031690565b6001600160a01b0381168114620008d557600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e051610300516103205160601c614dbe620010d5600039806134ef52508061089f52806129d9528061355b52806135b552508061096b5280612973525080610a095280611bb55280611d5d5280611d9a5280611dd85280612a2e52505080611c4b528061228c52508061173852806117c752806118b352806119f15280611a8f5280611e435280611ee152806122f352508061171752806117a6528061189252806119d05280611a6e5280611e225280611ec052806121a25250806113585280612a01528061358e525080611324528061299b52508061065552806106eb52806108435280610b625280610dc05280610e6b52806112d952806114f852806116c952806118445280611a205280611ce85280611e72528061234e525080610694528061072b528061090f5280610c155280610d1d5280610ee85280610f7052806114b95280611ca952806121c6525080612670525080612219525080612c7a525080612c565250806125495250806125255250806124af5250806136465250806136885250806136675250614dbe6000f3fe608060405234801561001057600080fd5b50600436106102f45760003560e01c806370a0823111610191578063a9059cbb116100e3578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e14610580578063ed24911d14610593578063fd19cac81461059b576102f4565b8063d2946c2b14610552578063d505accf1461055a578063d5c096c41461056d576102f4565b8063ab63c607116100c8578063ab63c6071461053a578063b35056b814610542578063b7b814fc1461054a576102f4565b8063a9059cbb1461051f578063aaabadc514610532576102f4565b806387ec68171161014557806390193b7c1161011f57806390193b7c146104f157806395d89b4114610504578063a457c2d71461050c576102f4565b806387ec6817146104ce578063893d20e8146104e15780638d928af8146104e9576102f4565b80637ecebe00116101765780637ecebe00146104a05780638456cb59146104b3578063851c1bb3146104bb576102f4565b806370a082311461046c57806374f3b0091461047f576102f4565b806338e9922e1161024a57806350dd6ed9116101fe5780635c1548fb116101d85780635c1548fb1461043b5780636028bfd4146104435780636945c1fd14610464576102f4565b806350dd6ed91461041857806354a844ba1461042b57806355c6762814610433576102f4565b8063395093511161022f57806339509351146103f55780633f4ba83a146104085780634d6d0fd014610410576102f4565b806338e9922e146103d857806338fff2d0146103ed576102f4565b80631dd746ea116102ac5780632541897f116102865780632541897f146103a6578063313ce567146103bb5780633644e515146103d0576102f4565b80631dd746ea1461037657806323b872dd1461038b57806325117b721461039e576102f4565b8063095ea7b3116102dd578063095ea7b31461033757806318160ddd146103575780631c0de0511461035f576102f4565b806301ec954a146102f957806306fdde0314610322575b600080fd5b61030c610307366004614346565b6105a3565b60405161031991906148c7565b60405180910390f35b61032a612041565b6040516103199190614a05565b61034a610345366004614080565b6120d7565b60405161031991906148a4565b61030c6120ee565b6103676120f4565b604051610319939291906148af565b61037e61211d565b6040516103199190614863565b61034a610399366004613fd0565b61212c565b61030c6121a0565b6103ae6121c4565b60405161031991906147ef565b6103c36121e8565b6040516103199190614d02565b61030c6121f1565b6103eb6103e6366004614545565b6121fb565b005b61030c612217565b61034a610403366004614080565b61223b565b6103eb612276565b61030c61228a565b6103eb610426366004614205565b6122ae565b6103eb6122cc565b61030c6122de565b61030c6122f1565b6104566104513660046140e3565b612315565b604051610319929190614ce9565b6103ae61234c565b61030c61047a366004613f7c565b612370565b61049261048d3660046140e3565b61238b565b604051610319929190614876565b61030c6104ae366004613f7c565b61248e565b6103eb612499565b61030c6104c93660046141a9565b6124ab565b6104566104dc3660046140e3565b6124fd565b6103ae612523565b6103ae612547565b61030c6104ff366004613f7c565b61256b565b61032a612586565b61034a61051a366004614080565b6125e7565b61034a61052d366004614080565b612625565b6103ae612632565b6103ae61263c565b61034a61264b565b6103eb61265c565b6103ae61266e565b6103eb610568366004614010565b612692565b61049261057b3660046140e3565b61271d565b61030c61058e366004613f98565b612840565b61030c61287d565b6103ae612887565b600084608001516105d06105b5612547565b6001600160a01b0316336001600160a01b03161460cd6128f1565b6105e56105db612217565b82146101f46128f1565b6105ed6128ff565b6000865160018111156105fc57fe5b1480610614575060018651600181111561061257fe5b145b610653576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614b51565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b031614806106cc57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b0316145b806106e3575060408601516001600160a01b031630145b8061072357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061076357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061077a575060208601516001600160a01b031630145b6107b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a18565b60606107ba612912565b90506107c68682612a85565b6107ce613e25565b6000808080808c5160018111156107e157fe5b1415610812576108088c60600151878c815181106107fb57fe5b6020026020010151612af4565b60608d0152610841565b60018c51600181111561082157fe5b14156108415761083b8c60600151878b815181106107fb57fe5b60608d01525b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316148015610892575060008c51600181111561089057fe5b145b1561090d578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106108c857fe5b60200260200101511015610908576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614abd565b610a72565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b031614801561095e575060008c51600181111561095c57fe5b145b156109d4578b606001518b7f00000000000000000000000000000000000000000000000000000000000000008151811061099457fe5b60200260200101511015610908576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614b88565b60208c01516001600160a01b0316301480156109fc575060008c5160018111156109fa57fe5b145b15610a72578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110610a3257fe5b60200260200101511015610a72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a86565b6101008c01515115611c3e578b6101000151806020019051810190610a979190614186565b90945092508361142057610aa9613e3c565b60095460c08e01516040517fca142f750000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163ca142f7591610af791889060040161484a565b60c06040518083038186803b158015610b0f57600080fd5b505afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4791906144df565b60208101519091506001600160a01b0316158015610b9a57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316145b8015610bb2575060208d01516001600160a01b031630145b8015610bca575060008d516001811115610bc857fe5b145b15610bfe57610bf08d60600151888c81518110610be357fe5b6020026020010151612b00565b985050505050505050612038565b60095460c08e015160208301516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811693811692635778472a928216911614610c53578360400151610c56565b83515b6040518263ffffffff1660e01b8152600401610c7291906148c7565b60a06040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc29190614465565b516001600160a01b031614610cf7577f63757272656e6379000000000000000000000000000000000000000000000000610d19565b7f73656375726974790000000000000000000000000000000000000000000000005b94507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610d6c575060008d516001811115610d6a57fe5b145b15610dbe57806080015191508c606001518160a0015114610db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614c1c565b610e67565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610e0f575060008d516001811115610e0d57fe5b145b15610e5c578060a0015191508c60600151816080015114610db9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614bbf565b610e67610163612b0c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610eba575060208e01516001600160a01b031630145b15610ee657507f53656c6c00000000000000000000000000000000000000000000000000000000610f6e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610f37575060208e01516001600160a01b031630145b15610f6357507f4275790000000000000000000000000000000000000000000000000000000000610f6e565b610f6e610163612b0c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f73d5870ecc5c28466106f013bf012d6be5b211d5e969d565d4e1cf583d3e56f98f60c001516001600160a01b031684602001516001600160a01b031614610fe4578360400151610fe7565b83515b7f736563757269747900000000000000000000000000000000000000000000000089146110b35760095460408087015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a9161105a916004016148c7565b60a06040518083038186803b15801561107257600080fd5b505afa158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190614465565b60600151611151565b60095485516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916110fc916004016148c7565b60a06040518083038186803b15801561111457600080fd5b505afa158015611128573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114c9190614465565b606001515b7f63757272656e63790000000000000000000000000000000000000000000000008a1461121d5760095460408088015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111c4916004016148c7565b60a06040518083038186803b1580156111dc57600080fd5b505afa1580156111f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112149190614465565b606001516112bb565b60095486516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a91611266916004016148c7565b60a06040518083038186803b15801561127e57600080fd5b505afa158015611292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b69190614465565b606001515b856112d788608001518960a00151612b3690919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000008a8a606001516040516113129897969594939291906148ef565b60405180910390a261134882608001517f0000000000000000000000000000000000000000000000000000000000000000612b00565b608083015260a082015161137c907f0000000000000000000000000000000000000000000000000000000000000000612b00565b60a083015260095460c08f01516040517fd729cf6c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163d729cf6c916113cf91899060040161484a565b600060405180830381600087803b1580156113e957600080fd5b505af11580156113fd573d6000803e3d6000fd5b5050505061141183898d81518110610be357fe5b99505050505050505050612038565b60405160200161142f906147c6565b604051602081830303815290604052805190602001208414801561145257508215155b1561147457604080518082019091528060015b81526020018490529450611c39565b60405160200161148390614767565b604051602081830303815290604052805190602001208414156114b25760408051808201909152806000611465565b826116c1577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316148061153057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316145b8015611548575060208c01516001600160a01b031630145b8015611560575060008c51600181111561155e57fe5b145b156116b1576009546040517f7489ec230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690637489ec23906115ae9087906004016148c7565b602060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160091906140cb565b90508b60600151811461163f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614af4565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b60405161168c989796959493929190614803565b60405180910390a16116a481878b81518110610be357fe5b9750505050505050612038565b6116bc610163612b0c565b611c39565b8215611c2e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316141561176c5760608c0151611766906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b612b99565b6128c3565b60608d01525b60208c01516001600160a01b031630148015611794575060008c51600181111561179257fe5b145b15611994576117eb836117618561175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b60405161183a989796959493929190614803565b60405180910390a17f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b031614156118dd5760608c01516118d7906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608d01525b600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b81526004016119209291906149ce565b602060405180830381600087803b15801561193a57600080fd5b505af115801561194e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197291906140cb565b9050611982818d606001516128c3565b90506116a481878b81518110610be357fe5b60408c01516001600160a01b0316301480156119bc575060008c5160018111156119ba57fe5b145b156116b1576000611a15846117618661175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90508c6060015192507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d602001516001600160a01b03161415611ab95760608d0151611ab3906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608e01525b600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4868f6040518363ffffffff1660e01b8152600401611afc9291906149ce565b602060405180830381600087803b158015611b1657600080fd5b505af1158015611b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4e91906140cb565b9150611b5e8d6060015183612b87565b91507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378d60c001518e602001518f60400151858886428c604051611ba9989796959493929190614803565b60405180910390a1828c7f000000000000000000000000000000000000000000000000000000000000000081518110611bde57fe5b60200260200101511015611c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614c79565b610bf083888c81518110610be357fe5b611c39610163612b0c565b611c49565b611c49610163612b0c565b7f00000000000000000000000000000000000000000000000000000000000000008c606001511015611ca7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90614a4f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480611d2057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316145b8015611d38575060408c01516001600160a01b031630145b8015611d50575060008c516001811115611d4e57fe5b145b15611fbf578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110611d8657fe5b60200260200101511115611faf57611dd58b7f000000000000000000000000000000000000000000000000000000000000000081518110611dc357fe5b60200260200101518d606001516128c3565b8b7f000000000000000000000000000000000000000000000000000000000000000081518110611e0157fe5b602002602001018181525050611e678560200151611761876020015161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b90508b6060015191507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161415611f0b5760608c0151611f05906117618161175c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b87565b60608d01525b6009546040517f5487e8cf0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690635487e8cf90611f56908f908990600401614cb0565b602060405180830381600087803b158015611f7057600080fd5b505af1158015611f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa891906140cb565b9350611fba565b611fba610201612b0c565b611fca565b611fca610163612b0c565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e6040015185896020015186428b604051612017989796959493929190614803565b60405180910390a161202f82878b81518110610be357fe5b97505050505050505b50949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156120cd5780601f106120a2576101008083540402835291602001916120cd565b820191906000526020600020905b8154815290600101906020018083116120b057829003601f168201915b5050505050905090565b60006120e4338484612bcf565b5060015b92915050565b60025490565b6000806000612101612c37565b15925061210c612c54565b9150612116612c78565b9050909192565b6060612127612912565b905090565b6000806121398533612840565b905061215d336001600160a01b03871614806121555750838210155b61019e6128f1565b612168858585612c9c565b336001600160a01b0386161480159061218357506000198114155b15612195576121958533858403612bcf565b506001949350505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b600061212761287d565b612203612d7c565b61220b6128ff565b61221481612dc2565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916120e49185906122719086612b87565b612bcf565b61227e612d7c565b6122886000612e3b565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b6122b6612d7c565b6122be6128ff565b6122c88282612ecc565b5050565b6122d4612d7c565b6122886001612fda565b6008546000906121279060c0603f613031565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000606061232b8651612326613040565b613045565b612340898989898989896130526130a461310d565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b6060808861239a6105b5612547565b6123a56105db612217565b606060006123b2866132c2565b156123da576123bf6132f1565b6123d1896123cb6120ee565b88613304565b9250905061242c565b6123e2613330565b60606123ec612912565b90506123f88a82612a85565b61241c8d8d8d8d8d61240861264b565b612412578d612415565b60005b878e613052565b9350915061242a83826130a4565b505b6124368b82613338565b81895167ffffffffffffffff8111801561244f57600080fd5b50604051908082528060200260200182016040528015612479578160200160208202803683370190505b509450945050505b5097509795505050505050565b60006120e88261256b565b6124a1612d7c565b6122886001612e3b565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016124e0929190614727565b604051602081830303815290604052805190602001209050919050565b6000606061250e8651612326613040565b6123408989898989898961334261335e61310d565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156120cd5780601f106120a2576101008083540402835291602001916120cd565b6000806125f43385612840565b905080831061260e5761260933856000612bcf565b61261b565b61261b3385858403612bcf565b5060019392505050565b60006120e4338484612c9c565b60006121276133c7565b6009546001600160a01b031690565b6008546000906121279060ff613441565b612664612d7c565b6122886000612fda565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886126c18c61256b565b896040516020016126d796959493929190614936565b60405160208183030381529060405280519060200120905061270888826126ff87878761344b565b886101f861348a565b612713888888612bcf565b5050505050505050565b6060808861272c6105b5612547565b6127376105db612217565b61273f613330565b6060612749612912565b90506127536120ee565b61280057600060606127688d8d8d868b6134e1565b91509150612781612777613606565b83101560cc6128f1565b612793600061278e613606565b61360d565b6127a68b61279f613606565b840361360d565b6127b0818461335e565b808a5167ffffffffffffffff811180156127c957600080fd5b506040519080825280602002602001820160405280156127f3578160200160208202803683370190505b5095509550505050612481565b61280a8882612a85565b600060606128328d8d8d8d8d61281e61264b565b612828578d61282b565b60005b898e613342565b915091506127a68b8361360d565b600061284a612547565b6001600160a01b0316826001600160a01b0316141561286c57506000196120e8565b6128768383613617565b90506120e8565b6000612127613642565b6009546001600160a01b031681565b806122c8816136df565b60006128ad84848461375d565b506001901b60001901811b1992909216911b1790565b60006128d38383111560016128f1565b50900390565b60008183106128e857816128ea565b825b9392505050565b816122c8576122c881612b0c565b61228861290a612c37565b6101926128f1565b6060600061291e613040565b905060608167ffffffffffffffff8111801561293957600080fd5b50604051908082528060200260200182016040528015612963578160200160208202803683370190505b50905060005b82811015612a7e577f00000000000000000000000000000000000000000000000000000000000000008114156129d7577f00000000000000000000000000000000000000000000000000000000000000008282815181106129c657fe5b602002602001018181525050612a76565b7f0000000000000000000000000000000000000000000000000000000000000000811415612a2c577f00000000000000000000000000000000000000000000000000000000000000008282815181106129c657fe5b7f0000000000000000000000000000000000000000000000000000000000000000811415612a7657670de0b6b3a7640000828281518110612a6957fe5b6020026020010181815250505b600101612969565b5091505090565b81518151612a94908290613045565b60005b81811015612aee57612acf848281518110612aae57fe5b6020026020010151848381518110612ac257fe5b6020026020010151612b99565b848281518110612adb57fe5b6020908102919091010152600101612a97565b50505050565b60006128ea8383612b99565b60006128ea8383612b36565b612214817f42414c00000000000000000000000000000000000000000000000000000000006137a4565b6000612b4582151560046128f1565b82612b52575060006120e8565b670de0b6b3a764000083810290612b7590858381612b6c57fe5b041460056128f1565b828181612b7e57fe5b049150506120e8565b60008282016128ea84821015836128f1565b6000828202612bbd841580612bb6575083858381612bb357fe5b04145b60036128f1565b670de0b6b3a764000090049392505050565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590612c2a9085906148c7565b60405180910390a3505050565b6000612c41612c78565b42118061212757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b612cb36001600160a01b03841615156101986128f1565b612cca6001600160a01b03831615156101996128f1565b612cd5838383613758565b6001600160a01b038316600090815260208190526040902054612cfb90826101a061381f565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612d2a9082612b87565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612c2a9085906148c7565b6000612dab6000357fffffffff00000000000000000000000000000000000000000000000000000000166124ab565b9050612214612dba8233613835565b6101916128f1565b612dd7612dcd61391e565b82101560cb6128f1565b612dec612de2613927565b82111560ca6128f1565b600854612dfd908260c0603f6128a0565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90612e309083906148c7565b60405180910390a150565b8015612e5b57612e56612e4c612c54565b42106101936128f1565b612e70565b612e70612e66612c78565b42106101a96128f1565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490612e309083906148a4565b6000612ed6612217565b90506000612ee2612547565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401612f0f9291906149b7565b60806040518083038186803b158015612f2757600080fd5b505afa158015612f3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f5f919061455d565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d49250612fac915085908790600401614996565b600060405180830381600087803b158015612fc657600080fd5b505af1158015612713573d6000803e3d6000fd5b600854612fe9908260ff613933565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c89061301c9083906148a4565b60405180910390a18061221457612214612288565b6001901b6000190191901c1690565b600390565b6122c881831460676128f1565b6000606060006130618461395a565b9050600181600181111561307157fe5b1461308657613081610163612b0c565b613096565b6130908885613970565b90935091505b509850989650505050505050565b815181516130b3908290613045565b60005b81811015612aee576130ee8482815181106130cd57fe5b60200260200101518483815181106130e157fe5b6020026020010151612b36565b8482815181106130fa57fe5b60209081029190910101526001016130b6565b3330146131fc576000306001600160a01b0316600036604051613131929190614757565b6000604051808303816000865af19150503d806000811461316e576040519150601f19603f3d011682016040523d82523d6000602084013e613173565b606091505b50509050806000811461318257fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb0000000000000000000000000000000000000000000000000000000081146131de573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b613204613330565b606061320e612912565b905061321a8782612a85565b600060606132328c8c8c8c8c8c898d8d63ffffffff16565b9150915061324481848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b60008082511180156120e8575060ff8016828060200190518101906132e7919061459d565b60ff161492915050565b6122886132fc61264b565b6101b66128f1565b60006060600061331384613a13565b90506060613322878784613a29565b919791965090945050505050565b6122886128ff565b6122c88282613ad8565b60006060613351610163612b0c565b9850989650505050505050565b8151815161336d908290613045565b60005b81811015612aee576133a884828151811061338757fe5b602002602001015184838151811061339b57fe5b6020026020010151613ba4565b8482815181106133b457fe5b6020908102919091010152600101613370565b60006133d1612547565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561340957600080fd5b505afa15801561341d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212791906141e9565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b600061349585613bf2565b90506134ab6134a5878387613c0e565b836128f1565b6134ba428410156101b86128f1565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b600060606134ed6128ff565b7f00000000000000000000000000000000000000000000000000000000000000006135286001600160a01b03888116908316146101566128f1565b613548816001600160a01b0316876001600160a01b0316146101566128f1565b606061355385613cdb565b90506135b2817f00000000000000000000000000000000000000000000000000000000000000008151811061358457fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000612af4565b817f0000000000000000000000000000000000000000000000000000000000000000815181106135de57fe5b60209081029190910101526dffffffffffffffffffffffffffff999098509650505050505050565b620f424090565b6122c88282613cf1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006136af613d84565b306040516020016136c495949392919061496a565b60405160208183030381529060405280519060200120905090565b6002815110156136ee57612214565b6000816000815181106136fd57fe5b602002602001015190506000600190505b825181101561375857600083828151811061372557fe5b6020026020010151905061374e816001600160a01b0316846001600160a01b03161060656128f1565b915060010161370e565b505050565b61376c610100831060646128f1565b6137956001821015801561378e575061378a60ff84610100036128d9565b8211155b60646128f1565b61375883821c156101b46128f1565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600061382e84841115836128f1565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b613854612523565b6001600160a01b03161415801561386f575061386f83613d88565b156138975761387c612523565b6001600160a01b0316336001600160a01b03161490506120e8565b61389f6133c7565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016138ce939291906148d0565b60206040518083038186803b1580156138e657600080fd5b505afa1580156138fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061287691906140ab565b64e8d4a5100090565b67016345785d8a000090565b60006001821b198416828461394957600061394c565b60015b60ff16901b17949350505050565b6000818060200190518101906120e89190614253565b60006060600061397f84613df6565b90506060855167ffffffffffffffff8111801561399b57600080fd5b506040519080825280602002602001820160405280156139c5578160200160208202803683370190505b50905060005b8651811015613a07578681815181106139e057fe5b60200260200101518282815181106139f457fe5b60209081029190910101526001016139cb565b50909590945092505050565b6000818060200190518101906128ea91906145b9565b60606000613a378385612b36565b9050845167ffffffffffffffff81118015613a5157600080fd5b50604051908082528060200260200182016040528015613a7b578160200160208202803683370190505b50915060005b8551811015613acf57613ab082878381518110613a9a57fe5b6020026020010151612b9990919063ffffffff16565b838281518110613abc57fe5b6020908102919091010152600101613a81565b50509392505050565b613aef6001600160a01b038316151561019b6128f1565b613afb82600083613758565b6001600160a01b038216600090815260208190526040902054613b2190826101b261381f565b6001600160a01b038316600090815260208190526040902055613b54613b4f82613b496120ee565b90613e0c565b613e1a565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613b9891906148c7565b60405180910390a35050565b6000613bb382151560046128f1565b82613bc0575060006120e8565b670de0b6b3a764000083810290613bda90858381612b6c57fe5b826001820381613be657fe5b046001019150506120e8565b6000613bfc613642565b826040516020016124e0929190614790565b6000613c2082516041146101b96128f1565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613c599089908590889088906149e7565b6020604051602081039080840390855afa158015613c7b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b03811615801590613ccf5750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906128ea919061429c565b613cfd60008383613758565b613d12613b4f82613d0c6120ee565b90612b87565b6001600160a01b038216600090815260208190526040902054613d359082612b87565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613b989085906148c7565b4690565b6000613db37f38e9922e000000000000000000000000000000000000000000000000000000006124ab565b821480613de75750613de47f50dd6ed9000000000000000000000000000000000000000000000000000000006124ab565b82145b806120e857506120e882613e1f565b6000818060200190518101906128ea919061426f565b60006128ea8383600161381f565b600255565b50600090565b604080518082019091526000808252602082015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356120e881614d57565b600082601f830112613e8c578081fd5b8135613e9f613e9a82614d37565b614d10565b818152915060208083019084810181840286018201871015613ec057600080fd5b60005b84811015613edf57813584529282019290820190600101613ec3565b505050505092915050565b600082601f830112613efa578081fd5b813567ffffffffffffffff811115613f10578182fd5b613f4160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614d10565b9150808252836020828501011115613f5857600080fd5b8060208401602084013760009082016020015292915050565b80356120e881614d6c565b600060208284031215613f8d578081fd5b81356128ea81614d57565b60008060408385031215613faa578081fd5b8235613fb581614d57565b91506020830135613fc581614d57565b809150509250929050565b600080600060608486031215613fe4578081fd5b8335613fef81614d57565b92506020840135613fff81614d57565b929592945050506040919091013590565b600080600080600080600060e0888a03121561402a578485fd5b873561403581614d57565b9650602088013561404581614d57565b95506040880135945060608801359350608088013561406381614d79565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215614092578182fd5b823561409d81614d57565b946020939093013593505050565b6000602082840312156140bc578081fd5b815180151581146128ea578182fd5b6000602082840312156140dc578081fd5b5051919050565b600080600080600080600060e0888a0312156140fd578081fd5b87359650602088013561410f81614d57565b9550604088013561411f81614d57565b9450606088013567ffffffffffffffff8082111561413b578283fd5b6141478b838c01613e7c565b955060808a0135945060a08a0135935060c08a013591508082111561416a578283fd5b506141778a828b01613eea565b91505092959891949750929550565b60008060408385031215614198578182fd5b505080516020909101519092909150565b6000602082840312156141ba578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146128ea578182fd5b6000602082840312156141fa578081fd5b81516128ea81614d57565b60008060408385031215614217578182fd5b823561422281614d57565b9150602083013567ffffffffffffffff81111561423d578182fd5b61424985828601613eea565b9150509250929050565b600060208284031215614264578081fd5b81516128ea81614d6c565b60008060408385031215614281578182fd5b825161428c81614d6c565b6020939093015192949293505050565b600080604083850312156142ae578182fd5b8251600481106142bc578283fd5b8092505060208084015167ffffffffffffffff8111156142da578283fd5b8401601f810186136142ea578283fd5b80516142f8613e9a82614d37565b81815283810190838501858402850186018a1015614314578687fd5b8694505b83851015614336578051835260019490940193918501918501614318565b5080955050505050509250929050565b6000806000806080858703121561435b578182fd5b843567ffffffffffffffff80821115614372578384fd5b818701915061012080838a031215614388578485fd5b61439181614d10565b905061439d8984613f71565b81526143ac8960208501613e71565b60208201526143be8960408501613e71565b6040820152606083013560608201526080830135608082015260a083013560a08201526143ee8960c08501613e71565b60c08201526144008960e08501613e71565b60e08201526101008084013583811115614418578687fd5b6144248b828701613eea565b828401525050809650506020870135915080821115614441578384fd5b5061444e87828801613e7c565b949794965050505060408301359260600135919050565b600060a08284031215614476578081fd5b61448060a0614d10565b825161448b81614d57565b815260208301516003811061449e578283fd5b60208201526040830151600581106144b4578283fd5b604082015260608301516144c781614d57565b60608201526080928301519281019290925250919050565b600060c082840312156144f0578081fd5b6144fa60c0614d10565b82518152602083015161450c81614d57565b8060208301525060408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b600060208284031215614556578081fd5b5035919050565b60008060008060808587031215614572578182fd5b845193506020850151925060408501519150606085015161459281614d57565b939692955090935050565b6000602082840312156145ae578081fd5b81516128ea81614d79565b600080604083850312156145cb578182fd5b825161428c81614d79565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015614612578151875295820195908201906001016145f6565b509495945050505050565b60008151808452815b8181101561464257602081850181015186830182015201614626565b818111156146535782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012082516002811061469757fe5b8085525060208301516146ad60208601826145d6565b5060408301516146c060408601826145d6565b50606083015160608501526080830151608085015260a083015160a085015260c08301516146f160c08601826145d6565b5060e083015161470460e08601826145d6565b5061010080840151828287015261471d8387018261461d565b9695505050505050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f4d61726b65740000000000000000000000000000000000000000000000000000815260060190565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b7f4c696d6974000000000000000000000000000000000000000000000000000000815260050190565b6001600160a01b0391909116815260200190565b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015260a083015260c082019290925260e08101919091526101000190565b6001600160a01b03929092168252602082015260400190565b6000602082526128ea60208301846145e3565b60006040825261488960408301856145e3565b828103602084015261489b81856145e3565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9788526001600160a01b03968716602089015294861660408801526060870193909352608086019190915290921660a084015260c083019190915260e08201526101000190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b6000838252604060208301526149af604083018461461d565b949350505050565b9182526001600160a01b0316602082015260400190565b6000838252604060208301526149af6040830184614686565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526128ea602083018461461d565b60208082526016908201527f496e76616c6964207377617070656420746f6b656e7300000000000000000000604082015260600190565b60208082526018908201527f4f726465722062656c6f77206d696e696d756d2073697a650000000000000000604082015260600190565b6020808252601f908201527f496e73756666696369656e7420706f6f6c20746f6b656e2062616c616e636500604082015260600190565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526023908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e0000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600c908201527f496e76616c696420737761700000000000000000000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f722063757272656e637900000000000000000000000000000000606082015260800190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f7220736563757269747900000000000000000000000000000000606082015260800190565b6020808252601d908201527f494e53554646494349454e545f494e5445524e414c5f42414c414e4345000000604082015260600190565b600060608252614cc36060830185614686565b9050825160038110614cd157fe5b80602084015250602083015160408301529392505050565b6000838252604060208301526149af60408301846145e3565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715614d2f57600080fd5b604052919050565b600067ffffffffffffffff821115614d4d578081fd5b5060209081020190565b6001600160a01b038116811461221457600080fd5b6002811061221457600080fd5b60ff8116811461221457600080fdfea26469706673582212204023d8be5f78011358098636c25b2ce13aa73bbd223f75aecfda22e4c24fe54f64736f6c63430007010033608060405260006001553480156200001657600080fd5b506040516200191238038062001912833981016040819052620000399162000106565b620000443362000098565b600980546001600160a01b039586166001600160a01b03199182161790915560078054948616948216949094179093556008805492851692841692909217909155600a805491909316911617905562000166565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200010057600080fd5b92915050565b600080600080608085870312156200011c578384fd5b620001288686620000e8565b9350620001398660208701620000e8565b92506200014a8660408701620000e8565b91506200015b8660608701620000e8565b905092959194509250565b61179c80620001766000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063ca142f7511610066578063ca142f75146101c8578063d729cf6c146101e8578063e43372e9146101fb578063f2fde38b14610203576100f5565b8063715018a6146101905780637489ec231461019a5780638da5cb5b146101ad578063c49f3fe3146101b5576100f5565b806346b8b730116100d357806346b8b730146101405780635487e8cf146101555780635778472a146101685780636945c1fd14610188576100f5565b8063014d92b4146100fa5780632541897f1461012357806338fff2d014610138575b600080fd5b61010d6101083660046113fa565b610216565b60405161011a9190611564565b60405180910390f35b61012b610395565b60405161011a919061150c565b61010d6103a4565b610148610433565b60405161011a9190611520565b61010d61016336600461143f565b61056b565b61017b610176366004611399565b6107d6565b60405161011a9190611680565b61012b61092c565b61019861093b565b005b61010d6101a8366004611399565b610953565b61012b610ad7565b6101986101c33660046113c9565b610ae6565b6101db6101d636600461136e565b610e5f565b60405161011a91906116dd565b6101986101f636600461136e565b610f38565b610148610fdc565b610198610211366004611352565b61103d565b600061023633610224610ad7565b6001600160a01b0316146101aa61106c565b60026000848152600260205260409020547501000000000000000000000000000000000000000000900460ff16600481111561026e57fe5b146102ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115db565b60405180910390fd5b6000838152600260205260409020600101546001600160a01b03163314610301576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115a4565b600083815260026020818152604090922001546007549184015190916001600160a01b0391821691161480610348575060085460208401516001600160a01b039081169116145b156103735761035b83606001518261107e565b6000858152600260208190526040909120015561038c565b6060830151600085815260026020819052604090912001555b90505b92915050565b6007546001600160a01b031690565b600080600a60009054906101000a90046001600160a01b03166001600160a01b03166338fff2d06040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f557600080fd5b505afa158015610409573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042d91906113b1565b91505090565b600354606090819067ffffffffffffffff8111801561045157600080fd5b5060405190808252806020026020018201604052801561047b578160200160208202803683370190505b5090506000805b60035481101561056357336001600160a01b031660026000600384815481106104a757fe5b600091825260208083209091015483528201929092526040019020600101546001600160a01b031614801561052057506002806000600384815481106104e957fe5b9060005260206000200154815260200190815260200160002060000160159054906101000a900460ff16600481111561051e57fe5b145b1561055b576003818154811061053257fe5b906000526020600020015483838151811061054957fe5b60209081029190910101526001909101905b600101610482565b509091505090565b600061057933610224610ad7565b60008251600281111561058857fe5b14806105a0575060018251600281111561059e57fe5b145b6105a957600080fd5b6001544214156105c05760018054810190556105c5565b426001555b60008360c001516001546040516020016105e09291906114d7565b604051602081830303815290604052805190602001209050610600611187565b6040518060a0016040528086602001516001600160a01b031681526020018560000151600281111561062e57fe5b81526020016002815260c08701516001600160a01b03908116602080840191909152606089015160409384015260008681526002808352939020845181547fffffffffffffffffffffffff000000000000000000000000000000000000000016931692909217808355908401519394508493919283917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690740100000000000000000000000000000000000000009084908111156106e957fe5b02179055506040820151815482907fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000083600481111561073c57fe5b02179055506060820151600182810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0390931692909217909155608090920151600290910155600380546000858152600460205260408120829055928101825591527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01829055509392505050565b6107de611187565b6107e6610ad7565b6001600160a01b0316336001600160a01b0316148061080f57506009546001600160a01b031633145b8061083357506000828152600260205260409020600101546001600160a01b031633145b610869576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a59061156d565b600082815260026020818152604092839020835160a0810190945280546001600160a01b03811685529092918401917401000000000000000000000000000000000000000090910460ff16908111156108be57fe5b60028111156108c957fe5b815281546020909101907501000000000000000000000000000000000000000000900460ff1660048111156108fa57fe5b600481111561090557fe5b815260018201546001600160a01b0316602082015260029091015460409091015292915050565b6008546001600160a01b031690565b61094733610224610ad7565b6109516000611090565b565b600061096133610224610ad7565b60026000838152600260205260409020547501000000000000000000000000000000000000000000900460ff16600481111561099957fe5b146109d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115db565b6000828152600260205260409020600101546001600160a01b03163314610a23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a5906115a4565b600082815260026020908152604080832080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750300000000000000000000000000000000000000000017905560049091529020546003805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01908110610aab57fe5b906000526020600020016000905560026000838152602001908152602001600020600201549050919050565b6000546001600160a01b031690565b6009546001600160a01b03163314610b2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a590611612565b60008481526002602052604080822080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff90811690915585835291208054909116905560018054810190819055610b806111b7565b6040518060c001604052808781526020016002600089815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b031681526020018681526020018381526020018581526020018481525090508060056000600260008a815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060008481526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015590505080600560006002600089815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060008481526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050155905050600660006002600089815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081606001519080600181540180825580915050600190039060005260206000200160009091909190915055600660006002600088815260200190815260200160002060010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081606001519080600181540180825580915050600190039060005260206000200160009091909190915055505050505050565b610e676111b7565b610e6f610ad7565b6001600160a01b0316336001600160a01b03161480610e965750336001600160a01b038416145b610ecc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102a590611649565b506001600160a01b03918216600090815260056020818152604080842094845293815291839020835160c081018552815481526001820154909516928501929092526002820154928401929092526003810154606084015260048101546080840152015460a082015290565b610f4433610224610ad7565b60005b6001600160a01b038316600090815260066020526040902054811015610fd7576001600160a01b0383166000908152600660205260409020805483919083908110610f8e57fe5b90600052602060002001541415610fcf576001600160a01b0383166000908152600660205260409020805482908110610fc357fe5b60009182526020822001555b600101610f47565b505050565b3360009081526006602090815260409182902080548351818402810184019094528084526060939283018282801561103357602002820191906000526020600020905b81548152602001906001019080831161101f575b5050505050905090565b61104933610224610ad7565b6110606001600160a01b03821615156101ab61106c565b61106981611090565b50565b8161107a5761107a816110f8565b5050565b600082820161038c848210158361106c565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b604452611069917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b6040805160a081019091526000808252602082019081526020016000815260006020820181905260409091015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b803561038f81611751565b600082601f830112611207578081fd5b813567ffffffffffffffff81111561121d578182fd5b61124e60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161172a565b915080825283602082850101111561126557600080fd5b8060208401602084013760009082016020015292915050565b80356002811061038f57600080fd5b60006101208083850312156112a0578182fd5b6112a98161172a565b9150506112b6838361127e565b81526112c583602084016111ec565b60208201526112d783604084016111ec565b6040820152606082013560608201526080820135608082015260a082013560a08201526113078360c084016111ec565b60c08201526113198360e084016111ec565b60e08201526101008083013567ffffffffffffffff81111561133a57600080fd5b611346858286016111f7565b82840152505092915050565b600060208284031215611363578081fd5b813561038c81611751565b60008060408385031215611380578081fd5b823561138b81611751565b946020939093013593505050565b6000602082840312156113aa578081fd5b5035919050565b6000602082840312156113c2578081fd5b5051919050565b600080600080608085870312156113de578182fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561140c578182fd5b82359150602083013567ffffffffffffffff811115611429578182fd5b6114358582860161128d565b9150509250929050565b6000808284036060811215611452578283fd5b833567ffffffffffffffff811115611468578384fd5b6114748682870161128d565b93505060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156114a6578182fd5b506114b1604061172a565b6020840135600381106114c2578283fd5b81526040939093013560208401525092909150565b60609290921b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000168252601482015260340190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156115585783518352928401929184019160010161153c565b50909695505050505050565b90815260200190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f206f7264657273000000604082015260600190565b6020808252601b908201527f53656e646572206973206e6f74206f726465722063726561746f720000000000604082015260600190565b60208082526017908201527f4f7264657220697320616c72656164792066696c6c6564000000000000000000604082015260600190565b6020808252601c908201527f556e617574686f72697a656420746f207265706f727420747261646500000000604082015260600190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f20747261646573000000604082015260600190565b600060a0820190506001600160a01b038084511683526020840151600381106116a557fe5b60208401526040840151600581106116b957fe5b80604085015250806060850151166060840152506080830151608083015292915050565b600060c082019050825182526001600160a01b03602084015116602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b60405181810167ffffffffffffffff8111828210171561174957600080fd5b604052919050565b6001600160a01b038116811461106957600080fdfea2646970667358221220765cd68ea5a59c3e41197cab7f1c30d8bfc5f816e6f20b319305d43e06857a9564736f6c63430007010033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c85760003560e01c80636634b75311610081578063851c1bb31161005b578063851c1bb3146101715780638d928af814610191578063aaabadc514610199576100c8565b80636634b753146101415780636c57f5a914610161578063739238d614610169576100c8565b8063174481fa116100b2578063174481fa1461010b5780632da47c40146101215780632f2770db14610137576100c8565b8062c194db146100cd57806309f3a67e146100eb575b600080fd5b6100d56101a1565b6040516100e29190610c01565b60405180910390f35b6100fe6100f93660046109d0565b6101c0565b6040516100e29190610b79565b610113610210565b6040516100e2929190610b9a565b610129610256565b6040516100e2929190610d1f565b61013f6102c0565b005b61015461014f366004610938565b610325565b6040516100e29190610bc1565b610154610350565b6100fe610359565b61018461017f366004610974565b61037d565b6040516100e29190610bcc565b6100fe6103cf565b6100fe6103f3565b60606101bb604051806020016040528060008152506104d9565b905090565b60008060006101cd610256565b915091506102086101dc6103cf565b858484336040516020016101f4959493929190610c14565b6040516020818303038152906040526105b2565b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156102b257807f000000000000000000000000000000000000000000000000000000000000000003925062278d0091506102bb565b60009250600091505b509091565b6102c8610646565b6102d061068f565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103b2929190610b49565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103fd6103cf565b73ffffffffffffffffffffffffffffffffffffffff1663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561044257600080fd5b505afa158015610456573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bb91906109b4565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506104d373ffffffffffffffffffffffffffffffffffffffff831615156101ac6106a4565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c50602089810190898501016105a48183866106b6565b505050505050505050919050565b60006105bc61068f565b60006105c783610730565b73ffffffffffffffffffffffffffffffffffffffff811660008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006106756000357fffffffff000000000000000000000000000000000000000000000000000000001661037d565b905061068c6106848233610778565b6101916106a4565b50565b6106a261069a610350565b1560d36106a4565b565b816106b2576106b281610817565b5050565b5b602081106106f45781518352602092830192909101907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0016106b7565b905182516020929092036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199091169116179052565b6000606061073d836104d9565b905060008151602083016000f0905073ffffffffffffffffffffffffffffffffffffffff8116610771573d6000803e3d6000fd5b9392505050565b60006107826103f3565b73ffffffffffffffffffffffffffffffffffffffff16639be2a8848484306040518463ffffffff1660e01b81526004016107be93929190610bd5565b60206040518083038186803b1580156107d657600080fd5b505afa1580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190610954565b90505b92915050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b60445261068c917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b803561081181610d54565b600082601f8301126108c1578081fd5b813567ffffffffffffffff8111156108d7578182fd5b61090860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610d2d565b915080825283602082850101111561091f57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610949578081fd5b813561077181610d54565b600060208284031215610965578081fd5b81518015158114610771578182fd5b600060208284031215610985578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610771578182fd5b6000602082840312156109c5578081fd5b815161077181610d54565b6000602082840312156109e1578081fd5b813567ffffffffffffffff808211156109f8578283fd5b8184019150610140808387031215610a0e578384fd5b610a1781610d2d565b9050823582811115610a27578485fd5b610a33878286016108b1565b825250602083013582811115610a47578485fd5b610a53878286016108b1565b602083015250610a6686604085016108a6565b604082015260608301356060820152610a8286608085016108a6565b608082015260a0838101359082015260c0808401359082015260e0808401359082015261010080840135908201526101209283013592810192909252509392505050565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452815b81811015610b0557602081850181015186830182015201610ae9565b81811115610b165782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b901515815260200190565b90815260200190565b92835273ffffffffffffffffffffffffffffffffffffffff918216602084015216604082015260600190565b60006020825261080e6020830184610ae0565b600073ffffffffffffffffffffffffffffffffffffffff8716825260a0602083015285516101408060a0850152610c4f6101e0850183610ae0565b915060208801517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608584030160c0860152610c8a8382610ae0565b9250506040880151610c9f60e0860182610ac6565b506060880151610100818187015260808a01519150610120610cc381880184610ac6565b60a08b01519387019390935260c08a015161016087015260e08a01516101808701528901516101a0860152508701516101c084015260408301869052606083018590529050610d156080830184610ac6565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610d4c57600080fd5b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461068c57600080fdfea2646970667358221220ee5f1dffb46aad59dac7b1369875bd4b4bf4c134e3dd4aeb7ceefb01f4610d6764736f6c63430007010033", + "bytecode": "0x6101806040523480156200001257600080fd5b50604051620085b2380380620085b28339810160408190526200003591620001fc565b8181604051806020016200004990620001ee565b601f1982820381018352601f90910116604052805183903090839060006002820460a081905280830360e08190528185529091508362000095816200010f602090811b6200047a17901c565b60601b6001600160601b0319166080528285018051838252620000c4826200010f602090811b6200047a17901c565b6001600160601b0319606091821b811660c05296909352905261010095909552505092821b831661012052509290921b90911661014052505050426276a70001610160525062000250565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506200015d6001600160a01b03831615156101ac62000163565b50919050565b816200017457620001748162000178565b5050565b6200018a816210905360ea1b6200018d565b50565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b61753d806200107583390190565b600080604083850312156200020f578182fd5b82516200021c816200023a565b60208401519092506200022f816200023a565b809150509250929050565b6001600160a01b03811681146200018a57600080fd5b60805160601c60a05160c05160601c60e051610100516101205160601c6101405160601c61016051610dac620002c96000398061025c528061028552508061035b5250806103d15250806103815250806104e1525080610233528061055d52508061050252508061021252806105395250610dac6000f3fe608060405234801561001057600080fd5b50600436106100c85760003560e01c80636634b75311610081578063851c1bb31161005b578063851c1bb3146101715780638d928af814610191578063aaabadc514610199576100c8565b80636634b753146101415780636c57f5a914610161578063739238d614610169576100c8565b8063174481fa116100b2578063174481fa1461010b5780632da47c40146101215780632f2770db14610137576100c8565b8062c194db146100cd57806309f3a67e146100eb575b600080fd5b6100d56101a1565b6040516100e29190610c01565b60405180910390f35b6100fe6100f93660046109d0565b6101c0565b6040516100e29190610b79565b610113610210565b6040516100e2929190610b9a565b610129610256565b6040516100e2929190610d1f565b61013f6102c0565b005b61015461014f366004610938565b610325565b6040516100e29190610bc1565b610154610350565b6100fe610359565b61018461017f366004610974565b61037d565b6040516100e29190610bcc565b6100fe6103cf565b6100fe6103f3565b60606101bb604051806020016040528060008152506104d9565b905090565b60008060006101cd610256565b915091506102086101dc6103cf565b858484336040516020016101f4959493929190610c14565b6040516020818303038152906040526105b2565b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156102b257807f000000000000000000000000000000000000000000000000000000000000000003925062278d0091506102bb565b60009250600091505b509091565b6102c8610646565b6102d061068f565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103b2929190610b49565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103fd6103cf565b73ffffffffffffffffffffffffffffffffffffffff1663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561044257600080fd5b505afa158015610456573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bb91906109b4565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506104d373ffffffffffffffffffffffffffffffffffffffff831615156101ac6106a4565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c50602089810190898501016105a48183866106b6565b505050505050505050919050565b60006105bc61068f565b60006105c783610730565b73ffffffffffffffffffffffffffffffffffffffff811660008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006106756000357fffffffff000000000000000000000000000000000000000000000000000000001661037d565b905061068c6106848233610778565b6101916106a4565b50565b6106a261069a610350565b1560d36106a4565b565b816106b2576106b281610817565b5050565b5b602081106106f45781518352602092830192909101907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0016106b7565b905182516020929092036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199091169116179052565b6000606061073d836104d9565b905060008151602083016000f0905073ffffffffffffffffffffffffffffffffffffffff8116610771573d6000803e3d6000fd5b9392505050565b60006107826103f3565b73ffffffffffffffffffffffffffffffffffffffff16639be2a8848484306040518463ffffffff1660e01b81526004016107be93929190610bd5565b60206040518083038186803b1580156107d657600080fd5b505afa1580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190610954565b90505b92915050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b60445261068c917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b803561081181610d54565b600082601f8301126108c1578081fd5b813567ffffffffffffffff8111156108d7578182fd5b61090860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610d2d565b915080825283602082850101111561091f57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610949578081fd5b813561077181610d54565b600060208284031215610965578081fd5b81518015158114610771578182fd5b600060208284031215610985578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610771578182fd5b6000602082840312156109c5578081fd5b815161077181610d54565b6000602082840312156109e1578081fd5b813567ffffffffffffffff808211156109f8578283fd5b8184019150610140808387031215610a0e578384fd5b610a1781610d2d565b9050823582811115610a27578485fd5b610a33878286016108b1565b825250602083013582811115610a47578485fd5b610a53878286016108b1565b602083015250610a6686604085016108a6565b604082015260608301356060820152610a8286608085016108a6565b608082015260a0838101359082015260c0808401359082015260e0808401359082015261010080840135908201526101209283013592810192909252509392505050565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452815b81811015610b0557602081850181015186830182015201610ae9565b81811115610b165782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b901515815260200190565b90815260200190565b92835273ffffffffffffffffffffffffffffffffffffffff918216602084015216604082015260600190565b60006020825261080e6020830184610ae0565b600073ffffffffffffffffffffffffffffffffffffffff8716825260a0602083015285516101408060a0850152610c4f6101e0850183610ae0565b915060208801517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608584030160c0860152610c8a8382610ae0565b9250506040880151610c9f60e0860182610ac6565b506060880151610100818187015260808a01519150610120610cc381880184610ac6565b60a08b01519387019390935260c08a015161016087015260e08a01516101808701528901516101a0860152508701516101c084015260408301869052606083018590529050610d156080830184610ac6565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610d4c57600080fd5b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461068c57600080fdfea26469706673582212201ef9217c7f3adbe247f4f3b916e5dc76835a8c1c6f960a1da8e72cb31d3c87d264736f6c634300070100336103406040523480156200001257600080fd5b506040516200753d3803806200753d833981016040819052620000359162000c0f565b846000856000015186602001516200005d88604001518960800151306200057060201b60201c565b60408051600380825260808201909252906020820160608036833701905050896101200151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000ce92919062000a91565b508051620000e490600490602084019062000a91565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016290506276a7008311156101946200063f565b6200017662278d008211156101956200063f565b429091016101408190520161016052855162000198906002111560c86200063f565b620001b2620001a662000654565b8751111560c96200063f565b620001c8866200065960201b620025901760201c565b620001d38462000665565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000204908d9060040162000e82565b602060405180830381600087803b1580156200021f57600080fd5b505af115801562000234573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025a919062000bd7565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028f9084908b908b9060040162000da2565b600060405180830381600087803b158015620002aa57600080fd5b505af1158015620002bf573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030657600080fd5b505afa1580156200031b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000341919062000bf0565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083608001516001600160a01b03166101e0816001600160a01b031660601b8152505084600a60006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000806000620003f48760400151886080015130620006f960201b60201c565b6102c08190526102e083905261030082905260408a015192955090935091506200041e90620007ef565b6102005260808701516200043290620007ef565b6102205260e0870151610240526101008701516102605260c0870151610280526101208701516102a0526001600160601b0319606085901b16610320526040808801516080890151915186929030906200048c9062000b16565b6200049b949392919062000d77565b604051809103906000f080158015620004b8573d6000803e3d6000fd5b50600960006101000a8154816001600160a01b0302191690836001600160a01b0316021790555086604001516001600160a01b03167f3d3c4c037711d546c8299d521821c31f3d622836675303d87dce53bb231a863688606001518960c001518a608001518b60e001518c61010001518d60a00151600960009054906101000a90046001600160a01b03168c6040516200055a98979695949392919062000e3e565b60405180910390a2505050505050505062000ee9565b60606000808062000583878787620006f9565b6040805160038082526080820190925293965091945092506020820160608036833701905050935086848481518110620005b957fe5b60200260200101906001600160a01b031690816001600160a01b03168152505085848381518110620005e757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200061557fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b8162000650576200065081620008c3565b5050565b600390565b806200065081620008d8565b6200067e6200067362000964565b82101560cb6200063f565b620006976200068c6200096d565b82111560ca6200063f565b620006b98160c0603f6008546200097960201b6200259a17909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90620006ee90839062000e97565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200078257836001600160a01b0316856001600160a01b0316101562000745575060009150600190506002620007e6565b836001600160a01b0316866001600160a01b0316101562000771575060009150600290506001620007e6565b5060019150600290506000620007e6565b846001600160a01b0316846001600160a01b03161015620007ae575060029150600190506000620007e6565b856001600160a01b0316846001600160a01b03161015620007da575060029150600090506001620007e6565b50600191506000905060025b93509350939050565b60006001600160a01b038216301415620008135750670de0b6b3a7640000620008be565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200084f57600080fd5b505afa15801562000864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200088a919062000d54565b60ff1690506000620008a96012836200099e60201b620025bd1760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b620008d5816210905360ea1b620009bb565b50565b600281511015620008e957620008d5565b600081600081518110620008f957fe5b602002602001015190506000600190505b82518110156200095f5760008382815181106200092357fe5b6020026020010151905062000954816001600160a01b0316846001600160a01b03161060656200063f60201b60201c565b91506001016200090a565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200098884848462000a1c565b506001901b60001901811b1992909216911b1790565b6000620009b08383111560016200063f565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b62000a2d610100831060646200063f565b62000a666001821015801562000a5e575062000a5a60ff846101000362000a7760201b620025d31760201c565b8211155b60646200063f565b6200095f83821c156101b46200063f565b600081831062000a88578162000a8a565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000ad457805160ff191683800117855562000b04565b8280016001018555821562000b04579182015b8281111562000b0457825182559160200191906001019062000ae7565b5062000b1292915062000b24565b5090565b611a3e8062005aff83390190565b5b8082111562000b12576000815560010162000b25565b8051620009b58162000ed3565b600082601f83011262000b59578081fd5b81516001600160401b0381111562000b6f578182fd5b602062000b85601f8301601f1916820162000ea0565b9250818352848183860101111562000b9c57600080fd5b60005b8281101562000bbc57848101820151848201830152810162000b9f565b8281111562000bce5760008284860101525b50505092915050565b60006020828403121562000be9578081fd5b5051919050565b60006020828403121562000c02578081fd5b815162000a8a8162000ed3565b600080600080600060a0868803121562000c27578081fd5b855162000c348162000ed3565b60208701519095506001600160401b038082111562000c51578283fd5b818801915061014080838b03121562000c68578384fd5b62000c738162000ea0565b905082518281111562000c84578485fd5b62000c928b82860162000b48565b82525060208301518281111562000ca7578485fd5b62000cb58b82860162000b48565b60208301525062000cca8a6040850162000b3b565b60408201526060830151606082015262000ce88a6080850162000b3b565b608082015260a083015160a082015260c083015160c082015260e083015160e08201526101009150818301518282015261012091508183015182820152809650505050604086015192506060860151915062000d48876080880162000b3b565b90509295509295909350565b60006020828403121562000d66578081fd5b815160ff8116811462000a8a578182fd5b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000dee5762000ddb855162000ec7565b8352938301939183019160010162000dc6565b505084810360408601528551808252908201925081860190845b8181101562000e305762000e1d835162000ec7565b8552938301939183019160010162000e08565b509298975050505050505050565b97885260208801969096526001600160a01b0394851660408801526060870193909352608086019190915260a0850152811660c08401521660e08201526101000190565b602081016003831062000e9157fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000ebf57600080fd5b604052919050565b6001600160a01b031690565b6001600160a01b0381168114620008d557600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e051610300516103205160601c614a6662001099600039806131e95250806108b252806126d3528061325552806132af52508061097e528061266d525080610a1c52806118c55280611ace5280611b0b5280611b4952806127285250806123465250806119bc5280611f6252508061164d52806117f05280611bb45280611fc952508061162c52806117cf5280611b935280611e785250806112b952806126fb5280613288525080611285528061269552508061066852806106fe52806108565280610d215280610dcc528061123a52806114235280611a5952806120245250806106a7528061073e52806109225280610b745280610c7e5280610e495280610ed152806113e45280611a1a5280611e9c52508061236a525080611eef52508061297452508061295052508061221f5250806121fb5250806121855250806133405250806133825250806133615250614a666000f3fe608060405234801561001057600080fd5b50600436106102ff5760003560e01c806370a082311161019c578063a9059cbb116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e14610593578063ed24911d146105a6578063fd19cac8146105ae576102ff565b8063d2946c2b14610565578063d505accf1461056d578063d5c096c414610580576102ff565b8063b35056b8116100c8578063b35056b81461054d578063b7b814fc14610555578063ced72f871461055d576102ff565b8063a9059cbb1461052a578063aaabadc51461053d578063ab63c60714610545576102ff565b806387ec68171161015057806390193b7c1161012a57806390193b7c146104fc57806395d89b411461050f578063a457c2d714610517576102ff565b806387ec6817146104d9578063893d20e8146104ec5780638d928af8146104f4576102ff565b80637ecebe00116101815780637ecebe00146104ab5780638456cb59146104be578063851c1bb3146104c6576102ff565b806370a082311461047757806374f3b0091461048a576102ff565b806338e9922e1161025557806350dd6ed9116102095780635c1548fb116101e35780635c1548fb146104465780636028bfd41461044e5780636945c1fd1461046f576102ff565b806350dd6ed91461042357806354a844ba1461043657806355c676281461043e576102ff565b8063395093511161023a57806339509351146104005780633f4ba83a146104135780634d6d0fd01461041b576102ff565b806338e9922e146103e357806338fff2d0146103f8576102ff565b80631dd746ea116102b75780632541897f116102915780632541897f146103b1578063313ce567146103c65780633644e515146103db576102ff565b80631dd746ea1461038157806323b872dd1461039657806325117b72146103a9576102ff565b8063095ea7b3116102e8578063095ea7b31461034257806318160ddd146103625780631c0de0511461036a576102ff565b806301ec954a1461030457806306fdde031461032d575b600080fd5b610317610312366004614040565b6105b6565b604051610324919061456f565b60405180910390f35b610335611d17565b60405161032491906146ad565b610355610350366004613d7a565b611dad565b604051610324919061454c565b610317611dc4565b610372611dca565b60405161032493929190614557565b610389611df3565b604051610324919061450b565b6103556103a4366004613cca565b611e02565b610317611e76565b6103b9611e9a565b6040516103249190614497565b6103ce611ebe565b60405161032491906149aa565b610317611ec7565b6103f66103f136600461423f565b611ed1565b005b610317611eed565b61035561040e366004613d7a565b611f11565b6103f6611f4c565b610317611f60565b6103f6610431366004613eff565b611f84565b6103f6611fa2565b610317611fb4565b610317611fc7565b61046161045c366004613ddd565b611feb565b604051610324929190614991565b6103b9612022565b610317610485366004613c76565b612046565b61049d610498366004613ddd565b612061565b60405161032492919061451e565b6103176104b9366004613c76565b612164565b6103f661216f565b6103176104d4366004613ea3565b612181565b6104616104e7366004613ddd565b6121d3565b6103b96121f9565b6103b961221d565b61031761050a366004613c76565b612241565b61033561225c565b610355610525366004613d7a565b6122bd565b610355610538366004613d7a565b6122fb565b6103b9612308565b6103b9612312565b610355612321565b6103f6612332565b610317612344565b6103b9612368565b6103f661057b366004613d0a565b61238c565b61049d61058e366004613ddd565b612417565b6103176105a1366004613c92565b61253a565b610317612577565b6103b9612581565b600084608001516105e36105c861221d565b6001600160a01b0316336001600160a01b03161460cd6125eb565b6105f86105ee611eed565b82146101f46125eb565b6106006125f9565b60008651600181111561060f57fe5b1480610627575060018651600181111561062557fe5b145b610666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906147f9565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b031614806106df57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686604001516001600160a01b0316145b806106f6575060408601516001600160a01b031630145b8061073657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061077657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b0316145b8061078d575060208601516001600160a01b031630145b6107c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906146c0565b60606107cd61260c565b90506107d9868261277f565b6107e1613b1f565b6000808080808c5160018111156107f457fe5b14156108255761081b8c60600151878c8151811061080e57fe5b60200260200101516127ee565b60608d0152610854565b60018c51600181111561083457fe5b14156108545761084e8c60600151878b8151811061080e57fe5b60608d01525b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480156108a5575060008c5160018111156108a357fe5b145b15610920578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106108db57fe5b6020026020010151101561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614765565b610a85565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316148015610971575060008c51600181111561096f57fe5b145b156109e7578b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106109a757fe5b6020026020010151101561091b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614830565b60208c01516001600160a01b031630148015610a0f575060008c516001811115610a0d57fe5b145b15610a85578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110610a4557fe5b60200260200101511015610a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d9061472e565b6101008c015151156119a3578b6101000151806020019051810190610aaa9190613e80565b90945092508361138e57610abc613b36565b60095460c08e01516040517fca142f750000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163ca142f7591610b0a9188906004016144f2565b60c06040518083038186803b158015610b2257600080fd5b505afa158015610b36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5a91906141d9565b60095460c08f015160208301519293506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169392811692635778472a92908216911614610bb4578360400151610bb7565b83515b6040518263ffffffff1660e01b8152600401610bd3919061456f565b60a06040518083038186803b158015610beb57600080fd5b505afa158015610bff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c23919061415f565b516001600160a01b031614610c58577f63757272656e6379000000000000000000000000000000000000000000000000610c7a565b7f73656375726974790000000000000000000000000000000000000000000000005b94507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610ccd575060008d516001811115610ccb57fe5b145b15610d1f57806080015191508c606001518160a0015114610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906148c4565b610dc8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d604001516001600160a01b0316148015610d70575060008d516001811115610d6e57fe5b145b15610dbd578060a0015191508c60600151816080015114610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614867565b610dc86101646127fa565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610e1b575060208e01516001600160a01b031630145b15610e4757507f53656c6c00000000000000000000000000000000000000000000000000000000610ecf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168e604001516001600160a01b0316148015610e98575060208e01516001600160a01b031630145b15610ec457507f4275790000000000000000000000000000000000000000000000000000000000610ecf565b610ecf6101646127fa565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f73d5870ecc5c28466106f013bf012d6be5b211d5e969d565d4e1cf583d3e56f98f60c001516001600160a01b031684602001516001600160a01b031614610f45578360400151610f48565b83515b7f736563757269747900000000000000000000000000000000000000000000000089146110145760095460408087015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a91610fbb9160040161456f565b60a06040518083038186803b158015610fd357600080fd5b505afa158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b919061415f565b606001516110b2565b60095485516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a9161105d9160040161456f565b60a06040518083038186803b15801561107557600080fd5b505afa158015611089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ad919061415f565b606001515b7f63757272656e63790000000000000000000000000000000000000000000000008a1461117e5760095460408088015190517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111259160040161456f565b60a06040518083038186803b15801561113d57600080fd5b505afa158015611151573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611175919061415f565b6060015161121c565b60095486516040517f5778472a0000000000000000000000000000000000000000000000000000000081526001600160a01b0390921691635778472a916111c79160040161456f565b60a06040518083038186803b1580156111df57600080fd5b505afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611217919061415f565b606001515b8561123888608001518960a0015161282490919063ffffffff16565b7f00000000000000000000000000000000000000000000000000000000000000008a8a60600151604051611273989796959493929190614597565b60405180910390a26112a982608001517f0000000000000000000000000000000000000000000000000000000000000000612875565b608083015260a08201516112dd907f0000000000000000000000000000000000000000000000000000000000000000612875565b60a083015260095460c08f01516040517fd729cf6c0000000000000000000000000000000000000000000000000000000081526001600160a01b039092169163d729cf6c916113309189906004016144f2565b600060405180830381600087803b15801561134a57600080fd5b505af115801561135e573d6000803e3d6000fd5b5050505061137f83898d8151811061137257fe5b6020026020010151612875565b99505050505050505050611d0e565b837f4c696d69740000000000000000000000000000000000000000000000000000001480156113bc57508215155b156113dd57604080518082019091528060018152602001849052945061199e565b826115ec577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316148061145b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c604001516001600160a01b0316145b8015611473575060208c01516001600160a01b031630145b801561148b575060008c51600181111561148957fe5b145b156115dc576009546040517f7489ec230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690637489ec23906114d990879060040161456f565b602060405180830381600087803b1580156114f357600080fd5b505af1158015611507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152b9190613dc5565b90508b60600151811461156a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d9061479c565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b6040516115b79897969594939291906144ab565b60405180910390a16115cf81878b8151811061137257fe5b9750505050505050611d0e565b6115e76101646127fa565b61199e565b82156119935760208c01516001600160a01b03163014801561161a575060008c51600181111561161857fe5b145b156117895761167b83611676856116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b612893565b6125bd565b90507f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f606001518786428b6040516116ca9897969594939291906144ab565b60405180910390a1600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b8152600401611715929190614676565b602060405180830381600087803b15801561172f57600080fd5b505af1158015611743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117679190613dc5565b9050611777818d606001516125bd565b90506115cf81878b8151811061137257fe5b60408c01516001600160a01b0316301480156117b1575060008c5160018111156117af57fe5b145b80156117bd5750600083115b156115dc5761181483611676856116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b9150600960009054906101000a90046001600160a01b03166001600160a01b031663014d92b4858e6040518363ffffffff1660e01b8152600401611859929190614676565b602060405180830381600087803b15801561187357600080fd5b505af1158015611887573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ab9190613dc5565b90506118bb8c6060015182612881565b90508b606001518b7f0000000000000000000000000000000000000000000000000000000000000000815181106118ee57fe5b6020026020010151101561192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d90614921565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e60400151848787428b6040516119779897969594939291906144ab565b60405180910390a16115cf8c60600151878b8151811061137257fe5b61199e6101646127fa565b6119ba565b604080518082019091526000808252602082015294505b7f00000000000000000000000000000000000000000000000000000000000000008c606001511015611a18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065d906146f7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b03161480611a9157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168c602001516001600160a01b0316145b8015611aa9575060408c01516001600160a01b031630145b8015611ac1575060008c516001811115611abf57fe5b145b15611c8d578b606001518b7f000000000000000000000000000000000000000000000000000000000000000081518110611af757fe5b60200260200101511115611c7d57611b468b7f000000000000000000000000000000000000000000000000000000000000000081518110611b3457fe5b60200260200101518d606001516125bd565b8b7f000000000000000000000000000000000000000000000000000000000000000081518110611b7257fe5b602002602001018181525050611bd8856020015161167687602001516116717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612881565b6009546040517f5487e8cf0000000000000000000000000000000000000000000000000000000081529192506001600160a01b031690635487e8cf90611c24908f908990600401614958565b602060405180830381600087803b158015611c3e57600080fd5b505af1158015611c52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c769190613dc5565b9350611c88565b611c886102016127fa565b611c98565b611c986101646127fa565b7f48317135bf25937d8d55f728e0dc3814ceabb16fd67dfc82efb46d297f8eda378c60c001518d602001518e604001518f60600151896020015186428b604051611ce99897969594939291906144ab565b60405180910390a1611d058c60600151878b8151811061137257fe5b97505050505050505b50949350505050565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611da35780601f10611d7857610100808354040283529160200191611da3565b820191906000526020600020905b815481529060010190602001808311611d8657829003601f168201915b5050505050905090565b6000611dba3384846128c9565b5060015b92915050565b60025490565b6000806000611dd7612931565b159250611de261294e565b9150611dec612972565b9050909192565b6060611dfd61260c565b905090565b600080611e0f853361253a565b9050611e33336001600160a01b0387161480611e2b5750838210155b61019e6125eb565b611e3e858585612996565b336001600160a01b03861614801590611e5957506000198114155b15611e6b57611e6b85338584036128c9565b506001949350505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b6000611dfd612577565b611ed9612a76565b611ee16125f9565b611eea81612abc565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091611dba918590611f479086612881565b6128c9565b611f54612a76565b611f5e6000612b35565b565b7f000000000000000000000000000000000000000000000000000000000000000090565b611f8c612a76565b611f946125f9565b611f9e8282612bc6565b5050565b611faa612a76565b611f5e6001612cd4565b600854600090611dfd9060c0603f612d2b565b7f000000000000000000000000000000000000000000000000000000000000000090565b600060606120018651611ffc612d3a565b612d3f565b61201689898989898989612d4c612d9e612e07565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b606080886120706105c861221d565b61207b6105ee611eed565b6060600061208886612fbc565b156120b057612095612feb565b6120a7896120a1611dc4565b88612ffe565b92509050612102565b6120b861302a565b60606120c261260c565b90506120ce8a8261277f565b6120f28d8d8d8d8d6120de612321565b6120e8578d6120eb565b60005b878e612d4c565b935091506121008382612d9e565b505b61210c8b82613032565b81895167ffffffffffffffff8111801561212557600080fd5b5060405190808252806020026020018201604052801561214f578160200160208202803683370190505b509450945050505b5097509795505050505050565b6000611dbe82612241565b612177612a76565b611f5e6001612b35565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016121b6929190614421565b604051602081830303815290604052805190602001209050919050565b600060606121e48651611ffc612d3a565b6120168989898989898961303c613058612e07565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611da35780601f10611d7857610100808354040283529160200191611da3565b6000806122ca338561253a565b90508083106122e4576122df338560006128c9565b6122f1565b6122f133858584036128c9565b5060019392505050565b6000611dba338484612996565b6000611dfd6130c1565b6009546001600160a01b031690565b600854600090611dfd9060ff61313b565b61233a612a76565b611f5e6000612cd4565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886123bb8c612241565b896040516020016123d1969594939291906145de565b60405160208183030381529060405280519060200120905061240288826123f9878787613145565b886101f8613184565b61240d8888886128c9565b5050505050505050565b606080886124266105c861221d565b6124316105ee611eed565b61243961302a565b606061244361260c565b905061244d611dc4565b6124fa57600060606124628d8d8d868b6131db565b9150915061247b612471613300565b83101560cc6125eb565b61248d6000612488613300565b613307565b6124a08b612499613300565b8403613307565b6124aa8184613058565b808a5167ffffffffffffffff811180156124c357600080fd5b506040519080825280602002602001820160405280156124ed578160200160208202803683370190505b5095509550505050612157565b612504888261277f565b6000606061252c8d8d8d8d8d612518612321565b612522578d612525565b60005b898e61303c565b915091506124a08b83613307565b600061254461221d565b6001600160a01b0316826001600160a01b031614156125665750600019611dbe565b6125708383613311565b9050611dbe565b6000611dfd61333c565b6009546001600160a01b031681565b80611f9e816133d9565b60006125a7848484613457565b506001901b60001901811b1992909216911b1790565b60006125cd8383111560016125eb565b50900390565b60008183106125e257816125e4565b825b9392505050565b81611f9e57611f9e816127fa565b611f5e612604612931565b6101926125eb565b60606000612618612d3a565b905060608167ffffffffffffffff8111801561263357600080fd5b5060405190808252806020026020018201604052801561265d578160200160208202803683370190505b50905060005b82811015612778577f00000000000000000000000000000000000000000000000000000000000000008114156126d1577f00000000000000000000000000000000000000000000000000000000000000008282815181106126c057fe5b602002602001018181525050612770565b7f0000000000000000000000000000000000000000000000000000000000000000811415612726577f00000000000000000000000000000000000000000000000000000000000000008282815181106126c057fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561277057670de0b6b3a764000082828151811061276357fe5b6020026020010181815250505b600101612663565b5091505090565b8151815161278e908290612d3f565b60005b818110156127e8576127c98482815181106127a857fe5b60200260200101518483815181106127bc57fe5b6020026020010151612893565b8482815181106127d557fe5b6020908102919091010152600101612791565b50505050565b60006125e48383612893565b611eea817f42414c000000000000000000000000000000000000000000000000000000000061349e565b600061283382151560046125eb565b8261284057506000611dbe565b670de0b6b3a7640000838102906128639085838161285a57fe5b041460056125eb565b82818161286c57fe5b04915050611dbe565b60006125e48383612824565b60008282016125e484821015836125eb565b60008282026128b78415806128b05750838583816128ad57fe5b04145b60036125eb565b670de0b6b3a764000090049392505050565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061292490859061456f565b60405180910390a3505050565b600061293b612972565b421180611dfd57505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6129ad6001600160a01b03841615156101986125eb565b6129c46001600160a01b03831615156101996125eb565b6129cf838383613452565b6001600160a01b0383166000908152602081905260409020546129f590826101a0613519565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612a249082612881565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061292490859061456f565b6000612aa56000357fffffffff0000000000000000000000000000000000000000000000000000000016612181565b9050611eea612ab4823361352f565b6101916125eb565b612ad1612ac7613618565b82101560cb6125eb565b612ae6612adc613621565b82111560ca6125eb565b600854612af7908260c0603f61259a565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90612b2a90839061456f565b60405180910390a150565b8015612b5557612b50612b4661294e565b42106101936125eb565b612b6a565b612b6a612b60612972565b42106101a96125eb565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490612b2a90839061454c565b6000612bd0611eed565b90506000612bdc61221d565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401612c0992919061465f565b60806040518083038186803b158015612c2157600080fd5b505afa158015612c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c599190614257565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d49250612ca691508590879060040161463e565b600060405180830381600087803b158015612cc057600080fd5b505af115801561240d573d6000803e3d6000fd5b600854612ce3908260ff61362d565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890612d1690839061454c565b60405180910390a180611eea57611eea611f5e565b6001901b6000190191901c1690565b600390565b611f9e81831460676125eb565b600060606000612d5b84613654565b90506001816001811115612d6b57fe5b14612d8057612d7b6101646127fa565b612d90565b612d8a888561366a565b90935091505b509850989650505050505050565b81518151612dad908290612d3f565b60005b818110156127e857612de8848281518110612dc757fe5b6020026020010151848381518110612ddb57fe5b6020026020010151612824565b848281518110612df457fe5b6020908102919091010152600101612db0565b333014612ef6576000306001600160a01b0316600036604051612e2b929190614451565b6000604051808303816000865af19150503d8060008114612e68576040519150601f19603f3d011682016040523d82523d6000602084013e612e6d565b606091505b505090508060008114612e7c57fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb000000000000000000000000000000000000000000000000000000008114612ed8573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b612efe61302a565b6060612f0861260c565b9050612f14878261277f565b60006060612f2c8c8c8c8c8c8c898d8d63ffffffff16565b91509150612f3e81848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b6000808251118015611dbe575060ff801682806020019051810190612fe19190614297565b60ff161492915050565b611f5e612ff6612321565b6101b66125eb565b60006060600061300d8461370d565b9050606061301c878784613723565b919791965090945050505050565b611f5e6125f9565b611f9e82826137d2565b6000606061304b6101646127fa565b9850989650505050505050565b81518151613067908290612d3f565b60005b818110156127e8576130a284828151811061308157fe5b602002602001015184838151811061309557fe5b602002602001015161389e565b8482815181106130ae57fe5b602090810291909101015260010161306a565b60006130cb61221d565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561310357600080fd5b505afa158015613117573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd9190613ee3565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b600061318f856138ec565b90506131a561319f878387613908565b836125eb565b6131b4428410156101b86125eb565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b600060606131e76125f9565b7f00000000000000000000000000000000000000000000000000000000000000006132226001600160a01b03888116908316146101566125eb565b613242816001600160a01b0316876001600160a01b0316146101566125eb565b606061324d856139d5565b90506132ac817f00000000000000000000000000000000000000000000000000000000000000008151811061327e57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006127ee565b817f0000000000000000000000000000000000000000000000000000000000000000815181106132d857fe5b60209081029190910101526dffffffffffffffffffffffffffff999098509650505050505050565b620f424090565b611f9e82826139eb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006133a9613a7e565b306040516020016133be959493929190614612565b60405160208183030381529060405280519060200120905090565b6002815110156133e857611eea565b6000816000815181106133f757fe5b602002602001015190506000600190505b825181101561345257600083828151811061341f57fe5b60200260200101519050613448816001600160a01b0316846001600160a01b03161060656125eb565b9150600101613408565b505050565b613466610100831060646125eb565b61348f60018210158015613488575061348460ff84610100036125d3565b8211155b60646125eb565b61345283821c156101b46125eb565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600061352884841115836125eb565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b61354e6121f9565b6001600160a01b031614158015613569575061356983613a82565b15613591576135766121f9565b6001600160a01b0316336001600160a01b0316149050611dbe565b6135996130c1565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016135c893929190614578565b60206040518083038186803b1580156135e057600080fd5b505afa1580156135f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125709190613da5565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284613643576000613646565b60015b60ff16901b17949350505050565b600081806020019051810190611dbe9190613f4d565b60006060600061367984613af0565b90506060855167ffffffffffffffff8111801561369557600080fd5b506040519080825280602002602001820160405280156136bf578160200160208202803683370190505b50905060005b8651811015613701578681815181106136da57fe5b60200260200101518282815181106136ee57fe5b60209081029190910101526001016136c5565b50909590945092505050565b6000818060200190518101906125e491906142b3565b606060006137318385612824565b9050845167ffffffffffffffff8111801561374b57600080fd5b50604051908082528060200260200182016040528015613775578160200160208202803683370190505b50915060005b85518110156137c9576137aa8287838151811061379457fe5b602002602001015161289390919063ffffffff16565b8382815181106137b657fe5b602090810291909101015260010161377b565b50509392505050565b6137e96001600160a01b038316151561019b6125eb565b6137f582600083613452565b6001600160a01b03821660009081526020819052604090205461381b90826101b2613519565b6001600160a01b03831660009081526020819052604090205561384e61384982613843611dc4565b90613b06565b613b14565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613892919061456f565b60405180910390a35050565b60006138ad82151560046125eb565b826138ba57506000611dbe565b670de0b6b3a7640000838102906138d49085838161285a57fe5b8260018203816138e057fe5b04600101915050611dbe565b60006138f661333c565b826040516020016121b6929190614461565b600061391a82516041146101b96125eb565b60208281015160408085015160608601518251600080825295019283905292939092811a9160019061395390899085908890889061468f565b6020604051602081039080840390855afa158015613975573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b038116158015906139c95750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906125e49190613f96565b6139f760008383613452565b613a0c61384982613a06611dc4565b90612881565b6001600160a01b038216600090815260208190526040902054613a2f9082612881565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061389290859061456f565b4690565b6000613aad7f38e9922e00000000000000000000000000000000000000000000000000000000612181565b821480613ae15750613ade7f50dd6ed900000000000000000000000000000000000000000000000000000000612181565b82145b80611dbe5750611dbe82613b19565b6000818060200190518101906125e49190613f69565b60006125e483836001613519565b600255565b50600090565b604080518082019091526000808252602082015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b8035611dbe816149ff565b600082601f830112613b86578081fd5b8135613b99613b94826149df565b6149b8565b818152915060208083019084810181840286018201871015613bba57600080fd5b60005b84811015613bd957813584529282019290820190600101613bbd565b505050505092915050565b600082601f830112613bf4578081fd5b813567ffffffffffffffff811115613c0a578182fd5b613c3b60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016149b8565b9150808252836020828501011115613c5257600080fd5b8060208401602084013760009082016020015292915050565b8035611dbe81614a14565b600060208284031215613c87578081fd5b81356125e4816149ff565b60008060408385031215613ca4578081fd5b8235613caf816149ff565b91506020830135613cbf816149ff565b809150509250929050565b600080600060608486031215613cde578081fd5b8335613ce9816149ff565b92506020840135613cf9816149ff565b929592945050506040919091013590565b600080600080600080600060e0888a031215613d24578485fd5b8735613d2f816149ff565b96506020880135613d3f816149ff565b955060408801359450606088013593506080880135613d5d81614a21565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215613d8c578182fd5b8235613d97816149ff565b946020939093013593505050565b600060208284031215613db6578081fd5b815180151581146125e4578182fd5b600060208284031215613dd6578081fd5b5051919050565b600080600080600080600060e0888a031215613df7578081fd5b873596506020880135613e09816149ff565b95506040880135613e19816149ff565b9450606088013567ffffffffffffffff80821115613e35578283fd5b613e418b838c01613b76565b955060808a0135945060a08a0135935060c08a0135915080821115613e64578283fd5b50613e718a828b01613be4565b91505092959891949750929550565b60008060408385031215613e92578182fd5b505080516020909101519092909150565b600060208284031215613eb4578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146125e4578182fd5b600060208284031215613ef4578081fd5b81516125e4816149ff565b60008060408385031215613f11578182fd5b8235613f1c816149ff565b9150602083013567ffffffffffffffff811115613f37578182fd5b613f4385828601613be4565b9150509250929050565b600060208284031215613f5e578081fd5b81516125e481614a14565b60008060408385031215613f7b578182fd5b8251613f8681614a14565b6020939093015192949293505050565b60008060408385031215613fa8578182fd5b825160048110613fb6578283fd5b8092505060208084015167ffffffffffffffff811115613fd4578283fd5b8401601f81018613613fe4578283fd5b8051613ff2613b94826149df565b81815283810190838501858402850186018a101561400e578687fd5b8694505b83851015614030578051835260019490940193918501918501614012565b5080955050505050509250929050565b60008060008060808587031215614055578182fd5b843567ffffffffffffffff8082111561406c578384fd5b818701915061012080838a031215614082578485fd5b61408b816149b8565b90506140978984613c6b565b81526140a68960208501613b6b565b60208201526140b88960408501613b6b565b6040820152606083013560608201526080830135608082015260a083013560a08201526140e88960c08501613b6b565b60c08201526140fa8960e08501613b6b565b60e08201526101008084013583811115614112578687fd5b61411e8b828701613be4565b82840152505080965050602087013591508082111561413b578384fd5b5061414887828801613b76565b949794965050505060408301359260600135919050565b600060a08284031215614170578081fd5b61417a60a06149b8565b8251614185816149ff565b8152602083015160038110614198578283fd5b60208201526040830151600581106141ae578283fd5b604082015260608301516141c1816149ff565b60608201526080928301519281019290925250919050565b600060c082840312156141ea578081fd5b6141f460c06149b8565b825181526020830151614206816149ff565b8060208301525060408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b600060208284031215614250578081fd5b5035919050565b6000806000806080858703121561426c578182fd5b845193506020850151925060408501519150606085015161428c816149ff565b939692955090935050565b6000602082840312156142a8578081fd5b81516125e481614a21565b600080604083850312156142c5578182fd5b8251613f8681614a21565b6001600160a01b03169052565b6000815180845260208085019450808401835b8381101561430c578151875295820195908201906001016142f0565b509495945050505050565b60008151808452815b8181101561433c57602081850181015186830182015201614320565b8181111561434d5782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012082516002811061439157fe5b8085525060208301516143a760208601826142d0565b5060408301516143ba60408601826142d0565b50606083015160608501526080830151608085015260a083015160a085015260c08301516143eb60c08601826142d0565b5060e08301516143fe60e08601826142d0565b5061010080840151828287015261441783870182614317565b9695505050505050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015260a083015260c082019290925260e08101919091526101000190565b6001600160a01b03929092168252602082015260400190565b6000602082526125e460208301846142dd565b60006040825261453160408301856142dd565b828103602084015261454381856142dd565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9788526001600160a01b03968716602089015294861660408801526060870193909352608086019190915290921660a084015260c083019190915260e08201526101000190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b6000838252604060208301526146576040830184614317565b949350505050565b9182526001600160a01b0316602082015260400190565b6000838252604060208301526146576040830184614380565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526125e46020830184614317565b60208082526016908201527f496e76616c6964207377617070656420746f6b656e7300000000000000000000604082015260600190565b60208082526018908201527f4f726465722062656c6f77206d696e696d756d2073697a650000000000000000604082015260600190565b6020808252601f908201527f496e73756666696369656e7420706f6f6c20746f6b656e2062616c616e636500604082015260600190565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526023908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e0000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600c908201527f496e76616c696420737761700000000000000000000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f722063757272656e637900000000000000000000000000000000606082015260800190565b60208082526030908201527f496e73756666696369656e7420706f6f6c20746f6b656e73207377617070656460408201527f20696e20666f7220736563757269747900000000000000000000000000000000606082015260800190565b6020808252601d908201527f494e53554646494349454e545f494e5445524e414c5f42414c414e4345000000604082015260600190565b60006060825261496b6060830185614380565b905082516003811061497957fe5b80602084015250602083015160408301529392505050565b60008382526040602083015261465760408301846142dd565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156149d757600080fd5b604052919050565b600067ffffffffffffffff8211156149f5578081fd5b5060209081020190565b6001600160a01b0381168114611eea57600080fd5b60028110611eea57600080fd5b60ff81168114611eea57600080fdfea2646970667358221220ae7da2d668586f6857a25427cc16ebfc2ba40f06c673f6665785abbdb0c701e064736f6c63430007010033608060405260006001553480156200001657600080fd5b5060405162001a3e38038062001a3e833981016040819052620000399162000106565b620000443362000098565b600980546001600160a01b039586166001600160a01b03199182161790915560078054948616948216949094179093556008805492851692841692909217909155600a805491909316911617905562000166565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200010057600080fd5b92915050565b600080600080608085870312156200011c578384fd5b620001288686620000e8565b9350620001398660208701620000e8565b92506200014a8660408701620000e8565b91506200015b8660608701620000e8565b905092959194509250565b6118c880620001766000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063ca142f7511610066578063ca142f75146101c8578063d729cf6c146101e8578063e43372e9146101fb578063f2fde38b14610203576100f5565b8063715018a6146101905780637489ec231461019a5780638da5cb5b146101ad578063c49f3fe3146101b5576100f5565b806346b8b730116100d357806346b8b730146101405780635487e8cf146101555780635778472a146101685780636945c1fd14610188576100f5565b8063014d92b4146100fa5780632541897f1461012357806338fff2d014610138575b600080fd5b61010d6101083660046114f2565b610216565b60405161011a9190611669565b60405180910390f35b61012b6103c9565b60405161011a9190611604565b61010d6103e5565b61014861048e565b60405161011a9190611625565b61010d610163366004611537565b6105e0565b61017b610176366004611491565b610872565b60405161011a9190611785565b61012b610a16565b610198610a32565b005b61010d6101a8366004611491565b610a4a565b61012b610bdb565b6101986101c33660046114c1565b610bf7565b6101db6101d6366004611466565b610ee2565b60405161011a91906117ef565b6101986101f6366004611466565b610fef565b6101486110ba565b61019861021136600461144a565b61111b565b600061024333610224610bdb565b73ffffffffffffffffffffffffffffffffffffffff16146101aa611157565b60026000848152600260205260409020547501000000000000000000000000000000000000000000900460ff16600481111561027b57fe5b146102bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116e0565b60405180910390fd5b60008381526002602052604090206001015473ffffffffffffffffffffffffffffffffffffffff16331461031b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116a9565b6000838152600260208181526040909220015460075491840151909173ffffffffffffffffffffffffffffffffffffffff9182169116148061037c5750600854602084015173ffffffffffffffffffffffffffffffffffffffff9081169116145b156103a75761038f836060015182611169565b600085815260026020819052604090912001556103c0565b6060830151600085815260026020819052604090912001555b90505b92915050565b60075473ffffffffffffffffffffffffffffffffffffffff1690565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338fff2d06040518163ffffffff1660e01b815260040160206040518083038186803b15801561045057600080fd5b505afa158015610464573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048891906114a9565b91505090565b600354606090819067ffffffffffffffff811180156104ac57600080fd5b506040519080825280602002602001820160405280156104d6578160200160208202803683370190505b5090506000805b6003548110156105d8573373ffffffffffffffffffffffffffffffffffffffff16600260006003848154811061050f57fe5b6000918252602080832090910154835282019290925260400190206001015473ffffffffffffffffffffffffffffffffffffffff16148015610595575060028060006003848154811061055e57fe5b9060005260206000200154815260200190815260200160002060000160159054906101000a900460ff16600481111561059357fe5b145b156105d057600381815481106105a757fe5b90600052602060002001548383815181106105be57fe5b60209081029190910101526001909101905b6001016104dd565b509091505090565b60006105ee33610224610bdb565b6000825160028111156105fd57fe5b1480610615575060018251600281111561061357fe5b145b61061e57600080fd5b60015442141561063557600180548101905561063a565b426001555b60008360c001516001546040516020016106559291906115cf565b60405160208183030381529060405280519060200120905061067561127f565b6040518060a00160405280866020015173ffffffffffffffffffffffffffffffffffffffff168152602001856000015160028111156106b057fe5b81526020016002815260c087015173ffffffffffffffffffffffffffffffffffffffff908116602080840191909152606089015160409384015260008681526002808352939020845181547fffffffffffffffffffffffff000000000000000000000000000000000000000016931692909217808355908401519394508493919283917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16907401000000000000000000000000000000000000000090849081111561077857fe5b02179055506040820151815482907fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000008360048111156107cb57fe5b02179055506060820151600182810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155608090920151600290910155600380546000858152600460205260408120829055928101825591527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01829055509392505050565b61087a61127f565b610882610bdb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108d2575060095473ffffffffffffffffffffffffffffffffffffffff1633145b80610903575060008281526002602052604090206001015473ffffffffffffffffffffffffffffffffffffffff1633145b610939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b290611672565b600082815260026020818152604092839020835160a08101909452805473ffffffffffffffffffffffffffffffffffffffff811685529092918401917401000000000000000000000000000000000000000090910460ff169081111561099b57fe5b60028111156109a657fe5b815281546020909101907501000000000000000000000000000000000000000000900460ff1660048111156109d757fe5b60048111156109e257fe5b8152600182015473ffffffffffffffffffffffffffffffffffffffff16602082015260029091015460409091015292915050565b60085473ffffffffffffffffffffffffffffffffffffffff1690565b610a3e33610224610bdb565b610a48600061117b565b565b6000610a5833610224610bdb565b60026000838152600260205260409020547501000000000000000000000000000000000000000000900460ff166004811115610a9057fe5b14610ac7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116e0565b60008281526002602052604090206001015473ffffffffffffffffffffffffffffffffffffffff163314610b27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b2906116a9565b600082815260026020908152604080832080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750300000000000000000000000000000000000000000017905560049091529020546003805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01908110610baf57fe5b906000526020600020016000905560026000838152602001908152602001600020600201549050919050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60095473ffffffffffffffffffffffffffffffffffffffff163314610c48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b290611717565b600084815260026020526040902080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1690558215610cb757600083815260026020526040902080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1690555b60018054810190819055610cc96112af565b506040805160c08101825286815260008781526002602081815284832060019081015473ffffffffffffffffffffffffffffffffffffffff9081168387018181528789018d8152606089018b815260808a018e815260a08b018e8152948a5260058089528c8b208e8c529098529a90982089518155915194820180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169590941694909417909255915193810193909355925160038301559351600482015590519201919091558415610e3957600085815260026020818152604080842060019081015473ffffffffffffffffffffffffffffffffffffffff90811686526005808552838720898852855295839020875181559387015191840180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169290911691909117905584015191810191909155606083015160038201556080830151600482015560a08301519101555b600086815260026020908152604080832060019081015473ffffffffffffffffffffffffffffffffffffffff1684526006835290832060608501518154928301825590845291909220909101558415610eda57600085815260026020908152604080832060019081015473ffffffffffffffffffffffffffffffffffffffff1684526006835290832060608501518154928301825590845291909220909101555b505050505050565b610eea6112af565b610ef2610bdb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f4057503373ffffffffffffffffffffffffffffffffffffffff8416145b610f76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b29061174e565b5073ffffffffffffffffffffffffffffffffffffffff918216600090815260056020818152604080842094845293815291839020835160c081018552815481526001820154909516928501929092526002820154928401929092526003810154606084015260048101546080840152015460a082015290565b610ffb33610224610bdb565b60005b73ffffffffffffffffffffffffffffffffffffffff83166000908152600660205260409020548110156110b55773ffffffffffffffffffffffffffffffffffffffff8316600090815260066020526040902080548391908390811061105f57fe5b906000526020600020015414156110ad5773ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604090208054829081106110a157fe5b60009182526020822001555b600101610ffe565b505050565b3360009081526006602090815260409182902080548351818402810184019094528084526060939283018282801561111157602002820191906000526020600020905b8154815260200190600101908083116110fd575b5050505050905090565b61112733610224610bdb565b61114b73ffffffffffffffffffffffffffffffffffffffff821615156101ab611157565b6111548161117b565b50565b8161116557611165816111f0565b5050565b60008282016103c08482101583611157565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b604452611154917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b6040805160a081019091526000808252602082019081526020016000815260006020820181905260409091015290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b80356103c381611870565b600082601f8301126112ff578081fd5b813567ffffffffffffffff811115611315578182fd5b61134660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611849565b915080825283602082850101111561135d57600080fd5b8060208401602084013760009082016020015292915050565b8035600281106103c357600080fd5b6000610120808385031215611398578182fd5b6113a181611849565b9150506113ae8383611376565b81526113bd83602084016112e4565b60208201526113cf83604084016112e4565b6040820152606082013560608201526080820135608082015260a082013560a08201526113ff8360c084016112e4565b60c08201526114118360e084016112e4565b60e08201526101008083013567ffffffffffffffff81111561143257600080fd5b61143e858286016112ef565b82840152505092915050565b60006020828403121561145b578081fd5b81356103c081611870565b60008060408385031215611478578081fd5b823561148381611870565b946020939093013593505050565b6000602082840312156114a2578081fd5b5035919050565b6000602082840312156114ba578081fd5b5051919050565b600080600080608085870312156114d6578182fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611504578182fd5b82359150602083013567ffffffffffffffff811115611521578182fd5b61152d85828601611385565b9150509250929050565b600080828403606081121561154a578283fd5b833567ffffffffffffffff811115611560578384fd5b61156c86828701611385565b93505060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08201121561159e578182fd5b506115a96040611849565b6020840135600381106115ba578283fd5b81526040939093013560208401525092909150565b60609290921b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000168252601482015260340190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561165d57835183529284019291840191600101611641565b50909695505050505050565b90815260200190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f206f7264657273000000604082015260600190565b6020808252601b908201527f53656e646572206973206e6f74206f726465722063726561746f720000000000604082015260600190565b60208082526017908201527f4f7264657220697320616c72656164792066696c6c6564000000000000000000604082015260600190565b6020808252601c908201527f556e617574686f72697a656420746f207265706f727420747261646500000000604082015260600190565b6020808252601d908201527f556e617574686f72697a65642061636365737320746f20747261646573000000604082015260600190565b600060a08201905073ffffffffffffffffffffffffffffffffffffffff8084511683526020840151600381106117b757fe5b60208401526040840151600581106117cb57fe5b80604085015250806060850151166060840152506080830151608083015292915050565b600060c0820190508251825273ffffffffffffffffffffffffffffffffffffffff602084015116602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b60405181810167ffffffffffffffff8111828210171561186857600080fd5b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461115457600080fdfea26469706673582212208fca6a74b683eb7e8f87a927f50fb59fcae94a24cc79504f3e4ba11818259dbb64736f6c63430007010033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c85760003560e01c80636634b75311610081578063851c1bb31161005b578063851c1bb3146101715780638d928af814610191578063aaabadc514610199576100c8565b80636634b753146101415780636c57f5a914610161578063739238d614610169576100c8565b8063174481fa116100b2578063174481fa1461010b5780632da47c40146101215780632f2770db14610137576100c8565b8062c194db146100cd57806309f3a67e146100eb575b600080fd5b6100d56101a1565b6040516100e29190610c01565b60405180910390f35b6100fe6100f93660046109d0565b6101c0565b6040516100e29190610b79565b610113610210565b6040516100e2929190610b9a565b610129610256565b6040516100e2929190610d1f565b61013f6102c0565b005b61015461014f366004610938565b610325565b6040516100e29190610bc1565b610154610350565b6100fe610359565b61018461017f366004610974565b61037d565b6040516100e29190610bcc565b6100fe6103cf565b6100fe6103f3565b60606101bb604051806020016040528060008152506104d9565b905090565b60008060006101cd610256565b915091506102086101dc6103cf565b858484336040516020016101f4959493929190610c14565b6040516020818303038152906040526105b2565b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156102b257807f000000000000000000000000000000000000000000000000000000000000000003925062278d0091506102bb565b60009250600091505b509091565b6102c8610646565b6102d061068f565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103b2929190610b49565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103fd6103cf565b73ffffffffffffffffffffffffffffffffffffffff1663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561044257600080fd5b505afa158015610456573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bb91906109b4565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506104d373ffffffffffffffffffffffffffffffffffffffff831615156101ac6106a4565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c50602089810190898501016105a48183866106b6565b505050505050505050919050565b60006105bc61068f565b60006105c783610730565b73ffffffffffffffffffffffffffffffffffffffff811660008181526020819052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006106756000357fffffffff000000000000000000000000000000000000000000000000000000001661037d565b905061068c6106848233610778565b6101916106a4565b50565b6106a261069a610350565b1560d36106a4565b565b816106b2576106b281610817565b5050565b5b602081106106f45781518352602092830192909101907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0016106b7565b905182516020929092036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0180199091169116179052565b6000606061073d836104d9565b905060008151602083016000f0905073ffffffffffffffffffffffffffffffffffffffff8116610771573d6000803e3d6000fd5b9392505050565b60006107826103f3565b73ffffffffffffffffffffffffffffffffffffffff16639be2a8848484306040518463ffffffff1660e01b81526004016107be93929190610bd5565b60206040518083038186803b1580156107d657600080fd5b505afa1580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190610954565b90505b92915050565b7f08c379a000000000000000000000000000000000000000000000000000000000600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b60445261068c917f42414c0000000000000000000000000000000000000000000000000000000000906242414c90606490fd5b803561081181610d54565b600082601f8301126108c1578081fd5b813567ffffffffffffffff8111156108d7578182fd5b61090860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610d2d565b915080825283602082850101111561091f57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610949578081fd5b813561077181610d54565b600060208284031215610965578081fd5b81518015158114610771578182fd5b600060208284031215610985578081fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610771578182fd5b6000602082840312156109c5578081fd5b815161077181610d54565b6000602082840312156109e1578081fd5b813567ffffffffffffffff808211156109f8578283fd5b8184019150610140808387031215610a0e578384fd5b610a1781610d2d565b9050823582811115610a27578485fd5b610a33878286016108b1565b825250602083013582811115610a47578485fd5b610a53878286016108b1565b602083015250610a6686604085016108a6565b604082015260608301356060820152610a8286608085016108a6565b608082015260a0838101359082015260c0808401359082015260e0808401359082015261010080840135908201526101209283013592810192909252509392505050565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452815b81811015610b0557602081850181015186830182015201610ae9565b81811115610b165782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b901515815260200190565b90815260200190565b92835273ffffffffffffffffffffffffffffffffffffffff918216602084015216604082015260600190565b60006020825261080e6020830184610ae0565b600073ffffffffffffffffffffffffffffffffffffffff8716825260a0602083015285516101408060a0850152610c4f6101e0850183610ae0565b915060208801517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608584030160c0860152610c8a8382610ae0565b9250506040880151610c9f60e0860182610ac6565b506060880151610100818187015260808a01519150610120610cc381880184610ac6565b60a08b01519387019390935260c08a015161016087015260e08a01516101808701528901516101a0860152508701516101c084015260408301869052606083018590529050610d156080830184610ac6565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610d4c57600080fd5b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461068c57600080fdfea26469706673582212201ef9217c7f3adbe247f4f3b916e5dc76835a8c1c6f960a1da8e72cb31d3c87d264736f6c63430007010033", "linkReferences": {}, "deployedLinkReferences": {} } \ No newline at end of file diff --git a/abis/PrimaryIssuePool.json b/abis/PrimaryIssuePool.json index 586a32bce..a2097f644 100644 --- a/abis/PrimaryIssuePool.json +++ b/abis/PrimaryIssuePool.json @@ -155,12 +155,6 @@ "internalType": "string", "name": "offeringDocs", "type": "string" - }, - { - "indexed": false, - "internalType": "address", - "name": "issueManager", - "type": "address" } ], "name": "OpenIssue", @@ -1233,8 +1227,8 @@ "type": "function" } ], - "bytecode": "0x6103806040523480156200001257600080fd5b506040516200511738038062005117833981016040819052620000359162000b67565b846000856000015186602001516200005d8860400151896060015130620004f760201b60201c565b604080516003808252608082019092529060208201606080368337019050508960e00151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000cd92919062000a18565b508051620000e390600490602084019062000a18565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016190506276a700831115610194620005c6565b6200017562278d00821115610195620005c6565b429091016101408190520161016052855162000197906002111560c8620005c6565b620001b1620001a5620005db565b8751111560c9620005c6565b620001c786620005e060201b6200111b1760201c565b620001d284620005ec565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000203908d9060040162000d85565b602060405180830381600087803b1580156200021e57600080fd5b505af115801562000233573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000259919062000b2f565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028e9084908b908b9060040162000ce9565b600060405180830381600087803b158015620002a957600080fd5b505af1158015620002be573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030557600080fd5b505afa1580156200031a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000340919062000b48565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083606001516001600160a01b03166101e0816001600160a01b031660601b815250506000806000620003cc87604001518860600151306200068060201b60201c565b61030083905261032082905261034081905260408a01519295509093509150620003f69062000776565b6102005260608701516200040a9062000776565b6102205260808701516102405260a08701516102605260e08701516102805260c08701516102a0526101008701516102c052426102e05261012087015180516200045d9160099160209091019062000a18565b50836001600160a01b0316610360816001600160a01b031660601b8152505086604001516001600160a01b03167f64c76ecbe716809a0085ae1b389296a3c6e716fe1ee5d1804c8032e0e76dabb18860a0015189608001518a606001518b60c001518c61010001518d61012001518b604051620004e1979695949392919062000da3565b60405180910390a2505050505050505062000e8b565b6060600080806200050a87878762000680565b60408051600380825260808201909252939650919450925060208201606080368337019050509350868484815181106200054057fe5b60200260200101906001600160a01b031690816001600160a01b031681525050858483815181106200056e57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200059c57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b81620005d757620005d7816200084a565b5050565b600390565b80620005d7816200085f565b62000605620005fa620008eb565b82101560cb620005c6565b6200061e62000613620008f4565b82111560ca620005c6565b620006408160c0603f6008546200090060201b6200112517909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906200067590839062000d9a565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200070957836001600160a01b0316856001600160a01b03161015620006cc5750600091506001905060026200076d565b836001600160a01b0316866001600160a01b03161015620006f85750600091506002905060016200076d565b50600191506002905060006200076d565b846001600160a01b0316846001600160a01b03161015620007355750600291506001905060006200076d565b856001600160a01b0316846001600160a01b03161015620007615750600291506000905060016200076d565b50600191506000905060025b93509350939050565b60006001600160a01b0382163014156200079a5750670de0b6b3a764000062000845565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620007d657600080fd5b505afa158015620007eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000811919062000cc6565b60ff1690506000620008306012836200092560201b620011481760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b6200085c816210905360ea1b62000942565b50565b60028151101562000870576200085c565b6000816000815181106200088057fe5b602002602001015190506000600190505b8251811015620008e6576000838281518110620008aa57fe5b60200260200101519050620008db816001600160a01b0316846001600160a01b0316106065620005c660201b60201c565b915060010162000891565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200090f848484620009a3565b506001901b60001901811b1992909216911b1790565b600062000937838311156001620005c6565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b620009b461010083106064620005c6565b620009ed60018210158015620009e55750620009e160ff8461010003620009fe60201b6200115e1760201c565b8211155b6064620005c6565b620008e683821c156101b4620005c6565b600081831062000a0f578162000a11565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000a5b57805160ff191683800117855562000a8b565b8280016001018555821562000a8b579182015b8281111562000a8b57825182559160200191906001019062000a6e565b5062000a9992915062000a9d565b5090565b5b8082111562000a99576000815560010162000a9e565b80516200093c8162000e75565b600082601f83011262000ad2578081fd5b81516001600160401b0381111562000ae8578182fd5b62000afd601f8201601f191660200162000e0f565b915080825283602082850101111562000b1557600080fd5b62000b2881602084016020860162000e42565b5092915050565b60006020828403121562000b41578081fd5b5051919050565b60006020828403121562000b5a578081fd5b815162000a118162000e75565b600080600080600060a0868803121562000b7f578081fd5b855162000b8c8162000e75565b60208701519095506001600160401b038082111562000ba9578283fd5b818801915061014080838b03121562000bc0578384fd5b62000bcb8162000e0f565b905082518281111562000bdc578485fd5b62000bea8b82860162000ac1565b82525060208301518281111562000bff578485fd5b62000c0d8b82860162000ac1565b60208301525062000c228a6040850162000ab4565b604082015262000c368a6060850162000ab4565b60608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120808401518381111562000c83578586fd5b62000c918c82870162000ac1565b828401525050809650505050604086015192506060860151915062000cba876080880162000ab4565b90509295509295909350565b60006020828403121562000cd8578081fd5b815160ff8116811462000a11578182fd5b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000d355762000d22855162000e36565b8352938301939183019160010162000d0d565b505084810360408601528551808252908201925081860190845b8181101562000d775762000d64835162000e36565b8552938301939183019160010162000d4f565b509298975050505050505050565b602081016003831062000d9457fe5b91905290565b90815260200190565b600088825287602083015260018060a01b03808816604084015286606084015285608084015260e060a084015284518060e085015261010062000ded8282870160208a0162000e42565b9490911660c0840152601f01601f191691909101909101979650505050505050565b6040518181016001600160401b038111828210171562000e2e57600080fd5b604052919050565b6001600160a01b031690565b60005b8381101562000e5f57818101518382015260200162000e45565b8381111562000e6f576000848401525b50505050565b6001600160a01b03811681146200085c57600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e0516103005161032051610340516103605160601c61407d6200109a60003980611e175280612330528061263e52806129ae5280612cc0525080610c2952806112c1528061303b525080610e5e528061126c5280611e925280611eec52806122df528061250252806125385280612bab5280612c065280612c3d525080610af75280611206528061217852806121f6528061225952806125ed528061284a52806128cd52806129315280612b5a52508061062c52508061064d52806110f9525080610d3a525050806106f35280610a945250806106cd5280610e995250806112945280611ec552508061122e525080610ab852806113e7528061149252806121345280612388528061245552806126d2528061274452806128085280612a065280612a885280612d545280612e0c525080610954528061139752806114495280612367528061240a52806124bb52806126b0528061278a52806129e55280612ad35280612b165280612d325280612dc6525080610ee05250806109a752508061159052508061156c525080610cfb525080610cd7525080610c61525080611f6f525080611fb1525080611f90525061407d6000f3fe608060405234801561001057600080fd5b50600436106103155760003560e01c80637ecebe00116101a7578063a7488bb7116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e146105b9578063ed24911d146105cc578063f1493ee1146105d457610315565b8063d2946c2b1461058b578063d505accf14610593578063d5c096c4146105a657610315565b8063ac4316cb116100c8578063ac4316cb14610573578063b35056b81461057b578063b7b814fc1461058357610315565b8063a7488bb714610550578063a9059cbb14610558578063aaabadc51461056b57610315565b80638d928af81161015057806395d89b411161012a57806395d89b411461052d5780639c0e5d1314610535578063a457c2d71461053d57610315565b80638d928af81461050a57806390193b7c1461051257806395c95a4f1461052557610315565b8063851c1bb311610181578063851c1bb3146104dc57806387ec6817146104ef578063893d20e81461050257610315565b80637ecebe00146104b957806382687a56146104cc5780638456cb59146104d457610315565b806338fff2d01161026b5780636028bfd41161021457806370a08231116101ee57806370a082311461047d57806372f3824d1461049057806374f3b0091461049857610315565b80636028bfd41461044c5780636482c9d31461046d5780636945c1fd1461047557610315565b806350dd6ed91161024557806350dd6ed91461042957806354a844ba1461043c57806355c676281461044457610315565b806338fff2d014610406578063395093511461040e5780633f4ba83a1461042157610315565b80631dd746ea116102cd578063313ce567116102a7578063313ce567146103d45780633644e515146103e957806338e9922e146103f157610315565b80631dd746ea1461039757806323b872dd146103ac5780632541897f146103bf57610315565b8063095ea7b3116102fe578063095ea7b31461035857806318160ddd146103785780631c0de0511461038057610315565b806301ec954a1461031a57806306fdde0314610343575b600080fd5b61032d610328366004613981565b6105dc565b60405161033a9190613cf6565b60405180910390f35b61034b6107f1565b60405161033a9190613e14565b61036b6103663660046136f6565b610887565b60405161033a9190613cd3565b61032d61089e565b6103886108a4565b60405161033a93929190613cde565b61039f6108cd565b60405161033a9190613c92565b61036b6103ba366004613646565b6108dc565b6103c7610952565b60405161033a9190613c4a565b6103dc610976565b60405161033a9190613fc1565b61032d61097f565b6104046103ff366004613aa0565b610989565b005b61032d6109a5565b61036b61041c3660046136f6565b6109c9565b610404610a04565b610404610437366004613840565b610a18565b610404610a36565b61032d610a48565b61045f61045a366004613741565b610a5b565b60405161033a929190613fa8565b61032d610a92565b6103c7610ab6565b61032d61048b3660046135f2565b610ada565b61032d610af5565b6104ab6104a6366004613741565b610b19565b60405161033a929190613ca5565b61032d6104c73660046135f2565b610c1c565b61032d610c27565b610404610c4b565b61032d6104ea3660046137e4565b610c5d565b61045f6104fd366004613741565b610caf565b6103c7610cd5565b6103c7610cf9565b61032d6105203660046135f2565b610d1d565b61032d610d38565b61034b610d5c565b61034b610dbd565b61036b61054b3660046136f6565b610e1e565b61032d610e5c565b61036b6105663660046136f6565b610e80565b6103c7610e8d565b61032d610e97565b61036b610ebb565b610404610ecc565b6103c7610ede565b6104046105a1366004613686565b610f02565b6104ab6105b4366004613741565b610f8d565b61032d6105c736600461360e565b6110b0565b61032d6110ed565b61032d6110f7565b600084608001516106096105ee610cf9565b6001600160a01b0316336001600160a01b03161460cd611174565b61061e6106146109a5565b82146101f4611174565b610626611182565b426106717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611195565b10156106985760405162461bcd60e51b815260040161068f90613f71565b60405180910390fd5b60606106a26111a5565b90506106ae8682611318565b6106b66134c6565b60405180606001604052806106c9610a48565b81527f000000000000000000000000000000000000000000000000000000000000000060208201527f0000000000000000000000000000000000000000000000000000000000000000604090910152905060008851600181111561072957fe5b141561078b57610750886060015183888151811061074357fe5b6020026020010151611387565b60608901526000610762898984611393565b90506107818184888151811061077457fe5b6020026020010151611439565b94505050506107e8565b60018851600181111561079a57fe5b14156107e5576107b4886060015183878151811061074357fe5b606089015260006107c6898984611445565b9050610781818489815181106107d857fe5b60200260200101516114d9565b50505b50949350505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b820191906000526020600020905b81548152906001019060200180831161086057829003601f168201915b5050505050905090565b60006108943384846114e5565b5060015b92915050565b60025490565b60008060006108b161154d565b1592506108bc61156a565b91506108c661158e565b9050909192565b60606108d76111a5565b905090565b6000806108e985336110b0565b905061090d336001600160a01b03871614806109055750838210155b61019e611174565b6109188585856115b2565b336001600160a01b0386161480159061093357506000198114155b156109455761094585338584036114e5565b60019150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b60006108d76110ed565b610991611692565b610999611182565b6109a2816116d8565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108949185906109ff9086611751565b6114e5565b610a0c611692565b610a166000611763565b565b610a20611692565b610a28611182565b610a3282826117f4565b5050565b610a3e611692565b610a166001611902565b6008546000906108d79060c0603f611959565b60006060610a718651610a6c611968565b61196d565b610a868989898989898961197a6119cc611a35565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60608088610b286105ee610cf9565b610b336106146109a5565b60606000610b4086611bea565b15610b6857610b4d611c19565b610b5f89610b5961089e565b88611c2c565b92509050610bba565b610b70611c58565b6060610b7a6111a5565b9050610b868a82611318565b610baa8d8d8d8d8d610b96610ebb565b610ba0578d610ba3565b60005b878e61197a565b93509150610bb883826119cc565b505b610bc48b82611c60565b81895167ffffffffffffffff81118015610bdd57600080fd5b50604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061089882610d1d565b7f000000000000000000000000000000000000000000000000000000000000000090565b610c53611692565b610a166001611763565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610c92929190613bd4565b604051602081830303815290604052805190602001209050919050565b60006060610cc08651610a6c611968565b610a8689898989898989611c6a611c86611a35565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b600080610e2b33856110b0565b9050808310610e4557610e40338560006114e5565b610e52565b610e5233858584036114e5565b5060019392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006108943384846115b2565b60006108d7611cef565b7f000000000000000000000000000000000000000000000000000000000000000090565b6008546000906108d79060ff611d69565b610ed4611692565b610a166000611902565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610f318c610d1d565b89604051602001610f4796959493929190613d5e565b604051602081830303815290604052805190602001209050610f788882610f6f878787611d73565b886101f8611db2565b610f838888886114e5565b5050505050505050565b60608088610f9c6105ee610cf9565b610fa76106146109a5565b610faf611c58565b6060610fb96111a5565b9050610fc361089e565b6110705760006060610fd88d8d8d868b611e09565b91509150610ff1610fe7611f2f565b83101560cc611174565b6110036000610ffe611f2f565b611f36565b6110168b61100f611f2f565b8403611f36565b6110208184611c86565b808a5167ffffffffffffffff8111801561103957600080fd5b50604051908082528060200260200182016040528015611063578160200160208202803683370190505b5095509550505050610c0f565b61107a8882611318565b600060606110a28d8d8d8d8d61108e610ebb565b611098578d61109b565b60005b898e611c6a565b915091506110168b83611f36565b60006110ba610cf9565b6001600160a01b0316826001600160a01b031614156110dc5750600019610898565b6110e68383611f40565b9050610898565b60006108d7611f6b565b7f000000000000000000000000000000000000000000000000000000000000000090565b80610a3281612008565b6000611132848484612086565b506001901b60001901811b1992909216911b1790565b6000611158838311156001611174565b50900390565b600081831061116d578161094b565b5090919050565b81610a3257610a32816120cd565b610a1661118d61154d565b610192611174565b8181018281101561089857600080fd5b606060006111b1611968565b905060608167ffffffffffffffff811180156111cc57600080fd5b506040519080825280602002602001820160405280156111f6578160200160208202803683370190505b50905060005b82811015611311577f000000000000000000000000000000000000000000000000000000000000000081141561126a577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b602002602001018181525050611309565b7f00000000000000000000000000000000000000000000000000000000000000008114156112bf577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561130957670de0b6b3a76400008282815181106112fc57fe5b6020026020010181815250505b6001016111fc565b5091505090565b8151815161132790829061196d565b60005b818110156113815761136284828151811061134157fe5b602002602001015184838151811061135557fe5b60200260200101516120f7565b84828151811061136e57fe5b602090810291909101015260010161132a565b50505050565b600061094b83836120f7565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113e5576113de84848461212d565b905061094b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b0316141561142e576113de8484846124b4565b61094b6101356120cd565b600061094b83836127b0565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b03161415611490576113de848484612801565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b0316141561142e576113de848484612b0f565b600061094b8383612e36565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611540908590613cf6565b60405180910390a3505050565b600061155761158e565b4211806108d757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6115c96001600160a01b0384161515610198611174565b6115e06001600160a01b0383161515610199611174565b6115eb838383612081565b6001600160a01b03831660009081526020819052604090205461161190826101a0612e84565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546116409082611751565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611540908590613cf6565b60006116c16000357fffffffff0000000000000000000000000000000000000000000000000000000016610c5d565b90506109a26116d08233612e9a565b610191611174565b6116ed6116e3612f83565b82101560cb611174565b6117026116f8612f8c565b82111560ca611174565b600854611713908260c0603f611125565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90611746908390613cf6565b60405180910390a150565b600082820161094b8482101583611174565b80156117835761177e61177461156a565b4210610193611174565b611798565b61179861178e61158e565b42106101a9611174565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611746908390613cd3565b60006117fe6109a5565b9050600061180a610cf9565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401611837929190613ddf565b60806040518083038186803b15801561184f57600080fd5b505afa158015611863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118879190613ab8565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d492506118d4915085908790600401613dbe565b600060405180830381600087803b1580156118ee57600080fd5b505af1158015610f83573d6000803e3d6000fd5b600854611911908260ff612f98565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611944908390613cd3565b60405180910390a1806109a2576109a2610a16565b6001901b6000190191901c1690565b600390565b610a328183146067611174565b60006060600061198984612fbf565b9050600181600181111561199957fe5b146119ae576119a96101626120cd565b6119be565b6119b88885612fd5565b90935091505b509850989650505050505050565b815181516119db90829061196d565b60005b8181101561138157611a168482815181106119f557fe5b6020026020010151848381518110611a0957fe5b60200260200101516127b0565b848281518110611a2257fe5b60209081029190910101526001016119de565b333014611b24576000306001600160a01b0316600036604051611a59929190613c04565b6000604051808303816000865af19150503d8060008114611a96576040519150601f19603f3d011682016040523d82523d6000602084013e611a9b565b606091505b505090508060008114611aaa57fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb000000000000000000000000000000000000000000000000000000008114611b06573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611b2c611c58565b6060611b366111a5565b9050611b428782611318565b60006060611b5a8c8c8c8c8c8c898d8d63ffffffff16565b91509150611b6c81848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b6000808251118015610898575060ff801682806020019051810190611c0f9190613af8565b60ff161492915050565b610a16611c24610ebb565b6101b6611174565b600060606000611c3b846130a1565b90506060611c4a8787846130b7565b919791965090945050505050565b610a16611182565b610a328282613166565b60006060611c796101626120cd565b9850989650505050505050565b81518151611c9590829061196d565b60005b8181101561138157611cd0848281518110611caf57fe5b6020026020010151848381518110611cc357fe5b6020026020010151612e36565b848281518110611cdc57fe5b6020908102919091010152600101611c98565b6000611cf9610cf9565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3157600080fd5b505afa158015611d45573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190613824565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b6000611dbd85613232565b9050611dd3611dcd87838761324e565b83611174565b611de2428410156101b8611174565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b60006060611e15611182565b7f0000000000000000000000000000000000000000000000000000000000000000611e506001600160a01b0388811690831614610156611174565b611e70816001600160a01b0316876001600160a01b031614610156611174565b6dffffffffffffffffffffffffffff6060611e8a8661331b565b9050611ee9817f000000000000000000000000000000000000000000000000000000000000000081518110611ebb57fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000611387565b817f000000000000000000000000000000000000000000000000000000000000000081518110611f1557fe5b602090810291909101015290999098509650505050505050565b620f424090565b610a328282613331565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611fd86133c4565b30604051602001611fed959493929190613d92565b60405160208183030381529060405280519060200120905090565b600281511015612017576109a2565b60008160008151811061202657fe5b602002602001015190506000600190505b825181101561208157600083828151811061204e57fe5b60200260200101519050612077816001600160a01b0316846001600160a01b0316106065611174565b9150600101612037565b505050565b61209561010083106064611174565b6120be600182101580156120b757506120b360ff846101000361115e565b8211155b6064611174565b61208183821c156101b4611174565b6109a2817f42414c00000000000000000000000000000000000000000000000000000000006133c8565b600082820261211b84158061211457508385838161211157fe5b04145b6003611174565b670de0b6b3a764000090049392505050565b60006121737f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b6000837f0000000000000000000000000000000000000000000000000000000000000000815181106121a157fe5b6020026020010151116121c65760405162461bcd60e51b815260040161068f90613f3a565b8160400151846060015110156121ee5760405162461bcd60e51b815260040161068f90613e95565b6000612231847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b60200260200101518660600151611751565b9050600061229f612253856020015188606001516120f790919063ffffffff16565b612299877f00000000000000000000000000000000000000000000000000000000000000008151811061228257fe5b6020026020010151856127b090919063ffffffff16565b906120f7565b905083602001516122bd8760600151836127b090919063ffffffff16565b10156122db5760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061230857fe5b6020026020010151101561232e5760405162461bcd60e51b815260040161068f90613e27565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16123656109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160006040518863ffffffff1660e01b81526004016123d69796959493929190613d1e565b600060405180830381600087803b1580156123f057600080fd5b505af1158015612404573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b426040516124a3959493929190613c5e565b60405180910390a295945050505050565b60006124fa7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b600061252b847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b90506000612591612578867f00000000000000000000000000000000000000000000000000000000000000008151811061256157fe5b6020026020010151846127b090919063ffffffff16565b6020860151606089015161258b916127b0565b906127b0565b905083604001518110156125b75760405162461bcd60e51b815260040161068f90613e95565b602084015160608701516125cb90836127b0565b10156125e95760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061261657fe5b6020026020010151101561263c5760405162461bcd60e51b815260040161068f90613ecc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16126736109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526126ff93927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600190600401613d1e565b600060405180830381600087803b15801561271957600080fd5b505af115801561272d573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182875b60006127bf8215156004611174565b826127cc57506000610898565b670de0b6b3a7640000838102906127ef908583816127e657fe5b04146005611174565b8281816127f857fe5b04915050610898565b60006128477f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b827f00000000000000000000000000000000000000000000000000000000000000008151811061287357fe5b602002602001015184606001511061289d5760405162461bcd60e51b815260040161068f90613e5e565b8160400151846060015110156128c55760405162461bcd60e51b815260040161068f90613e95565b6000612908847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b60200260200101518660600151611148565b9050600061297061292a856020015188606001516120f790919063ffffffff16565b61229984887f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b60200260200101516127b090919063ffffffff16565b9050836020015161298e8760600151836127b090919063ffffffff16565b10156129ac5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16129e36109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160016040518863ffffffff1660e01b8152600401612a549796959493929190613d1e565b600060405180830381600087803b158015612a6e57600080fd5b505af1158015612a82573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b6000612b557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b6000837f000000000000000000000000000000000000000000000000000000000000000081518110612b8357fe5b602002602001015111612ba85760405162461bcd60e51b815260040161068f90613f3a565b827f000000000000000000000000000000000000000000000000000000000000000081518110612bd457fe5b6020026020010151846060015110612bfe5760405162461bcd60e51b815260040161068f90613e5e565b6000612c2f847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b90506000612c6661257883877f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b90508360400151811015612c8c5760405162461bcd60e51b815260040161068f90613e95565b60208401516060870151612ca090836127b0565b1015612cbe5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612cf56109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b168152612d8193927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600090600401613d1e565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182876127b0565b6000612e458215156004611174565b82612e5257506000610898565b670de0b6b3a764000083810290612e6c908583816127e657fe5b826001820381612e7857fe5b04600101915050610898565b6000612e938484111583611174565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612eb9610cd5565b6001600160a01b031614158015612ed45750612ed483613429565b15612efc57612ee1610cd5565b6001600160a01b0316336001600160a01b0316149050610898565b612f04611cef565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612f3393929190613cff565b60206040518083038186803b158015612f4b57600080fd5b505afa158015612f5f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190613721565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284612fae576000612fb1565b60015b60ff16901b17949350505050565b600081806020019051810190610898919061388e565b600060606000612fe484613497565b90506060855167ffffffffffffffff8111801561300057600080fd5b5060405190808252806020026020018201604052801561302a578160200160208202803683370190505b50905060005b8651811015613095577f0000000000000000000000000000000000000000000000000000000000000000811461308d5786818151811061306c57fe5b602002602001015182828151811061308057fe5b6020026020010181815250505b600101613030565b50909590945092505050565b60008180602001905181019061094b9190613b14565b606060006130c583856127b0565b9050845167ffffffffffffffff811180156130df57600080fd5b50604051908082528060200260200182016040528015613109578160200160208202803683370190505b50915060005b855181101561315d5761313e8287838151811061312857fe5b60200260200101516120f790919063ffffffff16565b83828151811061314a57fe5b602090810291909101015260010161310f565b50509392505050565b61317d6001600160a01b038316151561019b611174565b61318982600083612081565b6001600160a01b0382166000908152602081905260409020546131af90826101b2612e84565b6001600160a01b0383166000908152602081905260409020556131e26131dd826131d761089e565b906134ad565b6134bb565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516132269190613cf6565b60405180910390a35050565b600061323c611f6b565b82604051602001610c92929190613c14565b600061326082516041146101b9611174565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613299908990859088908890613df6565b6020604051602081039080840390855afa1580156132bb573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b0381161580159061330f5750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b60608180602001905181019061094b91906138d7565b61333d60008383612081565b6133526131dd8261334c61089e565b90611751565b6001600160a01b0382166000908152602081905260409020546133759082611751565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613226908590613cf6565b4690565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b60006134547f38e9922e00000000000000000000000000000000000000000000000000000000610c5d565b82148061348857506134857f50dd6ed900000000000000000000000000000000000000000000000000000000610c5d565b82145b806108985750610898826134c0565b60008180602001905181019061094b91906138aa565b600061094b83836001612e84565b600255565b50600090565b60405180606001604052806000815260200160008152602001600081525090565b803561089881614016565b600082601f830112613502578081fd5b813561351561351082613ff6565b613fcf565b81815291506020808301908481018184028601820187101561353657600080fd5b60005b8481101561355557813584529282019290820190600101613539565b505050505092915050565b600082601f830112613570578081fd5b813567ffffffffffffffff811115613586578182fd5b6135b760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613fcf565b91508082528360208285010111156135ce57600080fd5b8060208401602084013760009082016020015292915050565b80356108988161402b565b600060208284031215613603578081fd5b813561094b81614016565b60008060408385031215613620578081fd5b823561362b81614016565b9150602083013561363b81614016565b809150509250929050565b60008060006060848603121561365a578081fd5b833561366581614016565b9250602084013561367581614016565b929592945050506040919091013590565b600080600080600080600060e0888a0312156136a0578283fd5b87356136ab81614016565b965060208801356136bb81614016565b9550604088013594506060880135935060808801356136d981614038565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215613708578182fd5b823561371381614016565b946020939093013593505050565b600060208284031215613732578081fd5b8151801515811461094b578182fd5b600080600080600080600060e0888a03121561375b578081fd5b87359650602088013561376d81614016565b9550604088013561377d81614016565b9450606088013567ffffffffffffffff80821115613799578283fd5b6137a58b838c016134f2565b955060808a0135945060a08a0135935060c08a01359150808211156137c8578283fd5b506137d58a828b01613560565b91505092959891949750929550565b6000602082840312156137f5578081fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461094b578182fd5b600060208284031215613835578081fd5b815161094b81614016565b60008060408385031215613852578182fd5b823561385d81614016565b9150602083013567ffffffffffffffff811115613878578182fd5b61388485828601613560565b9150509250929050565b60006020828403121561389f578081fd5b815161094b8161402b565b600080604083850312156138bc578182fd5b82516138c78161402b565b6020939093015192949293505050565b600080604083850312156138e9578182fd5b8251600481106138f7578283fd5b8092505060208084015167ffffffffffffffff811115613915578283fd5b8401601f81018613613925578283fd5b805161393361351082613ff6565b81815283810190838501858402850186018a101561394f578687fd5b8694505b83851015613971578051835260019490940193918501918501613953565b5080955050505050509250929050565b60008060008060808587031215613996578182fd5b843567ffffffffffffffff808211156139ad578384fd5b818701915061012080838a0312156139c3578485fd5b6139cc81613fcf565b90506139d889846135e7565b81526139e789602085016134e7565b60208201526139f989604085016134e7565b6040820152606083013560608201526080830135608082015260a083013560a0820152613a298960c085016134e7565b60c0820152613a3b8960e085016134e7565b60e08201526101008084013583811115613a53578687fd5b613a5f8b828701613560565b828401525050809650506020870135915080821115613a7c578384fd5b50613a89878288016134f2565b949794965050505060408301359260600135919050565b600060208284031215613ab1578081fd5b5035919050565b60008060008060808587031215613acd578182fd5b8451935060208501519250604085015191506060850151613aed81614016565b939692955090935050565b600060208284031215613b09578081fd5b815161094b81614038565b60008060408385031215613b26578182fd5b82516138c781614038565b6000815180845260208085019450808401835b83811015613b6057815187529582019590820190600101613b44565b509495945050505050565b60008151808452815b81811015613b9057602081850181015186830182015201613b74565b81811115613ba15782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b60006020825261094b6020830184613b31565b600060408252613cb86040830185613b31565b8281036020840152613cca8185613b31565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9687526001600160a01b03958616602088015293851660408701526060860192909252909216608084015260a0830191909152151560c082015260e00190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b600083825260406020830152613dd76040830184613b6b565b949350505050565b9182526001600160a01b0316602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825261094b6020830184613b6b565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526014908201527f496e73756666696369656e742062616c616e6365000000000000000000000000604082015260600190565b60208082526014908201527f4f726465722073697a652076696f6c6174696f6e000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526012908201527f5072696365206f7574206f6620626f756e640000000000000000000000000000604082015260600190565b6020808252600e908201527f497373756520736f6c64206f7574000000000000000000000000000000000000604082015260600190565b6020808252600e908201527f54696d654c696d6974204f766572000000000000000000000000000000000000604082015260600190565b600083825260406020830152613dd76040830184613b31565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715613fee57600080fd5b604052919050565b600067ffffffffffffffff82111561400c578081fd5b5060209081020190565b6001600160a01b03811681146109a257600080fd5b600281106109a257600080fd5b60ff811681146109a257600080fdfea26469706673582212207ec4ecc0834c1fb0365ddf86f5931bb0419a1c824ed48daedf537cd736be022e64736f6c63430007010033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106103155760003560e01c80637ecebe00116101a7578063a7488bb7116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e146105b9578063ed24911d146105cc578063f1493ee1146105d457610315565b8063d2946c2b1461058b578063d505accf14610593578063d5c096c4146105a657610315565b8063ac4316cb116100c8578063ac4316cb14610573578063b35056b81461057b578063b7b814fc1461058357610315565b8063a7488bb714610550578063a9059cbb14610558578063aaabadc51461056b57610315565b80638d928af81161015057806395d89b411161012a57806395d89b411461052d5780639c0e5d1314610535578063a457c2d71461053d57610315565b80638d928af81461050a57806390193b7c1461051257806395c95a4f1461052557610315565b8063851c1bb311610181578063851c1bb3146104dc57806387ec6817146104ef578063893d20e81461050257610315565b80637ecebe00146104b957806382687a56146104cc5780638456cb59146104d457610315565b806338fff2d01161026b5780636028bfd41161021457806370a08231116101ee57806370a082311461047d57806372f3824d1461049057806374f3b0091461049857610315565b80636028bfd41461044c5780636482c9d31461046d5780636945c1fd1461047557610315565b806350dd6ed91161024557806350dd6ed91461042957806354a844ba1461043c57806355c676281461044457610315565b806338fff2d014610406578063395093511461040e5780633f4ba83a1461042157610315565b80631dd746ea116102cd578063313ce567116102a7578063313ce567146103d45780633644e515146103e957806338e9922e146103f157610315565b80631dd746ea1461039757806323b872dd146103ac5780632541897f146103bf57610315565b8063095ea7b3116102fe578063095ea7b31461035857806318160ddd146103785780631c0de0511461038057610315565b806301ec954a1461031a57806306fdde0314610343575b600080fd5b61032d610328366004613981565b6105dc565b60405161033a9190613cf6565b60405180910390f35b61034b6107f1565b60405161033a9190613e14565b61036b6103663660046136f6565b610887565b60405161033a9190613cd3565b61032d61089e565b6103886108a4565b60405161033a93929190613cde565b61039f6108cd565b60405161033a9190613c92565b61036b6103ba366004613646565b6108dc565b6103c7610952565b60405161033a9190613c4a565b6103dc610976565b60405161033a9190613fc1565b61032d61097f565b6104046103ff366004613aa0565b610989565b005b61032d6109a5565b61036b61041c3660046136f6565b6109c9565b610404610a04565b610404610437366004613840565b610a18565b610404610a36565b61032d610a48565b61045f61045a366004613741565b610a5b565b60405161033a929190613fa8565b61032d610a92565b6103c7610ab6565b61032d61048b3660046135f2565b610ada565b61032d610af5565b6104ab6104a6366004613741565b610b19565b60405161033a929190613ca5565b61032d6104c73660046135f2565b610c1c565b61032d610c27565b610404610c4b565b61032d6104ea3660046137e4565b610c5d565b61045f6104fd366004613741565b610caf565b6103c7610cd5565b6103c7610cf9565b61032d6105203660046135f2565b610d1d565b61032d610d38565b61034b610d5c565b61034b610dbd565b61036b61054b3660046136f6565b610e1e565b61032d610e5c565b61036b6105663660046136f6565b610e80565b6103c7610e8d565b61032d610e97565b61036b610ebb565b610404610ecc565b6103c7610ede565b6104046105a1366004613686565b610f02565b6104ab6105b4366004613741565b610f8d565b61032d6105c736600461360e565b6110b0565b61032d6110ed565b61032d6110f7565b600084608001516106096105ee610cf9565b6001600160a01b0316336001600160a01b03161460cd611174565b61061e6106146109a5565b82146101f4611174565b610626611182565b426106717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611195565b10156106985760405162461bcd60e51b815260040161068f90613f71565b60405180910390fd5b60606106a26111a5565b90506106ae8682611318565b6106b66134c6565b60405180606001604052806106c9610a48565b81527f000000000000000000000000000000000000000000000000000000000000000060208201527f0000000000000000000000000000000000000000000000000000000000000000604090910152905060008851600181111561072957fe5b141561078b57610750886060015183888151811061074357fe5b6020026020010151611387565b60608901526000610762898984611393565b90506107818184888151811061077457fe5b6020026020010151611439565b94505050506107e8565b60018851600181111561079a57fe5b14156107e5576107b4886060015183878151811061074357fe5b606089015260006107c6898984611445565b9050610781818489815181106107d857fe5b60200260200101516114d9565b50505b50949350505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b820191906000526020600020905b81548152906001019060200180831161086057829003601f168201915b5050505050905090565b60006108943384846114e5565b5060015b92915050565b60025490565b60008060006108b161154d565b1592506108bc61156a565b91506108c661158e565b9050909192565b60606108d76111a5565b905090565b6000806108e985336110b0565b905061090d336001600160a01b03871614806109055750838210155b61019e611174565b6109188585856115b2565b336001600160a01b0386161480159061093357506000198114155b156109455761094585338584036114e5565b60019150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b60006108d76110ed565b610991611692565b610999611182565b6109a2816116d8565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108949185906109ff9086611751565b6114e5565b610a0c611692565b610a166000611763565b565b610a20611692565b610a28611182565b610a3282826117f4565b5050565b610a3e611692565b610a166001611902565b6008546000906108d79060c0603f611959565b60006060610a718651610a6c611968565b61196d565b610a868989898989898961197a6119cc611a35565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60608088610b286105ee610cf9565b610b336106146109a5565b60606000610b4086611bea565b15610b6857610b4d611c19565b610b5f89610b5961089e565b88611c2c565b92509050610bba565b610b70611c58565b6060610b7a6111a5565b9050610b868a82611318565b610baa8d8d8d8d8d610b96610ebb565b610ba0578d610ba3565b60005b878e61197a565b93509150610bb883826119cc565b505b610bc48b82611c60565b81895167ffffffffffffffff81118015610bdd57600080fd5b50604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061089882610d1d565b7f000000000000000000000000000000000000000000000000000000000000000090565b610c53611692565b610a166001611763565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610c92929190613bd4565b604051602081830303815290604052805190602001209050919050565b60006060610cc08651610a6c611968565b610a8689898989898989611c6a611c86611a35565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b600080610e2b33856110b0565b9050808310610e4557610e40338560006114e5565b610e52565b610e5233858584036114e5565b5060019392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006108943384846115b2565b60006108d7611cef565b7f000000000000000000000000000000000000000000000000000000000000000090565b6008546000906108d79060ff611d69565b610ed4611692565b610a166000611902565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610f318c610d1d565b89604051602001610f4796959493929190613d5e565b604051602081830303815290604052805190602001209050610f788882610f6f878787611d73565b886101f8611db2565b610f838888886114e5565b5050505050505050565b60608088610f9c6105ee610cf9565b610fa76106146109a5565b610faf611c58565b6060610fb96111a5565b9050610fc361089e565b6110705760006060610fd88d8d8d868b611e09565b91509150610ff1610fe7611f2f565b83101560cc611174565b6110036000610ffe611f2f565b611f36565b6110168b61100f611f2f565b8403611f36565b6110208184611c86565b808a5167ffffffffffffffff8111801561103957600080fd5b50604051908082528060200260200182016040528015611063578160200160208202803683370190505b5095509550505050610c0f565b61107a8882611318565b600060606110a28d8d8d8d8d61108e610ebb565b611098578d61109b565b60005b898e611c6a565b915091506110168b83611f36565b60006110ba610cf9565b6001600160a01b0316826001600160a01b031614156110dc5750600019610898565b6110e68383611f40565b9050610898565b60006108d7611f6b565b7f000000000000000000000000000000000000000000000000000000000000000090565b80610a3281612008565b6000611132848484612086565b506001901b60001901811b1992909216911b1790565b6000611158838311156001611174565b50900390565b600081831061116d578161094b565b5090919050565b81610a3257610a32816120cd565b610a1661118d61154d565b610192611174565b8181018281101561089857600080fd5b606060006111b1611968565b905060608167ffffffffffffffff811180156111cc57600080fd5b506040519080825280602002602001820160405280156111f6578160200160208202803683370190505b50905060005b82811015611311577f000000000000000000000000000000000000000000000000000000000000000081141561126a577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b602002602001018181525050611309565b7f00000000000000000000000000000000000000000000000000000000000000008114156112bf577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561130957670de0b6b3a76400008282815181106112fc57fe5b6020026020010181815250505b6001016111fc565b5091505090565b8151815161132790829061196d565b60005b818110156113815761136284828151811061134157fe5b602002602001015184838151811061135557fe5b60200260200101516120f7565b84828151811061136e57fe5b602090810291909101015260010161132a565b50505050565b600061094b83836120f7565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113e5576113de84848461212d565b905061094b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b0316141561142e576113de8484846124b4565b61094b6101356120cd565b600061094b83836127b0565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b03161415611490576113de848484612801565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b0316141561142e576113de848484612b0f565b600061094b8383612e36565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611540908590613cf6565b60405180910390a3505050565b600061155761158e565b4211806108d757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6115c96001600160a01b0384161515610198611174565b6115e06001600160a01b0383161515610199611174565b6115eb838383612081565b6001600160a01b03831660009081526020819052604090205461161190826101a0612e84565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546116409082611751565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611540908590613cf6565b60006116c16000357fffffffff0000000000000000000000000000000000000000000000000000000016610c5d565b90506109a26116d08233612e9a565b610191611174565b6116ed6116e3612f83565b82101560cb611174565b6117026116f8612f8c565b82111560ca611174565b600854611713908260c0603f611125565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90611746908390613cf6565b60405180910390a150565b600082820161094b8482101583611174565b80156117835761177e61177461156a565b4210610193611174565b611798565b61179861178e61158e565b42106101a9611174565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611746908390613cd3565b60006117fe6109a5565b9050600061180a610cf9565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401611837929190613ddf565b60806040518083038186803b15801561184f57600080fd5b505afa158015611863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118879190613ab8565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d492506118d4915085908790600401613dbe565b600060405180830381600087803b1580156118ee57600080fd5b505af1158015610f83573d6000803e3d6000fd5b600854611911908260ff612f98565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611944908390613cd3565b60405180910390a1806109a2576109a2610a16565b6001901b6000190191901c1690565b600390565b610a328183146067611174565b60006060600061198984612fbf565b9050600181600181111561199957fe5b146119ae576119a96101626120cd565b6119be565b6119b88885612fd5565b90935091505b509850989650505050505050565b815181516119db90829061196d565b60005b8181101561138157611a168482815181106119f557fe5b6020026020010151848381518110611a0957fe5b60200260200101516127b0565b848281518110611a2257fe5b60209081029190910101526001016119de565b333014611b24576000306001600160a01b0316600036604051611a59929190613c04565b6000604051808303816000865af19150503d8060008114611a96576040519150601f19603f3d011682016040523d82523d6000602084013e611a9b565b606091505b505090508060008114611aaa57fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb000000000000000000000000000000000000000000000000000000008114611b06573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611b2c611c58565b6060611b366111a5565b9050611b428782611318565b60006060611b5a8c8c8c8c8c8c898d8d63ffffffff16565b91509150611b6c81848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b6000808251118015610898575060ff801682806020019051810190611c0f9190613af8565b60ff161492915050565b610a16611c24610ebb565b6101b6611174565b600060606000611c3b846130a1565b90506060611c4a8787846130b7565b919791965090945050505050565b610a16611182565b610a328282613166565b60006060611c796101626120cd565b9850989650505050505050565b81518151611c9590829061196d565b60005b8181101561138157611cd0848281518110611caf57fe5b6020026020010151848381518110611cc357fe5b6020026020010151612e36565b848281518110611cdc57fe5b6020908102919091010152600101611c98565b6000611cf9610cf9565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3157600080fd5b505afa158015611d45573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190613824565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b6000611dbd85613232565b9050611dd3611dcd87838761324e565b83611174565b611de2428410156101b8611174565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b60006060611e15611182565b7f0000000000000000000000000000000000000000000000000000000000000000611e506001600160a01b0388811690831614610156611174565b611e70816001600160a01b0316876001600160a01b031614610156611174565b6dffffffffffffffffffffffffffff6060611e8a8661331b565b9050611ee9817f000000000000000000000000000000000000000000000000000000000000000081518110611ebb57fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000611387565b817f000000000000000000000000000000000000000000000000000000000000000081518110611f1557fe5b602090810291909101015290999098509650505050505050565b620f424090565b610a328282613331565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611fd86133c4565b30604051602001611fed959493929190613d92565b60405160208183030381529060405280519060200120905090565b600281511015612017576109a2565b60008160008151811061202657fe5b602002602001015190506000600190505b825181101561208157600083828151811061204e57fe5b60200260200101519050612077816001600160a01b0316846001600160a01b0316106065611174565b9150600101612037565b505050565b61209561010083106064611174565b6120be600182101580156120b757506120b360ff846101000361115e565b8211155b6064611174565b61208183821c156101b4611174565b6109a2817f42414c00000000000000000000000000000000000000000000000000000000006133c8565b600082820261211b84158061211457508385838161211157fe5b04145b6003611174565b670de0b6b3a764000090049392505050565b60006121737f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b6000837f0000000000000000000000000000000000000000000000000000000000000000815181106121a157fe5b6020026020010151116121c65760405162461bcd60e51b815260040161068f90613f3a565b8160400151846060015110156121ee5760405162461bcd60e51b815260040161068f90613e95565b6000612231847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b60200260200101518660600151611751565b9050600061229f612253856020015188606001516120f790919063ffffffff16565b612299877f00000000000000000000000000000000000000000000000000000000000000008151811061228257fe5b6020026020010151856127b090919063ffffffff16565b906120f7565b905083602001516122bd8760600151836127b090919063ffffffff16565b10156122db5760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061230857fe5b6020026020010151101561232e5760405162461bcd60e51b815260040161068f90613e27565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16123656109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160006040518863ffffffff1660e01b81526004016123d69796959493929190613d1e565b600060405180830381600087803b1580156123f057600080fd5b505af1158015612404573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b426040516124a3959493929190613c5e565b60405180910390a295945050505050565b60006124fa7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b600061252b847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b90506000612591612578867f00000000000000000000000000000000000000000000000000000000000000008151811061256157fe5b6020026020010151846127b090919063ffffffff16565b6020860151606089015161258b916127b0565b906127b0565b905083604001518110156125b75760405162461bcd60e51b815260040161068f90613e95565b602084015160608701516125cb90836127b0565b10156125e95760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061261657fe5b6020026020010151101561263c5760405162461bcd60e51b815260040161068f90613ecc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16126736109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526126ff93927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600190600401613d1e565b600060405180830381600087803b15801561271957600080fd5b505af115801561272d573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182875b60006127bf8215156004611174565b826127cc57506000610898565b670de0b6b3a7640000838102906127ef908583816127e657fe5b04146005611174565b8281816127f857fe5b04915050610898565b60006128477f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b827f00000000000000000000000000000000000000000000000000000000000000008151811061287357fe5b602002602001015184606001511061289d5760405162461bcd60e51b815260040161068f90613e5e565b8160400151846060015110156128c55760405162461bcd60e51b815260040161068f90613e95565b6000612908847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b60200260200101518660600151611148565b9050600061297061292a856020015188606001516120f790919063ffffffff16565b61229984887f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b60200260200101516127b090919063ffffffff16565b9050836020015161298e8760600151836127b090919063ffffffff16565b10156129ac5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16129e36109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160016040518863ffffffff1660e01b8152600401612a549796959493929190613d1e565b600060405180830381600087803b158015612a6e57600080fd5b505af1158015612a82573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b6000612b557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b6000837f000000000000000000000000000000000000000000000000000000000000000081518110612b8357fe5b602002602001015111612ba85760405162461bcd60e51b815260040161068f90613f3a565b827f000000000000000000000000000000000000000000000000000000000000000081518110612bd457fe5b6020026020010151846060015110612bfe5760405162461bcd60e51b815260040161068f90613e5e565b6000612c2f847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b90506000612c6661257883877f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b90508360400151811015612c8c5760405162461bcd60e51b815260040161068f90613e95565b60208401516060870151612ca090836127b0565b1015612cbe5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612cf56109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b168152612d8193927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600090600401613d1e565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182876127b0565b6000612e458215156004611174565b82612e5257506000610898565b670de0b6b3a764000083810290612e6c908583816127e657fe5b826001820381612e7857fe5b04600101915050610898565b6000612e938484111583611174565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612eb9610cd5565b6001600160a01b031614158015612ed45750612ed483613429565b15612efc57612ee1610cd5565b6001600160a01b0316336001600160a01b0316149050610898565b612f04611cef565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612f3393929190613cff565b60206040518083038186803b158015612f4b57600080fd5b505afa158015612f5f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190613721565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284612fae576000612fb1565b60015b60ff16901b17949350505050565b600081806020019051810190610898919061388e565b600060606000612fe484613497565b90506060855167ffffffffffffffff8111801561300057600080fd5b5060405190808252806020026020018201604052801561302a578160200160208202803683370190505b50905060005b8651811015613095577f0000000000000000000000000000000000000000000000000000000000000000811461308d5786818151811061306c57fe5b602002602001015182828151811061308057fe5b6020026020010181815250505b600101613030565b50909590945092505050565b60008180602001905181019061094b9190613b14565b606060006130c583856127b0565b9050845167ffffffffffffffff811180156130df57600080fd5b50604051908082528060200260200182016040528015613109578160200160208202803683370190505b50915060005b855181101561315d5761313e8287838151811061312857fe5b60200260200101516120f790919063ffffffff16565b83828151811061314a57fe5b602090810291909101015260010161310f565b50509392505050565b61317d6001600160a01b038316151561019b611174565b61318982600083612081565b6001600160a01b0382166000908152602081905260409020546131af90826101b2612e84565b6001600160a01b0383166000908152602081905260409020556131e26131dd826131d761089e565b906134ad565b6134bb565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516132269190613cf6565b60405180910390a35050565b600061323c611f6b565b82604051602001610c92929190613c14565b600061326082516041146101b9611174565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613299908990859088908890613df6565b6020604051602081039080840390855afa1580156132bb573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b0381161580159061330f5750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b60608180602001905181019061094b91906138d7565b61333d60008383612081565b6133526131dd8261334c61089e565b90611751565b6001600160a01b0382166000908152602081905260409020546133759082611751565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613226908590613cf6565b4690565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b60006134547f38e9922e00000000000000000000000000000000000000000000000000000000610c5d565b82148061348857506134857f50dd6ed900000000000000000000000000000000000000000000000000000000610c5d565b82145b806108985750610898826134c0565b60008180602001905181019061094b91906138aa565b600061094b83836001612e84565b600255565b50600090565b60405180606001604052806000815260200160008152602001600081525090565b803561089881614016565b600082601f830112613502578081fd5b813561351561351082613ff6565b613fcf565b81815291506020808301908481018184028601820187101561353657600080fd5b60005b8481101561355557813584529282019290820190600101613539565b505050505092915050565b600082601f830112613570578081fd5b813567ffffffffffffffff811115613586578182fd5b6135b760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613fcf565b91508082528360208285010111156135ce57600080fd5b8060208401602084013760009082016020015292915050565b80356108988161402b565b600060208284031215613603578081fd5b813561094b81614016565b60008060408385031215613620578081fd5b823561362b81614016565b9150602083013561363b81614016565b809150509250929050565b60008060006060848603121561365a578081fd5b833561366581614016565b9250602084013561367581614016565b929592945050506040919091013590565b600080600080600080600060e0888a0312156136a0578283fd5b87356136ab81614016565b965060208801356136bb81614016565b9550604088013594506060880135935060808801356136d981614038565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215613708578182fd5b823561371381614016565b946020939093013593505050565b600060208284031215613732578081fd5b8151801515811461094b578182fd5b600080600080600080600060e0888a03121561375b578081fd5b87359650602088013561376d81614016565b9550604088013561377d81614016565b9450606088013567ffffffffffffffff80821115613799578283fd5b6137a58b838c016134f2565b955060808a0135945060a08a0135935060c08a01359150808211156137c8578283fd5b506137d58a828b01613560565b91505092959891949750929550565b6000602082840312156137f5578081fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461094b578182fd5b600060208284031215613835578081fd5b815161094b81614016565b60008060408385031215613852578182fd5b823561385d81614016565b9150602083013567ffffffffffffffff811115613878578182fd5b61388485828601613560565b9150509250929050565b60006020828403121561389f578081fd5b815161094b8161402b565b600080604083850312156138bc578182fd5b82516138c78161402b565b6020939093015192949293505050565b600080604083850312156138e9578182fd5b8251600481106138f7578283fd5b8092505060208084015167ffffffffffffffff811115613915578283fd5b8401601f81018613613925578283fd5b805161393361351082613ff6565b81815283810190838501858402850186018a101561394f578687fd5b8694505b83851015613971578051835260019490940193918501918501613953565b5080955050505050509250929050565b60008060008060808587031215613996578182fd5b843567ffffffffffffffff808211156139ad578384fd5b818701915061012080838a0312156139c3578485fd5b6139cc81613fcf565b90506139d889846135e7565b81526139e789602085016134e7565b60208201526139f989604085016134e7565b6040820152606083013560608201526080830135608082015260a083013560a0820152613a298960c085016134e7565b60c0820152613a3b8960e085016134e7565b60e08201526101008084013583811115613a53578687fd5b613a5f8b828701613560565b828401525050809650506020870135915080821115613a7c578384fd5b50613a89878288016134f2565b949794965050505060408301359260600135919050565b600060208284031215613ab1578081fd5b5035919050565b60008060008060808587031215613acd578182fd5b8451935060208501519250604085015191506060850151613aed81614016565b939692955090935050565b600060208284031215613b09578081fd5b815161094b81614038565b60008060408385031215613b26578182fd5b82516138c781614038565b6000815180845260208085019450808401835b83811015613b6057815187529582019590820190600101613b44565b509495945050505050565b60008151808452815b81811015613b9057602081850181015186830182015201613b74565b81811115613ba15782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b60006020825261094b6020830184613b31565b600060408252613cb86040830185613b31565b8281036020840152613cca8185613b31565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9687526001600160a01b03958616602088015293851660408701526060860192909252909216608084015260a0830191909152151560c082015260e00190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b600083825260406020830152613dd76040830184613b6b565b949350505050565b9182526001600160a01b0316602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825261094b6020830184613b6b565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526014908201527f496e73756666696369656e742062616c616e6365000000000000000000000000604082015260600190565b60208082526014908201527f4f726465722073697a652076696f6c6174696f6e000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526012908201527f5072696365206f7574206f6620626f756e640000000000000000000000000000604082015260600190565b6020808252600e908201527f497373756520736f6c64206f7574000000000000000000000000000000000000604082015260600190565b6020808252600e908201527f54696d654c696d6974204f766572000000000000000000000000000000000000604082015260600190565b600083825260406020830152613dd76040830184613b31565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715613fee57600080fd5b604052919050565b600067ffffffffffffffff82111561400c578081fd5b5060209081020190565b6001600160a01b03811681146109a257600080fd5b600281106109a257600080fd5b60ff811681146109a257600080fdfea26469706673582212207ec4ecc0834c1fb0365ddf86f5931bb0419a1c824ed48daedf537cd736be022e64736f6c63430007010033", + "bytecode": "0x6103806040523480156200001257600080fd5b506040516200510938038062005109833981016040819052620000359162000b65565b846000856000015186602001516200005d8860400151896060015130620004f560201b60201c565b604080516003808252608082019092529060208201606080368337019050508960e00151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000cd92919062000a16565b508051620000e390600490602084019062000a16565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016190506276a700831115610194620005c4565b6200017562278d00821115610195620005c4565b429091016101408190520161016052855162000197906002111560c8620005c4565b620001b1620001a5620005d9565b8751111560c9620005c4565b620001c786620005de60201b6200111b1760201c565b620001d284620005ea565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000203908d9060040162000d83565b602060405180830381600087803b1580156200021e57600080fd5b505af115801562000233573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000259919062000b2d565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028e9084908b908b9060040162000ce7565b600060405180830381600087803b158015620002a957600080fd5b505af1158015620002be573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030557600080fd5b505afa1580156200031a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000340919062000b46565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083606001516001600160a01b03166101e0816001600160a01b031660601b815250506000806000620003cc87604001518860600151306200067e60201b60201c565b61030083905261032082905261034081905260408a01519295509093509150620003f69062000774565b6102005260608701516200040a9062000774565b6102205260808701516102405260a08701516102605260e08701516102805260c08701516102a0526101008701516102c052426102e05261012087015180516200045d9160099160209091019062000a16565b50836001600160a01b0316610360816001600160a01b031660601b8152505086604001516001600160a01b03167ffc30a997970e4cac78235884be800647994f95d2388ac863446e51a96255d66d8860a0015189608001518a606001518b60c001518c61010001518d6101200151604051620004df9695949392919062000da1565b60405180910390a2505050505050505062000e7d565b606060008080620005088787876200067e565b60408051600380825260808201909252939650919450925060208201606080368337019050509350868484815181106200053e57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050858483815181106200056c57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200059a57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b81620005d557620005d58162000848565b5050565b600390565b80620005d5816200085d565b62000603620005f8620008e9565b82101560cb620005c4565b6200061c62000611620008f2565b82111560ca620005c4565b6200063e8160c0603f600854620008fe60201b6200112517909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906200067390839062000d98565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200070757836001600160a01b0316856001600160a01b03161015620006ca5750600091506001905060026200076b565b836001600160a01b0316866001600160a01b03161015620006f65750600091506002905060016200076b565b50600191506002905060006200076b565b846001600160a01b0316846001600160a01b03161015620007335750600291506001905060006200076b565b856001600160a01b0316846001600160a01b031610156200075f5750600291506000905060016200076b565b50600191506000905060025b93509350939050565b60006001600160a01b038216301415620007985750670de0b6b3a764000062000843565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620007d457600080fd5b505afa158015620007e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200080f919062000cc4565b60ff16905060006200082e6012836200092360201b620011481760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b6200085a816210905360ea1b62000940565b50565b6002815110156200086e576200085a565b6000816000815181106200087e57fe5b602002602001015190506000600190505b8251811015620008e4576000838281518110620008a857fe5b60200260200101519050620008d9816001600160a01b0316846001600160a01b0316106065620005c460201b60201c565b91506001016200088f565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200090d848484620009a1565b506001901b60001901811b1992909216911b1790565b600062000935838311156001620005c4565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b620009b261010083106064620005c4565b620009eb60018210158015620009e35750620009df60ff8461010003620009fc60201b6200115e1760201c565b8211155b6064620005c4565b620008e483821c156101b4620005c4565b600081831062000a0d578162000a0f565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000a5957805160ff191683800117855562000a89565b8280016001018555821562000a89579182015b8281111562000a8957825182559160200191906001019062000a6c565b5062000a9792915062000a9b565b5090565b5b8082111562000a97576000815560010162000a9c565b80516200093a8162000e67565b600082601f83011262000ad0578081fd5b81516001600160401b0381111562000ae6578182fd5b62000afb601f8201601f191660200162000e01565b915080825283602082850101111562000b1357600080fd5b62000b2681602084016020860162000e34565b5092915050565b60006020828403121562000b3f578081fd5b5051919050565b60006020828403121562000b58578081fd5b815162000a0f8162000e67565b600080600080600060a0868803121562000b7d578081fd5b855162000b8a8162000e67565b60208701519095506001600160401b038082111562000ba7578283fd5b818801915061014080838b03121562000bbe578384fd5b62000bc98162000e01565b905082518281111562000bda578485fd5b62000be88b82860162000abf565b82525060208301518281111562000bfd578485fd5b62000c0b8b82860162000abf565b60208301525062000c208a6040850162000ab2565b604082015262000c348a6060850162000ab2565b60608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120808401518381111562000c81578586fd5b62000c8f8c82870162000abf565b828401525050809650505050604086015192506060860151915062000cb8876080880162000ab2565b90509295509295909350565b60006020828403121562000cd6578081fd5b815160ff8116811462000a0f578182fd5b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000d335762000d20855162000e28565b8352938301939183019160010162000d0b565b505084810360408601528551808252908201925081860190845b8181101562000d755762000d62835162000e28565b8552938301939183019160010162000d4d565b509298975050505050505050565b602081016003831062000d9257fe5b91905290565b90815260200190565b600087825286602083015260018060a01b038616604083015284606083015283608083015260c060a083015282518060c084015262000de88160e085016020870162000e34565b601f01601f19169190910160e001979650505050505050565b6040518181016001600160401b038111828210171562000e2057600080fd5b604052919050565b6001600160a01b031690565b60005b8381101562000e5157818101518382015260200162000e37565b8381111562000e61576000848401525b50505050565b6001600160a01b03811681146200085a57600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e0516103005161032051610340516103605160601c61407d6200108c60003980611e175280612330528061263e52806129ae5280612cc0525080610c2952806112c1528061303b525080610e5e528061126c5280611e925280611eec52806122df528061250252806125385280612bab5280612c065280612c3d525080610af75280611206528061217852806121f6528061225952806125ed528061284a52806128cd52806129315280612b5a52508061062c52508061064d52806110f9525080610d3a525050806106f35280610a945250806106cd5280610e995250806112945280611ec552508061122e525080610ab852806113e7528061149252806121345280612388528061245552806126d2528061274452806128085280612a065280612a885280612d545280612e0c525080610954528061139752806114495280612367528061240a52806124bb52806126b0528061278a52806129e55280612ad35280612b165280612d325280612dc6525080610ee05250806109a752508061159052508061156c525080610cfb525080610cd7525080610c61525080611f6f525080611fb1525080611f90525061407d6000f3fe608060405234801561001057600080fd5b50600436106103155760003560e01c80637ecebe00116101a7578063a7488bb7116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e146105b9578063ed24911d146105cc578063f1493ee1146105d457610315565b8063d2946c2b1461058b578063d505accf14610593578063d5c096c4146105a657610315565b8063ac4316cb116100c8578063ac4316cb14610573578063b35056b81461057b578063b7b814fc1461058357610315565b8063a7488bb714610550578063a9059cbb14610558578063aaabadc51461056b57610315565b80638d928af81161015057806395d89b411161012a57806395d89b411461052d5780639c0e5d1314610535578063a457c2d71461053d57610315565b80638d928af81461050a57806390193b7c1461051257806395c95a4f1461052557610315565b8063851c1bb311610181578063851c1bb3146104dc57806387ec6817146104ef578063893d20e81461050257610315565b80637ecebe00146104b957806382687a56146104cc5780638456cb59146104d457610315565b806338fff2d01161026b5780636028bfd41161021457806370a08231116101ee57806370a082311461047d57806372f3824d1461049057806374f3b0091461049857610315565b80636028bfd41461044c5780636482c9d31461046d5780636945c1fd1461047557610315565b806350dd6ed91161024557806350dd6ed91461042957806354a844ba1461043c57806355c676281461044457610315565b806338fff2d014610406578063395093511461040e5780633f4ba83a1461042157610315565b80631dd746ea116102cd578063313ce567116102a7578063313ce567146103d45780633644e515146103e957806338e9922e146103f157610315565b80631dd746ea1461039757806323b872dd146103ac5780632541897f146103bf57610315565b8063095ea7b3116102fe578063095ea7b31461035857806318160ddd146103785780631c0de0511461038057610315565b806301ec954a1461031a57806306fdde0314610343575b600080fd5b61032d610328366004613981565b6105dc565b60405161033a9190613cf6565b60405180910390f35b61034b6107f1565b60405161033a9190613e14565b61036b6103663660046136f6565b610887565b60405161033a9190613cd3565b61032d61089e565b6103886108a4565b60405161033a93929190613cde565b61039f6108cd565b60405161033a9190613c92565b61036b6103ba366004613646565b6108dc565b6103c7610952565b60405161033a9190613c4a565b6103dc610976565b60405161033a9190613fc1565b61032d61097f565b6104046103ff366004613aa0565b610989565b005b61032d6109a5565b61036b61041c3660046136f6565b6109c9565b610404610a04565b610404610437366004613840565b610a18565b610404610a36565b61032d610a48565b61045f61045a366004613741565b610a5b565b60405161033a929190613fa8565b61032d610a92565b6103c7610ab6565b61032d61048b3660046135f2565b610ada565b61032d610af5565b6104ab6104a6366004613741565b610b19565b60405161033a929190613ca5565b61032d6104c73660046135f2565b610c1c565b61032d610c27565b610404610c4b565b61032d6104ea3660046137e4565b610c5d565b61045f6104fd366004613741565b610caf565b6103c7610cd5565b6103c7610cf9565b61032d6105203660046135f2565b610d1d565b61032d610d38565b61034b610d5c565b61034b610dbd565b61036b61054b3660046136f6565b610e1e565b61032d610e5c565b61036b6105663660046136f6565b610e80565b6103c7610e8d565b61032d610e97565b61036b610ebb565b610404610ecc565b6103c7610ede565b6104046105a1366004613686565b610f02565b6104ab6105b4366004613741565b610f8d565b61032d6105c736600461360e565b6110b0565b61032d6110ed565b61032d6110f7565b600084608001516106096105ee610cf9565b6001600160a01b0316336001600160a01b03161460cd611174565b61061e6106146109a5565b82146101f4611174565b610626611182565b426106717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611195565b10156106985760405162461bcd60e51b815260040161068f90613f71565b60405180910390fd5b60606106a26111a5565b90506106ae8682611318565b6106b66134c6565b60405180606001604052806106c9610a48565b81527f000000000000000000000000000000000000000000000000000000000000000060208201527f0000000000000000000000000000000000000000000000000000000000000000604090910152905060008851600181111561072957fe5b141561078b57610750886060015183888151811061074357fe5b6020026020010151611387565b60608901526000610762898984611393565b90506107818184888151811061077457fe5b6020026020010151611439565b94505050506107e8565b60018851600181111561079a57fe5b14156107e5576107b4886060015183878151811061074357fe5b606089015260006107c6898984611445565b9050610781818489815181106107d857fe5b60200260200101516114d9565b50505b50949350505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b820191906000526020600020905b81548152906001019060200180831161086057829003601f168201915b5050505050905090565b60006108943384846114e5565b5060015b92915050565b60025490565b60008060006108b161154d565b1592506108bc61156a565b91506108c661158e565b9050909192565b60606108d76111a5565b905090565b6000806108e985336110b0565b905061090d336001600160a01b03871614806109055750838210155b61019e611174565b6109188585856115b2565b336001600160a01b0386161480159061093357506000198114155b156109455761094585338584036114e5565b60019150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b60006108d76110ed565b610991611692565b610999611182565b6109a2816116d8565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108949185906109ff9086611751565b6114e5565b610a0c611692565b610a166000611763565b565b610a20611692565b610a28611182565b610a3282826117f4565b5050565b610a3e611692565b610a166001611902565b6008546000906108d79060c0603f611959565b60006060610a718651610a6c611968565b61196d565b610a868989898989898961197a6119cc611a35565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60608088610b286105ee610cf9565b610b336106146109a5565b60606000610b4086611bea565b15610b6857610b4d611c19565b610b5f89610b5961089e565b88611c2c565b92509050610bba565b610b70611c58565b6060610b7a6111a5565b9050610b868a82611318565b610baa8d8d8d8d8d610b96610ebb565b610ba0578d610ba3565b60005b878e61197a565b93509150610bb883826119cc565b505b610bc48b82611c60565b81895167ffffffffffffffff81118015610bdd57600080fd5b50604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061089882610d1d565b7f000000000000000000000000000000000000000000000000000000000000000090565b610c53611692565b610a166001611763565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610c92929190613bd4565b604051602081830303815290604052805190602001209050919050565b60006060610cc08651610a6c611968565b610a8689898989898989611c6a611c86611a35565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b600080610e2b33856110b0565b9050808310610e4557610e40338560006114e5565b610e52565b610e5233858584036114e5565b5060019392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006108943384846115b2565b60006108d7611cef565b7f000000000000000000000000000000000000000000000000000000000000000090565b6008546000906108d79060ff611d69565b610ed4611692565b610a166000611902565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610f318c610d1d565b89604051602001610f4796959493929190613d5e565b604051602081830303815290604052805190602001209050610f788882610f6f878787611d73565b886101f8611db2565b610f838888886114e5565b5050505050505050565b60608088610f9c6105ee610cf9565b610fa76106146109a5565b610faf611c58565b6060610fb96111a5565b9050610fc361089e565b6110705760006060610fd88d8d8d868b611e09565b91509150610ff1610fe7611f2f565b83101560cc611174565b6110036000610ffe611f2f565b611f36565b6110168b61100f611f2f565b8403611f36565b6110208184611c86565b808a5167ffffffffffffffff8111801561103957600080fd5b50604051908082528060200260200182016040528015611063578160200160208202803683370190505b5095509550505050610c0f565b61107a8882611318565b600060606110a28d8d8d8d8d61108e610ebb565b611098578d61109b565b60005b898e611c6a565b915091506110168b83611f36565b60006110ba610cf9565b6001600160a01b0316826001600160a01b031614156110dc5750600019610898565b6110e68383611f40565b9050610898565b60006108d7611f6b565b7f000000000000000000000000000000000000000000000000000000000000000090565b80610a3281612008565b6000611132848484612086565b506001901b60001901811b1992909216911b1790565b6000611158838311156001611174565b50900390565b600081831061116d578161094b565b5090919050565b81610a3257610a32816120cd565b610a1661118d61154d565b610192611174565b8181018281101561089857600080fd5b606060006111b1611968565b905060608167ffffffffffffffff811180156111cc57600080fd5b506040519080825280602002602001820160405280156111f6578160200160208202803683370190505b50905060005b82811015611311577f000000000000000000000000000000000000000000000000000000000000000081141561126a577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b602002602001018181525050611309565b7f00000000000000000000000000000000000000000000000000000000000000008114156112bf577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561130957670de0b6b3a76400008282815181106112fc57fe5b6020026020010181815250505b6001016111fc565b5091505090565b8151815161132790829061196d565b60005b818110156113815761136284828151811061134157fe5b602002602001015184838151811061135557fe5b60200260200101516120f7565b84828151811061136e57fe5b602090810291909101015260010161132a565b50505050565b600061094b83836120f7565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113e5576113de84848461212d565b905061094b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b0316141561142e576113de8484846124b4565b61094b6101356120cd565b600061094b83836127b0565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b03161415611490576113de848484612801565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b0316141561142e576113de848484612b0f565b600061094b8383612e36565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611540908590613cf6565b60405180910390a3505050565b600061155761158e565b4211806108d757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6115c96001600160a01b0384161515610198611174565b6115e06001600160a01b0383161515610199611174565b6115eb838383612081565b6001600160a01b03831660009081526020819052604090205461161190826101a0612e84565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546116409082611751565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611540908590613cf6565b60006116c16000357fffffffff0000000000000000000000000000000000000000000000000000000016610c5d565b90506109a26116d08233612e9a565b610191611174565b6116ed6116e3612f83565b82101560cb611174565b6117026116f8612f8c565b82111560ca611174565b600854611713908260c0603f611125565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90611746908390613cf6565b60405180910390a150565b600082820161094b8482101583611174565b80156117835761177e61177461156a565b4210610193611174565b611798565b61179861178e61158e565b42106101a9611174565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611746908390613cd3565b60006117fe6109a5565b9050600061180a610cf9565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401611837929190613ddf565b60806040518083038186803b15801561184f57600080fd5b505afa158015611863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118879190613ab8565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d492506118d4915085908790600401613dbe565b600060405180830381600087803b1580156118ee57600080fd5b505af1158015610f83573d6000803e3d6000fd5b600854611911908260ff612f98565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611944908390613cd3565b60405180910390a1806109a2576109a2610a16565b6001901b6000190191901c1690565b600390565b610a328183146067611174565b60006060600061198984612fbf565b9050600181600181111561199957fe5b146119ae576119a96101626120cd565b6119be565b6119b88885612fd5565b90935091505b509850989650505050505050565b815181516119db90829061196d565b60005b8181101561138157611a168482815181106119f557fe5b6020026020010151848381518110611a0957fe5b60200260200101516127b0565b848281518110611a2257fe5b60209081029190910101526001016119de565b333014611b24576000306001600160a01b0316600036604051611a59929190613c04565b6000604051808303816000865af19150503d8060008114611a96576040519150601f19603f3d011682016040523d82523d6000602084013e611a9b565b606091505b505090508060008114611aaa57fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb000000000000000000000000000000000000000000000000000000008114611b06573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611b2c611c58565b6060611b366111a5565b9050611b428782611318565b60006060611b5a8c8c8c8c8c8c898d8d63ffffffff16565b91509150611b6c81848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b6000808251118015610898575060ff801682806020019051810190611c0f9190613af8565b60ff161492915050565b610a16611c24610ebb565b6101b6611174565b600060606000611c3b846130a1565b90506060611c4a8787846130b7565b919791965090945050505050565b610a16611182565b610a328282613166565b60006060611c796101626120cd565b9850989650505050505050565b81518151611c9590829061196d565b60005b8181101561138157611cd0848281518110611caf57fe5b6020026020010151848381518110611cc357fe5b6020026020010151612e36565b848281518110611cdc57fe5b6020908102919091010152600101611c98565b6000611cf9610cf9565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3157600080fd5b505afa158015611d45573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190613824565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b6000611dbd85613232565b9050611dd3611dcd87838761324e565b83611174565b611de2428410156101b8611174565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b60006060611e15611182565b7f0000000000000000000000000000000000000000000000000000000000000000611e506001600160a01b0388811690831614610156611174565b611e70816001600160a01b0316876001600160a01b031614610156611174565b6dffffffffffffffffffffffffffff6060611e8a8661331b565b9050611ee9817f000000000000000000000000000000000000000000000000000000000000000081518110611ebb57fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000611387565b817f000000000000000000000000000000000000000000000000000000000000000081518110611f1557fe5b602090810291909101015290999098509650505050505050565b620f424090565b610a328282613331565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611fd86133c4565b30604051602001611fed959493929190613d92565b60405160208183030381529060405280519060200120905090565b600281511015612017576109a2565b60008160008151811061202657fe5b602002602001015190506000600190505b825181101561208157600083828151811061204e57fe5b60200260200101519050612077816001600160a01b0316846001600160a01b0316106065611174565b9150600101612037565b505050565b61209561010083106064611174565b6120be600182101580156120b757506120b360ff846101000361115e565b8211155b6064611174565b61208183821c156101b4611174565b6109a2817f42414c00000000000000000000000000000000000000000000000000000000006133c8565b600082820261211b84158061211457508385838161211157fe5b04145b6003611174565b670de0b6b3a764000090049392505050565b60006121737f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b6000837f0000000000000000000000000000000000000000000000000000000000000000815181106121a157fe5b6020026020010151116121c65760405162461bcd60e51b815260040161068f90613f3a565b8160400151846060015110156121ee5760405162461bcd60e51b815260040161068f90613e95565b6000612231847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b60200260200101518660600151611751565b9050600061229f612253856020015188606001516120f790919063ffffffff16565b612299877f00000000000000000000000000000000000000000000000000000000000000008151811061228257fe5b6020026020010151856127b090919063ffffffff16565b906120f7565b905083602001516122bd8760600151836127b090919063ffffffff16565b10156122db5760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061230857fe5b6020026020010151101561232e5760405162461bcd60e51b815260040161068f90613e27565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16123656109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160006040518863ffffffff1660e01b81526004016123d69796959493929190613d1e565b600060405180830381600087803b1580156123f057600080fd5b505af1158015612404573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b426040516124a3959493929190613c5e565b60405180910390a295945050505050565b60006124fa7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b600061252b847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b90506000612591612578867f00000000000000000000000000000000000000000000000000000000000000008151811061256157fe5b6020026020010151846127b090919063ffffffff16565b6020860151606089015161258b916127b0565b906127b0565b905083604001518110156125b75760405162461bcd60e51b815260040161068f90613e95565b602084015160608701516125cb90836127b0565b10156125e95760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061261657fe5b6020026020010151101561263c5760405162461bcd60e51b815260040161068f90613ecc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16126736109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526126ff93927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600190600401613d1e565b600060405180830381600087803b15801561271957600080fd5b505af115801561272d573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182875b60006127bf8215156004611174565b826127cc57506000610898565b670de0b6b3a7640000838102906127ef908583816127e657fe5b04146005611174565b8281816127f857fe5b04915050610898565b60006128477f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b827f00000000000000000000000000000000000000000000000000000000000000008151811061287357fe5b602002602001015184606001511061289d5760405162461bcd60e51b815260040161068f90613e5e565b8160400151846060015110156128c55760405162461bcd60e51b815260040161068f90613e95565b6000612908847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b60200260200101518660600151611148565b9050600061297061292a856020015188606001516120f790919063ffffffff16565b61229984887f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b60200260200101516127b090919063ffffffff16565b9050836020015161298e8760600151836127b090919063ffffffff16565b10156129ac5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16129e36109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160016040518863ffffffff1660e01b8152600401612a549796959493929190613d1e565b600060405180830381600087803b158015612a6e57600080fd5b505af1158015612a82573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b6000612b557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b6000837f000000000000000000000000000000000000000000000000000000000000000081518110612b8357fe5b602002602001015111612ba85760405162461bcd60e51b815260040161068f90613f3a565b827f000000000000000000000000000000000000000000000000000000000000000081518110612bd457fe5b6020026020010151846060015110612bfe5760405162461bcd60e51b815260040161068f90613e5e565b6000612c2f847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b90506000612c6661257883877f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b90508360400151811015612c8c5760405162461bcd60e51b815260040161068f90613e95565b60208401516060870151612ca090836127b0565b1015612cbe5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612cf56109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b168152612d8193927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600090600401613d1e565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182876127b0565b6000612e458215156004611174565b82612e5257506000610898565b670de0b6b3a764000083810290612e6c908583816127e657fe5b826001820381612e7857fe5b04600101915050610898565b6000612e938484111583611174565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612eb9610cd5565b6001600160a01b031614158015612ed45750612ed483613429565b15612efc57612ee1610cd5565b6001600160a01b0316336001600160a01b0316149050610898565b612f04611cef565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612f3393929190613cff565b60206040518083038186803b158015612f4b57600080fd5b505afa158015612f5f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190613721565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284612fae576000612fb1565b60015b60ff16901b17949350505050565b600081806020019051810190610898919061388e565b600060606000612fe484613497565b90506060855167ffffffffffffffff8111801561300057600080fd5b5060405190808252806020026020018201604052801561302a578160200160208202803683370190505b50905060005b8651811015613095577f0000000000000000000000000000000000000000000000000000000000000000811461308d5786818151811061306c57fe5b602002602001015182828151811061308057fe5b6020026020010181815250505b600101613030565b50909590945092505050565b60008180602001905181019061094b9190613b14565b606060006130c583856127b0565b9050845167ffffffffffffffff811180156130df57600080fd5b50604051908082528060200260200182016040528015613109578160200160208202803683370190505b50915060005b855181101561315d5761313e8287838151811061312857fe5b60200260200101516120f790919063ffffffff16565b83828151811061314a57fe5b602090810291909101015260010161310f565b50509392505050565b61317d6001600160a01b038316151561019b611174565b61318982600083612081565b6001600160a01b0382166000908152602081905260409020546131af90826101b2612e84565b6001600160a01b0383166000908152602081905260409020556131e26131dd826131d761089e565b906134ad565b6134bb565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516132269190613cf6565b60405180910390a35050565b600061323c611f6b565b82604051602001610c92929190613c14565b600061326082516041146101b9611174565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613299908990859088908890613df6565b6020604051602081039080840390855afa1580156132bb573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b0381161580159061330f5750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b60608180602001905181019061094b91906138d7565b61333d60008383612081565b6133526131dd8261334c61089e565b90611751565b6001600160a01b0382166000908152602081905260409020546133759082611751565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613226908590613cf6565b4690565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b60006134547f38e9922e00000000000000000000000000000000000000000000000000000000610c5d565b82148061348857506134857f50dd6ed900000000000000000000000000000000000000000000000000000000610c5d565b82145b806108985750610898826134c0565b60008180602001905181019061094b91906138aa565b600061094b83836001612e84565b600255565b50600090565b60405180606001604052806000815260200160008152602001600081525090565b803561089881614016565b600082601f830112613502578081fd5b813561351561351082613ff6565b613fcf565b81815291506020808301908481018184028601820187101561353657600080fd5b60005b8481101561355557813584529282019290820190600101613539565b505050505092915050565b600082601f830112613570578081fd5b813567ffffffffffffffff811115613586578182fd5b6135b760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613fcf565b91508082528360208285010111156135ce57600080fd5b8060208401602084013760009082016020015292915050565b80356108988161402b565b600060208284031215613603578081fd5b813561094b81614016565b60008060408385031215613620578081fd5b823561362b81614016565b9150602083013561363b81614016565b809150509250929050565b60008060006060848603121561365a578081fd5b833561366581614016565b9250602084013561367581614016565b929592945050506040919091013590565b600080600080600080600060e0888a0312156136a0578283fd5b87356136ab81614016565b965060208801356136bb81614016565b9550604088013594506060880135935060808801356136d981614038565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215613708578182fd5b823561371381614016565b946020939093013593505050565b600060208284031215613732578081fd5b8151801515811461094b578182fd5b600080600080600080600060e0888a03121561375b578081fd5b87359650602088013561376d81614016565b9550604088013561377d81614016565b9450606088013567ffffffffffffffff80821115613799578283fd5b6137a58b838c016134f2565b955060808a0135945060a08a0135935060c08a01359150808211156137c8578283fd5b506137d58a828b01613560565b91505092959891949750929550565b6000602082840312156137f5578081fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461094b578182fd5b600060208284031215613835578081fd5b815161094b81614016565b60008060408385031215613852578182fd5b823561385d81614016565b9150602083013567ffffffffffffffff811115613878578182fd5b61388485828601613560565b9150509250929050565b60006020828403121561389f578081fd5b815161094b8161402b565b600080604083850312156138bc578182fd5b82516138c78161402b565b6020939093015192949293505050565b600080604083850312156138e9578182fd5b8251600481106138f7578283fd5b8092505060208084015167ffffffffffffffff811115613915578283fd5b8401601f81018613613925578283fd5b805161393361351082613ff6565b81815283810190838501858402850186018a101561394f578687fd5b8694505b83851015613971578051835260019490940193918501918501613953565b5080955050505050509250929050565b60008060008060808587031215613996578182fd5b843567ffffffffffffffff808211156139ad578384fd5b818701915061012080838a0312156139c3578485fd5b6139cc81613fcf565b90506139d889846135e7565b81526139e789602085016134e7565b60208201526139f989604085016134e7565b6040820152606083013560608201526080830135608082015260a083013560a0820152613a298960c085016134e7565b60c0820152613a3b8960e085016134e7565b60e08201526101008084013583811115613a53578687fd5b613a5f8b828701613560565b828401525050809650506020870135915080821115613a7c578384fd5b50613a89878288016134f2565b949794965050505060408301359260600135919050565b600060208284031215613ab1578081fd5b5035919050565b60008060008060808587031215613acd578182fd5b8451935060208501519250604085015191506060850151613aed81614016565b939692955090935050565b600060208284031215613b09578081fd5b815161094b81614038565b60008060408385031215613b26578182fd5b82516138c781614038565b6000815180845260208085019450808401835b83811015613b6057815187529582019590820190600101613b44565b509495945050505050565b60008151808452815b81811015613b9057602081850181015186830182015201613b74565b81811115613ba15782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b60006020825261094b6020830184613b31565b600060408252613cb86040830185613b31565b8281036020840152613cca8185613b31565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9687526001600160a01b03958616602088015293851660408701526060860192909252909216608084015260a0830191909152151560c082015260e00190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b600083825260406020830152613dd76040830184613b6b565b949350505050565b9182526001600160a01b0316602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825261094b6020830184613b6b565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526014908201527f496e73756666696369656e742062616c616e6365000000000000000000000000604082015260600190565b60208082526014908201527f4f726465722073697a652076696f6c6174696f6e000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526012908201527f5072696365206f7574206f6620626f756e640000000000000000000000000000604082015260600190565b6020808252600e908201527f497373756520736f6c64206f7574000000000000000000000000000000000000604082015260600190565b6020808252600e908201527f54696d654c696d6974204f766572000000000000000000000000000000000000604082015260600190565b600083825260406020830152613dd76040830184613b31565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715613fee57600080fd5b604052919050565b600067ffffffffffffffff82111561400c578081fd5b5060209081020190565b6001600160a01b03811681146109a257600080fd5b600281106109a257600080fd5b60ff811681146109a257600080fdfea264697066735822122095a454cd2aba0e5b98211a2dc03743af8f6d99e0cb3e505d05565349f22200e264736f6c63430007010033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106103155760003560e01c80637ecebe00116101a7578063a7488bb7116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e146105b9578063ed24911d146105cc578063f1493ee1146105d457610315565b8063d2946c2b1461058b578063d505accf14610593578063d5c096c4146105a657610315565b8063ac4316cb116100c8578063ac4316cb14610573578063b35056b81461057b578063b7b814fc1461058357610315565b8063a7488bb714610550578063a9059cbb14610558578063aaabadc51461056b57610315565b80638d928af81161015057806395d89b411161012a57806395d89b411461052d5780639c0e5d1314610535578063a457c2d71461053d57610315565b80638d928af81461050a57806390193b7c1461051257806395c95a4f1461052557610315565b8063851c1bb311610181578063851c1bb3146104dc57806387ec6817146104ef578063893d20e81461050257610315565b80637ecebe00146104b957806382687a56146104cc5780638456cb59146104d457610315565b806338fff2d01161026b5780636028bfd41161021457806370a08231116101ee57806370a082311461047d57806372f3824d1461049057806374f3b0091461049857610315565b80636028bfd41461044c5780636482c9d31461046d5780636945c1fd1461047557610315565b806350dd6ed91161024557806350dd6ed91461042957806354a844ba1461043c57806355c676281461044457610315565b806338fff2d014610406578063395093511461040e5780633f4ba83a1461042157610315565b80631dd746ea116102cd578063313ce567116102a7578063313ce567146103d45780633644e515146103e957806338e9922e146103f157610315565b80631dd746ea1461039757806323b872dd146103ac5780632541897f146103bf57610315565b8063095ea7b3116102fe578063095ea7b31461035857806318160ddd146103785780631c0de0511461038057610315565b806301ec954a1461031a57806306fdde0314610343575b600080fd5b61032d610328366004613981565b6105dc565b60405161033a9190613cf6565b60405180910390f35b61034b6107f1565b60405161033a9190613e14565b61036b6103663660046136f6565b610887565b60405161033a9190613cd3565b61032d61089e565b6103886108a4565b60405161033a93929190613cde565b61039f6108cd565b60405161033a9190613c92565b61036b6103ba366004613646565b6108dc565b6103c7610952565b60405161033a9190613c4a565b6103dc610976565b60405161033a9190613fc1565b61032d61097f565b6104046103ff366004613aa0565b610989565b005b61032d6109a5565b61036b61041c3660046136f6565b6109c9565b610404610a04565b610404610437366004613840565b610a18565b610404610a36565b61032d610a48565b61045f61045a366004613741565b610a5b565b60405161033a929190613fa8565b61032d610a92565b6103c7610ab6565b61032d61048b3660046135f2565b610ada565b61032d610af5565b6104ab6104a6366004613741565b610b19565b60405161033a929190613ca5565b61032d6104c73660046135f2565b610c1c565b61032d610c27565b610404610c4b565b61032d6104ea3660046137e4565b610c5d565b61045f6104fd366004613741565b610caf565b6103c7610cd5565b6103c7610cf9565b61032d6105203660046135f2565b610d1d565b61032d610d38565b61034b610d5c565b61034b610dbd565b61036b61054b3660046136f6565b610e1e565b61032d610e5c565b61036b6105663660046136f6565b610e80565b6103c7610e8d565b61032d610e97565b61036b610ebb565b610404610ecc565b6103c7610ede565b6104046105a1366004613686565b610f02565b6104ab6105b4366004613741565b610f8d565b61032d6105c736600461360e565b6110b0565b61032d6110ed565b61032d6110f7565b600084608001516106096105ee610cf9565b6001600160a01b0316336001600160a01b03161460cd611174565b61061e6106146109a5565b82146101f4611174565b610626611182565b426106717f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611195565b10156106985760405162461bcd60e51b815260040161068f90613f71565b60405180910390fd5b60606106a26111a5565b90506106ae8682611318565b6106b66134c6565b60405180606001604052806106c9610a48565b81527f000000000000000000000000000000000000000000000000000000000000000060208201527f0000000000000000000000000000000000000000000000000000000000000000604090910152905060008851600181111561072957fe5b141561078b57610750886060015183888151811061074357fe5b6020026020010151611387565b60608901526000610762898984611393565b90506107818184888151811061077457fe5b6020026020010151611439565b94505050506107e8565b60018851600181111561079a57fe5b14156107e5576107b4886060015183878151811061074357fe5b606089015260006107c6898984611445565b9050610781818489815181106107d857fe5b60200260200101516114d9565b50505b50949350505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b820191906000526020600020905b81548152906001019060200180831161086057829003601f168201915b5050505050905090565b60006108943384846114e5565b5060015b92915050565b60025490565b60008060006108b161154d565b1592506108bc61156a565b91506108c661158e565b9050909192565b60606108d76111a5565b905090565b6000806108e985336110b0565b905061090d336001600160a01b03871614806109055750838210155b61019e611174565b6109188585856115b2565b336001600160a01b0386161480159061093357506000198114155b156109455761094585338584036114e5565b60019150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b60006108d76110ed565b610991611692565b610999611182565b6109a2816116d8565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108949185906109ff9086611751565b6114e5565b610a0c611692565b610a166000611763565b565b610a20611692565b610a28611182565b610a3282826117f4565b5050565b610a3e611692565b610a166001611902565b6008546000906108d79060c0603f611959565b60006060610a718651610a6c611968565b61196d565b610a868989898989898961197a6119cc611a35565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60608088610b286105ee610cf9565b610b336106146109a5565b60606000610b4086611bea565b15610b6857610b4d611c19565b610b5f89610b5961089e565b88611c2c565b92509050610bba565b610b70611c58565b6060610b7a6111a5565b9050610b868a82611318565b610baa8d8d8d8d8d610b96610ebb565b610ba0578d610ba3565b60005b878e61197a565b93509150610bb883826119cc565b505b610bc48b82611c60565b81895167ffffffffffffffff81118015610bdd57600080fd5b50604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061089882610d1d565b7f000000000000000000000000000000000000000000000000000000000000000090565b610c53611692565b610a166001611763565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610c92929190613bd4565b604051602081830303815290604052805190602001209050919050565b60006060610cc08651610a6c611968565b610a8689898989898989611c6a611c86611a35565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b60098054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561087d5780601f106108525761010080835404028352916020019161087d565b600080610e2b33856110b0565b9050808310610e4557610e40338560006114e5565b610e52565b610e5233858584036114e5565b5060019392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006108943384846115b2565b60006108d7611cef565b7f000000000000000000000000000000000000000000000000000000000000000090565b6008546000906108d79060ff611d69565b610ed4611692565b610a166000611902565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610f318c610d1d565b89604051602001610f4796959493929190613d5e565b604051602081830303815290604052805190602001209050610f788882610f6f878787611d73565b886101f8611db2565b610f838888886114e5565b5050505050505050565b60608088610f9c6105ee610cf9565b610fa76106146109a5565b610faf611c58565b6060610fb96111a5565b9050610fc361089e565b6110705760006060610fd88d8d8d868b611e09565b91509150610ff1610fe7611f2f565b83101560cc611174565b6110036000610ffe611f2f565b611f36565b6110168b61100f611f2f565b8403611f36565b6110208184611c86565b808a5167ffffffffffffffff8111801561103957600080fd5b50604051908082528060200260200182016040528015611063578160200160208202803683370190505b5095509550505050610c0f565b61107a8882611318565b600060606110a28d8d8d8d8d61108e610ebb565b611098578d61109b565b60005b898e611c6a565b915091506110168b83611f36565b60006110ba610cf9565b6001600160a01b0316826001600160a01b031614156110dc5750600019610898565b6110e68383611f40565b9050610898565b60006108d7611f6b565b7f000000000000000000000000000000000000000000000000000000000000000090565b80610a3281612008565b6000611132848484612086565b506001901b60001901811b1992909216911b1790565b6000611158838311156001611174565b50900390565b600081831061116d578161094b565b5090919050565b81610a3257610a32816120cd565b610a1661118d61154d565b610192611174565b8181018281101561089857600080fd5b606060006111b1611968565b905060608167ffffffffffffffff811180156111cc57600080fd5b506040519080825280602002602001820160405280156111f6578160200160208202803683370190505b50905060005b82811015611311577f000000000000000000000000000000000000000000000000000000000000000081141561126a577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b602002602001018181525050611309565b7f00000000000000000000000000000000000000000000000000000000000000008114156112bf577f000000000000000000000000000000000000000000000000000000000000000082828151811061125957fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561130957670de0b6b3a76400008282815181106112fc57fe5b6020026020010181815250505b6001016111fc565b5091505090565b8151815161132790829061196d565b60005b818110156113815761136284828151811061134157fe5b602002602001015184838151811061135557fe5b60200260200101516120f7565b84828151811061136e57fe5b602090810291909101015260010161132a565b50505050565b600061094b83836120f7565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113e5576113de84848461212d565b905061094b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b0316141561142e576113de8484846124b4565b61094b6101356120cd565b600061094b83836127b0565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b03161415611490576113de848484612801565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b0316141561142e576113de848484612b0f565b600061094b8383612e36565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611540908590613cf6565b60405180910390a3505050565b600061155761158e565b4211806108d757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6115c96001600160a01b0384161515610198611174565b6115e06001600160a01b0383161515610199611174565b6115eb838383612081565b6001600160a01b03831660009081526020819052604090205461161190826101a0612e84565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546116409082611751565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611540908590613cf6565b60006116c16000357fffffffff0000000000000000000000000000000000000000000000000000000016610c5d565b90506109a26116d08233612e9a565b610191611174565b6116ed6116e3612f83565b82101560cb611174565b6117026116f8612f8c565b82111560ca611174565b600854611713908260c0603f611125565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90611746908390613cf6565b60405180910390a150565b600082820161094b8482101583611174565b80156117835761177e61177461156a565b4210610193611174565b611798565b61179861178e61158e565b42106101a9611174565b600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611746908390613cd3565b60006117fe6109a5565b9050600061180a610cf9565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401611837929190613ddf565b60806040518083038186803b15801561184f57600080fd5b505afa158015611863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118879190613ab8565b6040517f18e736d40000000000000000000000000000000000000000000000000000000081529094506001600160a01b03851693506318e736d492506118d4915085908790600401613dbe565b600060405180830381600087803b1580156118ee57600080fd5b505af1158015610f83573d6000803e3d6000fd5b600854611911908260ff612f98565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611944908390613cd3565b60405180910390a1806109a2576109a2610a16565b6001901b6000190191901c1690565b600390565b610a328183146067611174565b60006060600061198984612fbf565b9050600181600181111561199957fe5b146119ae576119a96101626120cd565b6119be565b6119b88885612fd5565b90935091505b509850989650505050505050565b815181516119db90829061196d565b60005b8181101561138157611a168482815181106119f557fe5b6020026020010151848381518110611a0957fe5b60200260200101516127b0565b848281518110611a2257fe5b60209081029190910101526001016119de565b333014611b24576000306001600160a01b0316600036604051611a59929190613c04565b6000604051808303816000865af19150503d8060008114611a96576040519150601f19603f3d011682016040523d82523d6000602084013e611a9b565b606091505b505090508060008114611aaa57fe5b60046000803e6000517fffffffff00000000000000000000000000000000000000000000000000000000167f43adbafb000000000000000000000000000000000000000000000000000000008114611b06573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611b2c611c58565b6060611b366111a5565b9050611b428782611318565b60006060611b5a8c8c8c8c8c8c898d8d63ffffffff16565b91509150611b6c81848663ffffffff16565b80517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082018390526343adbafb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08301526020027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc82016044820181fd5b6000808251118015610898575060ff801682806020019051810190611c0f9190613af8565b60ff161492915050565b610a16611c24610ebb565b6101b6611174565b600060606000611c3b846130a1565b90506060611c4a8787846130b7565b919791965090945050505050565b610a16611182565b610a328282613166565b60006060611c796101626120cd565b9850989650505050505050565b81518151611c9590829061196d565b60005b8181101561138157611cd0848281518110611caf57fe5b6020026020010151848381518110611cc357fe5b6020026020010151612e36565b848281518110611cdc57fe5b6020908102919091010152600101611c98565b6000611cf9610cf9565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611d3157600080fd5b505afa158015611d45573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190613824565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b6000611dbd85613232565b9050611dd3611dcd87838761324e565b83611174565b611de2428410156101b8611174565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b60006060611e15611182565b7f0000000000000000000000000000000000000000000000000000000000000000611e506001600160a01b0388811690831614610156611174565b611e70816001600160a01b0316876001600160a01b031614610156611174565b6dffffffffffffffffffffffffffff6060611e8a8661331b565b9050611ee9817f000000000000000000000000000000000000000000000000000000000000000081518110611ebb57fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000611387565b817f000000000000000000000000000000000000000000000000000000000000000081518110611f1557fe5b602090810291909101015290999098509650505050505050565b620f424090565b610a328282613331565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611fd86133c4565b30604051602001611fed959493929190613d92565b60405160208183030381529060405280519060200120905090565b600281511015612017576109a2565b60008160008151811061202657fe5b602002602001015190506000600190505b825181101561208157600083828151811061204e57fe5b60200260200101519050612077816001600160a01b0316846001600160a01b0316106065611174565b9150600101612037565b505050565b61209561010083106064611174565b6120be600182101580156120b757506120b360ff846101000361115e565b8211155b6064611174565b61208183821c156101b4611174565b6109a2817f42414c00000000000000000000000000000000000000000000000000000000006133c8565b600082820261211b84158061211457508385838161211157fe5b04145b6003611174565b670de0b6b3a764000090049392505050565b60006121737f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b6000837f0000000000000000000000000000000000000000000000000000000000000000815181106121a157fe5b6020026020010151116121c65760405162461bcd60e51b815260040161068f90613f3a565b8160400151846060015110156121ee5760405162461bcd60e51b815260040161068f90613e95565b6000612231847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b60200260200101518660600151611751565b9050600061229f612253856020015188606001516120f790919063ffffffff16565b612299877f00000000000000000000000000000000000000000000000000000000000000008151811061228257fe5b6020026020010151856127b090919063ffffffff16565b906120f7565b905083602001516122bd8760600151836127b090919063ffffffff16565b10156122db5760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061230857fe5b6020026020010151101561232e5760405162461bcd60e51b815260040161068f90613e27565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16123656109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160006040518863ffffffff1660e01b81526004016123d69796959493929190613d1e565b600060405180830381600087803b1580156123f057600080fd5b505af1158015612404573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b426040516124a3959493929190613c5e565b60405180910390a295945050505050565b60006124fa7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b031614610135611174565b600061252b847f00000000000000000000000000000000000000000000000000000000000000008151811061221f57fe5b90506000612591612578867f00000000000000000000000000000000000000000000000000000000000000008151811061256157fe5b6020026020010151846127b090919063ffffffff16565b6020860151606089015161258b916127b0565b906127b0565b905083604001518110156125b75760405162461bcd60e51b815260040161068f90613e95565b602084015160608701516125cb90836127b0565b10156125e95760405162461bcd60e51b815260040161068f90613f03565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061261657fe5b6020026020010151101561263c5760405162461bcd60e51b815260040161068f90613ecc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16126736109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526126ff93927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600190600401613d1e565b600060405180830381600087803b15801561271957600080fd5b505af115801561272d573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182875b60006127bf8215156004611174565b826127cc57506000610898565b670de0b6b3a7640000838102906127ef908583816127e657fe5b04146005611174565b8281816127f857fe5b04915050610898565b60006128477f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b827f00000000000000000000000000000000000000000000000000000000000000008151811061287357fe5b602002602001015184606001511061289d5760405162461bcd60e51b815260040161068f90613e5e565b8160400151846060015110156128c55760405162461bcd60e51b815260040161068f90613e95565b6000612908847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b60200260200101518660600151611148565b9050600061297061292a856020015188606001516120f790919063ffffffff16565b61229984887f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b60200260200101516127b090919063ffffffff16565b9050836020015161298e8760600151836127b090919063ffffffff16565b10156129ac5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16129e36109a5565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160016040518863ffffffff1660e01b8152600401612a549796959493929190613d1e565b600060405180830381600087803b158015612a6e57600080fd5b505af1158015612a82573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c7f0000000000000000000000000000000000000000000000000000000000000000838960c001516124918b60600151876127b090919063ffffffff16565b6000612b557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b031614610135611174565b6000837f000000000000000000000000000000000000000000000000000000000000000081518110612b8357fe5b602002602001015111612ba85760405162461bcd60e51b815260040161068f90613f3a565b827f000000000000000000000000000000000000000000000000000000000000000081518110612bd457fe5b6020026020010151846060015110612bfe5760405162461bcd60e51b815260040161068f90613e5e565b6000612c2f847f0000000000000000000000000000000000000000000000000000000000000000815181106128f657fe5b90506000612c6661257883877f00000000000000000000000000000000000000000000000000000000000000008151811061295a57fe5b90508360400151811015612c8c5760405162461bcd60e51b815260040161068f90613e95565b60208401516060870151612ca090836127b0565b1015612cbe5760405162461bcd60e51b815260040161068f90613f03565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612cf56109a5565b606089015160c08a01516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b168152612d8193927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600090600401613d1e565b600060405180830381600087803b158015612d9b57600080fd5b505af1158015612daf573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692507f560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9c917f00000000000000000000000000000000000000000000000000000000000000009161249182876127b0565b6000612e458215156004611174565b82612e5257506000610898565b670de0b6b3a764000083810290612e6c908583816127e657fe5b826001820381612e7857fe5b04600101915050610898565b6000612e938484111583611174565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612eb9610cd5565b6001600160a01b031614158015612ed45750612ed483613429565b15612efc57612ee1610cd5565b6001600160a01b0316336001600160a01b0316149050610898565b612f04611cef565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612f3393929190613cff565b60206040518083038186803b158015612f4b57600080fd5b505afa158015612f5f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190613721565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284612fae576000612fb1565b60015b60ff16901b17949350505050565b600081806020019051810190610898919061388e565b600060606000612fe484613497565b90506060855167ffffffffffffffff8111801561300057600080fd5b5060405190808252806020026020018201604052801561302a578160200160208202803683370190505b50905060005b8651811015613095577f0000000000000000000000000000000000000000000000000000000000000000811461308d5786818151811061306c57fe5b602002602001015182828151811061308057fe5b6020026020010181815250505b600101613030565b50909590945092505050565b60008180602001905181019061094b9190613b14565b606060006130c583856127b0565b9050845167ffffffffffffffff811180156130df57600080fd5b50604051908082528060200260200182016040528015613109578160200160208202803683370190505b50915060005b855181101561315d5761313e8287838151811061312857fe5b60200260200101516120f790919063ffffffff16565b83828151811061314a57fe5b602090810291909101015260010161310f565b50509392505050565b61317d6001600160a01b038316151561019b611174565b61318982600083612081565b6001600160a01b0382166000908152602081905260409020546131af90826101b2612e84565b6001600160a01b0383166000908152602081905260409020556131e26131dd826131d761089e565b906134ad565b6134bb565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516132269190613cf6565b60405180910390a35050565b600061323c611f6b565b82604051602001610c92929190613c14565b600061326082516041146101b9611174565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613299908990859088908890613df6565b6020604051602081039080840390855afa1580156132bb573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b0381161580159061330f5750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b60608180602001905181019061094b91906138d7565b61333d60008383612081565b6133526131dd8261334c61089e565b90611751565b6001600160a01b0382166000908152602081905260409020546133759082611751565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613226908590613cf6565b4690565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b60006134547f38e9922e00000000000000000000000000000000000000000000000000000000610c5d565b82148061348857506134857f50dd6ed900000000000000000000000000000000000000000000000000000000610c5d565b82145b806108985750610898826134c0565b60008180602001905181019061094b91906138aa565b600061094b83836001612e84565b600255565b50600090565b60405180606001604052806000815260200160008152602001600081525090565b803561089881614016565b600082601f830112613502578081fd5b813561351561351082613ff6565b613fcf565b81815291506020808301908481018184028601820187101561353657600080fd5b60005b8481101561355557813584529282019290820190600101613539565b505050505092915050565b600082601f830112613570578081fd5b813567ffffffffffffffff811115613586578182fd5b6135b760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613fcf565b91508082528360208285010111156135ce57600080fd5b8060208401602084013760009082016020015292915050565b80356108988161402b565b600060208284031215613603578081fd5b813561094b81614016565b60008060408385031215613620578081fd5b823561362b81614016565b9150602083013561363b81614016565b809150509250929050565b60008060006060848603121561365a578081fd5b833561366581614016565b9250602084013561367581614016565b929592945050506040919091013590565b600080600080600080600060e0888a0312156136a0578283fd5b87356136ab81614016565b965060208801356136bb81614016565b9550604088013594506060880135935060808801356136d981614038565b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215613708578182fd5b823561371381614016565b946020939093013593505050565b600060208284031215613732578081fd5b8151801515811461094b578182fd5b600080600080600080600060e0888a03121561375b578081fd5b87359650602088013561376d81614016565b9550604088013561377d81614016565b9450606088013567ffffffffffffffff80821115613799578283fd5b6137a58b838c016134f2565b955060808a0135945060a08a0135935060c08a01359150808211156137c8578283fd5b506137d58a828b01613560565b91505092959891949750929550565b6000602082840312156137f5578081fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461094b578182fd5b600060208284031215613835578081fd5b815161094b81614016565b60008060408385031215613852578182fd5b823561385d81614016565b9150602083013567ffffffffffffffff811115613878578182fd5b61388485828601613560565b9150509250929050565b60006020828403121561389f578081fd5b815161094b8161402b565b600080604083850312156138bc578182fd5b82516138c78161402b565b6020939093015192949293505050565b600080604083850312156138e9578182fd5b8251600481106138f7578283fd5b8092505060208084015167ffffffffffffffff811115613915578283fd5b8401601f81018613613925578283fd5b805161393361351082613ff6565b81815283810190838501858402850186018a101561394f578687fd5b8694505b83851015613971578051835260019490940193918501918501613953565b5080955050505050509250929050565b60008060008060808587031215613996578182fd5b843567ffffffffffffffff808211156139ad578384fd5b818701915061012080838a0312156139c3578485fd5b6139cc81613fcf565b90506139d889846135e7565b81526139e789602085016134e7565b60208201526139f989604085016134e7565b6040820152606083013560608201526080830135608082015260a083013560a0820152613a298960c085016134e7565b60c0820152613a3b8960e085016134e7565b60e08201526101008084013583811115613a53578687fd5b613a5f8b828701613560565b828401525050809650506020870135915080821115613a7c578384fd5b50613a89878288016134f2565b949794965050505060408301359260600135919050565b600060208284031215613ab1578081fd5b5035919050565b60008060008060808587031215613acd578182fd5b8451935060208501519250604085015191506060850151613aed81614016565b939692955090935050565b600060208284031215613b09578081fd5b815161094b81614038565b60008060408385031215613b26578182fd5b82516138c781614038565b6000815180845260208085019450808401835b83811015613b6057815187529582019590820190600101613b44565b509495945050505050565b60008151808452815b81811015613b9057602081850181015186830182015201613b74565b81811115613ba15782602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6000828483379101908152919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b60006020825261094b6020830184613b31565b600060408252613cb86040830185613b31565b8281036020840152613cca8185613b31565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9687526001600160a01b03958616602088015293851660408701526060860192909252909216608084015260a0830191909152151560c082015260e00190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b600083825260406020830152613dd76040830184613b6b565b949350505050565b9182526001600160a01b0316602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825261094b6020830184613b6b565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b60208082526014908201527f496e73756666696369656e742062616c616e6365000000000000000000000000604082015260600190565b60208082526014908201527f4f726465722073697a652076696f6c6174696f6e000000000000000000000000604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b60208082526012908201527f5072696365206f7574206f6620626f756e640000000000000000000000000000604082015260600190565b6020808252600e908201527f497373756520736f6c64206f7574000000000000000000000000000000000000604082015260600190565b6020808252600e908201527f54696d654c696d6974204f766572000000000000000000000000000000000000604082015260600190565b600083825260406020830152613dd76040830184613b31565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715613fee57600080fd5b604052919050565b600067ffffffffffffffff82111561400c578081fd5b5060209081020190565b6001600160a01b03811681146109a257600080fd5b600281106109a257600080fd5b60ff811681146109a257600080fdfea264697066735822122095a454cd2aba0e5b98211a2dc03743af8f6d99e0cb3e505d05565349f22200e264736f6c63430007010033", "linkReferences": {}, "deployedLinkReferences": {} } \ No newline at end of file diff --git a/abis/PrimaryIssuePoolFactory.json b/abis/PrimaryIssuePoolFactory.json index 96dc95b6f..7fba7ba67 100644 --- a/abis/PrimaryIssuePoolFactory.json +++ b/abis/PrimaryIssuePoolFactory.json @@ -256,8 +256,8 @@ "type": "function" } ], - "bytecode": "0x6101806040523480156200001257600080fd5b5060405162005cd238038062005cd28339810160408190526200003591620001fc565b8181604051806020016200004990620001ee565b601f1982820381018352601f90910116604052805183903090839060006002820460a081905280830360e08190528185529091508362000095816200010f602090811b6200042217901c565b60601b6001600160601b0319166080528285018051838252620000c4826200010f602090811b6200042217901c565b6001600160601b0319606091821b811660c05296909352905261010095909552505092821b831661012052509290921b90911661014052505050426276a70001610160525062000250565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506200015d6001600160a01b03831615156101ac62000163565b50919050565b816200017457620001748162000178565b5050565b6200018a816210905360ea1b6200018d565b50565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b614e398062000e9983390190565b600080604083850312156200020f578182fd5b82516200021c816200023a565b60208401519092506200022f816200023a565b809150509250929050565b6001600160a01b03811681146200018a57600080fd5b60805160601c60a05160c05160601c60e051610100516101205160601c6101405160601c61016051610bd0620002c96000398061023c528061026552508061031052508061038652508061033652508061047c5250806101c352806104f852508061049d5250806101a252806104d45250610bd06000f3fe608060405234801561001057600080fd5b50600436106100a85760003560e01c80636634b753116100715780636634b753146101215780636c57f5a914610141578063739238d614610149578063851c1bb3146101515780638d928af814610171578063aaabadc514610179576100a8565b8062c194db146100ad578063174481fa146100cb5780632236c4cc146100e15780632da47c40146101015780632f2770db14610117575b600080fd5b6100b5610181565b6040516100c29190610a4a565b60405180910390f35b6100d36101a0565b6040516100c29291906109fd565b6100f46100ef366004610868565b6101e6565b6040516100c291906109e9565b610109610236565b6040516100c2929190610b50565b61011f6102a0565b005b61013461012f3660046107e8565b6102e7565b6040516100c29190610a17565b610134610305565b6100f461030e565b61016461015f366004610824565b610332565b6040516100c29190610a22565b6100f4610384565b6100f46103a8565b606061019b60405180602001604052806000815250610474565b905090565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b60008060006101f3610236565b9150915061022e610202610384565b8584843360405160200161021a959493929190610a5d565b60405160208183030381529060405261054d565b949350505050565b600080427f000000000000000000000000000000000000000000000000000000000000000081101561029257807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915061029b565b60009250600091505b509091565b6102a86105b6565b6102b06105e7565b6001805460ff1916811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103679291906109d1565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103b2610384565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ea57600080fd5b505afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019b919061084c565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f0908452915061046e6001600160a01b03831615156101ac6105fc565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c506020898101908985010161053f81838661060e565b505050505050505050919050565b60006105576105e7565b60006105628361064c565b6001600160a01b038116600081815260208190526040808220805460ff191660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006105cd6000356001600160e01b031916610332565b90506105e46105dc8233610687565b6101916105fc565b50565b6105fa6105f2610305565b1560d36105fc565b565b8161060a5761060a81610719565b5050565b5b6020811061062e578151835260209283019290910190601f190161060f565b905182516020929092036101000a6000190180199091169116179052565b6000606061065983610474565b905060008151602083016000f090506001600160a01b038116610680573d6000803e3d6000fd5b9392505050565b60006106916103a8565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016106c093929190610a2b565b60206040518083038186803b1580156106d857600080fd5b505afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107109190610804565b90505b92915050565b62461bcd60e51b600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b6044526105e4916210905360ea1b906242414c90606490fd5b803561071381610b85565b600082601f83011261078f578081fd5b813567ffffffffffffffff8111156107a5578182fd5b6107b8601f8201601f1916602001610b5e565b91508082528360208285010111156107cf57600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156107f9578081fd5b813561068081610b85565b600060208284031215610815578081fd5b81518015158114610680578182fd5b600060208284031215610835578081fd5b81356001600160e01b031981168114610680578182fd5b60006020828403121561085d578081fd5b815161068081610b85565b600060208284031215610879578081fd5b813567ffffffffffffffff80821115610890578283fd5b81840191506101408083870312156108a6578384fd5b6108af81610b5e565b90508235828111156108bf578485fd5b6108cb8782860161077f565b8252506020830135828111156108df578485fd5b6108eb8782860161077f565b6020830152506108fe8660408501610774565b60408201526109108660608501610774565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e0820152610100808401358183015250610120808401358381111561095c578586fd5b6109688882870161077f565b918301919091525095945050505050565b6001600160a01b03169052565b60008151808452815b818110156109ab5760208185018101518683018201520161098f565b818111156109bc5782602083870101525b50601f01601f19169290920160200192915050565b9182526001600160e01b031916602082015260240190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b901515815260200190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b6000602082526107106020830184610986565b600060018060a01b038716825260a0602083015285516101408060a0850152610a8a6101e0850183610986565b91506020880151609f19808685030160c0870152610aa88483610986565b935060408a01519150610abe60e0870183610979565b60608a01519150610100610ad481880184610979565b60808b01516101208881019190915260a08c01519488019490945260c08b015161016088015260e08b01516101808801528a01516101a0870152918901518584039092016101c086015250610b298282610986565b92505050846040830152836060830152610b466080830184610979565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610b7d57600080fd5b604052919050565b6001600160a01b03811681146105e457600080fdfea2646970667358221220df3c950682a0ca6bad119f2536e6858ecd048230171f9bb2b68ef9c8135af14064736f6c634300070100336103806040523480156200001257600080fd5b5060405162004e3938038062004e39833981016040819052620000359162000b67565b846000856000015186602001516200005d8860400151896060015130620004f760201b60201c565b604080516003808252608082019092529060208201606080368337019050508960e00151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000cd92919062000a18565b508051620000e390600490602084019062000a18565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016190506276a700831115610194620005c6565b6200017562278d00821115610195620005c6565b429091016101408190520161016052855162000197906002111560c8620005c6565b620001b1620001a5620005db565b8751111560c9620005c6565b620001c786620005e060201b6200109b1760201c565b620001d284620005ec565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000203908d9060040162000d85565b602060405180830381600087803b1580156200021e57600080fd5b505af115801562000233573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000259919062000b2f565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028e9084908b908b9060040162000ce9565b600060405180830381600087803b158015620002a957600080fd5b505af1158015620002be573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030557600080fd5b505afa1580156200031a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000340919062000b48565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083606001516001600160a01b03166101e0816001600160a01b031660601b815250506000806000620003cc87604001518860600151306200068060201b60201c565b61030083905261032082905261034081905260408a01519295509093509150620003f69062000776565b6102005260608701516200040a9062000776565b6102205260808701516102405260a08701516102605260e08701516102805260c08701516102a0526101008701516102c052426102e05261012087015180516200045d9160099160209091019062000a18565b50836001600160a01b0316610360816001600160a01b031660601b8152505086604001516001600160a01b03167f64c76ecbe716809a0085ae1b389296a3c6e716fe1ee5d1804c8032e0e76dabb18860a0015189608001518a606001518b60c001518c61010001518d61012001518b604051620004e1979695949392919062000da3565b60405180910390a2505050505050505062000e8b565b6060600080806200050a87878762000680565b60408051600380825260808201909252939650919450925060208201606080368337019050509350868484815181106200054057fe5b60200260200101906001600160a01b031690816001600160a01b031681525050858483815181106200056e57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200059c57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b81620005d757620005d7816200084a565b5050565b600390565b80620005d7816200085f565b62000605620005fa620008eb565b82101560cb620005c6565b6200061e62000613620008f4565b82111560ca620005c6565b620006408160c0603f6008546200090060201b620010a517909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906200067590839062000d9a565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200070957836001600160a01b0316856001600160a01b03161015620006cc5750600091506001905060026200076d565b836001600160a01b0316866001600160a01b03161015620006f85750600091506002905060016200076d565b50600191506002905060006200076d565b846001600160a01b0316846001600160a01b03161015620007355750600291506001905060006200076d565b856001600160a01b0316846001600160a01b03161015620007615750600291506000905060016200076d565b50600191506000905060025b93509350939050565b60006001600160a01b0382163014156200079a5750670de0b6b3a764000062000845565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620007d657600080fd5b505afa158015620007eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000811919062000cc6565b60ff1690506000620008306012836200092560201b620010c81760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b6200085c816210905360ea1b62000942565b50565b60028151101562000870576200085c565b6000816000815181106200088057fe5b602002602001015190506000600190505b8251811015620008e6576000838281518110620008aa57fe5b60200260200101519050620008db816001600160a01b0316846001600160a01b0316106065620005c660201b60201c565b915060010162000891565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200090f848484620009a3565b506001901b60001901811b1992909216911b1790565b600062000937838311156001620005c6565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b620009b461010083106064620005c6565b620009ed60018210158015620009e55750620009e160ff8461010003620009fe60201b620010de1760201c565b8211155b6064620005c6565b620008e683821c156101b4620005c6565b600081831062000a0f578162000a11565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000a5b57805160ff191683800117855562000a8b565b8280016001018555821562000a8b579182015b8281111562000a8b57825182559160200191906001019062000a6e565b5062000a9992915062000a9d565b5090565b5b8082111562000a99576000815560010162000a9e565b80516200093c8162000e75565b600082601f83011262000ad2578081fd5b81516001600160401b0381111562000ae8578182fd5b62000afd601f8201601f191660200162000e0f565b915080825283602082850101111562000b1557600080fd5b62000b2881602084016020860162000e42565b5092915050565b60006020828403121562000b41578081fd5b5051919050565b60006020828403121562000b5a578081fd5b815162000a118162000e75565b600080600080600060a0868803121562000b7f578081fd5b855162000b8c8162000e75565b60208701519095506001600160401b038082111562000ba9578283fd5b818801915061014080838b03121562000bc0578384fd5b62000bcb8162000e0f565b905082518281111562000bdc578485fd5b62000bea8b82860162000ac1565b82525060208301518281111562000bff578485fd5b62000c0d8b82860162000ac1565b60208301525062000c228a6040850162000ab4565b604082015262000c368a6060850162000ab4565b60608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120808401518381111562000c83578586fd5b62000c918c82870162000ac1565b828401525050809650505050604086015192506060860151915062000cba876080880162000ab4565b90509295509295909350565b60006020828403121562000cd8578081fd5b815160ff8116811462000a11578182fd5b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000d355762000d22855162000e36565b8352938301939183019160010162000d0d565b505084810360408601528551808252908201925081860190845b8181101562000d775762000d64835162000e36565b8552938301939183019160010162000d4f565b509298975050505050505050565b602081016003831062000d9457fe5b91905290565b90815260200190565b600088825287602083015260018060a01b03808816604084015286606084015285608084015260e060a084015284518060e085015261010062000ded8282870160208a0162000e42565b9490911660c0840152601f01601f191691909101909101979650505050505050565b6040518181016001600160401b038111828210171562000e2e57600080fd5b604052919050565b6001600160a01b031690565b60005b8381101562000e5f57818101518382015260200162000e45565b8381111562000e6f576000848401525b50505050565b6001600160a01b03811681146200085c57600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e0516103005161032051610340516103605160601c613d9f6200109a60003980611cbd52806121bc52806124b852806127fe5280612afe525080610ba952806112415280612e4f525080610dde52806111ec5280611d385280611d92528061216b528061237c52806123b252806129e95280612a445280612a7b525080610a7752806111865280612004528061208252806120e55280612467528061269a528061271d528061278152806129985250806105ac5250806105cd5280611079525080610cba525050806106735280610a1452508061064d5280610e195250806112145280611d6b5250806111ae525080610a38528061136752806114125280611fc0528061221452806122cf528061253452806125a65280612658528061285652806128d85280612b7a5280612c205250806108d4528061131752806113c952806121f352806122965280612335528061251252806125da5280612835528061291152806129545280612b585280612bec525080610e605250806109275250806115105250806114ec525080610c7b525080610c57525080610be1525080611e15525080611e57525080611e365250613d9f6000f3fe608060405234801561001057600080fd5b50600436106102955760003560e01c80637ecebe0011610167578063a7488bb7116100ce578063d2946c2b11610087578063d2946c2b1461050b578063d505accf14610513578063d5c096c414610526578063dd62ed3e14610539578063ed24911d1461054c578063f1493ee11461055457610295565b8063a7488bb7146104d0578063a9059cbb146104d8578063aaabadc5146104eb578063ac4316cb146104f3578063b35056b8146104fb578063b7b814fc1461050357610295565b80638d928af8116101205780638d928af81461048a57806390193b7c1461049257806395c95a4f146104a557806395d89b41146104ad5780639c0e5d13146104b5578063a457c2d7146104bd57610295565b80637ecebe001461043957806382687a561461044c5780638456cb5914610454578063851c1bb31461045c57806387ec68171461046f578063893d20e81461048257610295565b806338fff2d01161020b5780636028bfd4116101c45780636028bfd4146103cc5780636482c9d3146103ed5780636945c1fd146103f557806370a08231146103fd57806372f3824d1461041057806374f3b0091461041857610295565b806338fff2d014610386578063395093511461038e5780633f4ba83a146103a157806350dd6ed9146103a957806354a844ba146103bc57806355c67628146103c457610295565b80631dd746ea1161025d5780631dd746ea1461031757806323b872dd1461032c5780632541897f1461033f578063313ce567146103545780633644e5151461036957806338e9922e1461037157610295565b806301ec954a1461029a57806306fdde03146102c3578063095ea7b3146102d857806318160ddd146102f85780631c0de05114610300575b600080fd5b6102ad6102a836600461370f565b61055c565b6040516102ba9190613a33565b60405180910390f35b6102cb610771565b6040516102ba9190613b51565b6102eb6102e636600461349c565b610807565b6040516102ba9190613a10565b6102ad61081e565b610308610824565b6040516102ba93929190613a1b565b61031f61084d565b6040516102ba91906139cf565b6102eb61033a3660046133ec565b61085c565b6103476108d2565b6040516102ba9190613987565b61035c6108f6565b6040516102ba9190613cc3565b6102ad6108ff565b61038461037f36600461382e565b610909565b005b6102ad610925565b6102eb61039c36600461349c565b610949565b610384610984565b6103846103b73660046135ce565b610998565b6103846109b6565b6102ad6109c8565b6103df6103da3660046134e7565b6109db565b6040516102ba929190613caa565b6102ad610a12565b610347610a36565b6102ad61040b366004613398565b610a5a565b6102ad610a75565b61042b6104263660046134e7565b610a99565b6040516102ba9291906139e2565b6102ad610447366004613398565b610b9c565b6102ad610ba7565b610384610bcb565b6102ad61046a36600461358a565b610bdd565b6103df61047d3660046134e7565b610c2f565b610347610c55565b610347610c79565b6102ad6104a0366004613398565b610c9d565b6102ad610cb8565b6102cb610cdc565b6102cb610d3d565b6102eb6104cb36600461349c565b610d9e565b6102ad610ddc565b6102eb6104e636600461349c565b610e00565b610347610e0d565b6102ad610e17565b6102eb610e3b565b610384610e4c565b610347610e5e565b61038461052136600461342c565b610e82565b61042b6105343660046134e7565b610f0d565b6102ad6105473660046133b4565b611030565b6102ad61106d565b6102ad611077565b6000846080015161058961056e610c79565b6001600160a01b0316336001600160a01b03161460cd6110f4565b61059e610594610925565b82146101f46110f4565b6105a6611102565b426105f17f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611115565b10156106185760405162461bcd60e51b815260040161060f90613c82565b60405180910390fd5b6060610622611125565b905061062e8682611298565b61063661328a565b60405180606001604052806106496109c8565b81527f000000000000000000000000000000000000000000000000000000000000000060208201527f000000000000000000000000000000000000000000000000000000000000000060409091015290506000885160018111156106a957fe5b141561070b576106d088606001518388815181106106c357fe5b6020026020010151611307565b606089015260006106e2898984611313565b9050610701818488815181106106f457fe5b60200260200101516113b9565b9450505050610768565b60018851600181111561071a57fe5b14156107655761073488606001518387815181106106c357fe5b606089015260006107468989846113c5565b90506107018184898151811061075857fe5b6020026020010151611459565b50505b50949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107fd5780601f106107d2576101008083540402835291602001916107fd565b820191906000526020600020905b8154815290600101906020018083116107e057829003601f168201915b5050505050905090565b6000610814338484611465565b5060015b92915050565b60025490565b60008060006108316114cd565b15925061083c6114ea565b915061084661150e565b9050909192565b6060610857611125565b905090565b6000806108698533611030565b905061088d336001600160a01b03871614806108855750838210155b61019e6110f4565b610898858585611532565b336001600160a01b038616148015906108b357506000198114155b156108c5576108c58533858403611465565b60019150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b600061085761106d565b610911611612565b610919611102565b61092281611640565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161081491859061097f90866116b9565b611465565b61098c611612565b61099660006116cb565b565b6109a0611612565b6109a8611102565b6109b2828261173e565b5050565b6109be611612565b6109966001611833565b6008546000906108579060c0603f61188a565b600060606109f186516109ec611899565b61189e565b610a06898989898989896118ab6118fd611966565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60608088610aa861056e610c79565b610ab3610594610925565b60606000610ac086611a90565b15610ae857610acd611abf565b610adf89610ad961081e565b88611ad2565b92509050610b3a565b610af0611afe565b6060610afa611125565b9050610b068a82611298565b610b2a8d8d8d8d8d610b16610e3b565b610b20578d610b23565b60005b878e6118ab565b93509150610b3883826118fd565b505b610b448b82611b06565b81895167ffffffffffffffff81118015610b5d57600080fd5b50604051908082528060200260200182016040528015610b87578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061081882610c9d565b7f000000000000000000000000000000000000000000000000000000000000000090565b610bd3611612565b61099660016116cb565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610c12929190613944565b604051602081830303815290604052805190602001209050919050565b60006060610c4086516109ec611899565b610a0689898989898989611b10611b2c611966565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107fd5780601f106107d2576101008083540402835291602001916107fd565b60098054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107fd5780601f106107d2576101008083540402835291602001916107fd565b600080610dab3385611030565b9050808310610dc557610dc033856000611465565b610dd2565b610dd23385858403611465565b5060019392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000610814338484611532565b6000610857611b95565b7f000000000000000000000000000000000000000000000000000000000000000090565b6008546000906108579060ff611c0f565b610e54611612565b6109966000611833565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610eb18c610c9d565b89604051602001610ec796959493929190613a9b565b604051602081830303815290604052805190602001209050610ef88882610eef878787611c19565b886101f8611c58565b610f03888888611465565b5050505050505050565b60608088610f1c61056e610c79565b610f27610594610925565b610f2f611afe565b6060610f39611125565b9050610f4361081e565b610ff05760006060610f588d8d8d868b611caf565b91509150610f71610f67611dd5565b83101560cc6110f4565b610f836000610f7e611dd5565b611ddc565b610f968b610f8f611dd5565b8403611ddc565b610fa08184611b2c565b808a5167ffffffffffffffff81118015610fb957600080fd5b50604051908082528060200260200182016040528015610fe3578160200160208202803683370190505b5095509550505050610b8f565b610ffa8882611298565b600060606110228d8d8d8d8d61100e610e3b565b611018578d61101b565b60005b898e611b10565b91509150610f968b83611ddc565b600061103a610c79565b6001600160a01b0316826001600160a01b0316141561105c5750600019610818565b6110668383611de6565b9050610818565b6000610857611e11565b7f000000000000000000000000000000000000000000000000000000000000000090565b806109b281611eae565b60006110b2848484611f2c565b506001901b60001901811b1992909216911b1790565b60006110d88383111560016110f4565b50900390565b60008183106110ed57816108cb565b5090919050565b816109b2576109b281611f73565b61099661110d6114cd565b6101926110f4565b8181018281101561081857600080fd5b60606000611131611899565b905060608167ffffffffffffffff8111801561114c57600080fd5b50604051908082528060200260200182016040528015611176578160200160208202803683370190505b50905060005b82811015611291577f00000000000000000000000000000000000000000000000000000000000000008114156111ea577f00000000000000000000000000000000000000000000000000000000000000008282815181106111d957fe5b602002602001018181525050611289565b7f000000000000000000000000000000000000000000000000000000000000000081141561123f577f00000000000000000000000000000000000000000000000000000000000000008282815181106111d957fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561128957670de0b6b3a764000082828151811061127c57fe5b6020026020010181815250505b60010161117c565b5091505090565b815181516112a790829061189e565b60005b81811015611301576112e28482815181106112c157fe5b60200260200101518483815181106112d557fe5b6020026020010151611f83565b8482815181106112ee57fe5b60209081029190910101526001016112aa565b50505050565b60006108cb8383611f83565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113655761135e848484611fb9565b90506108cb565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113ae5761135e84848461232e565b6108cb610135611f73565b60006108cb8383612600565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b031614156114105761135e848484612651565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b031614156113ae5761135e84848461294d565b60006108cb8383612c4a565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906114c0908590613a33565b60405180910390a3505050565b60006114d761150e565b42118061085757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6115496001600160a01b03841615156101986110f4565b6115606001600160a01b03831615156101996110f4565b61156b838383611f27565b6001600160a01b03831660009081526020819052604090205461159190826101a0612c98565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546115c090826116b9565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114c0908590613a33565b60006116296000356001600160e01b031916610bdd565b90506109226116388233612cae565b6101916110f4565b61165561164b612d97565b82101560cb6110f4565b61166a611660612da0565b82111560ca6110f4565b60085461167b908260c0603f6110a5565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906116ae908390613a33565b60405180910390a150565b60008282016108cb84821015836110f4565b80156116eb576116e66116dc6114ea565b42106101936110f4565b611700565b6117006116f661150e565b42106101a96110f4565b6007805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be64906116ae908390613a10565b6000611748610925565b90506000611754610c79565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401611781929190613b1c565b60806040518083038186803b15801561179957600080fd5b505afa1580156117ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d19190613846565b604051630639cdb560e21b81529094506001600160a01b03851693506318e736d49250611805915085908790600401613afb565b600060405180830381600087803b15801561181f57600080fd5b505af1158015610f03573d6000803e3d6000fd5b600854611842908260ff612dac565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611875908390613a10565b60405180910390a18061092257610922610996565b6001901b6000190191901c1690565b600390565b6109b281831460676110f4565b6000606060006118ba84612dd3565b905060018160018111156118ca57fe5b146118df576118da610162611f73565b6118ef565b6118e98885612de9565b90935091505b509850989650505050505050565b8151815161190c90829061189e565b60005b818110156113015761194784828151811061192657fe5b602002602001015184838151811061193a57fe5b6020026020010151612600565b84828151811061195357fe5b602090810291909101015260010161190f565b333014611a24576000306001600160a01b031660003660405161198a92919061395c565b6000604051808303816000865af19150503d80600081146119c7576040519150601f19603f3d011682016040523d82523d6000602084013e6119cc565b606091505b5050905080600081146119db57fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b8114611a06573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611a2c611afe565b6060611a36611125565b9050611a428782611298565b60006060611a5a8c8c8c8c8c8c898d8d63ffffffff16565b91509150611a6c81848663ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b6000808251118015610818575060ff801682806020019051810190611ab59190613886565b60ff161492915050565b610996611aca610e3b565b6101b66110f4565b600060606000611ae184612eb5565b90506060611af0878784612ecb565b919791965090945050505050565b610996611102565b6109b28282612f7a565b60006060611b1f610162611f73565b9850989650505050505050565b81518151611b3b90829061189e565b60005b8181101561130157611b76848281518110611b5557fe5b6020026020010151848381518110611b6957fe5b6020026020010151612c4a565b848281518110611b8257fe5b6020908102919091010152600101611b3e565b6000611b9f610c79565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611bd757600080fd5b505afa158015611beb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085791906135b2565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b6000611c6385613046565b9050611c79611c73878387613062565b836110f4565b611c88428410156101b86110f4565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b60006060611cbb611102565b7f0000000000000000000000000000000000000000000000000000000000000000611cf66001600160a01b03888116908316146101566110f4565b611d16816001600160a01b0316876001600160a01b0316146101566110f4565b6dffffffffffffffffffffffffffff6060611d3086613111565b9050611d8f817f000000000000000000000000000000000000000000000000000000000000000081518110611d6157fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000611307565b817f000000000000000000000000000000000000000000000000000000000000000081518110611dbb57fe5b602090810291909101015290999098509650505050505050565b620f424090565b6109b28282613127565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611e7e6131ba565b30604051602001611e93959493929190613acf565b60405160208183030381529060405280519060200120905090565b600281511015611ebd57610922565b600081600081518110611ecc57fe5b602002602001015190506000600190505b8251811015611f27576000838281518110611ef457fe5b60200260200101519050611f1d816001600160a01b0316846001600160a01b03161060656110f4565b9150600101611edd565b505050565b611f3b610100831060646110f4565b611f6460018210158015611f5d5750611f5960ff84610100036110de565b8211155b60646110f4565b611f2783821c156101b46110f4565b610922816210905360ea1b6131be565b6000828202611fa7841580611fa0575083858381611f9d57fe5b04145b60036110f4565b670de0b6b3a764000090049392505050565b6000611fff7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b0316146101356110f4565b6000837f00000000000000000000000000000000000000000000000000000000000000008151811061202d57fe5b6020026020010151116120525760405162461bcd60e51b815260040161060f90613c5a565b81604001518460600151101561207a5760405162461bcd60e51b815260040161060f90613bc9565b60006120bd847f0000000000000000000000000000000000000000000000000000000000000000815181106120ab57fe5b602002602001015186606001516116b9565b9050600061212b6120df85602001518860600151611f8390919063ffffffff16565b612125877f00000000000000000000000000000000000000000000000000000000000000008151811061210e57fe5b60200260200101518561260090919063ffffffff16565b90611f83565b9050836020015161214987606001518361260090919063ffffffff16565b10156121675760405162461bcd60e51b815260040161060f90613c2e565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061219457fe5b602002602001015110156121ba5760405162461bcd60e51b815260040161060f90613b64565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16121f1610925565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160006040518863ffffffff1660e01b81526004016122629796959493929190613a5b565b600060405180830381600087803b15801561227c57600080fd5b505af1158015612290573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600080516020613d4a8339815191527f0000000000000000000000000000000000000000000000000000000000000000838960c0015161230b8b606001518761260090919063ffffffff16565b4260405161231d95949392919061399b565b60405180910390a295945050505050565b60006123747f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b0316146101356110f4565b60006123a5847f0000000000000000000000000000000000000000000000000000000000000000815181106120ab57fe5b9050600061240b6123f2867f0000000000000000000000000000000000000000000000000000000000000000815181106123db57fe5b60200260200101518461260090919063ffffffff16565b6020860151606089015161240591612600565b90612600565b905083604001518110156124315760405162461bcd60e51b815260040161060f90613bc9565b602084015160608701516124459083612600565b10156124635760405162461bcd60e51b815260040161060f90613c2e565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061249057fe5b602002602001015110156124b65760405162461bcd60e51b815260040161060f90613bf7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16124ed610925565b606089015160c08a01516040516001600160e01b031960e086901b16815261256193927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600190600401613a5b565b600060405180830381600087803b15801561257b57600080fd5b505af115801561258f573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250600080516020613d4a833981519152917f00000000000000000000000000000000000000000000000000000000000000009161230b82875b600061260f82151560046110f4565b8261261c57506000610818565b670de0b6b3a76400008381029061263f9085838161263657fe5b041460056110f4565b82818161264857fe5b04915050610818565b60006126977f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b0316146101356110f4565b827f0000000000000000000000000000000000000000000000000000000000000000815181106126c357fe5b60200260200101518460600151106126ed5760405162461bcd60e51b815260040161060f90613b9b565b8160400151846060015110156127155760405162461bcd60e51b815260040161060f90613bc9565b6000612758847f00000000000000000000000000000000000000000000000000000000000000008151811061274657fe5b602002602001015186606001516110c8565b905060006127c061277a85602001518860600151611f8390919063ffffffff16565b61212584887f0000000000000000000000000000000000000000000000000000000000000000815181106127aa57fe5b602002602001015161260090919063ffffffff16565b905083602001516127de87606001518361260090919063ffffffff16565b10156127fc5760405162461bcd60e51b815260040161060f90613c2e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612833610925565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160016040518863ffffffff1660e01b81526004016128a49796959493929190613a5b565b600060405180830381600087803b1580156128be57600080fd5b505af11580156128d2573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600080516020613d4a8339815191527f0000000000000000000000000000000000000000000000000000000000000000838960c0015161230b8b606001518761260090919063ffffffff16565b60006129937f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b0316146101356110f4565b6000837f0000000000000000000000000000000000000000000000000000000000000000815181106129c157fe5b6020026020010151116129e65760405162461bcd60e51b815260040161060f90613c5a565b827f000000000000000000000000000000000000000000000000000000000000000081518110612a1257fe5b6020026020010151846060015110612a3c5760405162461bcd60e51b815260040161060f90613b9b565b6000612a6d847f00000000000000000000000000000000000000000000000000000000000000008151811061274657fe5b90506000612aa46123f283877f0000000000000000000000000000000000000000000000000000000000000000815181106127aa57fe5b90508360400151811015612aca5760405162461bcd60e51b815260040161060f90613bc9565b60208401516060870151612ade9083612600565b1015612afc5760405162461bcd60e51b815260040161060f90613c2e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612b33610925565b606089015160c08a01516040516001600160e01b031960e086901b168152612ba793927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600090600401613a5b565b600060405180830381600087803b158015612bc157600080fd5b505af1158015612bd5573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250600080516020613d4a833981519152917f00000000000000000000000000000000000000000000000000000000000000009161230b8287612600565b6000612c5982151560046110f4565b82612c6657506000610818565b670de0b6b3a764000083810290612c809085838161263657fe5b826001820381612c8c57fe5b04600101915050610818565b6000612ca784841115836110f4565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612ccd610c55565b6001600160a01b031614158015612ce85750612ce88361321f565b15612d1057612cf5610c55565b6001600160a01b0316336001600160a01b0316149050610818565b612d18611b95565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612d4793929190613a3c565b60206040518083038186803b158015612d5f57600080fd5b505afa158015612d73573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106691906134c7565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284612dc2576000612dc5565b60015b60ff16901b17949350505050565b600081806020019051810190610818919061361c565b600060606000612df88461325b565b90506060855167ffffffffffffffff81118015612e1457600080fd5b50604051908082528060200260200182016040528015612e3e578160200160208202803683370190505b50905060005b8651811015612ea9577f00000000000000000000000000000000000000000000000000000000000000008114612ea157868181518110612e8057fe5b6020026020010151828281518110612e9457fe5b6020026020010181815250505b600101612e44565b50909590945092505050565b6000818060200190518101906108cb91906138a2565b60606000612ed98385612600565b9050845167ffffffffffffffff81118015612ef357600080fd5b50604051908082528060200260200182016040528015612f1d578160200160208202803683370190505b50915060005b8551811015612f7157612f5282878381518110612f3c57fe5b6020026020010151611f8390919063ffffffff16565b838281518110612f5e57fe5b6020908102919091010152600101612f23565b50509392505050565b612f916001600160a01b038316151561019b6110f4565b612f9d82600083611f27565b6001600160a01b038216600090815260208190526040902054612fc390826101b2612c98565b6001600160a01b038316600090815260208190526040902055612ff6612ff182612feb61081e565b90613271565b61327f565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161303a9190613a33565b60405180910390a35050565b6000613050611e11565b82604051602001610c1292919061396c565b600061307482516041146101b96110f4565b60208281015160408085015160608601518251600080825295019283905292939092811a916001906130ad908990859088908890613b33565b6020604051602081039080840390855afa1580156130cf573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906131055750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906108cb9190613665565b61313360008383611f27565b613148612ff18261314261081e565b906116b9565b6001600160a01b03821660009081526020819052604090205461316b90826116b9565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061303a908590613a33565b4690565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b6000613231631c74c91760e11b610bdd565b82148061324c57506132496350dd6ed960e01b610bdd565b82145b80610818575061081882613284565b6000818060200190518101906108cb9190613638565b60006108cb83836001612c98565b600255565b50600090565b60405180606001604052806000815260200160008152602001600081525090565b803561081881613d18565b600082601f8301126132c6578081fd5b81356132d96132d482613cf8565b613cd1565b8181529150602080830190848101818402860182018710156132fa57600080fd5b60005b84811015613319578135845292820192908201906001016132fd565b505050505092915050565b600082601f830112613334578081fd5b813567ffffffffffffffff81111561334a578182fd5b61335d601f8201601f1916602001613cd1565b915080825283602082850101111561337457600080fd5b8060208401602084013760009082016020015292915050565b803561081881613d2d565b6000602082840312156133a9578081fd5b81356108cb81613d18565b600080604083850312156133c6578081fd5b82356133d181613d18565b915060208301356133e181613d18565b809150509250929050565b600080600060608486031215613400578081fd5b833561340b81613d18565b9250602084013561341b81613d18565b929592945050506040919091013590565b600080600080600080600060e0888a031215613446578283fd5b873561345181613d18565b9650602088013561346181613d18565b95506040880135945060608801359350608088013561347f81613d3a565b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156134ae578182fd5b82356134b981613d18565b946020939093013593505050565b6000602082840312156134d8578081fd5b815180151581146108cb578182fd5b600080600080600080600060e0888a031215613501578081fd5b87359650602088013561351381613d18565b9550604088013561352381613d18565b9450606088013567ffffffffffffffff8082111561353f578283fd5b61354b8b838c016132b6565b955060808a0135945060a08a0135935060c08a013591508082111561356e578283fd5b5061357b8a828b01613324565b91505092959891949750929550565b60006020828403121561359b578081fd5b81356001600160e01b0319811681146108cb578182fd5b6000602082840312156135c3578081fd5b81516108cb81613d18565b600080604083850312156135e0578182fd5b82356135eb81613d18565b9150602083013567ffffffffffffffff811115613606578182fd5b61361285828601613324565b9150509250929050565b60006020828403121561362d578081fd5b81516108cb81613d2d565b6000806040838503121561364a578182fd5b825161365581613d2d565b6020939093015192949293505050565b60008060408385031215613677578182fd5b825160048110613685578283fd5b8092505060208084015167ffffffffffffffff8111156136a3578283fd5b8401601f810186136136b3578283fd5b80516136c16132d482613cf8565b81815283810190838501858402850186018a10156136dd578687fd5b8694505b838510156136ff5780518352600194909401939185019185016136e1565b5080955050505050509250929050565b60008060008060808587031215613724578182fd5b843567ffffffffffffffff8082111561373b578384fd5b818701915061012080838a031215613751578485fd5b61375a81613cd1565b9050613766898461338d565b815261377589602085016132ab565b602082015261378789604085016132ab565b6040820152606083013560608201526080830135608082015260a083013560a08201526137b78960c085016132ab565b60c08201526137c98960e085016132ab565b60e082015261010080840135838111156137e1578687fd5b6137ed8b828701613324565b82840152505080965050602087013591508082111561380a578384fd5b50613817878288016132b6565b949794965050505060408301359260600135919050565b60006020828403121561383f578081fd5b5035919050565b6000806000806080858703121561385b578182fd5b845193506020850151925060408501519150606085015161387b81613d18565b939692955090935050565b600060208284031215613897578081fd5b81516108cb81613d3a565b600080604083850312156138b4578182fd5b825161365581613d3a565b6000815180845260208085019450808401835b838110156138ee578151875295820195908201906001016138d2565b509495945050505050565b60008151808452815b8181101561391e57602081850181015186830182015201613902565b8181111561392f5782602083870101525b50601f01601f19169290920160200192915050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b6000602082526108cb60208301846138bf565b6000604082526139f560408301856138bf565b8281036020840152613a0781856138bf565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9687526001600160a01b03958616602088015293851660408701526060860192909252909216608084015260a0830191909152151560c082015260e00190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b600083825260406020830152613b1460408301846138f9565b949350505050565b9182526001600160a01b0316602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526108cb60208301846138f9565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b602080825260149082015273496e73756666696369656e742062616c616e636560601b604082015260600190565b60208082526014908201527327b93232b91039b4bd32903b34b7b630ba34b7b760611b604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b602080825260129082015271141c9a58d9481bdd5d081bd988189bdd5b9960721b604082015260600190565b6020808252600e908201526d125cdcdd59481cdbdb19081bdd5d60921b604082015260600190565b6020808252600e908201526d2a34b6b2a634b6b4ba1027bb32b960911b604082015260600190565b600083825260406020830152613b1460408301846138bf565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715613cf057600080fd5b604052919050565b600067ffffffffffffffff821115613d0e578081fd5b5060209081020190565b6001600160a01b038116811461092257600080fd5b6002811061092257600080fd5b60ff8116811461092257600080fdfe560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9ca264697066735822122041b84783f18addc45bc892a428476429b5acdfb3f8b733a409d10e391400847c64736f6c63430007010033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a85760003560e01c80636634b753116100715780636634b753146101215780636c57f5a914610141578063739238d614610149578063851c1bb3146101515780638d928af814610171578063aaabadc514610179576100a8565b8062c194db146100ad578063174481fa146100cb5780632236c4cc146100e15780632da47c40146101015780632f2770db14610117575b600080fd5b6100b5610181565b6040516100c29190610a4a565b60405180910390f35b6100d36101a0565b6040516100c29291906109fd565b6100f46100ef366004610868565b6101e6565b6040516100c291906109e9565b610109610236565b6040516100c2929190610b50565b61011f6102a0565b005b61013461012f3660046107e8565b6102e7565b6040516100c29190610a17565b610134610305565b6100f461030e565b61016461015f366004610824565b610332565b6040516100c29190610a22565b6100f4610384565b6100f46103a8565b606061019b60405180602001604052806000815250610474565b905090565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b60008060006101f3610236565b9150915061022e610202610384565b8584843360405160200161021a959493929190610a5d565b60405160208183030381529060405261054d565b949350505050565b600080427f000000000000000000000000000000000000000000000000000000000000000081101561029257807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915061029b565b60009250600091505b509091565b6102a86105b6565b6102b06105e7565b6001805460ff1916811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103679291906109d1565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103b2610384565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ea57600080fd5b505afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019b919061084c565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f0908452915061046e6001600160a01b03831615156101ac6105fc565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c506020898101908985010161053f81838661060e565b505050505050505050919050565b60006105576105e7565b60006105628361064c565b6001600160a01b038116600081815260208190526040808220805460ff191660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006105cd6000356001600160e01b031916610332565b90506105e46105dc8233610687565b6101916105fc565b50565b6105fa6105f2610305565b1560d36105fc565b565b8161060a5761060a81610719565b5050565b5b6020811061062e578151835260209283019290910190601f190161060f565b905182516020929092036101000a6000190180199091169116179052565b6000606061065983610474565b905060008151602083016000f090506001600160a01b038116610680573d6000803e3d6000fd5b9392505050565b60006106916103a8565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016106c093929190610a2b565b60206040518083038186803b1580156106d857600080fd5b505afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107109190610804565b90505b92915050565b62461bcd60e51b600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b6044526105e4916210905360ea1b906242414c90606490fd5b803561071381610b85565b600082601f83011261078f578081fd5b813567ffffffffffffffff8111156107a5578182fd5b6107b8601f8201601f1916602001610b5e565b91508082528360208285010111156107cf57600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156107f9578081fd5b813561068081610b85565b600060208284031215610815578081fd5b81518015158114610680578182fd5b600060208284031215610835578081fd5b81356001600160e01b031981168114610680578182fd5b60006020828403121561085d578081fd5b815161068081610b85565b600060208284031215610879578081fd5b813567ffffffffffffffff80821115610890578283fd5b81840191506101408083870312156108a6578384fd5b6108af81610b5e565b90508235828111156108bf578485fd5b6108cb8782860161077f565b8252506020830135828111156108df578485fd5b6108eb8782860161077f565b6020830152506108fe8660408501610774565b60408201526109108660608501610774565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e0820152610100808401358183015250610120808401358381111561095c578586fd5b6109688882870161077f565b918301919091525095945050505050565b6001600160a01b03169052565b60008151808452815b818110156109ab5760208185018101518683018201520161098f565b818111156109bc5782602083870101525b50601f01601f19169290920160200192915050565b9182526001600160e01b031916602082015260240190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b901515815260200190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b6000602082526107106020830184610986565b600060018060a01b038716825260a0602083015285516101408060a0850152610a8a6101e0850183610986565b91506020880151609f19808685030160c0870152610aa88483610986565b935060408a01519150610abe60e0870183610979565b60608a01519150610100610ad481880184610979565b60808b01516101208881019190915260a08c01519488019490945260c08b015161016088015260e08b01516101808801528a01516101a0870152918901518584039092016101c086015250610b298282610986565b92505050846040830152836060830152610b466080830184610979565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610b7d57600080fd5b604052919050565b6001600160a01b03811681146105e457600080fdfea2646970667358221220df3c950682a0ca6bad119f2536e6858ecd048230171f9bb2b68ef9c8135af14064736f6c63430007010033", + "bytecode": "0x6101806040523480156200001257600080fd5b5060405162005cc438038062005cc48339810160408190526200003591620001fc565b8181604051806020016200004990620001ee565b601f1982820381018352601f90910116604052805183903090839060006002820460a081905280830360e08190528185529091508362000095816200010f602090811b6200042217901c565b60601b6001600160601b0319166080528285018051838252620000c4826200010f602090811b6200042217901c565b6001600160601b0319606091821b811660c05296909352905261010095909552505092821b831661012052509290921b90911661014052505050426276a70001610160525062000250565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f090845291506200015d6001600160a01b03831615156101ac62000163565b50919050565b816200017457620001748162000178565b5050565b6200018a816210905360ea1b6200018d565b50565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b614e2b8062000e9983390190565b600080604083850312156200020f578182fd5b82516200021c816200023a565b60208401519092506200022f816200023a565b809150509250929050565b6001600160a01b03811681146200018a57600080fd5b60805160601c60a05160c05160601c60e051610100516101205160601c6101405160601c61016051610bd0620002c96000398061023c528061026552508061031052508061038652508061033652508061047c5250806101c352806104f852508061049d5250806101a252806104d45250610bd06000f3fe608060405234801561001057600080fd5b50600436106100a85760003560e01c80636634b753116100715780636634b753146101215780636c57f5a914610141578063739238d614610149578063851c1bb3146101515780638d928af814610171578063aaabadc514610179576100a8565b8062c194db146100ad578063174481fa146100cb5780632236c4cc146100e15780632da47c40146101015780632f2770db14610117575b600080fd5b6100b5610181565b6040516100c29190610a4a565b60405180910390f35b6100d36101a0565b6040516100c29291906109fd565b6100f46100ef366004610868565b6101e6565b6040516100c291906109e9565b610109610236565b6040516100c2929190610b50565b61011f6102a0565b005b61013461012f3660046107e8565b6102e7565b6040516100c29190610a17565b610134610305565b6100f461030e565b61016461015f366004610824565b610332565b6040516100c29190610a22565b6100f4610384565b6100f46103a8565b606061019b60405180602001604052806000815250610474565b905090565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b60008060006101f3610236565b9150915061022e610202610384565b8584843360405160200161021a959493929190610a5d565b60405160208183030381529060405261054d565b949350505050565b600080427f000000000000000000000000000000000000000000000000000000000000000081101561029257807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915061029b565b60009250600091505b509091565b6102a86105b6565b6102b06105e7565b6001805460ff1916811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103679291906109d1565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103b2610384565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ea57600080fd5b505afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019b919061084c565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f0908452915061046e6001600160a01b03831615156101ac6105fc565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c506020898101908985010161053f81838661060e565b505050505050505050919050565b60006105576105e7565b60006105628361064c565b6001600160a01b038116600081815260208190526040808220805460ff191660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006105cd6000356001600160e01b031916610332565b90506105e46105dc8233610687565b6101916105fc565b50565b6105fa6105f2610305565b1560d36105fc565b565b8161060a5761060a81610719565b5050565b5b6020811061062e578151835260209283019290910190601f190161060f565b905182516020929092036101000a6000190180199091169116179052565b6000606061065983610474565b905060008151602083016000f090506001600160a01b038116610680573d6000803e3d6000fd5b9392505050565b60006106916103a8565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016106c093929190610a2b565b60206040518083038186803b1580156106d857600080fd5b505afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107109190610804565b90505b92915050565b62461bcd60e51b600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b6044526105e4916210905360ea1b906242414c90606490fd5b803561071381610b85565b600082601f83011261078f578081fd5b813567ffffffffffffffff8111156107a5578182fd5b6107b8601f8201601f1916602001610b5e565b91508082528360208285010111156107cf57600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156107f9578081fd5b813561068081610b85565b600060208284031215610815578081fd5b81518015158114610680578182fd5b600060208284031215610835578081fd5b81356001600160e01b031981168114610680578182fd5b60006020828403121561085d578081fd5b815161068081610b85565b600060208284031215610879578081fd5b813567ffffffffffffffff80821115610890578283fd5b81840191506101408083870312156108a6578384fd5b6108af81610b5e565b90508235828111156108bf578485fd5b6108cb8782860161077f565b8252506020830135828111156108df578485fd5b6108eb8782860161077f565b6020830152506108fe8660408501610774565b60408201526109108660608501610774565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e0820152610100808401358183015250610120808401358381111561095c578586fd5b6109688882870161077f565b918301919091525095945050505050565b6001600160a01b03169052565b60008151808452815b818110156109ab5760208185018101518683018201520161098f565b818111156109bc5782602083870101525b50601f01601f19169290920160200192915050565b9182526001600160e01b031916602082015260240190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b901515815260200190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b6000602082526107106020830184610986565b600060018060a01b038716825260a0602083015285516101408060a0850152610a8a6101e0850183610986565b91506020880151609f19808685030160c0870152610aa88483610986565b935060408a01519150610abe60e0870183610979565b60608a01519150610100610ad481880184610979565b60808b01516101208881019190915260a08c01519488019490945260c08b015161016088015260e08b01516101808801528a01516101a0870152918901518584039092016101c086015250610b298282610986565b92505050846040830152836060830152610b466080830184610979565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610b7d57600080fd5b604052919050565b6001600160a01b03811681146105e457600080fdfea2646970667358221220239ade2c2cbd79285908e566404f19e498242d851c1fd62dcda65e59a92ee6d364736f6c634300070100336103806040523480156200001257600080fd5b5060405162004e2b38038062004e2b833981016040819052620000359162000b65565b846000856000015186602001516200005d8860400151896060015130620004f560201b60201c565b604080516003808252608082019092529060208201606080368337019050508960e00151898989828289898d85336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000cd92919062000a16565b508051620000e390600490602084019062000a16565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b1661012052506200016190506276a700831115610194620005c4565b6200017562278d00821115610195620005c4565b429091016101408190520161016052855162000197906002111560c8620005c4565b620001b1620001a5620005d9565b8751111560c9620005c4565b620001c786620005de60201b6200109b1760201c565b620001d284620005ea565b6040516309b2760f60e01b81526000906001600160a01b038c16906309b2760f9062000203908d9060040162000d83565b602060405180830381600087803b1580156200021e57600080fd5b505af115801562000233573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000259919062000b2d565b604051633354e3e960e11b81529091506001600160a01b038c16906366a9c7d2906200028e9084908b908b9060040162000ce7565b600060405180830381600087803b158015620002a957600080fd5b505af1158015620002be573d6000803e3d6000fd5b505050508061018081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200030557600080fd5b505afa1580156200031a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000340919062000b46565b6001600160a01b03166101a0816001600160a01b031660601b81525050505050505050505050505083604001516001600160a01b03166101c0816001600160a01b031660601b8152505083606001516001600160a01b03166101e0816001600160a01b031660601b815250506000806000620003cc87604001518860600151306200067e60201b60201c565b61030083905261032082905261034081905260408a01519295509093509150620003f69062000774565b6102005260608701516200040a9062000774565b6102205260808701516102405260a08701516102605260e08701516102805260c08701516102a0526101008701516102c052426102e05261012087015180516200045d9160099160209091019062000a16565b50836001600160a01b0316610360816001600160a01b031660601b8152505086604001516001600160a01b03167ffc30a997970e4cac78235884be800647994f95d2388ac863446e51a96255d66d8860a0015189608001518a606001518b60c001518c61010001518d6101200151604051620004df9695949392919062000da1565b60405180910390a2505050505050505062000e7d565b606060008080620005088787876200067e565b60408051600380825260808201909252939650919450925060208201606080368337019050509350868484815181106200053e57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050858483815181106200056c57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050848482815181106200059a57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505050509392505050565b81620005d557620005d58162000848565b5050565b600390565b80620005d5816200085d565b62000603620005f8620008e9565b82101560cb620005c4565b6200061c62000611620008f2565b82111560ca620005c4565b6200063e8160c0603f600854620008fe60201b620010a517909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906200067390839062000d98565b60405180910390a150565b6000806000846001600160a01b0316866001600160a01b031610156200070757836001600160a01b0316856001600160a01b03161015620006ca5750600091506001905060026200076b565b836001600160a01b0316866001600160a01b03161015620006f65750600091506002905060016200076b565b50600191506002905060006200076b565b846001600160a01b0316846001600160a01b03161015620007335750600291506001905060006200076b565b856001600160a01b0316846001600160a01b031610156200075f5750600291506000905060016200076b565b50600191506000905060025b93509350939050565b60006001600160a01b038216301415620007985750670de0b6b3a764000062000843565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620007d457600080fd5b505afa158015620007e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200080f919062000cc4565b60ff16905060006200082e6012836200092360201b620010c81760201c565b905080600a0a670de0b6b3a764000002925050505b919050565b6200085a816210905360ea1b62000940565b50565b6002815110156200086e576200085a565b6000816000815181106200087e57fe5b602002602001015190506000600190505b8251811015620008e4576000838281518110620008a857fe5b60200260200101519050620008d9816001600160a01b0316846001600160a01b0316106065620005c460201b60201c565b91506001016200088f565b505050565b64e8d4a5100090565b67016345785d8a000090565b60006200090d848484620009a1565b506001901b60001901811b1992909216911b1790565b600062000935838311156001620005c4565b508082035b92915050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b620009b261010083106064620005c4565b620009eb60018210158015620009e35750620009df60ff8461010003620009fc60201b620010de1760201c565b8211155b6064620005c4565b620008e483821c156101b4620005c4565b600081831062000a0d578162000a0f565b825b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000a5957805160ff191683800117855562000a89565b8280016001018555821562000a89579182015b8281111562000a8957825182559160200191906001019062000a6c565b5062000a9792915062000a9b565b5090565b5b8082111562000a97576000815560010162000a9c565b80516200093a8162000e67565b600082601f83011262000ad0578081fd5b81516001600160401b0381111562000ae6578182fd5b62000afb601f8201601f191660200162000e01565b915080825283602082850101111562000b1357600080fd5b62000b2681602084016020860162000e34565b5092915050565b60006020828403121562000b3f578081fd5b5051919050565b60006020828403121562000b58578081fd5b815162000a0f8162000e67565b600080600080600060a0868803121562000b7d578081fd5b855162000b8a8162000e67565b60208701519095506001600160401b038082111562000ba7578283fd5b818801915061014080838b03121562000bbe578384fd5b62000bc98162000e01565b905082518281111562000bda578485fd5b62000be88b82860162000abf565b82525060208301518281111562000bfd578485fd5b62000c0b8b82860162000abf565b60208301525062000c208a6040850162000ab2565b604082015262000c348a6060850162000ab2565b60608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120808401518381111562000c81578586fd5b62000c8f8c82870162000abf565b828401525050809650505050604086015192506060860151915062000cb8876080880162000ab2565b90509295509295909350565b60006020828403121562000cd6578081fd5b815160ff8116811462000a0f578182fd5b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000d335762000d20855162000e28565b8352938301939183019160010162000d0b565b505084810360408601528551808252908201925081860190845b8181101562000d755762000d62835162000e28565b8552938301939183019160010162000d4d565b509298975050505050505050565b602081016003831062000d9257fe5b91905290565b90815260200190565b600087825286602083015260018060a01b038616604083015284606083015283608083015260c060a083015282518060c084015262000de88160e085016020870162000e34565b601f01601f19169190910160e001979650505050505050565b6040518181016001600160401b038111828210171562000e2057600080fd5b604052919050565b6001600160a01b031690565b60005b8381101562000e5157818101518382015260200162000e37565b8381111562000e61576000848401525b50505050565b6001600160a01b03811681146200085a57600080fd5b60805160a05160c05160e0516101005160601c6101205160601c6101405161016051610180516101a05160601c6101c05160601c6101e05160601c61020051610220516102405161026051610280516102a0516102c0516102e0516103005161032051610340516103605160601c613d9f6200108c60003980611cbd52806121bc52806124b852806127fe5280612afe525080610ba952806112415280612e4f525080610dde52806111ec5280611d385280611d92528061216b528061237c52806123b252806129e95280612a445280612a7b525080610a7752806111865280612004528061208252806120e55280612467528061269a528061271d528061278152806129985250806105ac5250806105cd5280611079525080610cba525050806106735280610a1452508061064d5280610e195250806112145280611d6b5250806111ae525080610a38528061136752806114125280611fc0528061221452806122cf528061253452806125a65280612658528061285652806128d85280612b7a5280612c205250806108d4528061131752806113c952806121f352806122965280612335528061251252806125da5280612835528061291152806129545280612b585280612bec525080610e605250806109275250806115105250806114ec525080610c7b525080610c57525080610be1525080611e15525080611e57525080611e365250613d9f6000f3fe608060405234801561001057600080fd5b50600436106102955760003560e01c80637ecebe0011610167578063a7488bb7116100ce578063d2946c2b11610087578063d2946c2b1461050b578063d505accf14610513578063d5c096c414610526578063dd62ed3e14610539578063ed24911d1461054c578063f1493ee11461055457610295565b8063a7488bb7146104d0578063a9059cbb146104d8578063aaabadc5146104eb578063ac4316cb146104f3578063b35056b8146104fb578063b7b814fc1461050357610295565b80638d928af8116101205780638d928af81461048a57806390193b7c1461049257806395c95a4f146104a557806395d89b41146104ad5780639c0e5d13146104b5578063a457c2d7146104bd57610295565b80637ecebe001461043957806382687a561461044c5780638456cb5914610454578063851c1bb31461045c57806387ec68171461046f578063893d20e81461048257610295565b806338fff2d01161020b5780636028bfd4116101c45780636028bfd4146103cc5780636482c9d3146103ed5780636945c1fd146103f557806370a08231146103fd57806372f3824d1461041057806374f3b0091461041857610295565b806338fff2d014610386578063395093511461038e5780633f4ba83a146103a157806350dd6ed9146103a957806354a844ba146103bc57806355c67628146103c457610295565b80631dd746ea1161025d5780631dd746ea1461031757806323b872dd1461032c5780632541897f1461033f578063313ce567146103545780633644e5151461036957806338e9922e1461037157610295565b806301ec954a1461029a57806306fdde03146102c3578063095ea7b3146102d857806318160ddd146102f85780631c0de05114610300575b600080fd5b6102ad6102a836600461370f565b61055c565b6040516102ba9190613a33565b60405180910390f35b6102cb610771565b6040516102ba9190613b51565b6102eb6102e636600461349c565b610807565b6040516102ba9190613a10565b6102ad61081e565b610308610824565b6040516102ba93929190613a1b565b61031f61084d565b6040516102ba91906139cf565b6102eb61033a3660046133ec565b61085c565b6103476108d2565b6040516102ba9190613987565b61035c6108f6565b6040516102ba9190613cc3565b6102ad6108ff565b61038461037f36600461382e565b610909565b005b6102ad610925565b6102eb61039c36600461349c565b610949565b610384610984565b6103846103b73660046135ce565b610998565b6103846109b6565b6102ad6109c8565b6103df6103da3660046134e7565b6109db565b6040516102ba929190613caa565b6102ad610a12565b610347610a36565b6102ad61040b366004613398565b610a5a565b6102ad610a75565b61042b6104263660046134e7565b610a99565b6040516102ba9291906139e2565b6102ad610447366004613398565b610b9c565b6102ad610ba7565b610384610bcb565b6102ad61046a36600461358a565b610bdd565b6103df61047d3660046134e7565b610c2f565b610347610c55565b610347610c79565b6102ad6104a0366004613398565b610c9d565b6102ad610cb8565b6102cb610cdc565b6102cb610d3d565b6102eb6104cb36600461349c565b610d9e565b6102ad610ddc565b6102eb6104e636600461349c565b610e00565b610347610e0d565b6102ad610e17565b6102eb610e3b565b610384610e4c565b610347610e5e565b61038461052136600461342c565b610e82565b61042b6105343660046134e7565b610f0d565b6102ad6105473660046133b4565b611030565b6102ad61106d565b6102ad611077565b6000846080015161058961056e610c79565b6001600160a01b0316336001600160a01b03161460cd6110f4565b61059e610594610925565b82146101f46110f4565b6105a6611102565b426105f17f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611115565b10156106185760405162461bcd60e51b815260040161060f90613c82565b60405180910390fd5b6060610622611125565b905061062e8682611298565b61063661328a565b60405180606001604052806106496109c8565b81527f000000000000000000000000000000000000000000000000000000000000000060208201527f000000000000000000000000000000000000000000000000000000000000000060409091015290506000885160018111156106a957fe5b141561070b576106d088606001518388815181106106c357fe5b6020026020010151611307565b606089015260006106e2898984611313565b9050610701818488815181106106f457fe5b60200260200101516113b9565b9450505050610768565b60018851600181111561071a57fe5b14156107655761073488606001518387815181106106c357fe5b606089015260006107468989846113c5565b90506107018184898151811061075857fe5b6020026020010151611459565b50505b50949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107fd5780601f106107d2576101008083540402835291602001916107fd565b820191906000526020600020905b8154815290600101906020018083116107e057829003601f168201915b5050505050905090565b6000610814338484611465565b5060015b92915050565b60025490565b60008060006108316114cd565b15925061083c6114ea565b915061084661150e565b9050909192565b6060610857611125565b905090565b6000806108698533611030565b905061088d336001600160a01b03871614806108855750838210155b61019e6110f4565b610898858585611532565b336001600160a01b038616148015906108b357506000198114155b156108c5576108c58533858403611465565b60019150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60055460ff1690565b600061085761106d565b610911611612565b610919611102565b61092281611640565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161081491859061097f90866116b9565b611465565b61098c611612565b61099660006116cb565b565b6109a0611612565b6109a8611102565b6109b2828261173e565b5050565b6109be611612565b6109966001611833565b6008546000906108579060c0603f61188a565b600060606109f186516109ec611899565b61189e565b610a06898989898989896118ab6118fd611966565b97509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526020819052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60608088610aa861056e610c79565b610ab3610594610925565b60606000610ac086611a90565b15610ae857610acd611abf565b610adf89610ad961081e565b88611ad2565b92509050610b3a565b610af0611afe565b6060610afa611125565b9050610b068a82611298565b610b2a8d8d8d8d8d610b16610e3b565b610b20578d610b23565b60005b878e6118ab565b93509150610b3883826118fd565b505b610b448b82611b06565b81895167ffffffffffffffff81118015610b5d57600080fd5b50604051908082528060200260200182016040528015610b87578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061081882610c9d565b7f000000000000000000000000000000000000000000000000000000000000000090565b610bd3611612565b61099660016116cb565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610c12929190613944565b604051602081830303815290604052805190602001209050919050565b60006060610c4086516109ec611899565b610a0689898989898989611b10611b2c611966565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107fd5780601f106107d2576101008083540402835291602001916107fd565b60098054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107fd5780601f106107d2576101008083540402835291602001916107fd565b600080610dab3385611030565b9050808310610dc557610dc033856000611465565b610dd2565b610dd23385858403611465565b5060019392505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000610814338484611532565b6000610857611b95565b7f000000000000000000000000000000000000000000000000000000000000000090565b6008546000906108579060ff611c0f565b610e54611612565b6109966000611833565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610eb18c610c9d565b89604051602001610ec796959493929190613a9b565b604051602081830303815290604052805190602001209050610ef88882610eef878787611c19565b886101f8611c58565b610f03888888611465565b5050505050505050565b60608088610f1c61056e610c79565b610f27610594610925565b610f2f611afe565b6060610f39611125565b9050610f4361081e565b610ff05760006060610f588d8d8d868b611caf565b91509150610f71610f67611dd5565b83101560cc6110f4565b610f836000610f7e611dd5565b611ddc565b610f968b610f8f611dd5565b8403611ddc565b610fa08184611b2c565b808a5167ffffffffffffffff81118015610fb957600080fd5b50604051908082528060200260200182016040528015610fe3578160200160208202803683370190505b5095509550505050610b8f565b610ffa8882611298565b600060606110228d8d8d8d8d61100e610e3b565b611018578d61101b565b60005b898e611b10565b91509150610f968b83611ddc565b600061103a610c79565b6001600160a01b0316826001600160a01b0316141561105c5750600019610818565b6110668383611de6565b9050610818565b6000610857611e11565b7f000000000000000000000000000000000000000000000000000000000000000090565b806109b281611eae565b60006110b2848484611f2c565b506001901b60001901811b1992909216911b1790565b60006110d88383111560016110f4565b50900390565b60008183106110ed57816108cb565b5090919050565b816109b2576109b281611f73565b61099661110d6114cd565b6101926110f4565b8181018281101561081857600080fd5b60606000611131611899565b905060608167ffffffffffffffff8111801561114c57600080fd5b50604051908082528060200260200182016040528015611176578160200160208202803683370190505b50905060005b82811015611291577f00000000000000000000000000000000000000000000000000000000000000008114156111ea577f00000000000000000000000000000000000000000000000000000000000000008282815181106111d957fe5b602002602001018181525050611289565b7f000000000000000000000000000000000000000000000000000000000000000081141561123f577f00000000000000000000000000000000000000000000000000000000000000008282815181106111d957fe5b7f000000000000000000000000000000000000000000000000000000000000000081141561128957670de0b6b3a764000082828151811061127c57fe5b6020026020010181815250505b60010161117c565b5091505090565b815181516112a790829061189e565b60005b81811015611301576112e28482815181106112c157fe5b60200260200101518483815181106112d557fe5b6020026020010151611f83565b8482815181106112ee57fe5b60209081029190910101526001016112aa565b50505050565b60006108cb8383611f83565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113655761135e848484611fb9565b90506108cb565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684602001516001600160a01b031614156113ae5761135e84848461232e565b6108cb610135611f73565b60006108cb8383612600565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b031614156114105761135e848484612651565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684604001516001600160a01b031614156113ae5761135e84848461294d565b60006108cb8383612c4a565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906114c0908590613a33565b60405180910390a3505050565b60006114d761150e565b42118061085757505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6115496001600160a01b03841615156101986110f4565b6115606001600160a01b03831615156101996110f4565b61156b838383611f27565b6001600160a01b03831660009081526020819052604090205461159190826101a0612c98565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546115c090826116b9565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114c0908590613a33565b60006116296000356001600160e01b031916610bdd565b90506109226116388233612cae565b6101916110f4565b61165561164b612d97565b82101560cb6110f4565b61166a611660612da0565b82111560ca6110f4565b60085461167b908260c0603f6110a5565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906116ae908390613a33565b60405180910390a150565b60008282016108cb84821015836110f4565b80156116eb576116e66116dc6114ea565b42106101936110f4565b611700565b6117006116f661150e565b42106101a96110f4565b6007805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be64906116ae908390613a10565b6000611748610925565b90506000611754610c79565b6001600160a01b031663b05f8e4883866040518363ffffffff1660e01b8152600401611781929190613b1c565b60806040518083038186803b15801561179957600080fd5b505afa1580156117ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d19190613846565b604051630639cdb560e21b81529094506001600160a01b03851693506318e736d49250611805915085908790600401613afb565b600060405180830381600087803b15801561181f57600080fd5b505af1158015610f03573d6000803e3d6000fd5b600854611842908260ff612dac565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611875908390613a10565b60405180910390a18061092257610922610996565b6001901b6000190191901c1690565b600390565b6109b281831460676110f4565b6000606060006118ba84612dd3565b905060018160018111156118ca57fe5b146118df576118da610162611f73565b6118ef565b6118e98885612de9565b90935091505b509850989650505050505050565b8151815161190c90829061189e565b60005b818110156113015761194784828151811061192657fe5b602002602001015184838151811061193a57fe5b6020026020010151612600565b84828151811061195357fe5b602090810291909101015260010161190f565b333014611a24576000306001600160a01b031660003660405161198a92919061395c565b6000604051808303816000865af19150503d80600081146119c7576040519150601f19603f3d011682016040523d82523d6000602084013e6119cc565b606091505b5050905080600081146119db57fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b8114611a06573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611a2c611afe565b6060611a36611125565b9050611a428782611298565b60006060611a5a8c8c8c8c8c8c898d8d63ffffffff16565b91509150611a6c81848663ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b6000808251118015610818575060ff801682806020019051810190611ab59190613886565b60ff161492915050565b610996611aca610e3b565b6101b66110f4565b600060606000611ae184612eb5565b90506060611af0878784612ecb565b919791965090945050505050565b610996611102565b6109b28282612f7a565b60006060611b1f610162611f73565b9850989650505050505050565b81518151611b3b90829061189e565b60005b8181101561130157611b76848281518110611b5557fe5b6020026020010151848381518110611b6957fe5b6020026020010151612c4a565b848281518110611b8257fe5b6020908102919091010152600101611b3e565b6000611b9f610c79565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611bd757600080fd5b505afa158015611beb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085791906135b2565b1c60019081161490565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b6000611c6385613046565b9050611c79611c73878387613062565b836110f4565b611c88428410156101b86110f4565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b60006060611cbb611102565b7f0000000000000000000000000000000000000000000000000000000000000000611cf66001600160a01b03888116908316146101566110f4565b611d16816001600160a01b0316876001600160a01b0316146101566110f4565b6dffffffffffffffffffffffffffff6060611d3086613111565b9050611d8f817f000000000000000000000000000000000000000000000000000000000000000081518110611d6157fe5b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000611307565b817f000000000000000000000000000000000000000000000000000000000000000081518110611dbb57fe5b602090810291909101015290999098509650505050505050565b620f424090565b6109b28282613127565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611e7e6131ba565b30604051602001611e93959493929190613acf565b60405160208183030381529060405280519060200120905090565b600281511015611ebd57610922565b600081600081518110611ecc57fe5b602002602001015190506000600190505b8251811015611f27576000838281518110611ef457fe5b60200260200101519050611f1d816001600160a01b0316846001600160a01b03161060656110f4565b9150600101611edd565b505050565b611f3b610100831060646110f4565b611f6460018210158015611f5d5750611f5960ff84610100036110de565b8211155b60646110f4565b611f2783821c156101b46110f4565b610922816210905360ea1b6131be565b6000828202611fa7841580611fa0575083858381611f9d57fe5b04145b60036110f4565b670de0b6b3a764000090049392505050565b6000611fff7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b0316146101356110f4565b6000837f00000000000000000000000000000000000000000000000000000000000000008151811061202d57fe5b6020026020010151116120525760405162461bcd60e51b815260040161060f90613c5a565b81604001518460600151101561207a5760405162461bcd60e51b815260040161060f90613bc9565b60006120bd847f0000000000000000000000000000000000000000000000000000000000000000815181106120ab57fe5b602002602001015186606001516116b9565b9050600061212b6120df85602001518860600151611f8390919063ffffffff16565b612125877f00000000000000000000000000000000000000000000000000000000000000008151811061210e57fe5b60200260200101518561260090919063ffffffff16565b90611f83565b9050836020015161214987606001518361260090919063ffffffff16565b10156121675760405162461bcd60e51b815260040161060f90613c2e565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061219457fe5b602002602001015110156121ba5760405162461bcd60e51b815260040161060f90613b64565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16121f1610925565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160006040518863ffffffff1660e01b81526004016122629796959493929190613a5b565b600060405180830381600087803b15801561227c57600080fd5b505af1158015612290573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600080516020613d4a8339815191527f0000000000000000000000000000000000000000000000000000000000000000838960c0015161230b8b606001518761260090919063ffffffff16565b4260405161231d95949392919061399b565b60405180910390a295945050505050565b60006123747f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685604001516001600160a01b0316146101356110f4565b60006123a5847f0000000000000000000000000000000000000000000000000000000000000000815181106120ab57fe5b9050600061240b6123f2867f0000000000000000000000000000000000000000000000000000000000000000815181106123db57fe5b60200260200101518461260090919063ffffffff16565b6020860151606089015161240591612600565b90612600565b905083604001518110156124315760405162461bcd60e51b815260040161060f90613bc9565b602084015160608701516124459083612600565b10156124635760405162461bcd60e51b815260040161060f90613c2e565b80857f00000000000000000000000000000000000000000000000000000000000000008151811061249057fe5b602002602001015110156124b65760405162461bcd60e51b815260040161060f90613bf7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f16124ed610925565b606089015160c08a01516040516001600160e01b031960e086901b16815261256193927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600190600401613a5b565b600060405180830381600087803b15801561257b57600080fd5b505af115801561258f573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250600080516020613d4a833981519152917f00000000000000000000000000000000000000000000000000000000000000009161230b82875b600061260f82151560046110f4565b8261261c57506000610818565b670de0b6b3a76400008381029061263f9085838161263657fe5b041460056110f4565b82818161264857fe5b04915050610818565b60006126977f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b0316146101356110f4565b827f0000000000000000000000000000000000000000000000000000000000000000815181106126c357fe5b60200260200101518460600151106126ed5760405162461bcd60e51b815260040161060f90613b9b565b8160400151846060015110156127155760405162461bcd60e51b815260040161060f90613bc9565b6000612758847f00000000000000000000000000000000000000000000000000000000000000008151811061274657fe5b602002602001015186606001516110c8565b905060006127c061277a85602001518860600151611f8390919063ffffffff16565b61212584887f0000000000000000000000000000000000000000000000000000000000000000815181106127aa57fe5b602002602001015161260090919063ffffffff16565b905083602001516127de87606001518361260090919063ffffffff16565b10156127fc5760405162461bcd60e51b815260040161060f90613c2e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612833610925565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000858b60c001518c6060015160016040518863ffffffff1660e01b81526004016128a49796959493929190613a5b565b600060405180830381600087803b1580156128be57600080fd5b505af11580156128d2573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600080516020613d4a8339815191527f0000000000000000000000000000000000000000000000000000000000000000838960c0015161230b8b606001518761260090919063ffffffff16565b60006129937f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031685602001516001600160a01b0316146101356110f4565b6000837f0000000000000000000000000000000000000000000000000000000000000000815181106129c157fe5b6020026020010151116129e65760405162461bcd60e51b815260040161060f90613c5a565b827f000000000000000000000000000000000000000000000000000000000000000081518110612a1257fe5b6020026020010151846060015110612a3c5760405162461bcd60e51b815260040161060f90613b9b565b6000612a6d847f00000000000000000000000000000000000000000000000000000000000000008151811061274657fe5b90506000612aa46123f283877f0000000000000000000000000000000000000000000000000000000000000000815181106127aa57fe5b90508360400151811015612aca5760405162461bcd60e51b815260040161060f90613bc9565b60208401516060870151612ade9083612600565b1015612afc5760405162461bcd60e51b815260040161060f90613c2e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638ac316f1612b33610925565b606089015160c08a01516040516001600160e01b031960e086901b168152612ba793927f0000000000000000000000000000000000000000000000000000000000000000927f0000000000000000000000000000000000000000000000000000000000000000928990600090600401613a5b565b600060405180830381600087803b158015612bc157600080fd5b505af1158015612bd5573d6000803e3d6000fd5b505050606087015160c08801516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250600080516020613d4a833981519152917f00000000000000000000000000000000000000000000000000000000000000009161230b8287612600565b6000612c5982151560046110f4565b82612c6657506000610818565b670de0b6b3a764000083810290612c809085838161263657fe5b826001820381612c8c57fe5b04600101915050610818565b6000612ca784841115836110f4565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612ccd610c55565b6001600160a01b031614158015612ce85750612ce88361321f565b15612d1057612cf5610c55565b6001600160a01b0316336001600160a01b0316149050610818565b612d18611b95565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612d4793929190613a3c565b60206040518083038186803b158015612d5f57600080fd5b505afa158015612d73573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106691906134c7565b64e8d4a5100090565b67016345785d8a000090565b60006001821b1984168284612dc2576000612dc5565b60015b60ff16901b17949350505050565b600081806020019051810190610818919061361c565b600060606000612df88461325b565b90506060855167ffffffffffffffff81118015612e1457600080fd5b50604051908082528060200260200182016040528015612e3e578160200160208202803683370190505b50905060005b8651811015612ea9577f00000000000000000000000000000000000000000000000000000000000000008114612ea157868181518110612e8057fe5b6020026020010151828281518110612e9457fe5b6020026020010181815250505b600101612e44565b50909590945092505050565b6000818060200190518101906108cb91906138a2565b60606000612ed98385612600565b9050845167ffffffffffffffff81118015612ef357600080fd5b50604051908082528060200260200182016040528015612f1d578160200160208202803683370190505b50915060005b8551811015612f7157612f5282878381518110612f3c57fe5b6020026020010151611f8390919063ffffffff16565b838281518110612f5e57fe5b6020908102919091010152600101612f23565b50509392505050565b612f916001600160a01b038316151561019b6110f4565b612f9d82600083611f27565b6001600160a01b038216600090815260208190526040902054612fc390826101b2612c98565b6001600160a01b038316600090815260208190526040902055612ff6612ff182612feb61081e565b90613271565b61327f565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161303a9190613a33565b60405180910390a35050565b6000613050611e11565b82604051602001610c1292919061396c565b600061307482516041146101b96110f4565b60208281015160408085015160608601518251600080825295019283905292939092811a916001906130ad908990859088908890613b33565b6020604051602081039080840390855afa1580156130cf573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906131055750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b6060818060200190518101906108cb9190613665565b61313360008383611f27565b613148612ff18261314261081e565b906116b9565b6001600160a01b03821660009081526020819052604090205461316b90826116b9565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061303a908590613a33565b4690565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b6000613231631c74c91760e11b610bdd565b82148061324c57506132496350dd6ed960e01b610bdd565b82145b80610818575061081882613284565b6000818060200190518101906108cb9190613638565b60006108cb83836001612c98565b600255565b50600090565b60405180606001604052806000815260200160008152602001600081525090565b803561081881613d18565b600082601f8301126132c6578081fd5b81356132d96132d482613cf8565b613cd1565b8181529150602080830190848101818402860182018710156132fa57600080fd5b60005b84811015613319578135845292820192908201906001016132fd565b505050505092915050565b600082601f830112613334578081fd5b813567ffffffffffffffff81111561334a578182fd5b61335d601f8201601f1916602001613cd1565b915080825283602082850101111561337457600080fd5b8060208401602084013760009082016020015292915050565b803561081881613d2d565b6000602082840312156133a9578081fd5b81356108cb81613d18565b600080604083850312156133c6578081fd5b82356133d181613d18565b915060208301356133e181613d18565b809150509250929050565b600080600060608486031215613400578081fd5b833561340b81613d18565b9250602084013561341b81613d18565b929592945050506040919091013590565b600080600080600080600060e0888a031215613446578283fd5b873561345181613d18565b9650602088013561346181613d18565b95506040880135945060608801359350608088013561347f81613d3a565b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156134ae578182fd5b82356134b981613d18565b946020939093013593505050565b6000602082840312156134d8578081fd5b815180151581146108cb578182fd5b600080600080600080600060e0888a031215613501578081fd5b87359650602088013561351381613d18565b9550604088013561352381613d18565b9450606088013567ffffffffffffffff8082111561353f578283fd5b61354b8b838c016132b6565b955060808a0135945060a08a0135935060c08a013591508082111561356e578283fd5b5061357b8a828b01613324565b91505092959891949750929550565b60006020828403121561359b578081fd5b81356001600160e01b0319811681146108cb578182fd5b6000602082840312156135c3578081fd5b81516108cb81613d18565b600080604083850312156135e0578182fd5b82356135eb81613d18565b9150602083013567ffffffffffffffff811115613606578182fd5b61361285828601613324565b9150509250929050565b60006020828403121561362d578081fd5b81516108cb81613d2d565b6000806040838503121561364a578182fd5b825161365581613d2d565b6020939093015192949293505050565b60008060408385031215613677578182fd5b825160048110613685578283fd5b8092505060208084015167ffffffffffffffff8111156136a3578283fd5b8401601f810186136136b3578283fd5b80516136c16132d482613cf8565b81815283810190838501858402850186018a10156136dd578687fd5b8694505b838510156136ff5780518352600194909401939185019185016136e1565b5080955050505050509250929050565b60008060008060808587031215613724578182fd5b843567ffffffffffffffff8082111561373b578384fd5b818701915061012080838a031215613751578485fd5b61375a81613cd1565b9050613766898461338d565b815261377589602085016132ab565b602082015261378789604085016132ab565b6040820152606083013560608201526080830135608082015260a083013560a08201526137b78960c085016132ab565b60c08201526137c98960e085016132ab565b60e082015261010080840135838111156137e1578687fd5b6137ed8b828701613324565b82840152505080965050602087013591508082111561380a578384fd5b50613817878288016132b6565b949794965050505060408301359260600135919050565b60006020828403121561383f578081fd5b5035919050565b6000806000806080858703121561385b578182fd5b845193506020850151925060408501519150606085015161387b81613d18565b939692955090935050565b600060208284031215613897578081fd5b81516108cb81613d3a565b600080604083850312156138b4578182fd5b825161365581613d3a565b6000815180845260208085019450808401835b838110156138ee578151875295820195908201906001016138d2565b509495945050505050565b60008151808452815b8181101561391e57602081850181015186830182015201613902565b8181111561392f5782602083870101525b50601f01601f19169290920160200192915050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b6000602082526108cb60208301846138bf565b6000604082526139f560408301856138bf565b8281036020840152613a0781856138bf565b95945050505050565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9687526001600160a01b03958616602088015293851660408701526060860192909252909216608084015260a0830191909152151560c082015260e00190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b600083825260406020830152613b1460408301846138f9565b949350505050565b9182526001600160a01b0316602082015260400190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526108cb60208301846138f9565b6020808252601d908201527f496e73756666696369656e742063757272656e63792062616c616e6365000000604082015260600190565b602080825260149082015273496e73756666696369656e742062616c616e636560601b604082015260600190565b60208082526014908201527327b93232b91039b4bd32903b34b7b630ba34b7b760611b604082015260600190565b6020808252601d908201527f496e73756666696369656e742073656375726974792062616c616e6365000000604082015260600190565b602080825260129082015271141c9a58d9481bdd5d081bd988189bdd5b9960721b604082015260600190565b6020808252600e908201526d125cdcdd59481cdbdb19081bdd5d60921b604082015260600190565b6020808252600e908201526d2a34b6b2a634b6b4ba1027bb32b960911b604082015260600190565b600083825260406020830152613b1460408301846138bf565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715613cf057600080fd5b604052919050565b600067ffffffffffffffff821115613d0e578081fd5b5060209081020190565b6001600160a01b038116811461092257600080fd5b6002811061092257600080fd5b60ff8116811461092257600080fdfe560f9a9aa840257b3f71f9f0cc55270169408d782595c416c1042eccf7426c9ca264697066735822122078b2e3934a4bd847cf132686d1eb2bf055d3a499ca31feaeae09ef577ec26d0c64736f6c63430007010033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a85760003560e01c80636634b753116100715780636634b753146101215780636c57f5a914610141578063739238d614610149578063851c1bb3146101515780638d928af814610171578063aaabadc514610179576100a8565b8062c194db146100ad578063174481fa146100cb5780632236c4cc146100e15780632da47c40146101015780632f2770db14610117575b600080fd5b6100b5610181565b6040516100c29190610a4a565b60405180910390f35b6100d36101a0565b6040516100c29291906109fd565b6100f46100ef366004610868565b6101e6565b6040516100c291906109e9565b610109610236565b6040516100c2929190610b50565b61011f6102a0565b005b61013461012f3660046107e8565b6102e7565b6040516100c29190610a17565b610134610305565b6100f461030e565b61016461015f366004610824565b610332565b6040516100c29190610a22565b6100f4610384565b6100f46103a8565b606061019b60405180602001604052806000815250610474565b905090565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000009091565b60008060006101f3610236565b9150915061022e610202610384565b8584843360405160200161021a959493929190610a5d565b60405160208183030381529060405261054d565b949350505050565b600080427f000000000000000000000000000000000000000000000000000000000000000081101561029257807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915061029b565b60009250600091505b509091565b6102a86105b6565b6102b06105e7565b6001805460ff1916811790556040517f432acbfd662dbb5d8b378384a67159b47ca9d0f1b79f97cf64cf8585fa362d5090600090a1565b6001600160a01b031660009081526020819052604090205460ff1690565b60015460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016103679291906109d1565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006103b2610384565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ea57600080fd5b505afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019b919061084c565b80517f602038038060206000396000f3fefefefefefefefefefefefefefefefefefefe808352600091602081018484f0908452915061046e6001600160a01b03831615156101ac6105fc565b50919050565b8051604080517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000818101858101848101602090810190965280855293957f00000000000000000000000000000000000000000000000000000000000000009592947f000000000000000000000000000000000000000000000000000000000000000094938801866000828a3c846000888301883c506020898101908985010161053f81838661060e565b505050505050505050919050565b60006105576105e7565b60006105628361064c565b6001600160a01b038116600081815260208190526040808220805460ff191660011790555192935090917f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a292915050565b60006105cd6000356001600160e01b031916610332565b90506105e46105dc8233610687565b6101916105fc565b50565b6105fa6105f2610305565b1560d36105fc565b565b8161060a5761060a81610719565b5050565b5b6020811061062e578151835260209283019290910190601f190161060f565b905182516020929092036101000a6000190180199091169116179052565b6000606061065983610474565b905060008151602083016000f090506001600160a01b038116610680573d6000803e3d6000fd5b9392505050565b60006106916103a8565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016106c093929190610a2b565b60206040518083038186803b1580156106d857600080fd5b505afa1580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107109190610804565b90505b92915050565b62461bcd60e51b600090815260206004526007602452600a808304818106603090810160081b83860601918390049283060160101b016642414c230000300160c81b6044526105e4916210905360ea1b906242414c90606490fd5b803561071381610b85565b600082601f83011261078f578081fd5b813567ffffffffffffffff8111156107a5578182fd5b6107b8601f8201601f1916602001610b5e565b91508082528360208285010111156107cf57600080fd5b8060208401602084013760009082016020015292915050565b6000602082840312156107f9578081fd5b813561068081610b85565b600060208284031215610815578081fd5b81518015158114610680578182fd5b600060208284031215610835578081fd5b81356001600160e01b031981168114610680578182fd5b60006020828403121561085d578081fd5b815161068081610b85565b600060208284031215610879578081fd5b813567ffffffffffffffff80821115610890578283fd5b81840191506101408083870312156108a6578384fd5b6108af81610b5e565b90508235828111156108bf578485fd5b6108cb8782860161077f565b8252506020830135828111156108df578485fd5b6108eb8782860161077f565b6020830152506108fe8660408501610774565b60408201526109108660608501610774565b60608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e0820152610100808401358183015250610120808401358381111561095c578586fd5b6109688882870161077f565b918301919091525095945050505050565b6001600160a01b03169052565b60008151808452815b818110156109ab5760208185018101518683018201520161098f565b818111156109bc5782602083870101525b50601f01601f19169290920160200192915050565b9182526001600160e01b031916602082015260240190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b901515815260200190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b6000602082526107106020830184610986565b600060018060a01b038716825260a0602083015285516101408060a0850152610a8a6101e0850183610986565b91506020880151609f19808685030160c0870152610aa88483610986565b935060408a01519150610abe60e0870183610979565b60608a01519150610100610ad481880184610979565b60808b01516101208881019190915260a08c01519488019490945260c08b015161016088015260e08b01516101808801528a01516101a0870152918901518584039092016101c086015250610b298282610986565b92505050846040830152836060830152610b466080830184610979565b9695505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715610b7d57600080fd5b604052919050565b6001600160a01b03811681146105e457600080fdfea2646970667358221220239ade2c2cbd79285908e566404f19e498242d851c1fd62dcda65e59a92ee6d364736f6c63430007010033", "linkReferences": {}, "deployedLinkReferences": {} } \ No newline at end of file diff --git a/generated/EventEmitter/EventEmitter.ts b/generated/EventEmitter/EventEmitter.ts new file mode 100644 index 000000000..08322922c --- /dev/null +++ b/generated/EventEmitter/EventEmitter.ts @@ -0,0 +1,318 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AuthorizationGranted extends ethereum.Event { + get params(): AuthorizationGranted__Params { + return new AuthorizationGranted__Params(this); + } +} + +export class AuthorizationGranted__Params { + _event: AuthorizationGranted; + + constructor(event: AuthorizationGranted) { + this._event = event; + } + + get addr(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get identifier(): Bytes { + return this._event.parameters[1].value.toBytes(); + } +} + +export class AuthorizationRevoked extends ethereum.Event { + get params(): AuthorizationRevoked__Params { + return new AuthorizationRevoked__Params(this); + } +} + +export class AuthorizationRevoked__Params { + _event: AuthorizationRevoked; + + constructor(event: AuthorizationRevoked) { + this._event = event; + } + + get addr(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get identifier(): Bytes { + return this._event.parameters[1].value.toBytes(); + } +} + +export class LogArgument extends ethereum.Event { + get params(): LogArgument__Params { + return new LogArgument__Params(this); + } +} + +export class LogArgument__Params { + _event: LogArgument; + + constructor(event: LogArgument) { + this._event = event; + } + + get sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get identifier(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get message(): Bytes { + return this._event.parameters[2].value.toBytes(); + } + + get value(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get newOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class EventEmitter extends ethereum.SmartContract { + static bind(address: Address): EventEmitter { + return new EventEmitter("EventEmitter", address); + } + + isAuthorized(param0: Address, param1: Bytes): boolean { + let result = super.call( + "isAuthorized", + "isAuthorized(address,bytes32):(bool)", + [ + ethereum.Value.fromAddress(param0), + ethereum.Value.fromFixedBytes(param1) + ] + ); + + return result[0].toBoolean(); + } + + try_isAuthorized( + param0: Address, + param1: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "isAuthorized", + "isAuthorized(address,bytes32):(bool)", + [ + ethereum.Value.fromAddress(param0), + ethereum.Value.fromFixedBytes(param1) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class AuthorizeCall extends ethereum.Call { + get inputs(): AuthorizeCall__Inputs { + return new AuthorizeCall__Inputs(this); + } + + get outputs(): AuthorizeCall__Outputs { + return new AuthorizeCall__Outputs(this); + } +} + +export class AuthorizeCall__Inputs { + _call: AuthorizeCall; + + constructor(call: AuthorizeCall) { + this._call = call; + } + + get identifier(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get addr(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class AuthorizeCall__Outputs { + _call: AuthorizeCall; + + constructor(call: AuthorizeCall) { + this._call = call; + } +} + +export class EmitEventCall extends ethereum.Call { + get inputs(): EmitEventCall__Inputs { + return new EmitEventCall__Inputs(this); + } + + get outputs(): EmitEventCall__Outputs { + return new EmitEventCall__Outputs(this); + } +} + +export class EmitEventCall__Inputs { + _call: EmitEventCall; + + constructor(call: EmitEventCall) { + this._call = call; + } + + get identifier(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get message(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class EmitEventCall__Outputs { + _call: EmitEventCall; + + constructor(call: EmitEventCall) { + this._call = call; + } +} + +export class RemoveAuthorizationCall extends ethereum.Call { + get inputs(): RemoveAuthorizationCall__Inputs { + return new RemoveAuthorizationCall__Inputs(this); + } + + get outputs(): RemoveAuthorizationCall__Outputs { + return new RemoveAuthorizationCall__Outputs(this); + } +} + +export class RemoveAuthorizationCall__Inputs { + _call: RemoveAuthorizationCall; + + constructor(call: RemoveAuthorizationCall) { + this._call = call; + } + + get identifier(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get addr(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class RemoveAuthorizationCall__Outputs { + _call: RemoveAuthorizationCall; + + constructor(call: RemoveAuthorizationCall) { + this._call = call; + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/generated/MarginTradingPoolFactory/ERC20.ts b/generated/MarginTradingPoolFactory/ERC20.ts new file mode 100644 index 000000000..0aa0d7efe --- /dev/null +++ b/generated/MarginTradingPoolFactory/ERC20.ts @@ -0,0 +1,543 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ERC20 extends ethereum.SmartContract { + static bind(address: Address): ERC20 { + return new ERC20("ERC20", address); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + subtractedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get name_(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol_(): string { + return this._call.inputValues[1].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get subtractedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/MarginTradingPoolFactory/MarginTradingPool.ts b/generated/MarginTradingPoolFactory/MarginTradingPool.ts new file mode 100644 index 000000000..2541a5dbc --- /dev/null +++ b/generated/MarginTradingPoolFactory/MarginTradingPool.ts @@ -0,0 +1,2057 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class MarginOffer extends ethereum.Event { + get params(): MarginOffer__Params { + return new MarginOffer__Params(this); + } +} + +export class MarginOffer__Params { + _event: MarginOffer; + + constructor(event: MarginOffer) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get securityType(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get minOrderSize(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get margin(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get collateral(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get CfiCode(): Bytes { + return this._event.parameters[6].value.toBytes(); + } + + get orderBook(): Address { + return this._event.parameters[7].value.toAddress(); + } + + get issueManager(): Address { + return this._event.parameters[8].value.toAddress(); + } +} + +export class MarginOrderBook extends ethereum.Event { + get params(): MarginOrderBook__Params { + return new MarginOrderBook__Params(this); + } +} + +export class MarginOrderBook__Params { + _event: MarginOrderBook; + + constructor(event: MarginOrderBook) { + this._event = event; + } + + get creator(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountOffered(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get priceOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get stoplossPrice(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get timestamp(): BigInt { + return this._event.parameters[6].value.toBigInt(); + } + + get orderRef(): Bytes { + return this._event.parameters[7].value.toBytes(); + } +} + +export class MarginTradeReport extends ethereum.Event { + get params(): MarginTradeReport__Params { + return new MarginTradeReport__Params(this); + } +} + +export class MarginTradeReport__Params { + _event: MarginTradeReport; + + constructor(event: MarginTradeReport) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderRef(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get party(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get counterparty(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get orderType(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get price(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[6].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[8].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class MarginTradingPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class MarginTradingPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class MarginTradingPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool extends ethereum.SmartContract { + static bind(address: Address): MarginTradingPool { + return new MarginTradingPool("MarginTradingPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + _orderbook(): Address { + let result = super.call("_orderbook", "_orderbook():(address)", []); + + return result[0].toAddress(); + } + + try__orderbook(): ethereum.CallResult
{ + let result = super.tryCall("_orderbook", "_orderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCollateral(): BigInt { + let result = super.call("getCollateral", "getCollateral():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getCollateral(): ethereum.CallResult { + let result = super.tryCall( + "getCollateral", + "getCollateral():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getMargin(): BigInt { + let result = super.call("getMargin", "getMargin():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getMargin(): ethereum.CallResult { + let result = super.tryCall("getMargin", "getMargin():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMinOrderSize(): BigInt { + let result = super.call( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOrderbook(): Address { + let result = super.call("getOrderbook", "getOrderbook():(address)", []); + + return result[0].toAddress(); + } + + try_getOrderbook(): ethereum.CallResult
{ + let result = super.tryCall("getOrderbook", "getOrderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): MarginTradingPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new MarginTradingPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + MarginTradingPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: MarginTradingPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: MarginTradingPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get factoryPoolParams(): ConstructorCallFactoryPoolParamsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[4].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get securityType(): Bytes { + return this[3].toBytes(); + } + + get currency(): Address { + return this[4].toAddress(); + } + + get cficode(): Bytes { + return this[5].toBytes(); + } + + get minOrderSize(): BigInt { + return this[6].toBigInt(); + } + + get margin(): BigInt { + return this[7].toBigInt(); + } + + get collateral(): BigInt { + return this[8].toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this[9].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/MarginTradingPoolFactory/MarginTradingPoolFactory.ts b/generated/MarginTradingPoolFactory/MarginTradingPoolFactory.ts new file mode 100644 index 000000000..becc7fa66 --- /dev/null +++ b/generated/MarginTradingPoolFactory/MarginTradingPoolFactory.ts @@ -0,0 +1,489 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class FactoryDisabled extends ethereum.Event { + get params(): FactoryDisabled__Params { + return new FactoryDisabled__Params(this); + } +} + +export class FactoryDisabled__Params { + _event: FactoryDisabled; + + constructor(event: FactoryDisabled) { + this._event = event; + } +} + +export class PoolCreated extends ethereum.Event { + get params(): PoolCreated__Params { + return new PoolCreated__Params(this); + } +} + +export class PoolCreated__Params { + _event: PoolCreated; + + constructor(event: PoolCreated) { + this._event = event; + } + + get pool(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class MarginTradingPoolFactory__createInputFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get securityType(): Bytes { + return this[3].toBytes(); + } + + get currency(): Address { + return this[4].toAddress(); + } + + get cficode(): Bytes { + return this[5].toBytes(); + } + + get minOrderSize(): BigInt { + return this[6].toBigInt(); + } + + get margin(): BigInt { + return this[7].toBigInt(); + } + + get collateral(): BigInt { + return this[8].toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this[9].toBigInt(); + } +} + +export class MarginTradingPoolFactory__getCreationCodeContractsResult { + value0: Address; + value1: Address; + + constructor(value0: Address, value1: Address) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromAddress(this.value1)); + return map; + } +} + +export class MarginTradingPoolFactory__getPauseConfigurationResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class MarginTradingPoolFactory extends ethereum.SmartContract { + static bind(address: Address): MarginTradingPoolFactory { + return new MarginTradingPoolFactory("MarginTradingPoolFactory", address); + } + + create( + factoryPoolParams: MarginTradingPoolFactory__createInputFactoryPoolParamsStruct + ): Address { + let result = super.call( + "create", + "create((string,string,address,bytes32,address,bytes32,uint256,uint256,uint256,uint256)):(address)", + [ethereum.Value.fromTuple(factoryPoolParams)] + ); + + return result[0].toAddress(); + } + + try_create( + factoryPoolParams: MarginTradingPoolFactory__createInputFactoryPoolParamsStruct + ): ethereum.CallResult
{ + let result = super.tryCall( + "create", + "create((string,string,address,bytes32,address,bytes32,uint256,uint256,uint256,uint256)):(address)", + [ethereum.Value.fromTuple(factoryPoolParams)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCreationCode(): Bytes { + let result = super.call("getCreationCode", "getCreationCode():(bytes)", []); + + return result[0].toBytes(); + } + + try_getCreationCode(): ethereum.CallResult { + let result = super.tryCall( + "getCreationCode", + "getCreationCode():(bytes)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getCreationCodeContracts(): MarginTradingPoolFactory__getCreationCodeContractsResult { + let result = super.call( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + + return new MarginTradingPoolFactory__getCreationCodeContractsResult( + result[0].toAddress(), + result[1].toAddress() + ); + } + + try_getCreationCodeContracts(): ethereum.CallResult< + MarginTradingPoolFactory__getCreationCodeContractsResult + > { + let result = super.tryCall( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPoolFactory__getCreationCodeContractsResult( + value[0].toAddress(), + value[1].toAddress() + ) + ); + } + + getPauseConfiguration(): MarginTradingPoolFactory__getPauseConfigurationResult { + let result = super.call( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + + return new MarginTradingPoolFactory__getPauseConfigurationResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getPauseConfiguration(): ethereum.CallResult< + MarginTradingPoolFactory__getPauseConfigurationResult + > { + let result = super.tryCall( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPoolFactory__getPauseConfigurationResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getProtocolFeePercentagesProvider(): Address { + let result = super.call( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeePercentagesProvider(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + isDisabled(): boolean { + let result = super.call("isDisabled", "isDisabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_isDisabled(): ethereum.CallResult { + let result = super.tryCall("isDisabled", "isDisabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isPoolFromFactory(pool: Address): boolean { + let result = super.call( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + + return result[0].toBoolean(); + } + + try_isPoolFromFactory(pool: Address): ethereum.CallResult { + let result = super.tryCall( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class CreateCall extends ethereum.Call { + get inputs(): CreateCall__Inputs { + return new CreateCall__Inputs(this); + } + + get outputs(): CreateCall__Outputs { + return new CreateCall__Outputs(this); + } +} + +export class CreateCall__Inputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get factoryPoolParams(): CreateCallFactoryPoolParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class CreateCall__Outputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get value0(): Address { + return this._call.outputValues[0].value.toAddress(); + } +} + +export class CreateCallFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get securityType(): Bytes { + return this[3].toBytes(); + } + + get currency(): Address { + return this[4].toAddress(); + } + + get cficode(): Bytes { + return this[5].toBytes(); + } + + get minOrderSize(): BigInt { + return this[6].toBigInt(); + } + + get margin(): BigInt { + return this[7].toBigInt(); + } + + get collateral(): BigInt { + return this[8].toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this[9].toBigInt(); + } +} + +export class DisableCall extends ethereum.Call { + get inputs(): DisableCall__Inputs { + return new DisableCall__Inputs(this); + } + + get outputs(): DisableCall__Outputs { + return new DisableCall__Outputs(this); + } +} + +export class DisableCall__Inputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} + +export class DisableCall__Outputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} diff --git a/generated/MarginTradingPoolFactory/Vault.ts b/generated/MarginTradingPoolFactory/Vault.ts new file mode 100644 index 000000000..3399274b3 --- /dev/null +++ b/generated/MarginTradingPoolFactory/Vault.ts @@ -0,0 +1,1544 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AuthorizerChanged extends ethereum.Event { + get params(): AuthorizerChanged__Params { + return new AuthorizerChanged__Params(this); + } +} + +export class AuthorizerChanged__Params { + _event: AuthorizerChanged; + + constructor(event: AuthorizerChanged) { + this._event = event; + } + + get newAuthorizer(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class ExternalBalanceTransfer extends ethereum.Event { + get params(): ExternalBalanceTransfer__Params { + return new ExternalBalanceTransfer__Params(this); + } +} + +export class ExternalBalanceTransfer__Params { + _event: ExternalBalanceTransfer; + + constructor(event: ExternalBalanceTransfer) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class FlashLoan extends ethereum.Event { + get params(): FlashLoan__Params { + return new FlashLoan__Params(this); + } +} + +export class FlashLoan__Params { + _event: FlashLoan; + + constructor(event: FlashLoan) { + this._event = event; + } + + get recipient(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get feeAmount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class InternalBalanceChanged extends ethereum.Event { + get params(): InternalBalanceChanged__Params { + return new InternalBalanceChanged__Params(this); + } +} + +export class InternalBalanceChanged__Params { + _event: InternalBalanceChanged; + + constructor(event: InternalBalanceChanged) { + this._event = event; + } + + get user(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get delta(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PoolBalanceChanged extends ethereum.Event { + get params(): PoolBalanceChanged__Params { + return new PoolBalanceChanged__Params(this); + } +} + +export class PoolBalanceChanged__Params { + _event: PoolBalanceChanged; + + constructor(event: PoolBalanceChanged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get liquidityProvider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokens(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } + + get deltas(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } + + get protocolFeeAmounts(): Array { + return this._event.parameters[4].value.toBigIntArray(); + } +} + +export class PoolBalanceManaged extends ethereum.Event { + get params(): PoolBalanceManaged__Params { + return new PoolBalanceManaged__Params(this); + } +} + +export class PoolBalanceManaged__Params { + _event: PoolBalanceManaged; + + constructor(event: PoolBalanceManaged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get assetManager(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get cashDelta(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get managedDelta(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class PoolRegistered extends ethereum.Event { + get params(): PoolRegistered__Params { + return new PoolRegistered__Params(this); + } +} + +export class PoolRegistered__Params { + _event: PoolRegistered; + + constructor(event: PoolRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get poolAddress(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get specialization(): i32 { + return this._event.parameters[2].value.toI32(); + } +} + +export class RelayerApprovalChanged extends ethereum.Event { + get params(): RelayerApprovalChanged__Params { + return new RelayerApprovalChanged__Params(this); + } +} + +export class RelayerApprovalChanged__Params { + _event: RelayerApprovalChanged; + + constructor(event: RelayerApprovalChanged) { + this._event = event; + } + + get relayer(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get approved(): boolean { + return this._event.parameters[2].value.toBoolean(); + } +} + +export class Swap extends ethereum.Event { + get params(): Swap__Params { + return new Swap__Params(this); + } +} + +export class Swap__Params { + _event: Swap; + + constructor(event: Swap) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountIn(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get amountOut(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class TokensDeregistered extends ethereum.Event { + get params(): TokensDeregistered__Params { + return new TokensDeregistered__Params(this); + } +} + +export class TokensDeregistered__Params { + _event: TokensDeregistered; + + constructor(event: TokensDeregistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } +} + +export class TokensRegistered extends ethereum.Event { + get params(): TokensRegistered__Params { + return new TokensRegistered__Params(this); + } +} + +export class TokensRegistered__Params { + _event: TokensRegistered; + + constructor(event: TokensRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } +} + +export class Vault__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__getPoolResult { + value0: Address; + value1: i32; + + constructor(value0: Address, value1: i32) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + return map; + } +} + +export class Vault__getPoolTokenInfoResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: Address; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromAddress(this.value3)); + return map; + } +} + +export class Vault__getPoolTokensResult { + value0: Array
; + value1: Array; + value2: BigInt; + + constructor(value0: Array
, value1: Array, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddressArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class Vault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class Vault extends ethereum.SmartContract { + static bind(address: Address): Vault { + return new Vault("Vault", address); + } + + WETH(): Address { + let result = super.call("WETH", "WETH():(address)", []); + + return result[0].toAddress(); + } + + try_WETH(): ethereum.CallResult
{ + let result = super.tryCall("WETH", "WETH():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInternalBalance(user: Address, tokens: Array
): Array { + let result = super.call( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + + return result[0].toBigIntArray(); + } + + try_getInternalBalance( + user: Address, + tokens: Array
+ ): ethereum.CallResult> { + let result = super.tryCall( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getNextNonce(user: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(user) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(user: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(user)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getPausedState(): Vault__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new Vault__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPool(poolId: Bytes): Vault__getPoolResult { + let result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + + return new Vault__getPoolResult(result[0].toAddress(), result[1].toI32()); + } + + try_getPool(poolId: Bytes): ethereum.CallResult { + let result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolResult(value[0].toAddress(), value[1].toI32()) + ); + } + + getPoolTokenInfo( + poolId: Bytes, + token: Address + ): Vault__getPoolTokenInfoResult { + let result = super.call( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + + return new Vault__getPoolTokenInfoResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toAddress() + ); + } + + try_getPoolTokenInfo( + poolId: Bytes, + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokenInfoResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toAddress() + ) + ); + } + + getPoolTokens(poolId: Bytes): Vault__getPoolTokensResult { + let result = super.call( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + + return new Vault__getPoolTokensResult( + result[0].toAddressArray(), + result[1].toBigIntArray(), + result[2].toBigInt() + ); + } + + try_getPoolTokens( + poolId: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokensResult( + value[0].toAddressArray(), + value[1].toBigIntArray(), + value[2].toBigInt() + ) + ); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + hasApprovedRelayer(user: Address, relayer: Address): boolean { + let result = super.call( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + + return result[0].toBoolean(); + } + + try_hasApprovedRelayer( + user: Address, + relayer: Address + ): ethereum.CallResult { + let result = super.tryCall( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): Array { + let result = super.call( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + + return result[0].toBigIntArray(); + } + + try_queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): ethereum.CallResult> { + let result = super.tryCall( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + registerPool(specialization: i32): Bytes { + let result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) + ]); + + return result[0].toBytes(); + } + + try_registerPool(specialization: i32): ethereum.CallResult { + let result = super.tryCall( + "registerPool", + "registerPool(uint8):(bytes32)", + [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get authorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get weth(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class BatchSwapCall extends ethereum.Call { + get inputs(): BatchSwapCall__Inputs { + return new BatchSwapCall__Inputs(this); + } + + get outputs(): BatchSwapCall__Outputs { + return new BatchSwapCall__Outputs(this); + } +} + +export class BatchSwapCall__Inputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get kind(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get swaps(): Array { + return this._call.inputValues[1].value.toTupleArray< + BatchSwapCallSwapsStruct + >(); + } + + get assets(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } + + get funds(): BatchSwapCallFundsStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } + + get limits(): Array { + return this._call.inputValues[4].value.toBigIntArray(); + } + + get deadline(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class BatchSwapCall__Outputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get assetDeltas(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } +} + +export class BatchSwapCallSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class BatchSwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class DeregisterTokensCall extends ethereum.Call { + get inputs(): DeregisterTokensCall__Inputs { + return new DeregisterTokensCall__Inputs(this); + } + + get outputs(): DeregisterTokensCall__Outputs { + return new DeregisterTokensCall__Outputs(this); + } +} + +export class DeregisterTokensCall__Inputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } +} + +export class DeregisterTokensCall__Outputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } +} + +export class ExitPoolCall extends ethereum.Call { + get inputs(): ExitPoolCall__Inputs { + return new ExitPoolCall__Inputs(this); + } + + get outputs(): ExitPoolCall__Outputs { + return new ExitPoolCall__Outputs(this); + } +} + +export class ExitPoolCall__Inputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): ExitPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class ExitPoolCall__Outputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } +} + +export class ExitPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get minAmountsOut(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class FlashLoanCall extends ethereum.Call { + get inputs(): FlashLoanCall__Inputs { + return new FlashLoanCall__Inputs(this); + } + + get outputs(): FlashLoanCall__Outputs { + return new FlashLoanCall__Outputs(this); + } +} + +export class FlashLoanCall__Inputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get amounts(): Array { + return this._call.inputValues[2].value.toBigIntArray(); + } + + get userData(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class FlashLoanCall__Outputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } +} + +export class JoinPoolCall extends ethereum.Call { + get inputs(): JoinPoolCall__Inputs { + return new JoinPoolCall__Inputs(this); + } + + get outputs(): JoinPoolCall__Outputs { + return new JoinPoolCall__Outputs(this); + } +} + +export class JoinPoolCall__Inputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): JoinPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class JoinPoolCall__Outputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } +} + +export class JoinPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get maxAmountsIn(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get fromInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class ManagePoolBalanceCall extends ethereum.Call { + get inputs(): ManagePoolBalanceCall__Inputs { + return new ManagePoolBalanceCall__Inputs(this); + } + + get outputs(): ManagePoolBalanceCall__Outputs { + return new ManagePoolBalanceCall__Outputs(this); + } +} + +export class ManagePoolBalanceCall__Inputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManagePoolBalanceCallOpsStruct + >(); + } +} + +export class ManagePoolBalanceCall__Outputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } +} + +export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get poolId(): Bytes { + return this[1].toBytes(); + } + + get token(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } +} + +export class ManageUserBalanceCall extends ethereum.Call { + get inputs(): ManageUserBalanceCall__Inputs { + return new ManageUserBalanceCall__Inputs(this); + } + + get outputs(): ManageUserBalanceCall__Outputs { + return new ManageUserBalanceCall__Outputs(this); + } +} + +export class ManageUserBalanceCall__Inputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManageUserBalanceCallOpsStruct + >(); + } +} + +export class ManageUserBalanceCall__Outputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } +} + +export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get asset(): Address { + return this[1].toAddress(); + } + + get amount(): BigInt { + return this[2].toBigInt(); + } + + get sender(): Address { + return this[3].toAddress(); + } + + get recipient(): Address { + return this[4].toAddress(); + } +} + +export class RegisterPoolCall extends ethereum.Call { + get inputs(): RegisterPoolCall__Inputs { + return new RegisterPoolCall__Inputs(this); + } + + get outputs(): RegisterPoolCall__Outputs { + return new RegisterPoolCall__Outputs(this); + } +} + +export class RegisterPoolCall__Inputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get specialization(): i32 { + return this._call.inputValues[0].value.toI32(); + } +} + +export class RegisterPoolCall__Outputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get value0(): Bytes { + return this._call.outputValues[0].value.toBytes(); + } +} + +export class RegisterTokensCall extends ethereum.Call { + get inputs(): RegisterTokensCall__Inputs { + return new RegisterTokensCall__Inputs(this); + } + + get outputs(): RegisterTokensCall__Outputs { + return new RegisterTokensCall__Outputs(this); + } +} + +export class RegisterTokensCall__Inputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } +} + +export class RegisterTokensCall__Outputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } +} + +export class SetAuthorizerCall extends ethereum.Call { + get inputs(): SetAuthorizerCall__Inputs { + return new SetAuthorizerCall__Inputs(this); + } + + get outputs(): SetAuthorizerCall__Outputs { + return new SetAuthorizerCall__Outputs(this); + } +} + +export class SetAuthorizerCall__Inputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } + + get newAuthorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetAuthorizerCall__Outputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetRelayerApprovalCall extends ethereum.Call { + get inputs(): SetRelayerApprovalCall__Inputs { + return new SetRelayerApprovalCall__Inputs(this); + } + + get outputs(): SetRelayerApprovalCall__Outputs { + return new SetRelayerApprovalCall__Outputs(this); + } +} + +export class SetRelayerApprovalCall__Inputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get relayer(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get approved(): boolean { + return this._call.inputValues[2].value.toBoolean(); + } +} + +export class SetRelayerApprovalCall__Outputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } +} + +export class SwapCall extends ethereum.Call { + get inputs(): SwapCall__Inputs { + return new SwapCall__Inputs(this); + } + + get outputs(): SwapCall__Outputs { + return new SwapCall__Outputs(this); + } +} + +export class SwapCall__Inputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get singleSwap(): SwapCallSingleSwapStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get funds(): SwapCallFundsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get limit(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class SwapCall__Outputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get amountCalculated(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class SwapCallSingleSwapStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get kind(): i32 { + return this[1].toI32(); + } + + get assetIn(): Address { + return this[2].toAddress(); + } + + get assetOut(): Address { + return this[3].toAddress(); + } + + get amount(): BigInt { + return this[4].toBigInt(); + } + + get userData(): Bytes { + return this[5].toBytes(); + } +} + +export class SwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} diff --git a/generated/MarginTradingPoolFactory/WeightedPool.ts b/generated/MarginTradingPoolFactory/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/MarginTradingPoolFactory/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/OffchainSecondariesPoolFactory/ERC20.ts b/generated/OffchainSecondariesPoolFactory/ERC20.ts new file mode 100644 index 000000000..0aa0d7efe --- /dev/null +++ b/generated/OffchainSecondariesPoolFactory/ERC20.ts @@ -0,0 +1,543 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ERC20 extends ethereum.SmartContract { + static bind(address: Address): ERC20 { + return new ERC20("ERC20", address); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + subtractedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get name_(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol_(): string { + return this._call.inputValues[1].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get subtractedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/OffchainSecondariesPoolFactory/OffchainSecondariesPool.ts b/generated/OffchainSecondariesPoolFactory/OffchainSecondariesPool.ts new file mode 100644 index 000000000..1e544679b --- /dev/null +++ b/generated/OffchainSecondariesPoolFactory/OffchainSecondariesPool.ts @@ -0,0 +1,1964 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Offer extends ethereum.Event { + get params(): Offer__Params { + return new Offer__Params(this); + } +} + +export class Offer__Params { + _event: Offer; + + constructor(event: Offer) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get orderBook(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get issueManager(): Address { + return this._event.parameters[4].value.toAddress(); + } +} + +export class OrderBook extends ethereum.Event { + get params(): OrderBook__Params { + return new OrderBook__Params(this); + } +} + +export class OrderBook__Params { + _event: OrderBook; + + constructor(event: OrderBook) { + this._event = event; + } + + get creator(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountOffered(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get priceOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get timestamp(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get orderRef(): Bytes { + return this._event.parameters[6].value.toBytes(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class TradeReport extends ethereum.Event { + get params(): TradeReport__Params { + return new TradeReport__Params(this); + } +} + +export class TradeReport__Params { + _event: TradeReport; + + constructor(event: TradeReport) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderRef(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get party(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get counterparty(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get orderType(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get price(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[6].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[8].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class OffchainSecondariesPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class OffchainSecondariesPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class OffchainSecondariesPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool extends ethereum.SmartContract { + static bind(address: Address): OffchainSecondariesPool { + return new OffchainSecondariesPool("OffchainSecondariesPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + _orderbook(): Address { + let result = super.call("_orderbook", "_orderbook():(address)", []); + + return result[0].toAddress(); + } + + try__orderbook(): ethereum.CallResult
{ + let result = super.tryCall("_orderbook", "_orderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getMinOrderSize(): BigInt { + let result = super.call( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): OffchainSecondariesPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new OffchainSecondariesPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + OffchainSecondariesPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: OffchainSecondariesPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: OffchainSecondariesPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get security(): Address { + return this._call.inputValues[3].value.toAddress(); + } + + get currency(): Address { + return this._call.inputValues[4].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[8].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[9].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/OffchainSecondariesPoolFactory/OffchainSecondariesPoolFactory.ts b/generated/OffchainSecondariesPoolFactory/OffchainSecondariesPoolFactory.ts new file mode 100644 index 000000000..8db506e0b --- /dev/null +++ b/generated/OffchainSecondariesPoolFactory/OffchainSecondariesPoolFactory.ts @@ -0,0 +1,450 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class FactoryDisabled extends ethereum.Event { + get params(): FactoryDisabled__Params { + return new FactoryDisabled__Params(this); + } +} + +export class FactoryDisabled__Params { + _event: FactoryDisabled; + + constructor(event: FactoryDisabled) { + this._event = event; + } +} + +export class PoolCreated extends ethereum.Event { + get params(): PoolCreated__Params { + return new PoolCreated__Params(this); + } +} + +export class PoolCreated__Params { + _event: PoolCreated; + + constructor(event: PoolCreated) { + this._event = event; + } + + get pool(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class OffchainSecondariesPoolFactory__getCreationCodeContractsResult { + value0: Address; + value1: Address; + + constructor(value0: Address, value1: Address) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromAddress(this.value1)); + return map; + } +} + +export class OffchainSecondariesPoolFactory__getPauseConfigurationResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class OffchainSecondariesPoolFactory extends ethereum.SmartContract { + static bind(address: Address): OffchainSecondariesPoolFactory { + return new OffchainSecondariesPoolFactory( + "OffchainSecondariesPoolFactory", + address + ); + } + + create( + name: string, + symbol: string, + security: Address, + currency: Address, + maxAmountsIn: BigInt, + tradeFeePercentage: BigInt + ): Address { + let result = super.call( + "create", + "create(string,string,address,address,uint256,uint256):(address)", + [ + ethereum.Value.fromString(name), + ethereum.Value.fromString(symbol), + ethereum.Value.fromAddress(security), + ethereum.Value.fromAddress(currency), + ethereum.Value.fromUnsignedBigInt(maxAmountsIn), + ethereum.Value.fromUnsignedBigInt(tradeFeePercentage) + ] + ); + + return result[0].toAddress(); + } + + try_create( + name: string, + symbol: string, + security: Address, + currency: Address, + maxAmountsIn: BigInt, + tradeFeePercentage: BigInt + ): ethereum.CallResult
{ + let result = super.tryCall( + "create", + "create(string,string,address,address,uint256,uint256):(address)", + [ + ethereum.Value.fromString(name), + ethereum.Value.fromString(symbol), + ethereum.Value.fromAddress(security), + ethereum.Value.fromAddress(currency), + ethereum.Value.fromUnsignedBigInt(maxAmountsIn), + ethereum.Value.fromUnsignedBigInt(tradeFeePercentage) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCreationCode(): Bytes { + let result = super.call("getCreationCode", "getCreationCode():(bytes)", []); + + return result[0].toBytes(); + } + + try_getCreationCode(): ethereum.CallResult { + let result = super.tryCall( + "getCreationCode", + "getCreationCode():(bytes)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getCreationCodeContracts(): OffchainSecondariesPoolFactory__getCreationCodeContractsResult { + let result = super.call( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + + return new OffchainSecondariesPoolFactory__getCreationCodeContractsResult( + result[0].toAddress(), + result[1].toAddress() + ); + } + + try_getCreationCodeContracts(): ethereum.CallResult< + OffchainSecondariesPoolFactory__getCreationCodeContractsResult + > { + let result = super.tryCall( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPoolFactory__getCreationCodeContractsResult( + value[0].toAddress(), + value[1].toAddress() + ) + ); + } + + getPauseConfiguration(): OffchainSecondariesPoolFactory__getPauseConfigurationResult { + let result = super.call( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + + return new OffchainSecondariesPoolFactory__getPauseConfigurationResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getPauseConfiguration(): ethereum.CallResult< + OffchainSecondariesPoolFactory__getPauseConfigurationResult + > { + let result = super.tryCall( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPoolFactory__getPauseConfigurationResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getProtocolFeePercentagesProvider(): Address { + let result = super.call( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeePercentagesProvider(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + isDisabled(): boolean { + let result = super.call("isDisabled", "isDisabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_isDisabled(): ethereum.CallResult { + let result = super.tryCall("isDisabled", "isDisabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isPoolFromFactory(pool: Address): boolean { + let result = super.call( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + + return result[0].toBoolean(); + } + + try_isPoolFromFactory(pool: Address): ethereum.CallResult { + let result = super.tryCall( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class CreateCall extends ethereum.Call { + get inputs(): CreateCall__Inputs { + return new CreateCall__Inputs(this); + } + + get outputs(): CreateCall__Outputs { + return new CreateCall__Outputs(this); + } +} + +export class CreateCall__Inputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get name(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[1].value.toString(); + } + + get security(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get currency(): Address { + return this._call.inputValues[3].value.toAddress(); + } + + get maxAmountsIn(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class CreateCall__Outputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get value0(): Address { + return this._call.outputValues[0].value.toAddress(); + } +} + +export class DisableCall extends ethereum.Call { + get inputs(): DisableCall__Inputs { + return new DisableCall__Inputs(this); + } + + get outputs(): DisableCall__Outputs { + return new DisableCall__Outputs(this); + } +} + +export class DisableCall__Inputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} + +export class DisableCall__Outputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} diff --git a/generated/OffchainSecondariesPoolFactory/Vault.ts b/generated/OffchainSecondariesPoolFactory/Vault.ts new file mode 100644 index 000000000..3399274b3 --- /dev/null +++ b/generated/OffchainSecondariesPoolFactory/Vault.ts @@ -0,0 +1,1544 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AuthorizerChanged extends ethereum.Event { + get params(): AuthorizerChanged__Params { + return new AuthorizerChanged__Params(this); + } +} + +export class AuthorizerChanged__Params { + _event: AuthorizerChanged; + + constructor(event: AuthorizerChanged) { + this._event = event; + } + + get newAuthorizer(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class ExternalBalanceTransfer extends ethereum.Event { + get params(): ExternalBalanceTransfer__Params { + return new ExternalBalanceTransfer__Params(this); + } +} + +export class ExternalBalanceTransfer__Params { + _event: ExternalBalanceTransfer; + + constructor(event: ExternalBalanceTransfer) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class FlashLoan extends ethereum.Event { + get params(): FlashLoan__Params { + return new FlashLoan__Params(this); + } +} + +export class FlashLoan__Params { + _event: FlashLoan; + + constructor(event: FlashLoan) { + this._event = event; + } + + get recipient(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get feeAmount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class InternalBalanceChanged extends ethereum.Event { + get params(): InternalBalanceChanged__Params { + return new InternalBalanceChanged__Params(this); + } +} + +export class InternalBalanceChanged__Params { + _event: InternalBalanceChanged; + + constructor(event: InternalBalanceChanged) { + this._event = event; + } + + get user(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get delta(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PoolBalanceChanged extends ethereum.Event { + get params(): PoolBalanceChanged__Params { + return new PoolBalanceChanged__Params(this); + } +} + +export class PoolBalanceChanged__Params { + _event: PoolBalanceChanged; + + constructor(event: PoolBalanceChanged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get liquidityProvider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokens(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } + + get deltas(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } + + get protocolFeeAmounts(): Array { + return this._event.parameters[4].value.toBigIntArray(); + } +} + +export class PoolBalanceManaged extends ethereum.Event { + get params(): PoolBalanceManaged__Params { + return new PoolBalanceManaged__Params(this); + } +} + +export class PoolBalanceManaged__Params { + _event: PoolBalanceManaged; + + constructor(event: PoolBalanceManaged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get assetManager(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get cashDelta(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get managedDelta(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class PoolRegistered extends ethereum.Event { + get params(): PoolRegistered__Params { + return new PoolRegistered__Params(this); + } +} + +export class PoolRegistered__Params { + _event: PoolRegistered; + + constructor(event: PoolRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get poolAddress(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get specialization(): i32 { + return this._event.parameters[2].value.toI32(); + } +} + +export class RelayerApprovalChanged extends ethereum.Event { + get params(): RelayerApprovalChanged__Params { + return new RelayerApprovalChanged__Params(this); + } +} + +export class RelayerApprovalChanged__Params { + _event: RelayerApprovalChanged; + + constructor(event: RelayerApprovalChanged) { + this._event = event; + } + + get relayer(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get approved(): boolean { + return this._event.parameters[2].value.toBoolean(); + } +} + +export class Swap extends ethereum.Event { + get params(): Swap__Params { + return new Swap__Params(this); + } +} + +export class Swap__Params { + _event: Swap; + + constructor(event: Swap) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountIn(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get amountOut(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class TokensDeregistered extends ethereum.Event { + get params(): TokensDeregistered__Params { + return new TokensDeregistered__Params(this); + } +} + +export class TokensDeregistered__Params { + _event: TokensDeregistered; + + constructor(event: TokensDeregistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } +} + +export class TokensRegistered extends ethereum.Event { + get params(): TokensRegistered__Params { + return new TokensRegistered__Params(this); + } +} + +export class TokensRegistered__Params { + _event: TokensRegistered; + + constructor(event: TokensRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } +} + +export class Vault__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__getPoolResult { + value0: Address; + value1: i32; + + constructor(value0: Address, value1: i32) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + return map; + } +} + +export class Vault__getPoolTokenInfoResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: Address; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromAddress(this.value3)); + return map; + } +} + +export class Vault__getPoolTokensResult { + value0: Array
; + value1: Array; + value2: BigInt; + + constructor(value0: Array
, value1: Array, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddressArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class Vault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class Vault extends ethereum.SmartContract { + static bind(address: Address): Vault { + return new Vault("Vault", address); + } + + WETH(): Address { + let result = super.call("WETH", "WETH():(address)", []); + + return result[0].toAddress(); + } + + try_WETH(): ethereum.CallResult
{ + let result = super.tryCall("WETH", "WETH():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInternalBalance(user: Address, tokens: Array
): Array { + let result = super.call( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + + return result[0].toBigIntArray(); + } + + try_getInternalBalance( + user: Address, + tokens: Array
+ ): ethereum.CallResult> { + let result = super.tryCall( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getNextNonce(user: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(user) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(user: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(user)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getPausedState(): Vault__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new Vault__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPool(poolId: Bytes): Vault__getPoolResult { + let result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + + return new Vault__getPoolResult(result[0].toAddress(), result[1].toI32()); + } + + try_getPool(poolId: Bytes): ethereum.CallResult { + let result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolResult(value[0].toAddress(), value[1].toI32()) + ); + } + + getPoolTokenInfo( + poolId: Bytes, + token: Address + ): Vault__getPoolTokenInfoResult { + let result = super.call( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + + return new Vault__getPoolTokenInfoResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toAddress() + ); + } + + try_getPoolTokenInfo( + poolId: Bytes, + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokenInfoResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toAddress() + ) + ); + } + + getPoolTokens(poolId: Bytes): Vault__getPoolTokensResult { + let result = super.call( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + + return new Vault__getPoolTokensResult( + result[0].toAddressArray(), + result[1].toBigIntArray(), + result[2].toBigInt() + ); + } + + try_getPoolTokens( + poolId: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokensResult( + value[0].toAddressArray(), + value[1].toBigIntArray(), + value[2].toBigInt() + ) + ); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + hasApprovedRelayer(user: Address, relayer: Address): boolean { + let result = super.call( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + + return result[0].toBoolean(); + } + + try_hasApprovedRelayer( + user: Address, + relayer: Address + ): ethereum.CallResult { + let result = super.tryCall( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): Array { + let result = super.call( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + + return result[0].toBigIntArray(); + } + + try_queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): ethereum.CallResult> { + let result = super.tryCall( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + registerPool(specialization: i32): Bytes { + let result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) + ]); + + return result[0].toBytes(); + } + + try_registerPool(specialization: i32): ethereum.CallResult { + let result = super.tryCall( + "registerPool", + "registerPool(uint8):(bytes32)", + [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get authorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get weth(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class BatchSwapCall extends ethereum.Call { + get inputs(): BatchSwapCall__Inputs { + return new BatchSwapCall__Inputs(this); + } + + get outputs(): BatchSwapCall__Outputs { + return new BatchSwapCall__Outputs(this); + } +} + +export class BatchSwapCall__Inputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get kind(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get swaps(): Array { + return this._call.inputValues[1].value.toTupleArray< + BatchSwapCallSwapsStruct + >(); + } + + get assets(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } + + get funds(): BatchSwapCallFundsStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } + + get limits(): Array { + return this._call.inputValues[4].value.toBigIntArray(); + } + + get deadline(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class BatchSwapCall__Outputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get assetDeltas(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } +} + +export class BatchSwapCallSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class BatchSwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class DeregisterTokensCall extends ethereum.Call { + get inputs(): DeregisterTokensCall__Inputs { + return new DeregisterTokensCall__Inputs(this); + } + + get outputs(): DeregisterTokensCall__Outputs { + return new DeregisterTokensCall__Outputs(this); + } +} + +export class DeregisterTokensCall__Inputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } +} + +export class DeregisterTokensCall__Outputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } +} + +export class ExitPoolCall extends ethereum.Call { + get inputs(): ExitPoolCall__Inputs { + return new ExitPoolCall__Inputs(this); + } + + get outputs(): ExitPoolCall__Outputs { + return new ExitPoolCall__Outputs(this); + } +} + +export class ExitPoolCall__Inputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): ExitPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class ExitPoolCall__Outputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } +} + +export class ExitPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get minAmountsOut(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class FlashLoanCall extends ethereum.Call { + get inputs(): FlashLoanCall__Inputs { + return new FlashLoanCall__Inputs(this); + } + + get outputs(): FlashLoanCall__Outputs { + return new FlashLoanCall__Outputs(this); + } +} + +export class FlashLoanCall__Inputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get amounts(): Array { + return this._call.inputValues[2].value.toBigIntArray(); + } + + get userData(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class FlashLoanCall__Outputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } +} + +export class JoinPoolCall extends ethereum.Call { + get inputs(): JoinPoolCall__Inputs { + return new JoinPoolCall__Inputs(this); + } + + get outputs(): JoinPoolCall__Outputs { + return new JoinPoolCall__Outputs(this); + } +} + +export class JoinPoolCall__Inputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): JoinPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class JoinPoolCall__Outputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } +} + +export class JoinPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get maxAmountsIn(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get fromInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class ManagePoolBalanceCall extends ethereum.Call { + get inputs(): ManagePoolBalanceCall__Inputs { + return new ManagePoolBalanceCall__Inputs(this); + } + + get outputs(): ManagePoolBalanceCall__Outputs { + return new ManagePoolBalanceCall__Outputs(this); + } +} + +export class ManagePoolBalanceCall__Inputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManagePoolBalanceCallOpsStruct + >(); + } +} + +export class ManagePoolBalanceCall__Outputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } +} + +export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get poolId(): Bytes { + return this[1].toBytes(); + } + + get token(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } +} + +export class ManageUserBalanceCall extends ethereum.Call { + get inputs(): ManageUserBalanceCall__Inputs { + return new ManageUserBalanceCall__Inputs(this); + } + + get outputs(): ManageUserBalanceCall__Outputs { + return new ManageUserBalanceCall__Outputs(this); + } +} + +export class ManageUserBalanceCall__Inputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManageUserBalanceCallOpsStruct + >(); + } +} + +export class ManageUserBalanceCall__Outputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } +} + +export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get asset(): Address { + return this[1].toAddress(); + } + + get amount(): BigInt { + return this[2].toBigInt(); + } + + get sender(): Address { + return this[3].toAddress(); + } + + get recipient(): Address { + return this[4].toAddress(); + } +} + +export class RegisterPoolCall extends ethereum.Call { + get inputs(): RegisterPoolCall__Inputs { + return new RegisterPoolCall__Inputs(this); + } + + get outputs(): RegisterPoolCall__Outputs { + return new RegisterPoolCall__Outputs(this); + } +} + +export class RegisterPoolCall__Inputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get specialization(): i32 { + return this._call.inputValues[0].value.toI32(); + } +} + +export class RegisterPoolCall__Outputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get value0(): Bytes { + return this._call.outputValues[0].value.toBytes(); + } +} + +export class RegisterTokensCall extends ethereum.Call { + get inputs(): RegisterTokensCall__Inputs { + return new RegisterTokensCall__Inputs(this); + } + + get outputs(): RegisterTokensCall__Outputs { + return new RegisterTokensCall__Outputs(this); + } +} + +export class RegisterTokensCall__Inputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } +} + +export class RegisterTokensCall__Outputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } +} + +export class SetAuthorizerCall extends ethereum.Call { + get inputs(): SetAuthorizerCall__Inputs { + return new SetAuthorizerCall__Inputs(this); + } + + get outputs(): SetAuthorizerCall__Outputs { + return new SetAuthorizerCall__Outputs(this); + } +} + +export class SetAuthorizerCall__Inputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } + + get newAuthorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetAuthorizerCall__Outputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetRelayerApprovalCall extends ethereum.Call { + get inputs(): SetRelayerApprovalCall__Inputs { + return new SetRelayerApprovalCall__Inputs(this); + } + + get outputs(): SetRelayerApprovalCall__Outputs { + return new SetRelayerApprovalCall__Outputs(this); + } +} + +export class SetRelayerApprovalCall__Inputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get relayer(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get approved(): boolean { + return this._call.inputValues[2].value.toBoolean(); + } +} + +export class SetRelayerApprovalCall__Outputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } +} + +export class SwapCall extends ethereum.Call { + get inputs(): SwapCall__Inputs { + return new SwapCall__Inputs(this); + } + + get outputs(): SwapCall__Outputs { + return new SwapCall__Outputs(this); + } +} + +export class SwapCall__Inputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get singleSwap(): SwapCallSingleSwapStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get funds(): SwapCallFundsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get limit(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class SwapCall__Outputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get amountCalculated(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class SwapCallSingleSwapStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get kind(): i32 { + return this[1].toI32(); + } + + get assetIn(): Address { + return this[2].toAddress(); + } + + get assetOut(): Address { + return this[3].toAddress(); + } + + get amount(): BigInt { + return this[4].toBigInt(); + } + + get userData(): Bytes { + return this[5].toBytes(); + } +} + +export class SwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} diff --git a/generated/OffchainSecondariesPoolFactory/WeightedPool.ts b/generated/OffchainSecondariesPoolFactory/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/OffchainSecondariesPoolFactory/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/PrimaryIssuePoolFactory/ERC20.ts b/generated/PrimaryIssuePoolFactory/ERC20.ts new file mode 100644 index 000000000..0aa0d7efe --- /dev/null +++ b/generated/PrimaryIssuePoolFactory/ERC20.ts @@ -0,0 +1,543 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ERC20 extends ethereum.SmartContract { + static bind(address: Address): ERC20 { + return new ERC20("ERC20", address); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + subtractedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get name_(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol_(): string { + return this._call.inputValues[1].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get subtractedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/PrimaryIssuePoolFactory/PrimaryIssuePool.ts b/generated/PrimaryIssuePoolFactory/PrimaryIssuePool.ts new file mode 100644 index 000000000..83faccd83 --- /dev/null +++ b/generated/PrimaryIssuePoolFactory/PrimaryIssuePool.ts @@ -0,0 +1,2080 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class OpenIssue extends ethereum.Event { + get params(): OpenIssue__Params { + return new OpenIssue__Params(this); + } +} + +export class OpenIssue__Params { + _event: OpenIssue; + + constructor(event: OpenIssue) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get minimumOrderSize(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get minimumPrice(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get securityOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get cutoffTime(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get offeringDocs(): string { + return this._event.parameters[6].value.toString(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class Subscription extends ethereum.Event { + get params(): Subscription__Params { + return new Subscription__Params(this); + } +} + +export class Subscription__Params { + _event: Subscription; + + constructor(event: Subscription) { + this._event = event; + } + + get assetIn(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get assetOut(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get subscription(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get investor(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get price(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PrimaryIssuePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class PrimaryIssuePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PrimaryIssuePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool extends ethereum.SmartContract { + static bind(address: Address): PrimaryIssuePool { + return new PrimaryIssuePool("PrimaryIssuePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getBptIndex(): BigInt { + let result = super.call("getBptIndex", "getBptIndex():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getBptIndex(): ethereum.CallResult { + let result = super.tryCall("getBptIndex", "getBptIndex():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCurrencyIndex(): BigInt { + let result = super.call( + "getCurrencyIndex", + "getCurrencyIndex():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getCurrencyIndex(): ethereum.CallResult { + let result = super.tryCall( + "getCurrencyIndex", + "getCurrencyIndex():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getIssueCutoffTime(): BigInt { + let result = super.call( + "getIssueCutoffTime", + "getIssueCutoffTime():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getIssueCutoffTime(): ethereum.CallResult { + let result = super.tryCall( + "getIssueCutoffTime", + "getIssueCutoffTime():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMinimumOrderSize(): BigInt { + let result = super.call( + "getMinimumOrderSize", + "getMinimumOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinimumOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinimumOrderSize", + "getMinimumOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMinimumPrice(): BigInt { + let result = super.call( + "getMinimumPrice", + "getMinimumPrice():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinimumPrice(): ethereum.CallResult { + let result = super.tryCall( + "getMinimumPrice", + "getMinimumPrice():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOfferingDocuments(): string { + let result = super.call( + "getOfferingDocuments", + "getOfferingDocuments():(string)", + [] + ); + + return result[0].toString(); + } + + try_getOfferingDocuments(): ethereum.CallResult { + let result = super.tryCall( + "getOfferingDocuments", + "getOfferingDocuments():(string)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): PrimaryIssuePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new PrimaryIssuePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + PrimaryIssuePool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSecurityIndex(): BigInt { + let result = super.call( + "getSecurityIndex", + "getSecurityIndex():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSecurityIndex(): ethereum.CallResult { + let result = super.tryCall( + "getSecurityIndex", + "getSecurityIndex():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSecurityOffered(): BigInt { + let result = super.call( + "getSecurityOffered", + "getSecurityOffered():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSecurityOffered(): ethereum.CallResult { + let result = super.tryCall( + "getSecurityOffered", + "getSecurityOffered():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: PrimaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: PrimaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get factoryPoolParams(): ConstructorCallFactoryPoolParamsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[4].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get currency(): Address { + return this[3].toAddress(); + } + + get minimumPrice(): BigInt { + return this[4].toBigInt(); + } + + get minimumOrderSize(): BigInt { + return this[5].toBigInt(); + } + + get maxAmountsIn(): BigInt { + return this[6].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[7].toBigInt(); + } + + get cutOffTime(): BigInt { + return this[8].toBigInt(); + } + + get offeringDocs(): string { + return this[9].toString(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/PrimaryIssuePoolFactory/PrimaryIssuePoolFactory.ts b/generated/PrimaryIssuePoolFactory/PrimaryIssuePoolFactory.ts new file mode 100644 index 000000000..cd10bcf09 --- /dev/null +++ b/generated/PrimaryIssuePoolFactory/PrimaryIssuePoolFactory.ts @@ -0,0 +1,489 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class FactoryDisabled extends ethereum.Event { + get params(): FactoryDisabled__Params { + return new FactoryDisabled__Params(this); + } +} + +export class FactoryDisabled__Params { + _event: FactoryDisabled; + + constructor(event: FactoryDisabled) { + this._event = event; + } +} + +export class PoolCreated extends ethereum.Event { + get params(): PoolCreated__Params { + return new PoolCreated__Params(this); + } +} + +export class PoolCreated__Params { + _event: PoolCreated; + + constructor(event: PoolCreated) { + this._event = event; + } + + get pool(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class PrimaryIssuePoolFactory__createInputFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get currency(): Address { + return this[3].toAddress(); + } + + get minimumPrice(): BigInt { + return this[4].toBigInt(); + } + + get minimumOrderSize(): BigInt { + return this[5].toBigInt(); + } + + get maxAmountsIn(): BigInt { + return this[6].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[7].toBigInt(); + } + + get cutOffTime(): BigInt { + return this[8].toBigInt(); + } + + get offeringDocs(): string { + return this[9].toString(); + } +} + +export class PrimaryIssuePoolFactory__getCreationCodeContractsResult { + value0: Address; + value1: Address; + + constructor(value0: Address, value1: Address) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromAddress(this.value1)); + return map; + } +} + +export class PrimaryIssuePoolFactory__getPauseConfigurationResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class PrimaryIssuePoolFactory extends ethereum.SmartContract { + static bind(address: Address): PrimaryIssuePoolFactory { + return new PrimaryIssuePoolFactory("PrimaryIssuePoolFactory", address); + } + + create( + factoryPoolParams: PrimaryIssuePoolFactory__createInputFactoryPoolParamsStruct + ): Address { + let result = super.call( + "create", + "create((string,string,address,address,uint256,uint256,uint256,uint256,uint256,string)):(address)", + [ethereum.Value.fromTuple(factoryPoolParams)] + ); + + return result[0].toAddress(); + } + + try_create( + factoryPoolParams: PrimaryIssuePoolFactory__createInputFactoryPoolParamsStruct + ): ethereum.CallResult
{ + let result = super.tryCall( + "create", + "create((string,string,address,address,uint256,uint256,uint256,uint256,uint256,string)):(address)", + [ethereum.Value.fromTuple(factoryPoolParams)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCreationCode(): Bytes { + let result = super.call("getCreationCode", "getCreationCode():(bytes)", []); + + return result[0].toBytes(); + } + + try_getCreationCode(): ethereum.CallResult { + let result = super.tryCall( + "getCreationCode", + "getCreationCode():(bytes)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getCreationCodeContracts(): PrimaryIssuePoolFactory__getCreationCodeContractsResult { + let result = super.call( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + + return new PrimaryIssuePoolFactory__getCreationCodeContractsResult( + result[0].toAddress(), + result[1].toAddress() + ); + } + + try_getCreationCodeContracts(): ethereum.CallResult< + PrimaryIssuePoolFactory__getCreationCodeContractsResult + > { + let result = super.tryCall( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePoolFactory__getCreationCodeContractsResult( + value[0].toAddress(), + value[1].toAddress() + ) + ); + } + + getPauseConfiguration(): PrimaryIssuePoolFactory__getPauseConfigurationResult { + let result = super.call( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + + return new PrimaryIssuePoolFactory__getPauseConfigurationResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getPauseConfiguration(): ethereum.CallResult< + PrimaryIssuePoolFactory__getPauseConfigurationResult + > { + let result = super.tryCall( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePoolFactory__getPauseConfigurationResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getProtocolFeePercentagesProvider(): Address { + let result = super.call( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeePercentagesProvider(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + isDisabled(): boolean { + let result = super.call("isDisabled", "isDisabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_isDisabled(): ethereum.CallResult { + let result = super.tryCall("isDisabled", "isDisabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isPoolFromFactory(pool: Address): boolean { + let result = super.call( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + + return result[0].toBoolean(); + } + + try_isPoolFromFactory(pool: Address): ethereum.CallResult { + let result = super.tryCall( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class CreateCall extends ethereum.Call { + get inputs(): CreateCall__Inputs { + return new CreateCall__Inputs(this); + } + + get outputs(): CreateCall__Outputs { + return new CreateCall__Outputs(this); + } +} + +export class CreateCall__Inputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get factoryPoolParams(): CreateCallFactoryPoolParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class CreateCall__Outputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get value0(): Address { + return this._call.outputValues[0].value.toAddress(); + } +} + +export class CreateCallFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get currency(): Address { + return this[3].toAddress(); + } + + get minimumPrice(): BigInt { + return this[4].toBigInt(); + } + + get minimumOrderSize(): BigInt { + return this[5].toBigInt(); + } + + get maxAmountsIn(): BigInt { + return this[6].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[7].toBigInt(); + } + + get cutOffTime(): BigInt { + return this[8].toBigInt(); + } + + get offeringDocs(): string { + return this[9].toString(); + } +} + +export class DisableCall extends ethereum.Call { + get inputs(): DisableCall__Inputs { + return new DisableCall__Inputs(this); + } + + get outputs(): DisableCall__Outputs { + return new DisableCall__Outputs(this); + } +} + +export class DisableCall__Inputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} + +export class DisableCall__Outputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} diff --git a/generated/PrimaryIssuePoolFactory/Vault.ts b/generated/PrimaryIssuePoolFactory/Vault.ts new file mode 100644 index 000000000..3399274b3 --- /dev/null +++ b/generated/PrimaryIssuePoolFactory/Vault.ts @@ -0,0 +1,1544 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AuthorizerChanged extends ethereum.Event { + get params(): AuthorizerChanged__Params { + return new AuthorizerChanged__Params(this); + } +} + +export class AuthorizerChanged__Params { + _event: AuthorizerChanged; + + constructor(event: AuthorizerChanged) { + this._event = event; + } + + get newAuthorizer(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class ExternalBalanceTransfer extends ethereum.Event { + get params(): ExternalBalanceTransfer__Params { + return new ExternalBalanceTransfer__Params(this); + } +} + +export class ExternalBalanceTransfer__Params { + _event: ExternalBalanceTransfer; + + constructor(event: ExternalBalanceTransfer) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class FlashLoan extends ethereum.Event { + get params(): FlashLoan__Params { + return new FlashLoan__Params(this); + } +} + +export class FlashLoan__Params { + _event: FlashLoan; + + constructor(event: FlashLoan) { + this._event = event; + } + + get recipient(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get feeAmount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class InternalBalanceChanged extends ethereum.Event { + get params(): InternalBalanceChanged__Params { + return new InternalBalanceChanged__Params(this); + } +} + +export class InternalBalanceChanged__Params { + _event: InternalBalanceChanged; + + constructor(event: InternalBalanceChanged) { + this._event = event; + } + + get user(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get delta(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PoolBalanceChanged extends ethereum.Event { + get params(): PoolBalanceChanged__Params { + return new PoolBalanceChanged__Params(this); + } +} + +export class PoolBalanceChanged__Params { + _event: PoolBalanceChanged; + + constructor(event: PoolBalanceChanged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get liquidityProvider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokens(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } + + get deltas(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } + + get protocolFeeAmounts(): Array { + return this._event.parameters[4].value.toBigIntArray(); + } +} + +export class PoolBalanceManaged extends ethereum.Event { + get params(): PoolBalanceManaged__Params { + return new PoolBalanceManaged__Params(this); + } +} + +export class PoolBalanceManaged__Params { + _event: PoolBalanceManaged; + + constructor(event: PoolBalanceManaged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get assetManager(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get cashDelta(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get managedDelta(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class PoolRegistered extends ethereum.Event { + get params(): PoolRegistered__Params { + return new PoolRegistered__Params(this); + } +} + +export class PoolRegistered__Params { + _event: PoolRegistered; + + constructor(event: PoolRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get poolAddress(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get specialization(): i32 { + return this._event.parameters[2].value.toI32(); + } +} + +export class RelayerApprovalChanged extends ethereum.Event { + get params(): RelayerApprovalChanged__Params { + return new RelayerApprovalChanged__Params(this); + } +} + +export class RelayerApprovalChanged__Params { + _event: RelayerApprovalChanged; + + constructor(event: RelayerApprovalChanged) { + this._event = event; + } + + get relayer(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get approved(): boolean { + return this._event.parameters[2].value.toBoolean(); + } +} + +export class Swap extends ethereum.Event { + get params(): Swap__Params { + return new Swap__Params(this); + } +} + +export class Swap__Params { + _event: Swap; + + constructor(event: Swap) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountIn(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get amountOut(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class TokensDeregistered extends ethereum.Event { + get params(): TokensDeregistered__Params { + return new TokensDeregistered__Params(this); + } +} + +export class TokensDeregistered__Params { + _event: TokensDeregistered; + + constructor(event: TokensDeregistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } +} + +export class TokensRegistered extends ethereum.Event { + get params(): TokensRegistered__Params { + return new TokensRegistered__Params(this); + } +} + +export class TokensRegistered__Params { + _event: TokensRegistered; + + constructor(event: TokensRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } +} + +export class Vault__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__getPoolResult { + value0: Address; + value1: i32; + + constructor(value0: Address, value1: i32) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + return map; + } +} + +export class Vault__getPoolTokenInfoResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: Address; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromAddress(this.value3)); + return map; + } +} + +export class Vault__getPoolTokensResult { + value0: Array
; + value1: Array; + value2: BigInt; + + constructor(value0: Array
, value1: Array, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddressArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class Vault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class Vault extends ethereum.SmartContract { + static bind(address: Address): Vault { + return new Vault("Vault", address); + } + + WETH(): Address { + let result = super.call("WETH", "WETH():(address)", []); + + return result[0].toAddress(); + } + + try_WETH(): ethereum.CallResult
{ + let result = super.tryCall("WETH", "WETH():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInternalBalance(user: Address, tokens: Array
): Array { + let result = super.call( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + + return result[0].toBigIntArray(); + } + + try_getInternalBalance( + user: Address, + tokens: Array
+ ): ethereum.CallResult> { + let result = super.tryCall( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getNextNonce(user: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(user) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(user: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(user)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getPausedState(): Vault__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new Vault__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPool(poolId: Bytes): Vault__getPoolResult { + let result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + + return new Vault__getPoolResult(result[0].toAddress(), result[1].toI32()); + } + + try_getPool(poolId: Bytes): ethereum.CallResult { + let result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolResult(value[0].toAddress(), value[1].toI32()) + ); + } + + getPoolTokenInfo( + poolId: Bytes, + token: Address + ): Vault__getPoolTokenInfoResult { + let result = super.call( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + + return new Vault__getPoolTokenInfoResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toAddress() + ); + } + + try_getPoolTokenInfo( + poolId: Bytes, + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokenInfoResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toAddress() + ) + ); + } + + getPoolTokens(poolId: Bytes): Vault__getPoolTokensResult { + let result = super.call( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + + return new Vault__getPoolTokensResult( + result[0].toAddressArray(), + result[1].toBigIntArray(), + result[2].toBigInt() + ); + } + + try_getPoolTokens( + poolId: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokensResult( + value[0].toAddressArray(), + value[1].toBigIntArray(), + value[2].toBigInt() + ) + ); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + hasApprovedRelayer(user: Address, relayer: Address): boolean { + let result = super.call( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + + return result[0].toBoolean(); + } + + try_hasApprovedRelayer( + user: Address, + relayer: Address + ): ethereum.CallResult { + let result = super.tryCall( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): Array { + let result = super.call( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + + return result[0].toBigIntArray(); + } + + try_queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): ethereum.CallResult> { + let result = super.tryCall( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + registerPool(specialization: i32): Bytes { + let result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) + ]); + + return result[0].toBytes(); + } + + try_registerPool(specialization: i32): ethereum.CallResult { + let result = super.tryCall( + "registerPool", + "registerPool(uint8):(bytes32)", + [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get authorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get weth(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class BatchSwapCall extends ethereum.Call { + get inputs(): BatchSwapCall__Inputs { + return new BatchSwapCall__Inputs(this); + } + + get outputs(): BatchSwapCall__Outputs { + return new BatchSwapCall__Outputs(this); + } +} + +export class BatchSwapCall__Inputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get kind(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get swaps(): Array { + return this._call.inputValues[1].value.toTupleArray< + BatchSwapCallSwapsStruct + >(); + } + + get assets(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } + + get funds(): BatchSwapCallFundsStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } + + get limits(): Array { + return this._call.inputValues[4].value.toBigIntArray(); + } + + get deadline(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class BatchSwapCall__Outputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get assetDeltas(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } +} + +export class BatchSwapCallSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class BatchSwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class DeregisterTokensCall extends ethereum.Call { + get inputs(): DeregisterTokensCall__Inputs { + return new DeregisterTokensCall__Inputs(this); + } + + get outputs(): DeregisterTokensCall__Outputs { + return new DeregisterTokensCall__Outputs(this); + } +} + +export class DeregisterTokensCall__Inputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } +} + +export class DeregisterTokensCall__Outputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } +} + +export class ExitPoolCall extends ethereum.Call { + get inputs(): ExitPoolCall__Inputs { + return new ExitPoolCall__Inputs(this); + } + + get outputs(): ExitPoolCall__Outputs { + return new ExitPoolCall__Outputs(this); + } +} + +export class ExitPoolCall__Inputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): ExitPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class ExitPoolCall__Outputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } +} + +export class ExitPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get minAmountsOut(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class FlashLoanCall extends ethereum.Call { + get inputs(): FlashLoanCall__Inputs { + return new FlashLoanCall__Inputs(this); + } + + get outputs(): FlashLoanCall__Outputs { + return new FlashLoanCall__Outputs(this); + } +} + +export class FlashLoanCall__Inputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get amounts(): Array { + return this._call.inputValues[2].value.toBigIntArray(); + } + + get userData(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class FlashLoanCall__Outputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } +} + +export class JoinPoolCall extends ethereum.Call { + get inputs(): JoinPoolCall__Inputs { + return new JoinPoolCall__Inputs(this); + } + + get outputs(): JoinPoolCall__Outputs { + return new JoinPoolCall__Outputs(this); + } +} + +export class JoinPoolCall__Inputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): JoinPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class JoinPoolCall__Outputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } +} + +export class JoinPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get maxAmountsIn(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get fromInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class ManagePoolBalanceCall extends ethereum.Call { + get inputs(): ManagePoolBalanceCall__Inputs { + return new ManagePoolBalanceCall__Inputs(this); + } + + get outputs(): ManagePoolBalanceCall__Outputs { + return new ManagePoolBalanceCall__Outputs(this); + } +} + +export class ManagePoolBalanceCall__Inputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManagePoolBalanceCallOpsStruct + >(); + } +} + +export class ManagePoolBalanceCall__Outputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } +} + +export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get poolId(): Bytes { + return this[1].toBytes(); + } + + get token(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } +} + +export class ManageUserBalanceCall extends ethereum.Call { + get inputs(): ManageUserBalanceCall__Inputs { + return new ManageUserBalanceCall__Inputs(this); + } + + get outputs(): ManageUserBalanceCall__Outputs { + return new ManageUserBalanceCall__Outputs(this); + } +} + +export class ManageUserBalanceCall__Inputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManageUserBalanceCallOpsStruct + >(); + } +} + +export class ManageUserBalanceCall__Outputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } +} + +export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get asset(): Address { + return this[1].toAddress(); + } + + get amount(): BigInt { + return this[2].toBigInt(); + } + + get sender(): Address { + return this[3].toAddress(); + } + + get recipient(): Address { + return this[4].toAddress(); + } +} + +export class RegisterPoolCall extends ethereum.Call { + get inputs(): RegisterPoolCall__Inputs { + return new RegisterPoolCall__Inputs(this); + } + + get outputs(): RegisterPoolCall__Outputs { + return new RegisterPoolCall__Outputs(this); + } +} + +export class RegisterPoolCall__Inputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get specialization(): i32 { + return this._call.inputValues[0].value.toI32(); + } +} + +export class RegisterPoolCall__Outputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get value0(): Bytes { + return this._call.outputValues[0].value.toBytes(); + } +} + +export class RegisterTokensCall extends ethereum.Call { + get inputs(): RegisterTokensCall__Inputs { + return new RegisterTokensCall__Inputs(this); + } + + get outputs(): RegisterTokensCall__Outputs { + return new RegisterTokensCall__Outputs(this); + } +} + +export class RegisterTokensCall__Inputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } +} + +export class RegisterTokensCall__Outputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } +} + +export class SetAuthorizerCall extends ethereum.Call { + get inputs(): SetAuthorizerCall__Inputs { + return new SetAuthorizerCall__Inputs(this); + } + + get outputs(): SetAuthorizerCall__Outputs { + return new SetAuthorizerCall__Outputs(this); + } +} + +export class SetAuthorizerCall__Inputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } + + get newAuthorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetAuthorizerCall__Outputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetRelayerApprovalCall extends ethereum.Call { + get inputs(): SetRelayerApprovalCall__Inputs { + return new SetRelayerApprovalCall__Inputs(this); + } + + get outputs(): SetRelayerApprovalCall__Outputs { + return new SetRelayerApprovalCall__Outputs(this); + } +} + +export class SetRelayerApprovalCall__Inputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get relayer(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get approved(): boolean { + return this._call.inputValues[2].value.toBoolean(); + } +} + +export class SetRelayerApprovalCall__Outputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } +} + +export class SwapCall extends ethereum.Call { + get inputs(): SwapCall__Inputs { + return new SwapCall__Inputs(this); + } + + get outputs(): SwapCall__Outputs { + return new SwapCall__Outputs(this); + } +} + +export class SwapCall__Inputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get singleSwap(): SwapCallSingleSwapStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get funds(): SwapCallFundsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get limit(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class SwapCall__Outputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get amountCalculated(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class SwapCallSingleSwapStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get kind(): i32 { + return this[1].toI32(); + } + + get assetIn(): Address { + return this[2].toAddress(); + } + + get assetOut(): Address { + return this[3].toAddress(); + } + + get amount(): BigInt { + return this[4].toBigInt(); + } + + get userData(): Bytes { + return this[5].toBytes(); + } +} + +export class SwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} diff --git a/generated/PrimaryIssuePoolFactory/WeightedPool.ts b/generated/PrimaryIssuePoolFactory/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/PrimaryIssuePoolFactory/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/SecondaryIssuePoolFactory/ERC20.ts b/generated/SecondaryIssuePoolFactory/ERC20.ts new file mode 100644 index 000000000..0aa0d7efe --- /dev/null +++ b/generated/SecondaryIssuePoolFactory/ERC20.ts @@ -0,0 +1,543 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ERC20 extends ethereum.SmartContract { + static bind(address: Address): ERC20 { + return new ERC20("ERC20", address); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + subtractedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get name_(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol_(): string { + return this._call.inputValues[1].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get subtractedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/SecondaryIssuePoolFactory/SecondaryIssuePool.ts b/generated/SecondaryIssuePoolFactory/SecondaryIssuePool.ts new file mode 100644 index 000000000..22b63f0fb --- /dev/null +++ b/generated/SecondaryIssuePoolFactory/SecondaryIssuePool.ts @@ -0,0 +1,1964 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Offer extends ethereum.Event { + get params(): Offer__Params { + return new Offer__Params(this); + } +} + +export class Offer__Params { + _event: Offer; + + constructor(event: Offer) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get orderBook(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get issueManager(): Address { + return this._event.parameters[4].value.toAddress(); + } +} + +export class OrderBook extends ethereum.Event { + get params(): OrderBook__Params { + return new OrderBook__Params(this); + } +} + +export class OrderBook__Params { + _event: OrderBook; + + constructor(event: OrderBook) { + this._event = event; + } + + get creator(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountOffered(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get priceOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get timestamp(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get orderRef(): Bytes { + return this._event.parameters[6].value.toBytes(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class TradeReport extends ethereum.Event { + get params(): TradeReport__Params { + return new TradeReport__Params(this); + } +} + +export class TradeReport__Params { + _event: TradeReport; + + constructor(event: TradeReport) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderRef(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get party(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get counterparty(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get orderType(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get price(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[6].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[8].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class SecondaryIssuePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class SecondaryIssuePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class SecondaryIssuePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool extends ethereum.SmartContract { + static bind(address: Address): SecondaryIssuePool { + return new SecondaryIssuePool("SecondaryIssuePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + _orderbook(): Address { + let result = super.call("_orderbook", "_orderbook():(address)", []); + + return result[0].toAddress(); + } + + try__orderbook(): ethereum.CallResult
{ + let result = super.tryCall("_orderbook", "_orderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getMinOrderSize(): BigInt { + let result = super.call( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): SecondaryIssuePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new SecondaryIssuePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + SecondaryIssuePool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: SecondaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: SecondaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get security(): Address { + return this._call.inputValues[3].value.toAddress(); + } + + get currency(): Address { + return this._call.inputValues[4].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[8].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[9].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/SecondaryIssuePoolFactory/SecondaryIssuePoolFactory.ts b/generated/SecondaryIssuePoolFactory/SecondaryIssuePoolFactory.ts new file mode 100644 index 000000000..7dab72a48 --- /dev/null +++ b/generated/SecondaryIssuePoolFactory/SecondaryIssuePoolFactory.ts @@ -0,0 +1,447 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class FactoryDisabled extends ethereum.Event { + get params(): FactoryDisabled__Params { + return new FactoryDisabled__Params(this); + } +} + +export class FactoryDisabled__Params { + _event: FactoryDisabled; + + constructor(event: FactoryDisabled) { + this._event = event; + } +} + +export class PoolCreated extends ethereum.Event { + get params(): PoolCreated__Params { + return new PoolCreated__Params(this); + } +} + +export class PoolCreated__Params { + _event: PoolCreated; + + constructor(event: PoolCreated) { + this._event = event; + } + + get pool(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class SecondaryIssuePoolFactory__getCreationCodeContractsResult { + value0: Address; + value1: Address; + + constructor(value0: Address, value1: Address) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromAddress(this.value1)); + return map; + } +} + +export class SecondaryIssuePoolFactory__getPauseConfigurationResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class SecondaryIssuePoolFactory extends ethereum.SmartContract { + static bind(address: Address): SecondaryIssuePoolFactory { + return new SecondaryIssuePoolFactory("SecondaryIssuePoolFactory", address); + } + + create( + name: string, + symbol: string, + security: Address, + currency: Address, + minOrderSize: BigInt, + tradeFeePercentage: BigInt + ): Address { + let result = super.call( + "create", + "create(string,string,address,address,uint256,uint256):(address)", + [ + ethereum.Value.fromString(name), + ethereum.Value.fromString(symbol), + ethereum.Value.fromAddress(security), + ethereum.Value.fromAddress(currency), + ethereum.Value.fromUnsignedBigInt(minOrderSize), + ethereum.Value.fromUnsignedBigInt(tradeFeePercentage) + ] + ); + + return result[0].toAddress(); + } + + try_create( + name: string, + symbol: string, + security: Address, + currency: Address, + minOrderSize: BigInt, + tradeFeePercentage: BigInt + ): ethereum.CallResult
{ + let result = super.tryCall( + "create", + "create(string,string,address,address,uint256,uint256):(address)", + [ + ethereum.Value.fromString(name), + ethereum.Value.fromString(symbol), + ethereum.Value.fromAddress(security), + ethereum.Value.fromAddress(currency), + ethereum.Value.fromUnsignedBigInt(minOrderSize), + ethereum.Value.fromUnsignedBigInt(tradeFeePercentage) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCreationCode(): Bytes { + let result = super.call("getCreationCode", "getCreationCode():(bytes)", []); + + return result[0].toBytes(); + } + + try_getCreationCode(): ethereum.CallResult { + let result = super.tryCall( + "getCreationCode", + "getCreationCode():(bytes)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getCreationCodeContracts(): SecondaryIssuePoolFactory__getCreationCodeContractsResult { + let result = super.call( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + + return new SecondaryIssuePoolFactory__getCreationCodeContractsResult( + result[0].toAddress(), + result[1].toAddress() + ); + } + + try_getCreationCodeContracts(): ethereum.CallResult< + SecondaryIssuePoolFactory__getCreationCodeContractsResult + > { + let result = super.tryCall( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePoolFactory__getCreationCodeContractsResult( + value[0].toAddress(), + value[1].toAddress() + ) + ); + } + + getPauseConfiguration(): SecondaryIssuePoolFactory__getPauseConfigurationResult { + let result = super.call( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + + return new SecondaryIssuePoolFactory__getPauseConfigurationResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getPauseConfiguration(): ethereum.CallResult< + SecondaryIssuePoolFactory__getPauseConfigurationResult + > { + let result = super.tryCall( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePoolFactory__getPauseConfigurationResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getProtocolFeePercentagesProvider(): Address { + let result = super.call( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeePercentagesProvider(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + isDisabled(): boolean { + let result = super.call("isDisabled", "isDisabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_isDisabled(): ethereum.CallResult { + let result = super.tryCall("isDisabled", "isDisabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isPoolFromFactory(pool: Address): boolean { + let result = super.call( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + + return result[0].toBoolean(); + } + + try_isPoolFromFactory(pool: Address): ethereum.CallResult { + let result = super.tryCall( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class CreateCall extends ethereum.Call { + get inputs(): CreateCall__Inputs { + return new CreateCall__Inputs(this); + } + + get outputs(): CreateCall__Outputs { + return new CreateCall__Outputs(this); + } +} + +export class CreateCall__Inputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get name(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[1].value.toString(); + } + + get security(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get currency(): Address { + return this._call.inputValues[3].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class CreateCall__Outputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get value0(): Address { + return this._call.outputValues[0].value.toAddress(); + } +} + +export class DisableCall extends ethereum.Call { + get inputs(): DisableCall__Inputs { + return new DisableCall__Inputs(this); + } + + get outputs(): DisableCall__Outputs { + return new DisableCall__Outputs(this); + } +} + +export class DisableCall__Inputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} + +export class DisableCall__Outputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} diff --git a/generated/SecondaryIssuePoolFactory/Vault.ts b/generated/SecondaryIssuePoolFactory/Vault.ts new file mode 100644 index 000000000..3399274b3 --- /dev/null +++ b/generated/SecondaryIssuePoolFactory/Vault.ts @@ -0,0 +1,1544 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AuthorizerChanged extends ethereum.Event { + get params(): AuthorizerChanged__Params { + return new AuthorizerChanged__Params(this); + } +} + +export class AuthorizerChanged__Params { + _event: AuthorizerChanged; + + constructor(event: AuthorizerChanged) { + this._event = event; + } + + get newAuthorizer(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class ExternalBalanceTransfer extends ethereum.Event { + get params(): ExternalBalanceTransfer__Params { + return new ExternalBalanceTransfer__Params(this); + } +} + +export class ExternalBalanceTransfer__Params { + _event: ExternalBalanceTransfer; + + constructor(event: ExternalBalanceTransfer) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class FlashLoan extends ethereum.Event { + get params(): FlashLoan__Params { + return new FlashLoan__Params(this); + } +} + +export class FlashLoan__Params { + _event: FlashLoan; + + constructor(event: FlashLoan) { + this._event = event; + } + + get recipient(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get feeAmount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class InternalBalanceChanged extends ethereum.Event { + get params(): InternalBalanceChanged__Params { + return new InternalBalanceChanged__Params(this); + } +} + +export class InternalBalanceChanged__Params { + _event: InternalBalanceChanged; + + constructor(event: InternalBalanceChanged) { + this._event = event; + } + + get user(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get delta(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PoolBalanceChanged extends ethereum.Event { + get params(): PoolBalanceChanged__Params { + return new PoolBalanceChanged__Params(this); + } +} + +export class PoolBalanceChanged__Params { + _event: PoolBalanceChanged; + + constructor(event: PoolBalanceChanged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get liquidityProvider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokens(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } + + get deltas(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } + + get protocolFeeAmounts(): Array { + return this._event.parameters[4].value.toBigIntArray(); + } +} + +export class PoolBalanceManaged extends ethereum.Event { + get params(): PoolBalanceManaged__Params { + return new PoolBalanceManaged__Params(this); + } +} + +export class PoolBalanceManaged__Params { + _event: PoolBalanceManaged; + + constructor(event: PoolBalanceManaged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get assetManager(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get cashDelta(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get managedDelta(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class PoolRegistered extends ethereum.Event { + get params(): PoolRegistered__Params { + return new PoolRegistered__Params(this); + } +} + +export class PoolRegistered__Params { + _event: PoolRegistered; + + constructor(event: PoolRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get poolAddress(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get specialization(): i32 { + return this._event.parameters[2].value.toI32(); + } +} + +export class RelayerApprovalChanged extends ethereum.Event { + get params(): RelayerApprovalChanged__Params { + return new RelayerApprovalChanged__Params(this); + } +} + +export class RelayerApprovalChanged__Params { + _event: RelayerApprovalChanged; + + constructor(event: RelayerApprovalChanged) { + this._event = event; + } + + get relayer(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get approved(): boolean { + return this._event.parameters[2].value.toBoolean(); + } +} + +export class Swap extends ethereum.Event { + get params(): Swap__Params { + return new Swap__Params(this); + } +} + +export class Swap__Params { + _event: Swap; + + constructor(event: Swap) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountIn(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get amountOut(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class TokensDeregistered extends ethereum.Event { + get params(): TokensDeregistered__Params { + return new TokensDeregistered__Params(this); + } +} + +export class TokensDeregistered__Params { + _event: TokensDeregistered; + + constructor(event: TokensDeregistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } +} + +export class TokensRegistered extends ethereum.Event { + get params(): TokensRegistered__Params { + return new TokensRegistered__Params(this); + } +} + +export class TokensRegistered__Params { + _event: TokensRegistered; + + constructor(event: TokensRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } +} + +export class Vault__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__getPoolResult { + value0: Address; + value1: i32; + + constructor(value0: Address, value1: i32) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + return map; + } +} + +export class Vault__getPoolTokenInfoResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: Address; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromAddress(this.value3)); + return map; + } +} + +export class Vault__getPoolTokensResult { + value0: Array
; + value1: Array; + value2: BigInt; + + constructor(value0: Array
, value1: Array, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddressArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class Vault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class Vault extends ethereum.SmartContract { + static bind(address: Address): Vault { + return new Vault("Vault", address); + } + + WETH(): Address { + let result = super.call("WETH", "WETH():(address)", []); + + return result[0].toAddress(); + } + + try_WETH(): ethereum.CallResult
{ + let result = super.tryCall("WETH", "WETH():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInternalBalance(user: Address, tokens: Array
): Array { + let result = super.call( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + + return result[0].toBigIntArray(); + } + + try_getInternalBalance( + user: Address, + tokens: Array
+ ): ethereum.CallResult> { + let result = super.tryCall( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getNextNonce(user: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(user) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(user: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(user)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getPausedState(): Vault__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new Vault__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPool(poolId: Bytes): Vault__getPoolResult { + let result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + + return new Vault__getPoolResult(result[0].toAddress(), result[1].toI32()); + } + + try_getPool(poolId: Bytes): ethereum.CallResult { + let result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolResult(value[0].toAddress(), value[1].toI32()) + ); + } + + getPoolTokenInfo( + poolId: Bytes, + token: Address + ): Vault__getPoolTokenInfoResult { + let result = super.call( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + + return new Vault__getPoolTokenInfoResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toAddress() + ); + } + + try_getPoolTokenInfo( + poolId: Bytes, + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokenInfoResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toAddress() + ) + ); + } + + getPoolTokens(poolId: Bytes): Vault__getPoolTokensResult { + let result = super.call( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + + return new Vault__getPoolTokensResult( + result[0].toAddressArray(), + result[1].toBigIntArray(), + result[2].toBigInt() + ); + } + + try_getPoolTokens( + poolId: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokensResult( + value[0].toAddressArray(), + value[1].toBigIntArray(), + value[2].toBigInt() + ) + ); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + hasApprovedRelayer(user: Address, relayer: Address): boolean { + let result = super.call( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + + return result[0].toBoolean(); + } + + try_hasApprovedRelayer( + user: Address, + relayer: Address + ): ethereum.CallResult { + let result = super.tryCall( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): Array { + let result = super.call( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + + return result[0].toBigIntArray(); + } + + try_queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): ethereum.CallResult> { + let result = super.tryCall( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + registerPool(specialization: i32): Bytes { + let result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) + ]); + + return result[0].toBytes(); + } + + try_registerPool(specialization: i32): ethereum.CallResult { + let result = super.tryCall( + "registerPool", + "registerPool(uint8):(bytes32)", + [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get authorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get weth(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class BatchSwapCall extends ethereum.Call { + get inputs(): BatchSwapCall__Inputs { + return new BatchSwapCall__Inputs(this); + } + + get outputs(): BatchSwapCall__Outputs { + return new BatchSwapCall__Outputs(this); + } +} + +export class BatchSwapCall__Inputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get kind(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get swaps(): Array { + return this._call.inputValues[1].value.toTupleArray< + BatchSwapCallSwapsStruct + >(); + } + + get assets(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } + + get funds(): BatchSwapCallFundsStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } + + get limits(): Array { + return this._call.inputValues[4].value.toBigIntArray(); + } + + get deadline(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class BatchSwapCall__Outputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get assetDeltas(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } +} + +export class BatchSwapCallSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class BatchSwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class DeregisterTokensCall extends ethereum.Call { + get inputs(): DeregisterTokensCall__Inputs { + return new DeregisterTokensCall__Inputs(this); + } + + get outputs(): DeregisterTokensCall__Outputs { + return new DeregisterTokensCall__Outputs(this); + } +} + +export class DeregisterTokensCall__Inputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } +} + +export class DeregisterTokensCall__Outputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } +} + +export class ExitPoolCall extends ethereum.Call { + get inputs(): ExitPoolCall__Inputs { + return new ExitPoolCall__Inputs(this); + } + + get outputs(): ExitPoolCall__Outputs { + return new ExitPoolCall__Outputs(this); + } +} + +export class ExitPoolCall__Inputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): ExitPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class ExitPoolCall__Outputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } +} + +export class ExitPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get minAmountsOut(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class FlashLoanCall extends ethereum.Call { + get inputs(): FlashLoanCall__Inputs { + return new FlashLoanCall__Inputs(this); + } + + get outputs(): FlashLoanCall__Outputs { + return new FlashLoanCall__Outputs(this); + } +} + +export class FlashLoanCall__Inputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get amounts(): Array { + return this._call.inputValues[2].value.toBigIntArray(); + } + + get userData(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class FlashLoanCall__Outputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } +} + +export class JoinPoolCall extends ethereum.Call { + get inputs(): JoinPoolCall__Inputs { + return new JoinPoolCall__Inputs(this); + } + + get outputs(): JoinPoolCall__Outputs { + return new JoinPoolCall__Outputs(this); + } +} + +export class JoinPoolCall__Inputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): JoinPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class JoinPoolCall__Outputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } +} + +export class JoinPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get maxAmountsIn(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get fromInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class ManagePoolBalanceCall extends ethereum.Call { + get inputs(): ManagePoolBalanceCall__Inputs { + return new ManagePoolBalanceCall__Inputs(this); + } + + get outputs(): ManagePoolBalanceCall__Outputs { + return new ManagePoolBalanceCall__Outputs(this); + } +} + +export class ManagePoolBalanceCall__Inputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManagePoolBalanceCallOpsStruct + >(); + } +} + +export class ManagePoolBalanceCall__Outputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } +} + +export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get poolId(): Bytes { + return this[1].toBytes(); + } + + get token(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } +} + +export class ManageUserBalanceCall extends ethereum.Call { + get inputs(): ManageUserBalanceCall__Inputs { + return new ManageUserBalanceCall__Inputs(this); + } + + get outputs(): ManageUserBalanceCall__Outputs { + return new ManageUserBalanceCall__Outputs(this); + } +} + +export class ManageUserBalanceCall__Inputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManageUserBalanceCallOpsStruct + >(); + } +} + +export class ManageUserBalanceCall__Outputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } +} + +export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get asset(): Address { + return this[1].toAddress(); + } + + get amount(): BigInt { + return this[2].toBigInt(); + } + + get sender(): Address { + return this[3].toAddress(); + } + + get recipient(): Address { + return this[4].toAddress(); + } +} + +export class RegisterPoolCall extends ethereum.Call { + get inputs(): RegisterPoolCall__Inputs { + return new RegisterPoolCall__Inputs(this); + } + + get outputs(): RegisterPoolCall__Outputs { + return new RegisterPoolCall__Outputs(this); + } +} + +export class RegisterPoolCall__Inputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get specialization(): i32 { + return this._call.inputValues[0].value.toI32(); + } +} + +export class RegisterPoolCall__Outputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get value0(): Bytes { + return this._call.outputValues[0].value.toBytes(); + } +} + +export class RegisterTokensCall extends ethereum.Call { + get inputs(): RegisterTokensCall__Inputs { + return new RegisterTokensCall__Inputs(this); + } + + get outputs(): RegisterTokensCall__Outputs { + return new RegisterTokensCall__Outputs(this); + } +} + +export class RegisterTokensCall__Inputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } +} + +export class RegisterTokensCall__Outputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } +} + +export class SetAuthorizerCall extends ethereum.Call { + get inputs(): SetAuthorizerCall__Inputs { + return new SetAuthorizerCall__Inputs(this); + } + + get outputs(): SetAuthorizerCall__Outputs { + return new SetAuthorizerCall__Outputs(this); + } +} + +export class SetAuthorizerCall__Inputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } + + get newAuthorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetAuthorizerCall__Outputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetRelayerApprovalCall extends ethereum.Call { + get inputs(): SetRelayerApprovalCall__Inputs { + return new SetRelayerApprovalCall__Inputs(this); + } + + get outputs(): SetRelayerApprovalCall__Outputs { + return new SetRelayerApprovalCall__Outputs(this); + } +} + +export class SetRelayerApprovalCall__Inputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get relayer(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get approved(): boolean { + return this._call.inputValues[2].value.toBoolean(); + } +} + +export class SetRelayerApprovalCall__Outputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } +} + +export class SwapCall extends ethereum.Call { + get inputs(): SwapCall__Inputs { + return new SwapCall__Inputs(this); + } + + get outputs(): SwapCall__Outputs { + return new SwapCall__Outputs(this); + } +} + +export class SwapCall__Inputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get singleSwap(): SwapCallSingleSwapStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get funds(): SwapCallFundsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get limit(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class SwapCall__Outputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get amountCalculated(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class SwapCallSingleSwapStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get kind(): i32 { + return this[1].toI32(); + } + + get assetIn(): Address { + return this[2].toAddress(); + } + + get assetOut(): Address { + return this[3].toAddress(); + } + + get amount(): BigInt { + return this[4].toBigInt(); + } + + get userData(): Bytes { + return this[5].toBytes(); + } +} + +export class SwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} diff --git a/generated/SecondaryIssuePoolFactory/WeightedPool.ts b/generated/SecondaryIssuePoolFactory/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/SecondaryIssuePoolFactory/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/Vault/ERC20.ts b/generated/Vault/ERC20.ts new file mode 100644 index 000000000..0aa0d7efe --- /dev/null +++ b/generated/Vault/ERC20.ts @@ -0,0 +1,543 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ERC20 extends ethereum.SmartContract { + static bind(address: Address): ERC20 { + return new ERC20("ERC20", address); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + subtractedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(subtractedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get name_(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol_(): string { + return this._call.inputValues[1].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get subtractedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/Vault/FXPool.ts b/generated/Vault/FXPool.ts new file mode 100644 index 000000000..a846c808d --- /dev/null +++ b/generated/Vault/FXPool.ts @@ -0,0 +1,2234 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class AssetIncluded extends ethereum.Event { + get params(): AssetIncluded__Params { + return new AssetIncluded__Params(this); + } +} + +export class AssetIncluded__Params { + _event: AssetIncluded; + + constructor(event: AssetIncluded) { + this._event = event; + } + + get numeraire(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get reserve(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get weight(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class AssimilatorIncluded extends ethereum.Event { + get params(): AssimilatorIncluded__Params { + return new AssimilatorIncluded__Params(this); + } +} + +export class AssimilatorIncluded__Params { + _event: AssimilatorIncluded; + + constructor(event: AssimilatorIncluded) { + this._event = event; + } + + get derivative(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get numeraire(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get reserve(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get assimilator(): Address { + return this._event.parameters[3].value.toAddress(); + } +} + +export class ChangeCollectorAddress extends ethereum.Event { + get params(): ChangeCollectorAddress__Params { + return new ChangeCollectorAddress__Params(this); + } +} + +export class ChangeCollectorAddress__Params { + _event: ChangeCollectorAddress; + + constructor(event: ChangeCollectorAddress) { + this._event = event; + } + + get newCollector(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class EmergencyAlarm extends ethereum.Event { + get params(): EmergencyAlarm__Params { + return new EmergencyAlarm__Params(this); + } +} + +export class EmergencyAlarm__Params { + _event: EmergencyAlarm; + + constructor(event: EmergencyAlarm) { + this._event = event; + } + + get isEmergency(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class EmergencyWithdraw extends ethereum.Event { + get params(): EmergencyWithdraw__Params { + return new EmergencyWithdraw__Params(this); + } +} + +export class EmergencyWithdraw__Params { + _event: EmergencyWithdraw; + + constructor(event: EmergencyWithdraw) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get lptAmountBurned(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get amountsWithdrawn(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } +} + +export class FeesAccrued extends ethereum.Event { + get params(): FeesAccrued__Params { + return new FeesAccrued__Params(this); + } +} + +export class FeesAccrued__Params { + _event: FeesAccrued; + + constructor(event: FeesAccrued) { + this._event = event; + } + + get feesCollected(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class FeesCollected extends ethereum.Event { + get params(): FeesCollected__Params { + return new FeesCollected__Params(this); + } +} + +export class FeesCollected__Params { + _event: FeesCollected; + + constructor(event: FeesCollected) { + this._event = event; + } + + get recipient(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get feesCollected(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class OnExitPool extends ethereum.Event { + get params(): OnExitPool__Params { + return new OnExitPool__Params(this); + } +} + +export class OnExitPool__Params { + _event: OnExitPool; + + constructor(event: OnExitPool) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get lptAmountBurned(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get amountsWithdrawn(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } +} + +export class OnJoinPool extends ethereum.Event { + get params(): OnJoinPool__Params { + return new OnJoinPool__Params(this); + } +} + +export class OnJoinPool__Params { + _event: OnJoinPool; + + constructor(event: OnJoinPool) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get lptAmountMinted(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get amountsDeposited(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class ParametersSet extends ethereum.Event { + get params(): ParametersSet__Params { + return new ParametersSet__Params(this); + } +} + +export class ParametersSet__Params { + _event: ParametersSet; + + constructor(event: ParametersSet) { + this._event = event; + } + + get alpha(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get beta(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get delta(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get epsilon(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get lambda(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class Paused extends ethereum.Event { + get params(): Paused__Params { + return new Paused__Params(this); + } +} + +export class Paused__Params { + _event: Paused; + + constructor(event: Paused) { + this._event = event; + } + + get account(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class ProtocolFeeShareUpdated extends ethereum.Event { + get params(): ProtocolFeeShareUpdated__Params { + return new ProtocolFeeShareUpdated__Params(this); + } +} + +export class ProtocolFeeShareUpdated__Params { + _event: ProtocolFeeShareUpdated; + + constructor(event: ProtocolFeeShareUpdated) { + this._event = event; + } + + get updater(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newProtocolPercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class Trade extends ethereum.Event { + get params(): Trade__Params { + return new Trade__Params(this); + } +} + +export class Trade__Params { + _event: Trade; + + constructor(event: Trade) { + this._event = event; + } + + get trader(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get origin(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get target(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get originAmount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get targetAmount(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Unpaused extends ethereum.Event { + get params(): Unpaused__Params { + return new Unpaused__Params(this); + } +} + +export class Unpaused__Params { + _event: Unpaused; + + constructor(event: Unpaused) { + this._event = event; + } + + get account(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class FXPool__curveResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + value5: BigInt; + value6: Address; + value7: Address; + value8: Bytes; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt, + value5: BigInt, + value6: Address, + value7: Address, + value8: Bytes + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + this.value7 = value7; + this.value8 = value8; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromSignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromSignedBigInt(this.value4)); + map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); + map.set("value6", ethereum.Value.fromAddress(this.value6)); + map.set("value7", ethereum.Value.fromAddress(this.value7)); + map.set("value8", ethereum.Value.fromFixedBytes(this.value8)); + return map; + } +} + +export class FXPool__liquidityResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class FXPool__viewDepositResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__viewParametersResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); + return map; + } +} + +export class FXPool extends ethereum.SmartContract { + static bind(address: Address): FXPool { + return new FXPool("FXPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + assimilator(_derivative: Address): Address { + let result = super.call("assimilator", "assimilator(address):(address)", [ + ethereum.Value.fromAddress(_derivative) + ]); + + return result[0].toAddress(); + } + + try_assimilator(_derivative: Address): ethereum.CallResult
{ + let result = super.tryCall( + "assimilator", + "assimilator(address):(address)", + [ethereum.Value.fromAddress(_derivative)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + collectorAddress(): Address { + let result = super.call( + "collectorAddress", + "collectorAddress():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_collectorAddress(): ethereum.CallResult
{ + let result = super.tryCall( + "collectorAddress", + "collectorAddress():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + curve(): FXPool__curveResult { + let result = super.call( + "curve", + "curve():(int128,int128,int128,int128,int128,uint256,address,address,bytes32)", + [] + ); + + return new FXPool__curveResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt(), + result[5].toBigInt(), + result[6].toAddress(), + result[7].toAddress(), + result[8].toBytes() + ); + } + + try_curve(): ethereum.CallResult { + let result = super.tryCall( + "curve", + "curve():(int128,int128,int128,int128,int128,uint256,address,address,bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__curveResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt(), + value[5].toBigInt(), + value[6].toAddress(), + value[7].toAddress(), + value[8].toBytes() + ) + ); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + derivatives(param0: BigInt): Address { + let result = super.call("derivatives", "derivatives(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + + return result[0].toAddress(); + } + + try_derivatives(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall( + "derivatives", + "derivatives(uint256):(address)", + [ethereum.Value.fromUnsignedBigInt(param0)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + emergency(): boolean { + let result = super.call("emergency", "emergency():(bool)", []); + + return result[0].toBoolean(); + } + + try_emergency(): ethereum.CallResult { + let result = super.tryCall("emergency", "emergency():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + liquidity(): FXPool__liquidityResult { + let result = super.call("liquidity", "liquidity():(uint256,uint256[])", []); + + return new FXPool__liquidityResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_liquidity(): ethereum.CallResult { + let result = super.tryCall( + "liquidity", + "liquidity():(uint256,uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__liquidityResult(value[0].toBigInt(), value[1].toBigIntArray()) + ); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + numeraires(param0: BigInt): Address { + let result = super.call("numeraires", "numeraires(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + + return result[0].toAddress(); + } + + try_numeraires(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall("numeraires", "numeraires(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + param2: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): FXPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(param2), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + + return new FXPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + param2: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(param2), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + param1: Address, + recipient: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): FXPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + + return new FXPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + param1: Address, + recipient: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: FXPool__onSwapInputSwapRequestStruct, + param1: BigInt, + param2: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(param1), + ethereum.Value.fromUnsignedBigInt(param2) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: FXPool__onSwapInputSwapRequestStruct, + param1: BigInt, + param2: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(param1), + ethereum.Value.fromUnsignedBigInt(param2) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + paused(): boolean { + let result = super.call("paused", "paused():(bool)", []); + + return result[0].toBoolean(); + } + + try_paused(): ethereum.CallResult { + let result = super.tryCall("paused", "paused():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + protocolPercentFee(): BigInt { + let result = super.call( + "protocolPercentFee", + "protocolPercentFee():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_protocolPercentFee(): ethereum.CallResult { + let result = super.tryCall( + "protocolPercentFee", + "protocolPercentFee():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + reserves(param0: BigInt): Address { + let result = super.call("reserves", "reserves(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + + return result[0].toAddress(); + } + + try_reserves(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall("reserves", "reserves(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + totalUnclaimedFeesInNumeraire(): BigInt { + let result = super.call( + "totalUnclaimedFeesInNumeraire", + "totalUnclaimedFeesInNumeraire():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_totalUnclaimedFeesInNumeraire(): ethereum.CallResult { + let result = super.tryCall( + "totalUnclaimedFeesInNumeraire", + "totalUnclaimedFeesInNumeraire():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + viewDeposit(totalDepositNumeraire: BigInt): FXPool__viewDepositResult { + let result = super.call( + "viewDeposit", + "viewDeposit(uint256):(uint256,uint256[])", + [ethereum.Value.fromUnsignedBigInt(totalDepositNumeraire)] + ); + + return new FXPool__viewDepositResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_viewDeposit( + totalDepositNumeraire: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "viewDeposit", + "viewDeposit(uint256):(uint256,uint256[])", + [ethereum.Value.fromUnsignedBigInt(totalDepositNumeraire)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__viewDepositResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + viewParameters(): FXPool__viewParametersResult { + let result = super.call( + "viewParameters", + "viewParameters():(uint256,uint256,uint256,uint256,uint256)", + [] + ); + + return new FXPool__viewParametersResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt() + ); + } + + try_viewParameters(): ethereum.CallResult { + let result = super.tryCall( + "viewParameters", + "viewParameters():(uint256,uint256,uint256,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__viewParametersResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt() + ) + ); + } + + viewWithdraw(_curvesToBurn: BigInt): Array { + let result = super.call( + "viewWithdraw", + "viewWithdraw(uint256):(uint256[])", + [ethereum.Value.fromUnsignedBigInt(_curvesToBurn)] + ); + + return result[0].toBigIntArray(); + } + + try_viewWithdraw(_curvesToBurn: BigInt): ethereum.CallResult> { + let result = super.tryCall( + "viewWithdraw", + "viewWithdraw(uint256):(uint256[])", + [ethereum.Value.fromUnsignedBigInt(_curvesToBurn)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _assetsToRegister(): Array
{ + return this._call.inputValues[0].value.toAddressArray(); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get _protocolPercentFee(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _name(): string { + return this._call.inputValues[3].value.toString(); + } + + get _symbol(): string { + return this._call.inputValues[4].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class InitializeCall extends ethereum.Call { + get inputs(): InitializeCall__Inputs { + return new InitializeCall__Inputs(this); + } + + get outputs(): InitializeCall__Outputs { + return new InitializeCall__Outputs(this); + } +} + +export class InitializeCall__Inputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } + + get _assets(): Array
{ + return this._call.inputValues[0].value.toAddressArray(); + } + + get _assetWeights(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } +} + +export class InitializeCall__Outputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value2(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get value3(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get value4(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get value5(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get amountsOut(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get value1(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get value3(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get value4(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get value5(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get amountsIn(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get swapRequest(): OnSwapCallSwapRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get value1(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get value2(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class SetCapCall extends ethereum.Call { + get inputs(): SetCapCall__Inputs { + return new SetCapCall__Inputs(this); + } + + get outputs(): SetCapCall__Outputs { + return new SetCapCall__Outputs(this); + } +} + +export class SetCapCall__Inputs { + _call: SetCapCall; + + constructor(call: SetCapCall) { + this._call = call; + } + + get _cap(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetCapCall__Outputs { + _call: SetCapCall; + + constructor(call: SetCapCall) { + this._call = call; + } +} + +export class SetCollectorAddressCall extends ethereum.Call { + get inputs(): SetCollectorAddressCall__Inputs { + return new SetCollectorAddressCall__Inputs(this); + } + + get outputs(): SetCollectorAddressCall__Outputs { + return new SetCollectorAddressCall__Outputs(this); + } +} + +export class SetCollectorAddressCall__Inputs { + _call: SetCollectorAddressCall; + + constructor(call: SetCollectorAddressCall) { + this._call = call; + } + + get _collectorAddress(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetCollectorAddressCall__Outputs { + _call: SetCollectorAddressCall; + + constructor(call: SetCollectorAddressCall) { + this._call = call; + } +} + +export class SetEmergencyCall extends ethereum.Call { + get inputs(): SetEmergencyCall__Inputs { + return new SetEmergencyCall__Inputs(this); + } + + get outputs(): SetEmergencyCall__Outputs { + return new SetEmergencyCall__Outputs(this); + } +} + +export class SetEmergencyCall__Inputs { + _call: SetEmergencyCall; + + constructor(call: SetEmergencyCall) { + this._call = call; + } + + get _emergency(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetEmergencyCall__Outputs { + _call: SetEmergencyCall; + + constructor(call: SetEmergencyCall) { + this._call = call; + } +} + +export class SetParamsCall extends ethereum.Call { + get inputs(): SetParamsCall__Inputs { + return new SetParamsCall__Inputs(this); + } + + get outputs(): SetParamsCall__Outputs { + return new SetParamsCall__Outputs(this); + } +} + +export class SetParamsCall__Inputs { + _call: SetParamsCall; + + constructor(call: SetParamsCall) { + this._call = call; + } + + get _alpha(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _beta(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get _feeAtHalt(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _epsilon(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get _lambda(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } +} + +export class SetParamsCall__Outputs { + _call: SetParamsCall; + + constructor(call: SetParamsCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetProtocolPercentFeeCall extends ethereum.Call { + get inputs(): SetProtocolPercentFeeCall__Inputs { + return new SetProtocolPercentFeeCall__Inputs(this); + } + + get outputs(): SetProtocolPercentFeeCall__Outputs { + return new SetProtocolPercentFeeCall__Outputs(this); + } +} + +export class SetProtocolPercentFeeCall__Inputs { + _call: SetProtocolPercentFeeCall; + + constructor(call: SetProtocolPercentFeeCall) { + this._call = call; + } + + get _protocolPercentFee(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetProtocolPercentFeeCall__Outputs { + _call: SetProtocolPercentFeeCall; + + constructor(call: SetProtocolPercentFeeCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/generated/Vault/StablePool.ts b/generated/Vault/StablePool.ts new file mode 100644 index 000000000..626dd6b59 --- /dev/null +++ b/generated/Vault/StablePool.ts @@ -0,0 +1,1860 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class StablePool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__onSwap1InputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool extends ethereum.SmartContract { + static bind(address: Address): StablePool { + return new StablePool("StablePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAmplificationParameter(): StablePool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new StablePool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + StablePool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): StablePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new StablePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get tokens(): Array
{ + return this._call.inputValues[3].value.toAddressArray(); + } + + get amplificationParameter(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[8].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/Vault/Vault.ts b/generated/Vault/Vault.ts new file mode 100644 index 000000000..3399274b3 --- /dev/null +++ b/generated/Vault/Vault.ts @@ -0,0 +1,1544 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AuthorizerChanged extends ethereum.Event { + get params(): AuthorizerChanged__Params { + return new AuthorizerChanged__Params(this); + } +} + +export class AuthorizerChanged__Params { + _event: AuthorizerChanged; + + constructor(event: AuthorizerChanged) { + this._event = event; + } + + get newAuthorizer(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class ExternalBalanceTransfer extends ethereum.Event { + get params(): ExternalBalanceTransfer__Params { + return new ExternalBalanceTransfer__Params(this); + } +} + +export class ExternalBalanceTransfer__Params { + _event: ExternalBalanceTransfer; + + constructor(event: ExternalBalanceTransfer) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get recipient(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class FlashLoan extends ethereum.Event { + get params(): FlashLoan__Params { + return new FlashLoan__Params(this); + } +} + +export class FlashLoan__Params { + _event: FlashLoan; + + constructor(event: FlashLoan) { + this._event = event; + } + + get recipient(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get feeAmount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class InternalBalanceChanged extends ethereum.Event { + get params(): InternalBalanceChanged__Params { + return new InternalBalanceChanged__Params(this); + } +} + +export class InternalBalanceChanged__Params { + _event: InternalBalanceChanged; + + constructor(event: InternalBalanceChanged) { + this._event = event; + } + + get user(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get delta(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PoolBalanceChanged extends ethereum.Event { + get params(): PoolBalanceChanged__Params { + return new PoolBalanceChanged__Params(this); + } +} + +export class PoolBalanceChanged__Params { + _event: PoolBalanceChanged; + + constructor(event: PoolBalanceChanged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get liquidityProvider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokens(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } + + get deltas(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } + + get protocolFeeAmounts(): Array { + return this._event.parameters[4].value.toBigIntArray(); + } +} + +export class PoolBalanceManaged extends ethereum.Event { + get params(): PoolBalanceManaged__Params { + return new PoolBalanceManaged__Params(this); + } +} + +export class PoolBalanceManaged__Params { + _event: PoolBalanceManaged; + + constructor(event: PoolBalanceManaged) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get assetManager(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get token(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get cashDelta(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get managedDelta(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class PoolRegistered extends ethereum.Event { + get params(): PoolRegistered__Params { + return new PoolRegistered__Params(this); + } +} + +export class PoolRegistered__Params { + _event: PoolRegistered; + + constructor(event: PoolRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get poolAddress(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get specialization(): i32 { + return this._event.parameters[2].value.toI32(); + } +} + +export class RelayerApprovalChanged extends ethereum.Event { + get params(): RelayerApprovalChanged__Params { + return new RelayerApprovalChanged__Params(this); + } +} + +export class RelayerApprovalChanged__Params { + _event: RelayerApprovalChanged; + + constructor(event: RelayerApprovalChanged) { + this._event = event; + } + + get relayer(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get sender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get approved(): boolean { + return this._event.parameters[2].value.toBoolean(); + } +} + +export class Swap extends ethereum.Event { + get params(): Swap__Params { + return new Swap__Params(this); + } +} + +export class Swap__Params { + _event: Swap; + + constructor(event: Swap) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountIn(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get amountOut(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class TokensDeregistered extends ethereum.Event { + get params(): TokensDeregistered__Params { + return new TokensDeregistered__Params(this); + } +} + +export class TokensDeregistered__Params { + _event: TokensDeregistered; + + constructor(event: TokensDeregistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } +} + +export class TokensRegistered extends ethereum.Event { + get params(): TokensRegistered__Params { + return new TokensRegistered__Params(this); + } +} + +export class TokensRegistered__Params { + _event: TokensRegistered; + + constructor(event: TokensRegistered) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._event.parameters[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } +} + +export class Vault__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__getPoolResult { + value0: Address; + value1: i32; + + constructor(value0: Address, value1: i32) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + return map; + } +} + +export class Vault__getPoolTokenInfoResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: Address; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: Address) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromAddress(this.value3)); + return map; + } +} + +export class Vault__getPoolTokensResult { + value0: Array
; + value1: Array; + value2: BigInt; + + constructor(value0: Array
, value1: Array, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddressArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Vault__queryBatchSwapInputSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class Vault__queryBatchSwapInputFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class Vault extends ethereum.SmartContract { + static bind(address: Address): Vault { + return new Vault("Vault", address); + } + + WETH(): Address { + let result = super.call("WETH", "WETH():(address)", []); + + return result[0].toAddress(); + } + + try_WETH(): ethereum.CallResult
{ + let result = super.tryCall("WETH", "WETH():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInternalBalance(user: Address, tokens: Array
): Array { + let result = super.call( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + + return result[0].toBigIntArray(); + } + + try_getInternalBalance( + user: Address, + tokens: Array
+ ): ethereum.CallResult> { + let result = super.tryCall( + "getInternalBalance", + "getInternalBalance(address,address[]):(uint256[])", + [ + ethereum.Value.fromAddress(user), + ethereum.Value.fromAddressArray(tokens) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getNextNonce(user: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(user) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(user: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(user)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getPausedState(): Vault__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new Vault__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPool(poolId: Bytes): Vault__getPoolResult { + let result = super.call("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + + return new Vault__getPoolResult(result[0].toAddress(), result[1].toI32()); + } + + try_getPool(poolId: Bytes): ethereum.CallResult { + let result = super.tryCall("getPool", "getPool(bytes32):(address,uint8)", [ + ethereum.Value.fromFixedBytes(poolId) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolResult(value[0].toAddress(), value[1].toI32()) + ); + } + + getPoolTokenInfo( + poolId: Bytes, + token: Address + ): Vault__getPoolTokenInfoResult { + let result = super.call( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + + return new Vault__getPoolTokenInfoResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toAddress() + ); + } + + try_getPoolTokenInfo( + poolId: Bytes, + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokenInfo", + "getPoolTokenInfo(bytes32,address):(uint256,uint256,uint256,address)", + [ethereum.Value.fromFixedBytes(poolId), ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokenInfoResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toAddress() + ) + ); + } + + getPoolTokens(poolId: Bytes): Vault__getPoolTokensResult { + let result = super.call( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + + return new Vault__getPoolTokensResult( + result[0].toAddressArray(), + result[1].toBigIntArray(), + result[2].toBigInt() + ); + } + + try_getPoolTokens( + poolId: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "getPoolTokens", + "getPoolTokens(bytes32):(address[],uint256[],uint256)", + [ethereum.Value.fromFixedBytes(poolId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Vault__getPoolTokensResult( + value[0].toAddressArray(), + value[1].toBigIntArray(), + value[2].toBigInt() + ) + ); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + hasApprovedRelayer(user: Address, relayer: Address): boolean { + let result = super.call( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + + return result[0].toBoolean(); + } + + try_hasApprovedRelayer( + user: Address, + relayer: Address + ): ethereum.CallResult { + let result = super.tryCall( + "hasApprovedRelayer", + "hasApprovedRelayer(address,address):(bool)", + [ethereum.Value.fromAddress(user), ethereum.Value.fromAddress(relayer)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): Array { + let result = super.call( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + + return result[0].toBigIntArray(); + } + + try_queryBatchSwap( + kind: i32, + swaps: Array, + assets: Array
, + funds: Vault__queryBatchSwapInputFundsStruct + ): ethereum.CallResult> { + let result = super.tryCall( + "queryBatchSwap", + "queryBatchSwap(uint8,(bytes32,uint256,uint256,uint256,bytes)[],address[],(address,bool,address,bool)):(int256[])", + [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(kind)), + ethereum.Value.fromTupleArray(swaps), + ethereum.Value.fromAddressArray(assets), + ethereum.Value.fromTuple(funds) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + registerPool(specialization: i32): Bytes { + let result = super.call("registerPool", "registerPool(uint8):(bytes32)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization)) + ]); + + return result[0].toBytes(); + } + + try_registerPool(specialization: i32): ethereum.CallResult { + let result = super.tryCall( + "registerPool", + "registerPool(uint8):(bytes32)", + [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(specialization))] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get authorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get weth(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class BatchSwapCall extends ethereum.Call { + get inputs(): BatchSwapCall__Inputs { + return new BatchSwapCall__Inputs(this); + } + + get outputs(): BatchSwapCall__Outputs { + return new BatchSwapCall__Outputs(this); + } +} + +export class BatchSwapCall__Inputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get kind(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get swaps(): Array { + return this._call.inputValues[1].value.toTupleArray< + BatchSwapCallSwapsStruct + >(); + } + + get assets(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } + + get funds(): BatchSwapCallFundsStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } + + get limits(): Array { + return this._call.inputValues[4].value.toBigIntArray(); + } + + get deadline(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class BatchSwapCall__Outputs { + _call: BatchSwapCall; + + constructor(call: BatchSwapCall) { + this._call = call; + } + + get assetDeltas(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } +} + +export class BatchSwapCallSwapsStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get assetInIndex(): BigInt { + return this[1].toBigInt(); + } + + get assetOutIndex(): BigInt { + return this[2].toBigInt(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get userData(): Bytes { + return this[4].toBytes(); + } +} + +export class BatchSwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class DeregisterTokensCall extends ethereum.Call { + get inputs(): DeregisterTokensCall__Inputs { + return new DeregisterTokensCall__Inputs(this); + } + + get outputs(): DeregisterTokensCall__Outputs { + return new DeregisterTokensCall__Outputs(this); + } +} + +export class DeregisterTokensCall__Inputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } +} + +export class DeregisterTokensCall__Outputs { + _call: DeregisterTokensCall; + + constructor(call: DeregisterTokensCall) { + this._call = call; + } +} + +export class ExitPoolCall extends ethereum.Call { + get inputs(): ExitPoolCall__Inputs { + return new ExitPoolCall__Inputs(this); + } + + get outputs(): ExitPoolCall__Outputs { + return new ExitPoolCall__Outputs(this); + } +} + +export class ExitPoolCall__Inputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): ExitPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class ExitPoolCall__Outputs { + _call: ExitPoolCall; + + constructor(call: ExitPoolCall) { + this._call = call; + } +} + +export class ExitPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get minAmountsOut(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class FlashLoanCall extends ethereum.Call { + get inputs(): FlashLoanCall__Inputs { + return new FlashLoanCall__Inputs(this); + } + + get outputs(): FlashLoanCall__Outputs { + return new FlashLoanCall__Outputs(this); + } +} + +export class FlashLoanCall__Inputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get amounts(): Array { + return this._call.inputValues[2].value.toBigIntArray(); + } + + get userData(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class FlashLoanCall__Outputs { + _call: FlashLoanCall; + + constructor(call: FlashLoanCall) { + this._call = call; + } +} + +export class JoinPoolCall extends ethereum.Call { + get inputs(): JoinPoolCall__Inputs { + return new JoinPoolCall__Inputs(this); + } + + get outputs(): JoinPoolCall__Outputs { + return new JoinPoolCall__Outputs(this); + } +} + +export class JoinPoolCall__Inputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get request(): JoinPoolCallRequestStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class JoinPoolCall__Outputs { + _call: JoinPoolCall; + + constructor(call: JoinPoolCall) { + this._call = call; + } +} + +export class JoinPoolCallRequestStruct extends ethereum.Tuple { + get assets(): Array
{ + return this[0].toAddressArray(); + } + + get maxAmountsIn(): Array { + return this[1].toBigIntArray(); + } + + get userData(): Bytes { + return this[2].toBytes(); + } + + get fromInternalBalance(): boolean { + return this[3].toBoolean(); + } +} + +export class ManagePoolBalanceCall extends ethereum.Call { + get inputs(): ManagePoolBalanceCall__Inputs { + return new ManagePoolBalanceCall__Inputs(this); + } + + get outputs(): ManagePoolBalanceCall__Outputs { + return new ManagePoolBalanceCall__Outputs(this); + } +} + +export class ManagePoolBalanceCall__Inputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManagePoolBalanceCallOpsStruct + >(); + } +} + +export class ManagePoolBalanceCall__Outputs { + _call: ManagePoolBalanceCall; + + constructor(call: ManagePoolBalanceCall) { + this._call = call; + } +} + +export class ManagePoolBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get poolId(): Bytes { + return this[1].toBytes(); + } + + get token(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } +} + +export class ManageUserBalanceCall extends ethereum.Call { + get inputs(): ManageUserBalanceCall__Inputs { + return new ManageUserBalanceCall__Inputs(this); + } + + get outputs(): ManageUserBalanceCall__Outputs { + return new ManageUserBalanceCall__Outputs(this); + } +} + +export class ManageUserBalanceCall__Inputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } + + get ops(): Array { + return this._call.inputValues[0].value.toTupleArray< + ManageUserBalanceCallOpsStruct + >(); + } +} + +export class ManageUserBalanceCall__Outputs { + _call: ManageUserBalanceCall; + + constructor(call: ManageUserBalanceCall) { + this._call = call; + } +} + +export class ManageUserBalanceCallOpsStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get asset(): Address { + return this[1].toAddress(); + } + + get amount(): BigInt { + return this[2].toBigInt(); + } + + get sender(): Address { + return this[3].toAddress(); + } + + get recipient(): Address { + return this[4].toAddress(); + } +} + +export class RegisterPoolCall extends ethereum.Call { + get inputs(): RegisterPoolCall__Inputs { + return new RegisterPoolCall__Inputs(this); + } + + get outputs(): RegisterPoolCall__Outputs { + return new RegisterPoolCall__Outputs(this); + } +} + +export class RegisterPoolCall__Inputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get specialization(): i32 { + return this._call.inputValues[0].value.toI32(); + } +} + +export class RegisterPoolCall__Outputs { + _call: RegisterPoolCall; + + constructor(call: RegisterPoolCall) { + this._call = call; + } + + get value0(): Bytes { + return this._call.outputValues[0].value.toBytes(); + } +} + +export class RegisterTokensCall extends ethereum.Call { + get inputs(): RegisterTokensCall__Inputs { + return new RegisterTokensCall__Inputs(this); + } + + get outputs(): RegisterTokensCall__Outputs { + return new RegisterTokensCall__Outputs(this); + } +} + +export class RegisterTokensCall__Inputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get tokens(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get assetManagers(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } +} + +export class RegisterTokensCall__Outputs { + _call: RegisterTokensCall; + + constructor(call: RegisterTokensCall) { + this._call = call; + } +} + +export class SetAuthorizerCall extends ethereum.Call { + get inputs(): SetAuthorizerCall__Inputs { + return new SetAuthorizerCall__Inputs(this); + } + + get outputs(): SetAuthorizerCall__Outputs { + return new SetAuthorizerCall__Outputs(this); + } +} + +export class SetAuthorizerCall__Inputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } + + get newAuthorizer(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetAuthorizerCall__Outputs { + _call: SetAuthorizerCall; + + constructor(call: SetAuthorizerCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetRelayerApprovalCall extends ethereum.Call { + get inputs(): SetRelayerApprovalCall__Inputs { + return new SetRelayerApprovalCall__Inputs(this); + } + + get outputs(): SetRelayerApprovalCall__Outputs { + return new SetRelayerApprovalCall__Outputs(this); + } +} + +export class SetRelayerApprovalCall__Inputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get relayer(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get approved(): boolean { + return this._call.inputValues[2].value.toBoolean(); + } +} + +export class SetRelayerApprovalCall__Outputs { + _call: SetRelayerApprovalCall; + + constructor(call: SetRelayerApprovalCall) { + this._call = call; + } +} + +export class SwapCall extends ethereum.Call { + get inputs(): SwapCall__Inputs { + return new SwapCall__Inputs(this); + } + + get outputs(): SwapCall__Outputs { + return new SwapCall__Outputs(this); + } +} + +export class SwapCall__Inputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get singleSwap(): SwapCallSingleSwapStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get funds(): SwapCallFundsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get limit(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class SwapCall__Outputs { + _call: SwapCall; + + constructor(call: SwapCall) { + this._call = call; + } + + get amountCalculated(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class SwapCallSingleSwapStruct extends ethereum.Tuple { + get poolId(): Bytes { + return this[0].toBytes(); + } + + get kind(): i32 { + return this[1].toI32(); + } + + get assetIn(): Address { + return this[2].toAddress(); + } + + get assetOut(): Address { + return this[3].toAddress(); + } + + get amount(): BigInt { + return this[4].toBigInt(); + } + + get userData(): Bytes { + return this[5].toBytes(); + } +} + +export class SwapCallFundsStruct extends ethereum.Tuple { + get sender(): Address { + return this[0].toAddress(); + } + + get fromInternalBalance(): boolean { + return this[1].toBoolean(); + } + + get recipient(): Address { + return this[2].toAddress(); + } + + get toInternalBalance(): boolean { + return this[3].toBoolean(); + } +} diff --git a/generated/Vault/WeightedPool.ts b/generated/Vault/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/Vault/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/Vault/WeightedPoolFactory.ts b/generated/Vault/WeightedPoolFactory.ts new file mode 100644 index 000000000..45f633c3e --- /dev/null +++ b/generated/Vault/WeightedPoolFactory.ts @@ -0,0 +1,455 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class FactoryDisabled extends ethereum.Event { + get params(): FactoryDisabled__Params { + return new FactoryDisabled__Params(this); + } +} + +export class FactoryDisabled__Params { + _event: FactoryDisabled; + + constructor(event: FactoryDisabled) { + this._event = event; + } +} + +export class PoolCreated extends ethereum.Event { + get params(): PoolCreated__Params { + return new PoolCreated__Params(this); + } +} + +export class PoolCreated__Params { + _event: PoolCreated; + + constructor(event: PoolCreated) { + this._event = event; + } + + get pool(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class WeightedPoolFactory__getCreationCodeContractsResult { + value0: Address; + value1: Address; + + constructor(value0: Address, value1: Address) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromAddress(this.value1)); + return map; + } +} + +export class WeightedPoolFactory__getPauseConfigurationResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class WeightedPoolFactory extends ethereum.SmartContract { + static bind(address: Address): WeightedPoolFactory { + return new WeightedPoolFactory("WeightedPoolFactory", address); + } + + create( + name: string, + symbol: string, + tokens: Array
, + normalizedWeights: Array, + rateProviders: Array
, + swapFeePercentage: BigInt, + owner: Address + ): Address { + let result = super.call( + "create", + "create(string,string,address[],uint256[],address[],uint256,address):(address)", + [ + ethereum.Value.fromString(name), + ethereum.Value.fromString(symbol), + ethereum.Value.fromAddressArray(tokens), + ethereum.Value.fromUnsignedBigIntArray(normalizedWeights), + ethereum.Value.fromAddressArray(rateProviders), + ethereum.Value.fromUnsignedBigInt(swapFeePercentage), + ethereum.Value.fromAddress(owner) + ] + ); + + return result[0].toAddress(); + } + + try_create( + name: string, + symbol: string, + tokens: Array
, + normalizedWeights: Array, + rateProviders: Array
, + swapFeePercentage: BigInt, + owner: Address + ): ethereum.CallResult
{ + let result = super.tryCall( + "create", + "create(string,string,address[],uint256[],address[],uint256,address):(address)", + [ + ethereum.Value.fromString(name), + ethereum.Value.fromString(symbol), + ethereum.Value.fromAddressArray(tokens), + ethereum.Value.fromUnsignedBigIntArray(normalizedWeights), + ethereum.Value.fromAddressArray(rateProviders), + ethereum.Value.fromUnsignedBigInt(swapFeePercentage), + ethereum.Value.fromAddress(owner) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCreationCode(): Bytes { + let result = super.call("getCreationCode", "getCreationCode():(bytes)", []); + + return result[0].toBytes(); + } + + try_getCreationCode(): ethereum.CallResult { + let result = super.tryCall( + "getCreationCode", + "getCreationCode():(bytes)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getCreationCodeContracts(): WeightedPoolFactory__getCreationCodeContractsResult { + let result = super.call( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + + return new WeightedPoolFactory__getCreationCodeContractsResult( + result[0].toAddress(), + result[1].toAddress() + ); + } + + try_getCreationCodeContracts(): ethereum.CallResult< + WeightedPoolFactory__getCreationCodeContractsResult + > { + let result = super.tryCall( + "getCreationCodeContracts", + "getCreationCodeContracts():(address,address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPoolFactory__getCreationCodeContractsResult( + value[0].toAddress(), + value[1].toAddress() + ) + ); + } + + getPauseConfiguration(): WeightedPoolFactory__getPauseConfigurationResult { + let result = super.call( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + + return new WeightedPoolFactory__getPauseConfigurationResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getPauseConfiguration(): ethereum.CallResult< + WeightedPoolFactory__getPauseConfigurationResult + > { + let result = super.tryCall( + "getPauseConfiguration", + "getPauseConfiguration():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPoolFactory__getPauseConfigurationResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getProtocolFeePercentagesProvider(): Address { + let result = super.call( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeePercentagesProvider(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeePercentagesProvider", + "getProtocolFeePercentagesProvider():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + isDisabled(): boolean { + let result = super.call("isDisabled", "isDisabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_isDisabled(): ethereum.CallResult { + let result = super.tryCall("isDisabled", "isDisabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isPoolFromFactory(pool: Address): boolean { + let result = super.call( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + + return result[0].toBoolean(); + } + + try_isPoolFromFactory(pool: Address): ethereum.CallResult { + let result = super.tryCall( + "isPoolFromFactory", + "isPoolFromFactory(address):(bool)", + [ethereum.Value.fromAddress(pool)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class CreateCall extends ethereum.Call { + get inputs(): CreateCall__Inputs { + return new CreateCall__Inputs(this); + } + + get outputs(): CreateCall__Outputs { + return new CreateCall__Outputs(this); + } +} + +export class CreateCall__Inputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get name(): string { + return this._call.inputValues[0].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[1].value.toString(); + } + + get tokens(): Array
{ + return this._call.inputValues[2].value.toAddressArray(); + } + + get normalizedWeights(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get rateProviders(): Array
{ + return this._call.inputValues[4].value.toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[6].value.toAddress(); + } +} + +export class CreateCall__Outputs { + _call: CreateCall; + + constructor(call: CreateCall) { + this._call = call; + } + + get value0(): Address { + return this._call.outputValues[0].value.toAddress(); + } +} + +export class DisableCall extends ethereum.Call { + get inputs(): DisableCall__Inputs { + return new DisableCall__Inputs(this); + } + + get outputs(): DisableCall__Outputs { + return new DisableCall__Outputs(this); + } +} + +export class DisableCall__Inputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} + +export class DisableCall__Outputs { + _call: DisableCall; + + constructor(call: DisableCall) { + this._call = call; + } +} diff --git a/generated/schema.ts b/generated/schema.ts new file mode 100644 index 000000000..5d74f786b --- /dev/null +++ b/generated/schema.ts @@ -0,0 +1,4126 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + TypedMap, + Entity, + Value, + ValueKind, + store, + Bytes, + BigInt, + BigDecimal +} from "@graphprotocol/graph-ts"; + +export class Balancer extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("poolCount", Value.fromI32(0)); + this.set("totalLiquidity", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapCount", Value.fromBigInt(BigInt.zero())); + this.set("totalSwapVolume", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapFee", Value.fromBigDecimal(BigDecimal.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Balancer entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save Balancer entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("Balancer", id.toString(), this); + } + } + + static load(id: string): Balancer | null { + return changetype(store.get("Balancer", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get poolCount(): i32 { + let value = this.get("poolCount"); + return value!.toI32(); + } + + set poolCount(value: i32) { + this.set("poolCount", Value.fromI32(value)); + } + + get pools(): Array | null { + let value = this.get("pools"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set pools(value: Array | null) { + if (!value) { + this.unset("pools"); + } else { + this.set("pools", Value.fromStringArray(>value)); + } + } + + get totalLiquidity(): BigDecimal { + let value = this.get("totalLiquidity"); + return value!.toBigDecimal(); + } + + set totalLiquidity(value: BigDecimal) { + this.set("totalLiquidity", Value.fromBigDecimal(value)); + } + + get totalSwapCount(): BigInt { + let value = this.get("totalSwapCount"); + return value!.toBigInt(); + } + + set totalSwapCount(value: BigInt) { + this.set("totalSwapCount", Value.fromBigInt(value)); + } + + get totalSwapVolume(): BigDecimal { + let value = this.get("totalSwapVolume"); + return value!.toBigDecimal(); + } + + set totalSwapVolume(value: BigDecimal) { + this.set("totalSwapVolume", Value.fromBigDecimal(value)); + } + + get totalSwapFee(): BigDecimal { + let value = this.get("totalSwapFee"); + return value!.toBigDecimal(); + } + + set totalSwapFee(value: BigDecimal) { + this.set("totalSwapFee", Value.fromBigDecimal(value)); + } +} + +export class Pool extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("address", Value.fromBytes(Bytes.empty())); + this.set("poolTypeVersion", Value.fromI32(0)); + this.set("strategyType", Value.fromI32(0)); + this.set("oracleEnabled", Value.fromBoolean(false)); + this.set("swapEnabled", Value.fromBoolean(false)); + this.set("swapFee", Value.fromBigDecimal(BigDecimal.zero())); + this.set("isPaused", Value.fromBoolean(false)); + this.set("totalSwapVolume", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapFee", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalLiquidity", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalShares", Value.fromBigDecimal(BigDecimal.zero())); + this.set("createTime", Value.fromI32(0)); + this.set("swapsCount", Value.fromBigInt(BigInt.zero())); + this.set("holdersCount", Value.fromBigInt(BigInt.zero())); + this.set("vaultID", Value.fromString("")); + this.set("tokensList", Value.fromBytesArray(new Array(0))); + this.set("mainIndex", Value.fromI32(0)); + this.set("wrappedIndex", Value.fromI32(0)); + this.set("isInRecoveryMode", Value.fromBoolean(false)); + this.set("protocolId", Value.fromI32(0)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Pool entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save Pool entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("Pool", id.toString(), this); + } + } + + static load(id: string): Pool | null { + return changetype(store.get("Pool", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get address(): Bytes { + let value = this.get("address"); + return value!.toBytes(); + } + + set address(value: Bytes) { + this.set("address", Value.fromBytes(value)); + } + + get poolType(): string | null { + let value = this.get("poolType"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set poolType(value: string | null) { + if (!value) { + this.unset("poolType"); + } else { + this.set("poolType", Value.fromString(value)); + } + } + + get poolTypeVersion(): i32 { + let value = this.get("poolTypeVersion"); + return value!.toI32(); + } + + set poolTypeVersion(value: i32) { + this.set("poolTypeVersion", Value.fromI32(value)); + } + + get factory(): Bytes | null { + let value = this.get("factory"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set factory(value: Bytes | null) { + if (!value) { + this.unset("factory"); + } else { + this.set("factory", Value.fromBytes(value)); + } + } + + get strategyType(): i32 { + let value = this.get("strategyType"); + return value!.toI32(); + } + + set strategyType(value: i32) { + this.set("strategyType", Value.fromI32(value)); + } + + get oracleEnabled(): boolean { + let value = this.get("oracleEnabled"); + return value!.toBoolean(); + } + + set oracleEnabled(value: boolean) { + this.set("oracleEnabled", Value.fromBoolean(value)); + } + + get symbol(): string | null { + let value = this.get("symbol"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set symbol(value: string | null) { + if (!value) { + this.unset("symbol"); + } else { + this.set("symbol", Value.fromString(value)); + } + } + + get name(): string | null { + let value = this.get("name"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set name(value: string | null) { + if (!value) { + this.unset("name"); + } else { + this.set("name", Value.fromString(value)); + } + } + + get swapEnabled(): boolean { + let value = this.get("swapEnabled"); + return value!.toBoolean(); + } + + set swapEnabled(value: boolean) { + this.set("swapEnabled", Value.fromBoolean(value)); + } + + get swapFee(): BigDecimal { + let value = this.get("swapFee"); + return value!.toBigDecimal(); + } + + set swapFee(value: BigDecimal) { + this.set("swapFee", Value.fromBigDecimal(value)); + } + + get owner(): Bytes | null { + let value = this.get("owner"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set owner(value: Bytes | null) { + if (!value) { + this.unset("owner"); + } else { + this.set("owner", Value.fromBytes(value)); + } + } + + get isPaused(): boolean { + let value = this.get("isPaused"); + return value!.toBoolean(); + } + + set isPaused(value: boolean) { + this.set("isPaused", Value.fromBoolean(value)); + } + + get totalWeight(): BigDecimal | null { + let value = this.get("totalWeight"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set totalWeight(value: BigDecimal | null) { + if (!value) { + this.unset("totalWeight"); + } else { + this.set("totalWeight", Value.fromBigDecimal(value)); + } + } + + get totalSwapVolume(): BigDecimal { + let value = this.get("totalSwapVolume"); + return value!.toBigDecimal(); + } + + set totalSwapVolume(value: BigDecimal) { + this.set("totalSwapVolume", Value.fromBigDecimal(value)); + } + + get totalSwapFee(): BigDecimal { + let value = this.get("totalSwapFee"); + return value!.toBigDecimal(); + } + + set totalSwapFee(value: BigDecimal) { + this.set("totalSwapFee", Value.fromBigDecimal(value)); + } + + get totalLiquidity(): BigDecimal { + let value = this.get("totalLiquidity"); + return value!.toBigDecimal(); + } + + set totalLiquidity(value: BigDecimal) { + this.set("totalLiquidity", Value.fromBigDecimal(value)); + } + + get totalShares(): BigDecimal { + let value = this.get("totalShares"); + return value!.toBigDecimal(); + } + + set totalShares(value: BigDecimal) { + this.set("totalShares", Value.fromBigDecimal(value)); + } + + get createTime(): i32 { + let value = this.get("createTime"); + return value!.toI32(); + } + + set createTime(value: i32) { + this.set("createTime", Value.fromI32(value)); + } + + get swapsCount(): BigInt { + let value = this.get("swapsCount"); + return value!.toBigInt(); + } + + set swapsCount(value: BigInt) { + this.set("swapsCount", Value.fromBigInt(value)); + } + + get holdersCount(): BigInt { + let value = this.get("holdersCount"); + return value!.toBigInt(); + } + + set holdersCount(value: BigInt) { + this.set("holdersCount", Value.fromBigInt(value)); + } + + get vaultID(): string { + let value = this.get("vaultID"); + return value!.toString(); + } + + set vaultID(value: string) { + this.set("vaultID", Value.fromString(value)); + } + + get tx(): Bytes | null { + let value = this.get("tx"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set tx(value: Bytes | null) { + if (!value) { + this.unset("tx"); + } else { + this.set("tx", Value.fromBytes(value)); + } + } + + get tokensList(): Array { + let value = this.get("tokensList"); + return value!.toBytesArray(); + } + + set tokensList(value: Array) { + this.set("tokensList", Value.fromBytesArray(value)); + } + + get tokens(): Array | null { + let value = this.get("tokens"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set tokens(value: Array | null) { + if (!value) { + this.unset("tokens"); + } else { + this.set("tokens", Value.fromStringArray(>value)); + } + } + + get swaps(): Array | null { + let value = this.get("swaps"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set swaps(value: Array | null) { + if (!value) { + this.unset("swaps"); + } else { + this.set("swaps", Value.fromStringArray(>value)); + } + } + + get shares(): Array | null { + let value = this.get("shares"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set shares(value: Array | null) { + if (!value) { + this.unset("shares"); + } else { + this.set("shares", Value.fromStringArray(>value)); + } + } + + get snapshots(): Array | null { + let value = this.get("snapshots"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set snapshots(value: Array | null) { + if (!value) { + this.unset("snapshots"); + } else { + this.set("snapshots", Value.fromStringArray(>value)); + } + } + + get historicalValues(): Array | null { + let value = this.get("historicalValues"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set historicalValues(value: Array | null) { + if (!value) { + this.unset("historicalValues"); + } else { + this.set("historicalValues", Value.fromStringArray(>value)); + } + } + + get weightUpdates(): Array | null { + let value = this.get("weightUpdates"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set weightUpdates(value: Array | null) { + if (!value) { + this.unset("weightUpdates"); + } else { + this.set("weightUpdates", Value.fromStringArray(>value)); + } + } + + get amp(): BigInt | null { + let value = this.get("amp"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set amp(value: BigInt | null) { + if (!value) { + this.unset("amp"); + } else { + this.set("amp", Value.fromBigInt(value)); + } + } + + get priceRateProviders(): Array | null { + let value = this.get("priceRateProviders"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set priceRateProviders(value: Array | null) { + if (!value) { + this.unset("priceRateProviders"); + } else { + this.set( + "priceRateProviders", + Value.fromStringArray(>value) + ); + } + } + + get principalToken(): Bytes | null { + let value = this.get("principalToken"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set principalToken(value: Bytes | null) { + if (!value) { + this.unset("principalToken"); + } else { + this.set("principalToken", Value.fromBytes(value)); + } + } + + get baseToken(): Bytes | null { + let value = this.get("baseToken"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set baseToken(value: Bytes | null) { + if (!value) { + this.unset("baseToken"); + } else { + this.set("baseToken", Value.fromBytes(value)); + } + } + + get expiryTime(): BigInt | null { + let value = this.get("expiryTime"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set expiryTime(value: BigInt | null) { + if (!value) { + this.unset("expiryTime"); + } else { + this.set("expiryTime", Value.fromBigInt(value)); + } + } + + get unitSeconds(): BigInt | null { + let value = this.get("unitSeconds"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set unitSeconds(value: BigInt | null) { + if (!value) { + this.unset("unitSeconds"); + } else { + this.set("unitSeconds", Value.fromBigInt(value)); + } + } + + get managementFee(): BigDecimal | null { + let value = this.get("managementFee"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set managementFee(value: BigDecimal | null) { + if (!value) { + this.unset("managementFee"); + } else { + this.set("managementFee", Value.fromBigDecimal(value)); + } + } + + get mainIndex(): i32 { + let value = this.get("mainIndex"); + return value!.toI32(); + } + + set mainIndex(value: i32) { + this.set("mainIndex", Value.fromI32(value)); + } + + get wrappedIndex(): i32 { + let value = this.get("wrappedIndex"); + return value!.toI32(); + } + + set wrappedIndex(value: i32) { + this.set("wrappedIndex", Value.fromI32(value)); + } + + get lowerTarget(): BigDecimal | null { + let value = this.get("lowerTarget"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set lowerTarget(value: BigDecimal | null) { + if (!value) { + this.unset("lowerTarget"); + } else { + this.set("lowerTarget", Value.fromBigDecimal(value)); + } + } + + get upperTarget(): BigDecimal | null { + let value = this.get("upperTarget"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set upperTarget(value: BigDecimal | null) { + if (!value) { + this.unset("upperTarget"); + } else { + this.set("upperTarget", Value.fromBigDecimal(value)); + } + } + + get sqrtAlpha(): BigDecimal | null { + let value = this.get("sqrtAlpha"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set sqrtAlpha(value: BigDecimal | null) { + if (!value) { + this.unset("sqrtAlpha"); + } else { + this.set("sqrtAlpha", Value.fromBigDecimal(value)); + } + } + + get sqrtBeta(): BigDecimal | null { + let value = this.get("sqrtBeta"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set sqrtBeta(value: BigDecimal | null) { + if (!value) { + this.unset("sqrtBeta"); + } else { + this.set("sqrtBeta", Value.fromBigDecimal(value)); + } + } + + get root3Alpha(): BigDecimal | null { + let value = this.get("root3Alpha"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set root3Alpha(value: BigDecimal | null) { + if (!value) { + this.unset("root3Alpha"); + } else { + this.set("root3Alpha", Value.fromBigDecimal(value)); + } + } + + get c(): BigDecimal | null { + let value = this.get("c"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set c(value: BigDecimal | null) { + if (!value) { + this.unset("c"); + } else { + this.set("c", Value.fromBigDecimal(value)); + } + } + + get s(): BigDecimal | null { + let value = this.get("s"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set s(value: BigDecimal | null) { + if (!value) { + this.unset("s"); + } else { + this.set("s", Value.fromBigDecimal(value)); + } + } + + get tauAlphaX(): BigDecimal | null { + let value = this.get("tauAlphaX"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set tauAlphaX(value: BigDecimal | null) { + if (!value) { + this.unset("tauAlphaX"); + } else { + this.set("tauAlphaX", Value.fromBigDecimal(value)); + } + } + + get tauAlphaY(): BigDecimal | null { + let value = this.get("tauAlphaY"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set tauAlphaY(value: BigDecimal | null) { + if (!value) { + this.unset("tauAlphaY"); + } else { + this.set("tauAlphaY", Value.fromBigDecimal(value)); + } + } + + get tauBetaX(): BigDecimal | null { + let value = this.get("tauBetaX"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set tauBetaX(value: BigDecimal | null) { + if (!value) { + this.unset("tauBetaX"); + } else { + this.set("tauBetaX", Value.fromBigDecimal(value)); + } + } + + get tauBetaY(): BigDecimal | null { + let value = this.get("tauBetaY"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set tauBetaY(value: BigDecimal | null) { + if (!value) { + this.unset("tauBetaY"); + } else { + this.set("tauBetaY", Value.fromBigDecimal(value)); + } + } + + get u(): BigDecimal | null { + let value = this.get("u"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set u(value: BigDecimal | null) { + if (!value) { + this.unset("u"); + } else { + this.set("u", Value.fromBigDecimal(value)); + } + } + + get v(): BigDecimal | null { + let value = this.get("v"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set v(value: BigDecimal | null) { + if (!value) { + this.unset("v"); + } else { + this.set("v", Value.fromBigDecimal(value)); + } + } + + get w(): BigDecimal | null { + let value = this.get("w"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set w(value: BigDecimal | null) { + if (!value) { + this.unset("w"); + } else { + this.set("w", Value.fromBigDecimal(value)); + } + } + + get z(): BigDecimal | null { + let value = this.get("z"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set z(value: BigDecimal | null) { + if (!value) { + this.unset("z"); + } else { + this.set("z", Value.fromBigDecimal(value)); + } + } + + get dSq(): BigDecimal | null { + let value = this.get("dSq"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set dSq(value: BigDecimal | null) { + if (!value) { + this.unset("dSq"); + } else { + this.set("dSq", Value.fromBigDecimal(value)); + } + } + + get alpha(): BigDecimal | null { + let value = this.get("alpha"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set alpha(value: BigDecimal | null) { + if (!value) { + this.unset("alpha"); + } else { + this.set("alpha", Value.fromBigDecimal(value)); + } + } + + get beta(): BigDecimal | null { + let value = this.get("beta"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set beta(value: BigDecimal | null) { + if (!value) { + this.unset("beta"); + } else { + this.set("beta", Value.fromBigDecimal(value)); + } + } + + get lambda(): BigDecimal | null { + let value = this.get("lambda"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set lambda(value: BigDecimal | null) { + if (!value) { + this.unset("lambda"); + } else { + this.set("lambda", Value.fromBigDecimal(value)); + } + } + + get delta(): BigDecimal | null { + let value = this.get("delta"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set delta(value: BigDecimal | null) { + if (!value) { + this.unset("delta"); + } else { + this.set("delta", Value.fromBigDecimal(value)); + } + } + + get epsilon(): BigDecimal | null { + let value = this.get("epsilon"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set epsilon(value: BigDecimal | null) { + if (!value) { + this.unset("epsilon"); + } else { + this.set("epsilon", Value.fromBigDecimal(value)); + } + } + + get isInRecoveryMode(): boolean { + let value = this.get("isInRecoveryMode"); + return value!.toBoolean(); + } + + set isInRecoveryMode(value: boolean) { + this.set("isInRecoveryMode", Value.fromBoolean(value)); + } + + get protocolSwapFeeCache(): BigDecimal | null { + let value = this.get("protocolSwapFeeCache"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set protocolSwapFeeCache(value: BigDecimal | null) { + if (!value) { + this.unset("protocolSwapFeeCache"); + } else { + this.set("protocolSwapFeeCache", Value.fromBigDecimal(value)); + } + } + + get protocolYieldFeeCache(): BigDecimal | null { + let value = this.get("protocolYieldFeeCache"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set protocolYieldFeeCache(value: BigDecimal | null) { + if (!value) { + this.unset("protocolYieldFeeCache"); + } else { + this.set( + "protocolYieldFeeCache", + Value.fromBigDecimal(value) + ); + } + } + + get protocolAumFeeCache(): BigDecimal | null { + let value = this.get("protocolAumFeeCache"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set protocolAumFeeCache(value: BigDecimal | null) { + if (!value) { + this.unset("protocolAumFeeCache"); + } else { + this.set("protocolAumFeeCache", Value.fromBigDecimal(value)); + } + } + + get protocolId(): i32 { + let value = this.get("protocolId"); + return value!.toI32(); + } + + set protocolId(value: i32) { + this.set("protocolId", Value.fromI32(value)); + } + + get security(): Bytes | null { + let value = this.get("security"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set security(value: Bytes | null) { + if (!value) { + this.unset("security"); + } else { + this.set("security", Value.fromBytes(value)); + } + } + + get currency(): Bytes | null { + let value = this.get("currency"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set currency(value: Bytes | null) { + if (!value) { + this.unset("currency"); + } else { + this.set("currency", Value.fromBytes(value)); + } + } + + get balancerManager(): Bytes | null { + let value = this.get("balancerManager"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set balancerManager(value: Bytes | null) { + if (!value) { + this.unset("balancerManager"); + } else { + this.set("balancerManager", Value.fromBytes(value)); + } + } + + get minimumOrderSize(): BigDecimal | null { + let value = this.get("minimumOrderSize"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set minimumOrderSize(value: BigDecimal | null) { + if (!value) { + this.unset("minimumOrderSize"); + } else { + this.set("minimumOrderSize", Value.fromBigDecimal(value)); + } + } + + get minimumPrice(): BigDecimal | null { + let value = this.get("minimumPrice"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set minimumPrice(value: BigDecimal | null) { + if (!value) { + this.unset("minimumPrice"); + } else { + this.set("minimumPrice", Value.fromBigDecimal(value)); + } + } + + get securityOffered(): BigDecimal | null { + let value = this.get("securityOffered"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set securityOffered(value: BigDecimal | null) { + if (!value) { + this.unset("securityOffered"); + } else { + this.set("securityOffered", Value.fromBigDecimal(value)); + } + } + + get cutoffTime(): BigDecimal | null { + let value = this.get("cutoffTime"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set cutoffTime(value: BigDecimal | null) { + if (!value) { + this.unset("cutoffTime"); + } else { + this.set("cutoffTime", Value.fromBigDecimal(value)); + } + } + + get offeringDocs(): string | null { + let value = this.get("offeringDocs"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set offeringDocs(value: string | null) { + if (!value) { + this.unset("offeringDocs"); + } else { + this.set("offeringDocs", Value.fromString(value)); + } + } + + get primarySubscriptions(): Array | null { + let value = this.get("primarySubscriptions"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set primarySubscriptions(value: Array | null) { + if (!value) { + this.unset("primarySubscriptions"); + } else { + this.set( + "primarySubscriptions", + Value.fromStringArray(>value) + ); + } + } + + get minOrderSize(): BigInt | null { + let value = this.get("minOrderSize"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set minOrderSize(value: BigInt | null) { + if (!value) { + this.unset("minOrderSize"); + } else { + this.set("minOrderSize", Value.fromBigInt(value)); + } + } + + get orderBook(): Bytes | null { + let value = this.get("orderBook"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set orderBook(value: Bytes | null) { + if (!value) { + this.unset("orderBook"); + } else { + this.set("orderBook", Value.fromBytes(value)); + } + } + + get issueManager(): Bytes | null { + let value = this.get("issueManager"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set issueManager(value: Bytes | null) { + if (!value) { + this.unset("issueManager"); + } else { + this.set("issueManager", Value.fromBytes(value)); + } + } + + get secondaryTrades(): Array | null { + let value = this.get("secondaryTrades"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set secondaryTrades(value: Array | null) { + if (!value) { + this.unset("secondaryTrades"); + } else { + this.set("secondaryTrades", Value.fromStringArray(>value)); + } + } + + get orders(): Array | null { + let value = this.get("orders"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set orders(value: Array | null) { + if (!value) { + this.unset("orders"); + } else { + this.set("orders", Value.fromStringArray(>value)); + } + } + + get securityType(): Bytes | null { + let value = this.get("securityType"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set securityType(value: Bytes | null) { + if (!value) { + this.unset("securityType"); + } else { + this.set("securityType", Value.fromBytes(value)); + } + } + + get margin(): BigInt | null { + let value = this.get("margin"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set margin(value: BigInt | null) { + if (!value) { + this.unset("margin"); + } else { + this.set("margin", Value.fromBigInt(value)); + } + } + + get collateral(): BigInt | null { + let value = this.get("collateral"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set collateral(value: BigInt | null) { + if (!value) { + this.unset("collateral"); + } else { + this.set("collateral", Value.fromBigInt(value)); + } + } + + get cficode(): Bytes | null { + let value = this.get("cficode"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set cficode(value: Bytes | null) { + if (!value) { + this.unset("cficode"); + } else { + this.set("cficode", Value.fromBytes(value)); + } + } +} + +export class PrimaryIssues extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pool", Value.fromString("")); + this.set("assetIn", Value.fromString("")); + this.set("assetOut", Value.fromString("")); + this.set("subscription", Value.fromBigDecimal(BigDecimal.zero())); + this.set("investor", Value.fromString("")); + this.set("price", Value.fromBigDecimal(BigDecimal.zero())); + this.set("executionDate", Value.fromBigInt(BigInt.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PrimaryIssues entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save PrimaryIssues entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("PrimaryIssues", id.toString(), this); + } + } + + static load(id: string): PrimaryIssues | null { + return changetype(store.get("PrimaryIssues", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } + + get assetIn(): string { + let value = this.get("assetIn"); + return value!.toString(); + } + + set assetIn(value: string) { + this.set("assetIn", Value.fromString(value)); + } + + get assetOut(): string { + let value = this.get("assetOut"); + return value!.toString(); + } + + set assetOut(value: string) { + this.set("assetOut", Value.fromString(value)); + } + + get subscription(): BigDecimal { + let value = this.get("subscription"); + return value!.toBigDecimal(); + } + + set subscription(value: BigDecimal) { + this.set("subscription", Value.fromBigDecimal(value)); + } + + get investor(): string { + let value = this.get("investor"); + return value!.toString(); + } + + set investor(value: string) { + this.set("investor", Value.fromString(value)); + } + + get price(): BigDecimal { + let value = this.get("price"); + return value!.toBigDecimal(); + } + + set price(value: BigDecimal) { + this.set("price", Value.fromBigDecimal(value)); + } + + get executionDate(): BigInt { + let value = this.get("executionDate"); + return value!.toBigInt(); + } + + set executionDate(value: BigInt) { + this.set("executionDate", Value.fromBigInt(value)); + } +} + +export class SecondaryTrades extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pool", Value.fromString("")); + this.set("orderType", Value.fromBytes(Bytes.empty())); + this.set("price", Value.fromBigDecimal(BigDecimal.zero())); + this.set("currency", Value.fromString("")); + this.set("amount", Value.fromBigDecimal(BigDecimal.zero())); + this.set("executionDate", Value.fromBigInt(BigInt.zero())); + this.set("orderReference", Value.fromBytes(Bytes.empty())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save SecondaryTrades entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save SecondaryTrades entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("SecondaryTrades", id.toString(), this); + } + } + + static load(id: string): SecondaryTrades | null { + return changetype(store.get("SecondaryTrades", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } + + get party(): string | null { + let value = this.get("party"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set party(value: string | null) { + if (!value) { + this.unset("party"); + } else { + this.set("party", Value.fromString(value)); + } + } + + get counterparty(): string | null { + let value = this.get("counterparty"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set counterparty(value: string | null) { + if (!value) { + this.unset("counterparty"); + } else { + this.set("counterparty", Value.fromString(value)); + } + } + + get orderType(): Bytes { + let value = this.get("orderType"); + return value!.toBytes(); + } + + set orderType(value: Bytes) { + this.set("orderType", Value.fromBytes(value)); + } + + get price(): BigDecimal { + let value = this.get("price"); + return value!.toBigDecimal(); + } + + set price(value: BigDecimal) { + this.set("price", Value.fromBigDecimal(value)); + } + + get currency(): string { + let value = this.get("currency"); + return value!.toString(); + } + + set currency(value: string) { + this.set("currency", Value.fromString(value)); + } + + get amount(): BigDecimal { + let value = this.get("amount"); + return value!.toBigDecimal(); + } + + set amount(value: BigDecimal) { + this.set("amount", Value.fromBigDecimal(value)); + } + + get executionDate(): BigInt { + let value = this.get("executionDate"); + return value!.toBigInt(); + } + + set executionDate(value: BigInt) { + this.set("executionDate", Value.fromBigInt(value)); + } + + get orderReference(): Bytes { + let value = this.get("orderReference"); + return value!.toBytes(); + } + + set orderReference(value: Bytes) { + this.set("orderReference", Value.fromBytes(value)); + } +} + +export class SecondaryOrders extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pool", Value.fromString("")); + this.set("tokenIn", Value.fromString("")); + this.set("tokenOut", Value.fromString("")); + this.set("amountOffered", Value.fromBigDecimal(BigDecimal.zero())); + this.set("priceOffered", Value.fromBigDecimal(BigDecimal.zero())); + this.set("orderReference", Value.fromBytes(Bytes.empty())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save SecondaryOrders entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save SecondaryOrders entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("SecondaryOrders", id.toString(), this); + } + } + + static load(id: string): SecondaryOrders | null { + return changetype(store.get("SecondaryOrders", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } + + get creator(): Bytes | null { + let value = this.get("creator"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set creator(value: Bytes | null) { + if (!value) { + this.unset("creator"); + } else { + this.set("creator", Value.fromBytes(value)); + } + } + + get tokenIn(): string { + let value = this.get("tokenIn"); + return value!.toString(); + } + + set tokenIn(value: string) { + this.set("tokenIn", Value.fromString(value)); + } + + get tokenOut(): string { + let value = this.get("tokenOut"); + return value!.toString(); + } + + set tokenOut(value: string) { + this.set("tokenOut", Value.fromString(value)); + } + + get amountOffered(): BigDecimal { + let value = this.get("amountOffered"); + return value!.toBigDecimal(); + } + + set amountOffered(value: BigDecimal) { + this.set("amountOffered", Value.fromBigDecimal(value)); + } + + get priceOffered(): BigDecimal { + let value = this.get("priceOffered"); + return value!.toBigDecimal(); + } + + set priceOffered(value: BigDecimal) { + this.set("priceOffered", Value.fromBigDecimal(value)); + } + + get timestamp(): BigInt | null { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt | null) { + if (!value) { + this.unset("timestamp"); + } else { + this.set("timestamp", Value.fromBigInt(value)); + } + } + + get orderReference(): Bytes { + let value = this.get("orderReference"); + return value!.toBytes(); + } + + set orderReference(value: Bytes) { + this.set("orderReference", Value.fromBytes(value)); + } +} + +export class MarginOrders extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pool", Value.fromString("")); + this.set("tokenIn", Value.fromString("")); + this.set("tokenOut", Value.fromString("")); + this.set("amountOffered", Value.fromBigDecimal(BigDecimal.zero())); + this.set("priceOffered", Value.fromBigDecimal(BigDecimal.zero())); + this.set("stoplossPrice", Value.fromBigDecimal(BigDecimal.zero())); + this.set("orderReference", Value.fromBytes(Bytes.empty())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save MarginOrders entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save MarginOrders entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("MarginOrders", id.toString(), this); + } + } + + static load(id: string): MarginOrders | null { + return changetype(store.get("MarginOrders", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } + + get creator(): Bytes | null { + let value = this.get("creator"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set creator(value: Bytes | null) { + if (!value) { + this.unset("creator"); + } else { + this.set("creator", Value.fromBytes(value)); + } + } + + get tokenIn(): string { + let value = this.get("tokenIn"); + return value!.toString(); + } + + set tokenIn(value: string) { + this.set("tokenIn", Value.fromString(value)); + } + + get tokenOut(): string { + let value = this.get("tokenOut"); + return value!.toString(); + } + + set tokenOut(value: string) { + this.set("tokenOut", Value.fromString(value)); + } + + get amountOffered(): BigDecimal { + let value = this.get("amountOffered"); + return value!.toBigDecimal(); + } + + set amountOffered(value: BigDecimal) { + this.set("amountOffered", Value.fromBigDecimal(value)); + } + + get priceOffered(): BigDecimal { + let value = this.get("priceOffered"); + return value!.toBigDecimal(); + } + + set priceOffered(value: BigDecimal) { + this.set("priceOffered", Value.fromBigDecimal(value)); + } + + get stoplossPrice(): BigDecimal { + let value = this.get("stoplossPrice"); + return value!.toBigDecimal(); + } + + set stoplossPrice(value: BigDecimal) { + this.set("stoplossPrice", Value.fromBigDecimal(value)); + } + + get timestamp(): BigInt | null { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set timestamp(value: BigInt | null) { + if (!value) { + this.unset("timestamp"); + } else { + this.set("timestamp", Value.fromBigInt(value)); + } + } + + get orderReference(): Bytes { + let value = this.get("orderReference"); + return value!.toBytes(); + } + + set orderReference(value: Bytes) { + this.set("orderReference", Value.fromBytes(value)); + } +} + +export class PoolContract extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pool", Value.fromString("")); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PoolContract entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save PoolContract entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("PoolContract", id.toString(), this); + } + } + + static load(id: string): PoolContract | null { + return changetype(store.get("PoolContract", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } +} + +export class PoolToken extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("token", Value.fromString("")); + this.set("assetManager", Value.fromBytes(Bytes.empty())); + this.set("symbol", Value.fromString("")); + this.set("name", Value.fromString("")); + this.set("decimals", Value.fromI32(0)); + this.set("index", Value.fromI32(0)); + this.set("address", Value.fromString("")); + this.set("priceRate", Value.fromBigDecimal(BigDecimal.zero())); + this.set("balance", Value.fromBigDecimal(BigDecimal.zero())); + this.set("cashBalance", Value.fromBigDecimal(BigDecimal.zero())); + this.set("managedBalance", Value.fromBigDecimal(BigDecimal.zero())); + this.set("isExemptFromYieldProtocolFee", Value.fromBoolean(false)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PoolToken entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save PoolToken entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("PoolToken", id.toString(), this); + } + } + + static load(id: string): PoolToken | null { + return changetype(store.get("PoolToken", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get poolId(): string | null { + let value = this.get("poolId"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set poolId(value: string | null) { + if (!value) { + this.unset("poolId"); + } else { + this.set("poolId", Value.fromString(value)); + } + } + + get token(): string { + let value = this.get("token"); + return value!.toString(); + } + + set token(value: string) { + this.set("token", Value.fromString(value)); + } + + get assetManager(): Bytes { + let value = this.get("assetManager"); + return value!.toBytes(); + } + + set assetManager(value: Bytes) { + this.set("assetManager", Value.fromBytes(value)); + } + + get symbol(): string { + let value = this.get("symbol"); + return value!.toString(); + } + + set symbol(value: string) { + this.set("symbol", Value.fromString(value)); + } + + get name(): string { + let value = this.get("name"); + return value!.toString(); + } + + set name(value: string) { + this.set("name", Value.fromString(value)); + } + + get decimals(): i32 { + let value = this.get("decimals"); + return value!.toI32(); + } + + set decimals(value: i32) { + this.set("decimals", Value.fromI32(value)); + } + + get index(): i32 { + let value = this.get("index"); + return value!.toI32(); + } + + set index(value: i32) { + this.set("index", Value.fromI32(value)); + } + + get address(): string { + let value = this.get("address"); + return value!.toString(); + } + + set address(value: string) { + this.set("address", Value.fromString(value)); + } + + get priceRate(): BigDecimal { + let value = this.get("priceRate"); + return value!.toBigDecimal(); + } + + set priceRate(value: BigDecimal) { + this.set("priceRate", Value.fromBigDecimal(value)); + } + + get balance(): BigDecimal { + let value = this.get("balance"); + return value!.toBigDecimal(); + } + + set balance(value: BigDecimal) { + this.set("balance", Value.fromBigDecimal(value)); + } + + get cashBalance(): BigDecimal { + let value = this.get("cashBalance"); + return value!.toBigDecimal(); + } + + set cashBalance(value: BigDecimal) { + this.set("cashBalance", Value.fromBigDecimal(value)); + } + + get managedBalance(): BigDecimal { + let value = this.get("managedBalance"); + return value!.toBigDecimal(); + } + + set managedBalance(value: BigDecimal) { + this.set("managedBalance", Value.fromBigDecimal(value)); + } + + get managements(): Array | null { + let value = this.get("managements"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set managements(value: Array | null) { + if (!value) { + this.unset("managements"); + } else { + this.set("managements", Value.fromStringArray(>value)); + } + } + + get weight(): BigDecimal | null { + let value = this.get("weight"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set weight(value: BigDecimal | null) { + if (!value) { + this.unset("weight"); + } else { + this.set("weight", Value.fromBigDecimal(value)); + } + } + + get isExemptFromYieldProtocolFee(): boolean { + let value = this.get("isExemptFromYieldProtocolFee"); + return value!.toBoolean(); + } + + set isExemptFromYieldProtocolFee(value: boolean) { + this.set("isExemptFromYieldProtocolFee", Value.fromBoolean(value)); + } +} + +export class PriceRateProvider extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("poolId", Value.fromString("")); + this.set("token", Value.fromString("")); + this.set("address", Value.fromBytes(Bytes.empty())); + this.set("lastCached", Value.fromI32(0)); + this.set("cacheDuration", Value.fromI32(0)); + this.set("cacheExpiry", Value.fromI32(0)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PriceRateProvider entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save PriceRateProvider entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("PriceRateProvider", id.toString(), this); + } + } + + static load(id: string): PriceRateProvider | null { + return changetype( + store.get("PriceRateProvider", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get token(): string { + let value = this.get("token"); + return value!.toString(); + } + + set token(value: string) { + this.set("token", Value.fromString(value)); + } + + get address(): Bytes { + let value = this.get("address"); + return value!.toBytes(); + } + + set address(value: Bytes) { + this.set("address", Value.fromBytes(value)); + } + + get rate(): BigDecimal | null { + let value = this.get("rate"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set rate(value: BigDecimal | null) { + if (!value) { + this.unset("rate"); + } else { + this.set("rate", Value.fromBigDecimal(value)); + } + } + + get lastCached(): i32 { + let value = this.get("lastCached"); + return value!.toI32(); + } + + set lastCached(value: i32) { + this.set("lastCached", Value.fromI32(value)); + } + + get cacheDuration(): i32 { + let value = this.get("cacheDuration"); + return value!.toI32(); + } + + set cacheDuration(value: i32) { + this.set("cacheDuration", Value.fromI32(value)); + } + + get cacheExpiry(): i32 { + let value = this.get("cacheExpiry"); + return value!.toI32(); + } + + set cacheExpiry(value: i32) { + this.set("cacheExpiry", Value.fromI32(value)); + } +} + +export class PoolShare extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("userAddress", Value.fromString("")); + this.set("poolId", Value.fromString("")); + this.set("balance", Value.fromBigDecimal(BigDecimal.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PoolShare entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save PoolShare entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("PoolShare", id.toString(), this); + } + } + + static load(id: string): PoolShare | null { + return changetype(store.get("PoolShare", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get userAddress(): string { + let value = this.get("userAddress"); + return value!.toString(); + } + + set userAddress(value: string) { + this.set("userAddress", Value.fromString(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get balance(): BigDecimal { + let value = this.get("balance"); + return value!.toBigDecimal(); + } + + set balance(value: BigDecimal) { + this.set("balance", Value.fromBigDecimal(value)); + } +} + +export class User extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save User entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save User entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("User", id.toString(), this); + } + } + + static load(id: string): User | null { + return changetype(store.get("User", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get sharesOwned(): Array | null { + let value = this.get("sharesOwned"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set sharesOwned(value: Array | null) { + if (!value) { + this.unset("sharesOwned"); + } else { + this.set("sharesOwned", Value.fromStringArray(>value)); + } + } + + get swaps(): Array | null { + let value = this.get("swaps"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set swaps(value: Array | null) { + if (!value) { + this.unset("swaps"); + } else { + this.set("swaps", Value.fromStringArray(>value)); + } + } + + get userInternalBalances(): Array | null { + let value = this.get("userInternalBalances"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toStringArray(); + } + } + + set userInternalBalances(value: Array | null) { + if (!value) { + this.unset("userInternalBalances"); + } else { + this.set( + "userInternalBalances", + Value.fromStringArray(>value) + ); + } + } +} + +export class UserInternalBalance extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("token", Value.fromBytes(Bytes.empty())); + this.set("balance", Value.fromBigDecimal(BigDecimal.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save UserInternalBalance entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save UserInternalBalance entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("UserInternalBalance", id.toString(), this); + } + } + + static load(id: string): UserInternalBalance | null { + return changetype( + store.get("UserInternalBalance", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get userAddress(): string | null { + let value = this.get("userAddress"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set userAddress(value: string | null) { + if (!value) { + this.unset("userAddress"); + } else { + this.set("userAddress", Value.fromString(value)); + } + } + + get token(): Bytes { + let value = this.get("token"); + return value!.toBytes(); + } + + set token(value: Bytes) { + this.set("token", Value.fromBytes(value)); + } + + get balance(): BigDecimal { + let value = this.get("balance"); + return value!.toBigDecimal(); + } + + set balance(value: BigDecimal) { + this.set("balance", Value.fromBigDecimal(value)); + } +} + +export class GradualWeightUpdate extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("poolId", Value.fromString("")); + this.set("scheduledTimestamp", Value.fromI32(0)); + this.set("startTimestamp", Value.fromBigInt(BigInt.zero())); + this.set("endTimestamp", Value.fromBigInt(BigInt.zero())); + this.set("startWeights", Value.fromBigIntArray(new Array(0))); + this.set("endWeights", Value.fromBigIntArray(new Array(0))); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save GradualWeightUpdate entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save GradualWeightUpdate entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("GradualWeightUpdate", id.toString(), this); + } + } + + static load(id: string): GradualWeightUpdate | null { + return changetype( + store.get("GradualWeightUpdate", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get scheduledTimestamp(): i32 { + let value = this.get("scheduledTimestamp"); + return value!.toI32(); + } + + set scheduledTimestamp(value: i32) { + this.set("scheduledTimestamp", Value.fromI32(value)); + } + + get startTimestamp(): BigInt { + let value = this.get("startTimestamp"); + return value!.toBigInt(); + } + + set startTimestamp(value: BigInt) { + this.set("startTimestamp", Value.fromBigInt(value)); + } + + get endTimestamp(): BigInt { + let value = this.get("endTimestamp"); + return value!.toBigInt(); + } + + set endTimestamp(value: BigInt) { + this.set("endTimestamp", Value.fromBigInt(value)); + } + + get startWeights(): Array { + let value = this.get("startWeights"); + return value!.toBigIntArray(); + } + + set startWeights(value: Array) { + this.set("startWeights", Value.fromBigIntArray(value)); + } + + get endWeights(): Array { + let value = this.get("endWeights"); + return value!.toBigIntArray(); + } + + set endWeights(value: Array) { + this.set("endWeights", Value.fromBigIntArray(value)); + } +} + +export class AmpUpdate extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("poolId", Value.fromString("")); + this.set("scheduledTimestamp", Value.fromI32(0)); + this.set("startTimestamp", Value.fromBigInt(BigInt.zero())); + this.set("endTimestamp", Value.fromBigInt(BigInt.zero())); + this.set("startAmp", Value.fromBigInt(BigInt.zero())); + this.set("endAmp", Value.fromBigInt(BigInt.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save AmpUpdate entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save AmpUpdate entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("AmpUpdate", id.toString(), this); + } + } + + static load(id: string): AmpUpdate | null { + return changetype(store.get("AmpUpdate", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get scheduledTimestamp(): i32 { + let value = this.get("scheduledTimestamp"); + return value!.toI32(); + } + + set scheduledTimestamp(value: i32) { + this.set("scheduledTimestamp", Value.fromI32(value)); + } + + get startTimestamp(): BigInt { + let value = this.get("startTimestamp"); + return value!.toBigInt(); + } + + set startTimestamp(value: BigInt) { + this.set("startTimestamp", Value.fromBigInt(value)); + } + + get endTimestamp(): BigInt { + let value = this.get("endTimestamp"); + return value!.toBigInt(); + } + + set endTimestamp(value: BigInt) { + this.set("endTimestamp", Value.fromBigInt(value)); + } + + get startAmp(): BigInt { + let value = this.get("startAmp"); + return value!.toBigInt(); + } + + set startAmp(value: BigInt) { + this.set("startAmp", Value.fromBigInt(value)); + } + + get endAmp(): BigInt { + let value = this.get("endAmp"); + return value!.toBigInt(); + } + + set endAmp(value: BigInt) { + this.set("endAmp", Value.fromBigInt(value)); + } +} + +export class SwapFeeUpdate extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pool", Value.fromString("")); + this.set("scheduledTimestamp", Value.fromI32(0)); + this.set("startTimestamp", Value.fromBigInt(BigInt.zero())); + this.set("endTimestamp", Value.fromBigInt(BigInt.zero())); + this.set("startSwapFeePercentage", Value.fromBigDecimal(BigDecimal.zero())); + this.set("endSwapFeePercentage", Value.fromBigDecimal(BigDecimal.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save SwapFeeUpdate entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save SwapFeeUpdate entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("SwapFeeUpdate", id.toString(), this); + } + } + + static load(id: string): SwapFeeUpdate | null { + return changetype(store.get("SwapFeeUpdate", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } + + get scheduledTimestamp(): i32 { + let value = this.get("scheduledTimestamp"); + return value!.toI32(); + } + + set scheduledTimestamp(value: i32) { + this.set("scheduledTimestamp", Value.fromI32(value)); + } + + get startTimestamp(): BigInt { + let value = this.get("startTimestamp"); + return value!.toBigInt(); + } + + set startTimestamp(value: BigInt) { + this.set("startTimestamp", Value.fromBigInt(value)); + } + + get endTimestamp(): BigInt { + let value = this.get("endTimestamp"); + return value!.toBigInt(); + } + + set endTimestamp(value: BigInt) { + this.set("endTimestamp", Value.fromBigInt(value)); + } + + get startSwapFeePercentage(): BigDecimal { + let value = this.get("startSwapFeePercentage"); + return value!.toBigDecimal(); + } + + set startSwapFeePercentage(value: BigDecimal) { + this.set("startSwapFeePercentage", Value.fromBigDecimal(value)); + } + + get endSwapFeePercentage(): BigDecimal { + let value = this.get("endSwapFeePercentage"); + return value!.toBigDecimal(); + } + + set endSwapFeePercentage(value: BigDecimal) { + this.set("endSwapFeePercentage", Value.fromBigDecimal(value)); + } +} + +export class Swap extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("caller", Value.fromBytes(Bytes.empty())); + this.set("tokenIn", Value.fromBytes(Bytes.empty())); + this.set("tokenInSym", Value.fromString("")); + this.set("tokenOut", Value.fromBytes(Bytes.empty())); + this.set("tokenOutSym", Value.fromString("")); + this.set("tokenAmountIn", Value.fromBigDecimal(BigDecimal.zero())); + this.set("tokenAmountOut", Value.fromBigDecimal(BigDecimal.zero())); + this.set("valueUSD", Value.fromBigDecimal(BigDecimal.zero())); + this.set("poolId", Value.fromString("")); + this.set("userAddress", Value.fromString("")); + this.set("timestamp", Value.fromI32(0)); + this.set("tx", Value.fromBytes(Bytes.empty())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Swap entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save Swap entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("Swap", id.toString(), this); + } + } + + static load(id: string): Swap | null { + return changetype(store.get("Swap", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get caller(): Bytes { + let value = this.get("caller"); + return value!.toBytes(); + } + + set caller(value: Bytes) { + this.set("caller", Value.fromBytes(value)); + } + + get tokenIn(): Bytes { + let value = this.get("tokenIn"); + return value!.toBytes(); + } + + set tokenIn(value: Bytes) { + this.set("tokenIn", Value.fromBytes(value)); + } + + get tokenInSym(): string { + let value = this.get("tokenInSym"); + return value!.toString(); + } + + set tokenInSym(value: string) { + this.set("tokenInSym", Value.fromString(value)); + } + + get tokenOut(): Bytes { + let value = this.get("tokenOut"); + return value!.toBytes(); + } + + set tokenOut(value: Bytes) { + this.set("tokenOut", Value.fromBytes(value)); + } + + get tokenOutSym(): string { + let value = this.get("tokenOutSym"); + return value!.toString(); + } + + set tokenOutSym(value: string) { + this.set("tokenOutSym", Value.fromString(value)); + } + + get tokenAmountIn(): BigDecimal { + let value = this.get("tokenAmountIn"); + return value!.toBigDecimal(); + } + + set tokenAmountIn(value: BigDecimal) { + this.set("tokenAmountIn", Value.fromBigDecimal(value)); + } + + get tokenAmountOut(): BigDecimal { + let value = this.get("tokenAmountOut"); + return value!.toBigDecimal(); + } + + set tokenAmountOut(value: BigDecimal) { + this.set("tokenAmountOut", Value.fromBigDecimal(value)); + } + + get valueUSD(): BigDecimal { + let value = this.get("valueUSD"); + return value!.toBigDecimal(); + } + + set valueUSD(value: BigDecimal) { + this.set("valueUSD", Value.fromBigDecimal(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get userAddress(): string { + let value = this.get("userAddress"); + return value!.toString(); + } + + set userAddress(value: string) { + this.set("userAddress", Value.fromString(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } + + get tx(): Bytes { + let value = this.get("tx"); + return value!.toBytes(); + } + + set tx(value: Bytes) { + this.set("tx", Value.fromBytes(value)); + } +} + +export class JoinExit extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("type", Value.fromString("")); + this.set("sender", Value.fromBytes(Bytes.empty())); + this.set("amounts", Value.fromBigDecimalArray(new Array(0))); + this.set("pool", Value.fromString("")); + this.set("user", Value.fromString("")); + this.set("timestamp", Value.fromI32(0)); + this.set("tx", Value.fromBytes(Bytes.empty())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save JoinExit entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save JoinExit entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("JoinExit", id.toString(), this); + } + } + + static load(id: string): JoinExit | null { + return changetype(store.get("JoinExit", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get type(): string { + let value = this.get("type"); + return value!.toString(); + } + + set type(value: string) { + this.set("type", Value.fromString(value)); + } + + get sender(): Bytes { + let value = this.get("sender"); + return value!.toBytes(); + } + + set sender(value: Bytes) { + this.set("sender", Value.fromBytes(value)); + } + + get amounts(): Array { + let value = this.get("amounts"); + return value!.toBigDecimalArray(); + } + + set amounts(value: Array) { + this.set("amounts", Value.fromBigDecimalArray(value)); + } + + get valueUSD(): BigDecimal | null { + let value = this.get("valueUSD"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set valueUSD(value: BigDecimal | null) { + if (!value) { + this.unset("valueUSD"); + } else { + this.set("valueUSD", Value.fromBigDecimal(value)); + } + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } + + get user(): string { + let value = this.get("user"); + return value!.toString(); + } + + set user(value: string) { + this.set("user", Value.fromString(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } + + get tx(): Bytes { + let value = this.get("tx"); + return value!.toBytes(); + } + + set tx(value: Bytes) { + this.set("tx", Value.fromBytes(value)); + } +} + +export class LatestPrice extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("asset", Value.fromBytes(Bytes.empty())); + this.set("pricingAsset", Value.fromBytes(Bytes.empty())); + this.set("poolId", Value.fromString("")); + this.set("price", Value.fromBigDecimal(BigDecimal.zero())); + this.set("block", Value.fromBigInt(BigInt.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save LatestPrice entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save LatestPrice entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("LatestPrice", id.toString(), this); + } + } + + static load(id: string): LatestPrice | null { + return changetype(store.get("LatestPrice", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get asset(): Bytes { + let value = this.get("asset"); + return value!.toBytes(); + } + + set asset(value: Bytes) { + this.set("asset", Value.fromBytes(value)); + } + + get pricingAsset(): Bytes { + let value = this.get("pricingAsset"); + return value!.toBytes(); + } + + set pricingAsset(value: Bytes) { + this.set("pricingAsset", Value.fromBytes(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get price(): BigDecimal { + let value = this.get("price"); + return value!.toBigDecimal(); + } + + set price(value: BigDecimal) { + this.set("price", Value.fromBigDecimal(value)); + } + + get block(): BigInt { + let value = this.get("block"); + return value!.toBigInt(); + } + + set block(value: BigInt) { + this.set("block", Value.fromBigInt(value)); + } +} + +export class PoolHistoricalLiquidity extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("poolId", Value.fromString("")); + this.set("poolTotalShares", Value.fromBigDecimal(BigDecimal.zero())); + this.set("poolLiquidity", Value.fromBigDecimal(BigDecimal.zero())); + this.set("poolShareValue", Value.fromBigDecimal(BigDecimal.zero())); + this.set("pricingAsset", Value.fromBytes(Bytes.empty())); + this.set("block", Value.fromBigInt(BigInt.zero())); + } + + save(): void { + let id = this.get("id"); + assert( + id != null, + "Cannot save PoolHistoricalLiquidity entity without an ID" + ); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save PoolHistoricalLiquidity entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("PoolHistoricalLiquidity", id.toString(), this); + } + } + + static load(id: string): PoolHistoricalLiquidity | null { + return changetype( + store.get("PoolHistoricalLiquidity", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get poolTotalShares(): BigDecimal { + let value = this.get("poolTotalShares"); + return value!.toBigDecimal(); + } + + set poolTotalShares(value: BigDecimal) { + this.set("poolTotalShares", Value.fromBigDecimal(value)); + } + + get poolLiquidity(): BigDecimal { + let value = this.get("poolLiquidity"); + return value!.toBigDecimal(); + } + + set poolLiquidity(value: BigDecimal) { + this.set("poolLiquidity", Value.fromBigDecimal(value)); + } + + get poolShareValue(): BigDecimal { + let value = this.get("poolShareValue"); + return value!.toBigDecimal(); + } + + set poolShareValue(value: BigDecimal) { + this.set("poolShareValue", Value.fromBigDecimal(value)); + } + + get pricingAsset(): Bytes { + let value = this.get("pricingAsset"); + return value!.toBytes(); + } + + set pricingAsset(value: Bytes) { + this.set("pricingAsset", Value.fromBytes(value)); + } + + get block(): BigInt { + let value = this.get("block"); + return value!.toBigInt(); + } + + set block(value: BigInt) { + this.set("block", Value.fromBigInt(value)); + } +} + +export class TokenPrice extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("poolId", Value.fromString("")); + this.set("asset", Value.fromBytes(Bytes.empty())); + this.set("amount", Value.fromBigDecimal(BigDecimal.zero())); + this.set("pricingAsset", Value.fromBytes(Bytes.empty())); + this.set("price", Value.fromBigDecimal(BigDecimal.zero())); + this.set("block", Value.fromBigInt(BigInt.zero())); + this.set("timestamp", Value.fromI32(0)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save TokenPrice entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save TokenPrice entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("TokenPrice", id.toString(), this); + } + } + + static load(id: string): TokenPrice | null { + return changetype(store.get("TokenPrice", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get poolId(): string { + let value = this.get("poolId"); + return value!.toString(); + } + + set poolId(value: string) { + this.set("poolId", Value.fromString(value)); + } + + get asset(): Bytes { + let value = this.get("asset"); + return value!.toBytes(); + } + + set asset(value: Bytes) { + this.set("asset", Value.fromBytes(value)); + } + + get amount(): BigDecimal { + let value = this.get("amount"); + return value!.toBigDecimal(); + } + + set amount(value: BigDecimal) { + this.set("amount", Value.fromBigDecimal(value)); + } + + get pricingAsset(): Bytes { + let value = this.get("pricingAsset"); + return value!.toBytes(); + } + + set pricingAsset(value: Bytes) { + this.set("pricingAsset", Value.fromBytes(value)); + } + + get price(): BigDecimal { + let value = this.get("price"); + return value!.toBigDecimal(); + } + + set price(value: BigDecimal) { + this.set("price", Value.fromBigDecimal(value)); + } + + get block(): BigInt { + let value = this.get("block"); + return value!.toBigInt(); + } + + set block(value: BigInt) { + this.set("block", Value.fromBigInt(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } +} + +export class ManagementOperation extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("type", Value.fromString("")); + this.set("cashDelta", Value.fromBigDecimal(BigDecimal.zero())); + this.set("managedDelta", Value.fromBigDecimal(BigDecimal.zero())); + this.set("poolTokenId", Value.fromString("")); + this.set("timestamp", Value.fromI32(0)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save ManagementOperation entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save ManagementOperation entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("ManagementOperation", id.toString(), this); + } + } + + static load(id: string): ManagementOperation | null { + return changetype( + store.get("ManagementOperation", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get type(): string { + let value = this.get("type"); + return value!.toString(); + } + + set type(value: string) { + this.set("type", Value.fromString(value)); + } + + get cashDelta(): BigDecimal { + let value = this.get("cashDelta"); + return value!.toBigDecimal(); + } + + set cashDelta(value: BigDecimal) { + this.set("cashDelta", Value.fromBigDecimal(value)); + } + + get managedDelta(): BigDecimal { + let value = this.get("managedDelta"); + return value!.toBigDecimal(); + } + + set managedDelta(value: BigDecimal) { + this.set("managedDelta", Value.fromBigDecimal(value)); + } + + get poolTokenId(): string { + let value = this.get("poolTokenId"); + return value!.toString(); + } + + set poolTokenId(value: string) { + this.set("poolTokenId", Value.fromString(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } +} + +export class PoolSnapshot extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pool", Value.fromString("")); + this.set("amounts", Value.fromBigDecimalArray(new Array(0))); + this.set("totalShares", Value.fromBigDecimal(BigDecimal.zero())); + this.set("swapVolume", Value.fromBigDecimal(BigDecimal.zero())); + this.set("swapFees", Value.fromBigDecimal(BigDecimal.zero())); + this.set("liquidity", Value.fromBigDecimal(BigDecimal.zero())); + this.set("swapsCount", Value.fromBigInt(BigInt.zero())); + this.set("holdersCount", Value.fromBigInt(BigInt.zero())); + this.set("timestamp", Value.fromI32(0)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PoolSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save PoolSnapshot entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("PoolSnapshot", id.toString(), this); + } + } + + static load(id: string): PoolSnapshot | null { + return changetype(store.get("PoolSnapshot", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + return value!.toString(); + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } + + get amounts(): Array { + let value = this.get("amounts"); + return value!.toBigDecimalArray(); + } + + set amounts(value: Array) { + this.set("amounts", Value.fromBigDecimalArray(value)); + } + + get totalShares(): BigDecimal { + let value = this.get("totalShares"); + return value!.toBigDecimal(); + } + + set totalShares(value: BigDecimal) { + this.set("totalShares", Value.fromBigDecimal(value)); + } + + get swapVolume(): BigDecimal { + let value = this.get("swapVolume"); + return value!.toBigDecimal(); + } + + set swapVolume(value: BigDecimal) { + this.set("swapVolume", Value.fromBigDecimal(value)); + } + + get swapFees(): BigDecimal { + let value = this.get("swapFees"); + return value!.toBigDecimal(); + } + + set swapFees(value: BigDecimal) { + this.set("swapFees", Value.fromBigDecimal(value)); + } + + get liquidity(): BigDecimal { + let value = this.get("liquidity"); + return value!.toBigDecimal(); + } + + set liquidity(value: BigDecimal) { + this.set("liquidity", Value.fromBigDecimal(value)); + } + + get swapsCount(): BigInt { + let value = this.get("swapsCount"); + return value!.toBigInt(); + } + + set swapsCount(value: BigInt) { + this.set("swapsCount", Value.fromBigInt(value)); + } + + get holdersCount(): BigInt { + let value = this.get("holdersCount"); + return value!.toBigInt(); + } + + set holdersCount(value: BigInt) { + this.set("holdersCount", Value.fromBigInt(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } +} + +export class Token extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("decimals", Value.fromI32(0)); + this.set("address", Value.fromString("")); + this.set("totalBalanceUSD", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalBalanceNotional", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalVolumeUSD", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalVolumeNotional", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapCount", Value.fromBigInt(BigInt.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save Token entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save Token entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("Token", id.toString(), this); + } + } + + static load(id: string): Token | null { + return changetype(store.get("Token", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get symbol(): string | null { + let value = this.get("symbol"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set symbol(value: string | null) { + if (!value) { + this.unset("symbol"); + } else { + this.set("symbol", Value.fromString(value)); + } + } + + get name(): string | null { + let value = this.get("name"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set name(value: string | null) { + if (!value) { + this.unset("name"); + } else { + this.set("name", Value.fromString(value)); + } + } + + get decimals(): i32 { + let value = this.get("decimals"); + return value!.toI32(); + } + + set decimals(value: i32) { + this.set("decimals", Value.fromI32(value)); + } + + get address(): string { + let value = this.get("address"); + return value!.toString(); + } + + set address(value: string) { + this.set("address", Value.fromString(value)); + } + + get totalBalanceUSD(): BigDecimal { + let value = this.get("totalBalanceUSD"); + return value!.toBigDecimal(); + } + + set totalBalanceUSD(value: BigDecimal) { + this.set("totalBalanceUSD", Value.fromBigDecimal(value)); + } + + get totalBalanceNotional(): BigDecimal { + let value = this.get("totalBalanceNotional"); + return value!.toBigDecimal(); + } + + set totalBalanceNotional(value: BigDecimal) { + this.set("totalBalanceNotional", Value.fromBigDecimal(value)); + } + + get totalVolumeUSD(): BigDecimal { + let value = this.get("totalVolumeUSD"); + return value!.toBigDecimal(); + } + + set totalVolumeUSD(value: BigDecimal) { + this.set("totalVolumeUSD", Value.fromBigDecimal(value)); + } + + get totalVolumeNotional(): BigDecimal { + let value = this.get("totalVolumeNotional"); + return value!.toBigDecimal(); + } + + set totalVolumeNotional(value: BigDecimal) { + this.set("totalVolumeNotional", Value.fromBigDecimal(value)); + } + + get totalSwapCount(): BigInt { + let value = this.get("totalSwapCount"); + return value!.toBigInt(); + } + + set totalSwapCount(value: BigInt) { + this.set("totalSwapCount", Value.fromBigInt(value)); + } + + get latestPrice(): string | null { + let value = this.get("latestPrice"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set latestPrice(value: string | null) { + if (!value) { + this.unset("latestPrice"); + } else { + this.set("latestPrice", Value.fromString(value)); + } + } + + get latestUSDPrice(): BigDecimal | null { + let value = this.get("latestUSDPrice"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set latestUSDPrice(value: BigDecimal | null) { + if (!value) { + this.unset("latestUSDPrice"); + } else { + this.set("latestUSDPrice", Value.fromBigDecimal(value)); + } + } + + get latestFXPrice(): BigDecimal | null { + let value = this.get("latestFXPrice"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigDecimal(); + } + } + + set latestFXPrice(value: BigDecimal | null) { + if (!value) { + this.unset("latestFXPrice"); + } else { + this.set("latestFXPrice", Value.fromBigDecimal(value)); + } + } + + get pool(): string | null { + let value = this.get("pool"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toString(); + } + } + + set pool(value: string | null) { + if (!value) { + this.unset("pool"); + } else { + this.set("pool", Value.fromString(value)); + } + } +} + +export class TokenSnapshot extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("token", Value.fromString("")); + this.set("timestamp", Value.fromI32(0)); + this.set("totalBalanceUSD", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalBalanceNotional", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalVolumeUSD", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalVolumeNotional", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapCount", Value.fromBigInt(BigInt.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save TokenSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save TokenSnapshot entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("TokenSnapshot", id.toString(), this); + } + } + + static load(id: string): TokenSnapshot | null { + return changetype(store.get("TokenSnapshot", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get token(): string { + let value = this.get("token"); + return value!.toString(); + } + + set token(value: string) { + this.set("token", Value.fromString(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } + + get totalBalanceUSD(): BigDecimal { + let value = this.get("totalBalanceUSD"); + return value!.toBigDecimal(); + } + + set totalBalanceUSD(value: BigDecimal) { + this.set("totalBalanceUSD", Value.fromBigDecimal(value)); + } + + get totalBalanceNotional(): BigDecimal { + let value = this.get("totalBalanceNotional"); + return value!.toBigDecimal(); + } + + set totalBalanceNotional(value: BigDecimal) { + this.set("totalBalanceNotional", Value.fromBigDecimal(value)); + } + + get totalVolumeUSD(): BigDecimal { + let value = this.get("totalVolumeUSD"); + return value!.toBigDecimal(); + } + + set totalVolumeUSD(value: BigDecimal) { + this.set("totalVolumeUSD", Value.fromBigDecimal(value)); + } + + get totalVolumeNotional(): BigDecimal { + let value = this.get("totalVolumeNotional"); + return value!.toBigDecimal(); + } + + set totalVolumeNotional(value: BigDecimal) { + this.set("totalVolumeNotional", Value.fromBigDecimal(value)); + } + + get totalSwapCount(): BigInt { + let value = this.get("totalSwapCount"); + return value!.toBigInt(); + } + + set totalSwapCount(value: BigInt) { + this.set("totalSwapCount", Value.fromBigInt(value)); + } +} + +export class TradePair extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("token0", Value.fromString("")); + this.set("token1", Value.fromString("")); + this.set("totalSwapVolume", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapFee", Value.fromBigDecimal(BigDecimal.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save TradePair entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save TradePair entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("TradePair", id.toString(), this); + } + } + + static load(id: string): TradePair | null { + return changetype(store.get("TradePair", id)); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get token0(): string { + let value = this.get("token0"); + return value!.toString(); + } + + set token0(value: string) { + this.set("token0", Value.fromString(value)); + } + + get token1(): string { + let value = this.get("token1"); + return value!.toString(); + } + + set token1(value: string) { + this.set("token1", Value.fromString(value)); + } + + get totalSwapVolume(): BigDecimal { + let value = this.get("totalSwapVolume"); + return value!.toBigDecimal(); + } + + set totalSwapVolume(value: BigDecimal) { + this.set("totalSwapVolume", Value.fromBigDecimal(value)); + } + + get totalSwapFee(): BigDecimal { + let value = this.get("totalSwapFee"); + return value!.toBigDecimal(); + } + + set totalSwapFee(value: BigDecimal) { + this.set("totalSwapFee", Value.fromBigDecimal(value)); + } +} + +export class TradePairSnapshot extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("pair", Value.fromString("")); + this.set("timestamp", Value.fromI32(0)); + this.set("totalSwapVolume", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapFee", Value.fromBigDecimal(BigDecimal.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save TradePairSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save TradePairSnapshot entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("TradePairSnapshot", id.toString(), this); + } + } + + static load(id: string): TradePairSnapshot | null { + return changetype( + store.get("TradePairSnapshot", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pair(): string { + let value = this.get("pair"); + return value!.toString(); + } + + set pair(value: string) { + this.set("pair", Value.fromString(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } + + get totalSwapVolume(): BigDecimal { + let value = this.get("totalSwapVolume"); + return value!.toBigDecimal(); + } + + set totalSwapVolume(value: BigDecimal) { + this.set("totalSwapVolume", Value.fromBigDecimal(value)); + } + + get totalSwapFee(): BigDecimal { + let value = this.get("totalSwapFee"); + return value!.toBigDecimal(); + } + + set totalSwapFee(value: BigDecimal) { + this.set("totalSwapFee", Value.fromBigDecimal(value)); + } +} + +export class BalancerSnapshot extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + + this.set("vault", Value.fromString("")); + this.set("timestamp", Value.fromI32(0)); + this.set("poolCount", Value.fromI32(0)); + this.set("totalLiquidity", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapCount", Value.fromBigInt(BigInt.zero())); + this.set("totalSwapVolume", Value.fromBigDecimal(BigDecimal.zero())); + this.set("totalSwapFee", Value.fromBigDecimal(BigDecimal.zero())); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save BalancerSnapshot entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + "Cannot save BalancerSnapshot entity with non-string ID. " + + 'Considering using .toHex() to convert the "id" to a string.' + ); + store.set("BalancerSnapshot", id.toString(), this); + } + } + + static load(id: string): BalancerSnapshot | null { + return changetype( + store.get("BalancerSnapshot", id) + ); + } + + get id(): string { + let value = this.get("id"); + return value!.toString(); + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get vault(): string { + let value = this.get("vault"); + return value!.toString(); + } + + set vault(value: string) { + this.set("vault", Value.fromString(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + return value!.toI32(); + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } + + get poolCount(): i32 { + let value = this.get("poolCount"); + return value!.toI32(); + } + + set poolCount(value: i32) { + this.set("poolCount", Value.fromI32(value)); + } + + get totalLiquidity(): BigDecimal { + let value = this.get("totalLiquidity"); + return value!.toBigDecimal(); + } + + set totalLiquidity(value: BigDecimal) { + this.set("totalLiquidity", Value.fromBigDecimal(value)); + } + + get totalSwapCount(): BigInt { + let value = this.get("totalSwapCount"); + return value!.toBigInt(); + } + + set totalSwapCount(value: BigInt) { + this.set("totalSwapCount", Value.fromBigInt(value)); + } + + get totalSwapVolume(): BigDecimal { + let value = this.get("totalSwapVolume"); + return value!.toBigDecimal(); + } + + set totalSwapVolume(value: BigDecimal) { + this.set("totalSwapVolume", Value.fromBigDecimal(value)); + } + + get totalSwapFee(): BigDecimal { + let value = this.get("totalSwapFee"); + return value!.toBigDecimal(); + } + + set totalSwapFee(value: BigDecimal) { + this.set("totalSwapFee", Value.fromBigDecimal(value)); + } +} diff --git a/generated/templates.ts b/generated/templates.ts new file mode 100644 index 000000000..0be15b143 --- /dev/null +++ b/generated/templates.ts @@ -0,0 +1,283 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + Address, + DataSourceTemplate, + DataSourceContext +} from "@graphprotocol/graph-ts"; + +export class WeightedPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("WeightedPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "WeightedPool", + [address.toHex()], + context + ); + } +} + +export class WeightedPoolV2 extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("WeightedPoolV2", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "WeightedPoolV2", + [address.toHex()], + context + ); + } +} + +export class WeightedPool2Tokens extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("WeightedPool2Tokens", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "WeightedPool2Tokens", + [address.toHex()], + context + ); + } +} + +export class StablePool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("StablePool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "StablePool", + [address.toHex()], + context + ); + } +} + +export class MetaStablePool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("MetaStablePool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "MetaStablePool", + [address.toHex()], + context + ); + } +} + +export class ConvergentCurvePool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("ConvergentCurvePool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "ConvergentCurvePool", + [address.toHex()], + context + ); + } +} + +export class LiquidityBootstrappingPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("LiquidityBootstrappingPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "LiquidityBootstrappingPool", + [address.toHex()], + context + ); + } +} + +export class InvestmentPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("InvestmentPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "InvestmentPool", + [address.toHex()], + context + ); + } +} + +export class StablePhantomPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("StablePhantomPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "StablePhantomPool", + [address.toHex()], + context + ); + } +} + +export class StablePhantomPoolV2 extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("StablePhantomPoolV2", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "StablePhantomPoolV2", + [address.toHex()], + context + ); + } +} + +export class LinearPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("LinearPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "LinearPool", + [address.toHex()], + context + ); + } +} + +export class PrimaryIssuePool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("PrimaryIssuePool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "PrimaryIssuePool", + [address.toHex()], + context + ); + } +} + +export class SecondaryIssuePool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("SecondaryIssuePool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "SecondaryIssuePool", + [address.toHex()], + context + ); + } +} + +export class OffchainSecondariesPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("OffchainSecondariesPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "OffchainSecondariesPool", + [address.toHex()], + context + ); + } +} + +export class MarginTradingPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("MarginTradingPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "MarginTradingPool", + [address.toHex()], + context + ); + } +} + +export class Gyro2Pool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("Gyro2Pool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "Gyro2Pool", + [address.toHex()], + context + ); + } +} + +export class Gyro3Pool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("Gyro3Pool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "Gyro3Pool", + [address.toHex()], + context + ); + } +} + +export class GyroEPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("GyroEPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "GyroEPool", + [address.toHex()], + context + ); + } +} + +export class FXPool extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("FXPool", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext("FXPool", [address.toHex()], context); + } +} + +export class OffchainAggregator extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("OffchainAggregator", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext( + "OffchainAggregator", + [address.toHex()], + context + ); + } +} diff --git a/generated/templates/ConvergentCurvePool/ConvergentCurvePool.ts b/generated/templates/ConvergentCurvePool/ConvergentCurvePool.ts new file mode 100644 index 000000000..3cdfebc44 --- /dev/null +++ b/generated/templates/ConvergentCurvePool/ConvergentCurvePool.ts @@ -0,0 +1,1413 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class FeeCollection extends ethereum.Event { + get params(): FeeCollection__Params { + return new FeeCollection__Params(this); + } +} + +export class FeeCollection__Params { + _event: FeeCollection; + + constructor(event: FeeCollection) { + this._event = event; + } + + get collectedBase(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get collectedBond(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get remainingBase(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get remainingBond(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ConvergentCurvePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class ConvergentCurvePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class ConvergentCurvePool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class ConvergentCurvePool extends ethereum.SmartContract { + static bind(address: Address): ConvergentCurvePool { + return new ConvergentCurvePool("ConvergentCurvePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + FEE_BOUND(): BigInt { + let result = super.call("FEE_BOUND", "FEE_BOUND():(uint256)", []); + + return result[0].toBigInt(); + } + + try_FEE_BOUND(): ethereum.CallResult { + let result = super.tryCall("FEE_BOUND", "FEE_BOUND():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + bond(): Address { + let result = super.call("bond", "bond():(address)", []); + + return result[0].toAddress(); + } + + try_bond(): ethereum.CallResult
{ + let result = super.tryCall("bond", "bond():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + bondDecimals(): i32 { + let result = super.call("bondDecimals", "bondDecimals():(uint8)", []); + + return result[0].toI32(); + } + + try_bondDecimals(): ethereum.CallResult { + let result = super.tryCall("bondDecimals", "bondDecimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseApproval(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseApproval", + "decreaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseApproval( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseApproval", + "decreaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + expiration(): BigInt { + let result = super.call("expiration", "expiration():(uint256)", []); + + return result[0].toBigInt(); + } + + try_expiration(): ethereum.CallResult { + let result = super.tryCall("expiration", "expiration():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + feesBond(): BigInt { + let result = super.call("feesBond", "feesBond():(uint128)", []); + + return result[0].toBigInt(); + } + + try_feesBond(): ethereum.CallResult { + let result = super.tryCall("feesBond", "feesBond():(uint128)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + feesUnderlying(): BigInt { + let result = super.call("feesUnderlying", "feesUnderlying():(uint128)", []); + + return result[0].toBigInt(); + } + + try_feesUnderlying(): ethereum.CallResult { + let result = super.tryCall( + "feesUnderlying", + "feesUnderlying():(uint128)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + governance(): Address { + let result = super.call("governance", "governance():(address)", []); + + return result[0].toAddress(); + } + + try_governance(): ethereum.CallResult
{ + let result = super.tryCall("governance", "governance():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseApproval(spender: Address, amount: BigInt): boolean { + let result = super.call( + "increaseApproval", + "increaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseApproval( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseApproval", + "increaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + param1: Address, + recipient: Address, + currentBalances: Array, + param4: BigInt, + protocolSwapFee: BigInt, + userData: Bytes + ): ConvergentCurvePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(currentBalances), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(protocolSwapFee), + ethereum.Value.fromBytes(userData) + ] + ); + + return new ConvergentCurvePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + param1: Address, + recipient: Address, + currentBalances: Array, + param4: BigInt, + protocolSwapFee: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(currentBalances), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(protocolSwapFee), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ConvergentCurvePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + param1: Address, + recipient: Address, + currentBalances: Array, + param4: BigInt, + protocolSwapFee: BigInt, + userData: Bytes + ): ConvergentCurvePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(currentBalances), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(protocolSwapFee), + ethereum.Value.fromBytes(userData) + ] + ); + + return new ConvergentCurvePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + param1: Address, + recipient: Address, + currentBalances: Array, + param4: BigInt, + protocolSwapFee: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(currentBalances), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(protocolSwapFee), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ConvergentCurvePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: ConvergentCurvePool__onSwapInputSwapRequestStruct, + currentBalanceTokenIn: BigInt, + currentBalanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenIn), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: ConvergentCurvePool__onSwapInputSwapRequestStruct, + currentBalanceTokenIn: BigInt, + currentBalanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenIn), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + percentFee(): BigInt { + let result = super.call("percentFee", "percentFee():(uint256)", []); + + return result[0].toBigInt(); + } + + try_percentFee(): ethereum.CallResult { + let result = super.tryCall("percentFee", "percentFee():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + percentFeeGov(): BigInt { + let result = super.call("percentFeeGov", "percentFeeGov():(uint256)", []); + + return result[0].toBigInt(); + } + + try_percentFeeGov(): ethereum.CallResult { + let result = super.tryCall( + "percentFeeGov", + "percentFeeGov():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + solveTradeInvariant( + amountX: BigInt, + reserveX: BigInt, + reserveY: BigInt, + out: boolean + ): BigInt { + let result = super.call( + "solveTradeInvariant", + "solveTradeInvariant(uint256,uint256,uint256,bool):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(amountX), + ethereum.Value.fromUnsignedBigInt(reserveX), + ethereum.Value.fromUnsignedBigInt(reserveY), + ethereum.Value.fromBoolean(out) + ] + ); + + return result[0].toBigInt(); + } + + try_solveTradeInvariant( + amountX: BigInt, + reserveX: BigInt, + reserveY: BigInt, + out: boolean + ): ethereum.CallResult { + let result = super.tryCall( + "solveTradeInvariant", + "solveTradeInvariant(uint256,uint256,uint256,bool):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(amountX), + ethereum.Value.fromUnsignedBigInt(reserveX), + ethereum.Value.fromUnsignedBigInt(reserveY), + ethereum.Value.fromBoolean(out) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + underlying(): Address { + let result = super.call("underlying", "underlying():(address)", []); + + return result[0].toAddress(); + } + + try_underlying(): ethereum.CallResult
{ + let result = super.tryCall("underlying", "underlying():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + underlyingDecimals(): i32 { + let result = super.call( + "underlyingDecimals", + "underlyingDecimals():(uint8)", + [] + ); + + return result[0].toI32(); + } + + try_underlyingDecimals(): ethereum.CallResult { + let result = super.tryCall( + "underlyingDecimals", + "underlyingDecimals():(uint8)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + unitSeconds(): BigInt { + let result = super.call("unitSeconds", "unitSeconds():(uint256)", []); + + return result[0].toBigInt(); + } + + try_unitSeconds(): ethereum.CallResult { + let result = super.tryCall("unitSeconds", "unitSeconds():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _underlying(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _bond(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get _expiration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _unitSeconds(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get vault(): Address { + return this._call.inputValues[4].value.toAddress(); + } + + get _percentFee(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get _percentFeeGov(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get _governance(): Address { + return this._call.inputValues[7].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[8].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[9].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseApprovalCall extends ethereum.Call { + get inputs(): DecreaseApprovalCall__Inputs { + return new DecreaseApprovalCall__Inputs(this); + } + + get outputs(): DecreaseApprovalCall__Outputs { + return new DecreaseApprovalCall__Outputs(this); + } +} + +export class DecreaseApprovalCall__Inputs { + _call: DecreaseApprovalCall; + + constructor(call: DecreaseApprovalCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseApprovalCall__Outputs { + _call: DecreaseApprovalCall; + + constructor(call: DecreaseApprovalCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseApprovalCall extends ethereum.Call { + get inputs(): IncreaseApprovalCall__Inputs { + return new IncreaseApprovalCall__Inputs(this); + } + + get outputs(): IncreaseApprovalCall__Outputs { + return new IncreaseApprovalCall__Outputs(this); + } +} + +export class IncreaseApprovalCall__Inputs { + _call: IncreaseApprovalCall; + + constructor(call: IncreaseApprovalCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseApprovalCall__Outputs { + _call: IncreaseApprovalCall; + + constructor(call: IncreaseApprovalCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get value1(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get currentBalances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get value4(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFee(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get amountsOut(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get value1(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get currentBalances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get value4(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFee(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get amountsIn(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get swapRequest(): OnSwapCallSwapRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get currentBalanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get currentBalanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/templates/FXPool/FXPool.ts b/generated/templates/FXPool/FXPool.ts new file mode 100644 index 000000000..a846c808d --- /dev/null +++ b/generated/templates/FXPool/FXPool.ts @@ -0,0 +1,2234 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class AssetIncluded extends ethereum.Event { + get params(): AssetIncluded__Params { + return new AssetIncluded__Params(this); + } +} + +export class AssetIncluded__Params { + _event: AssetIncluded; + + constructor(event: AssetIncluded) { + this._event = event; + } + + get numeraire(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get reserve(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get weight(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class AssimilatorIncluded extends ethereum.Event { + get params(): AssimilatorIncluded__Params { + return new AssimilatorIncluded__Params(this); + } +} + +export class AssimilatorIncluded__Params { + _event: AssimilatorIncluded; + + constructor(event: AssimilatorIncluded) { + this._event = event; + } + + get derivative(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get numeraire(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get reserve(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get assimilator(): Address { + return this._event.parameters[3].value.toAddress(); + } +} + +export class ChangeCollectorAddress extends ethereum.Event { + get params(): ChangeCollectorAddress__Params { + return new ChangeCollectorAddress__Params(this); + } +} + +export class ChangeCollectorAddress__Params { + _event: ChangeCollectorAddress; + + constructor(event: ChangeCollectorAddress) { + this._event = event; + } + + get newCollector(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class EmergencyAlarm extends ethereum.Event { + get params(): EmergencyAlarm__Params { + return new EmergencyAlarm__Params(this); + } +} + +export class EmergencyAlarm__Params { + _event: EmergencyAlarm; + + constructor(event: EmergencyAlarm) { + this._event = event; + } + + get isEmergency(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class EmergencyWithdraw extends ethereum.Event { + get params(): EmergencyWithdraw__Params { + return new EmergencyWithdraw__Params(this); + } +} + +export class EmergencyWithdraw__Params { + _event: EmergencyWithdraw; + + constructor(event: EmergencyWithdraw) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get lptAmountBurned(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get amountsWithdrawn(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } +} + +export class FeesAccrued extends ethereum.Event { + get params(): FeesAccrued__Params { + return new FeesAccrued__Params(this); + } +} + +export class FeesAccrued__Params { + _event: FeesAccrued; + + constructor(event: FeesAccrued) { + this._event = event; + } + + get feesCollected(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class FeesCollected extends ethereum.Event { + get params(): FeesCollected__Params { + return new FeesCollected__Params(this); + } +} + +export class FeesCollected__Params { + _event: FeesCollected; + + constructor(event: FeesCollected) { + this._event = event; + } + + get recipient(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get feesCollected(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class OnExitPool extends ethereum.Event { + get params(): OnExitPool__Params { + return new OnExitPool__Params(this); + } +} + +export class OnExitPool__Params { + _event: OnExitPool; + + constructor(event: OnExitPool) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get lptAmountBurned(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get amountsWithdrawn(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } +} + +export class OnJoinPool extends ethereum.Event { + get params(): OnJoinPool__Params { + return new OnJoinPool__Params(this); + } +} + +export class OnJoinPool__Params { + _event: OnJoinPool; + + constructor(event: OnJoinPool) { + this._event = event; + } + + get poolId(): Bytes { + return this._event.parameters[0].value.toBytes(); + } + + get lptAmountMinted(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get amountsDeposited(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class ParametersSet extends ethereum.Event { + get params(): ParametersSet__Params { + return new ParametersSet__Params(this); + } +} + +export class ParametersSet__Params { + _event: ParametersSet; + + constructor(event: ParametersSet) { + this._event = event; + } + + get alpha(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get beta(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get delta(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get epsilon(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get lambda(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class Paused extends ethereum.Event { + get params(): Paused__Params { + return new Paused__Params(this); + } +} + +export class Paused__Params { + _event: Paused; + + constructor(event: Paused) { + this._event = event; + } + + get account(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class ProtocolFeeShareUpdated extends ethereum.Event { + get params(): ProtocolFeeShareUpdated__Params { + return new ProtocolFeeShareUpdated__Params(this); + } +} + +export class ProtocolFeeShareUpdated__Params { + _event: ProtocolFeeShareUpdated; + + constructor(event: ProtocolFeeShareUpdated) { + this._event = event; + } + + get updater(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newProtocolPercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class Trade extends ethereum.Event { + get params(): Trade__Params { + return new Trade__Params(this); + } +} + +export class Trade__Params { + _event: Trade; + + constructor(event: Trade) { + this._event = event; + } + + get trader(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get origin(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get target(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get originAmount(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get targetAmount(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Unpaused extends ethereum.Event { + get params(): Unpaused__Params { + return new Unpaused__Params(this); + } +} + +export class Unpaused__Params { + _event: Unpaused; + + constructor(event: Unpaused) { + this._event = event; + } + + get account(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class FXPool__curveResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + value5: BigInt; + value6: Address; + value7: Address; + value8: Bytes; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt, + value5: BigInt, + value6: Address, + value7: Address, + value8: Bytes + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + this.value7 = value7; + this.value8 = value8; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromSignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromSignedBigInt(this.value4)); + map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); + map.set("value6", ethereum.Value.fromAddress(this.value6)); + map.set("value7", ethereum.Value.fromAddress(this.value7)); + map.set("value8", ethereum.Value.fromFixedBytes(this.value8)); + return map; + } +} + +export class FXPool__liquidityResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class FXPool__viewDepositResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class FXPool__viewParametersResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); + return map; + } +} + +export class FXPool extends ethereum.SmartContract { + static bind(address: Address): FXPool { + return new FXPool("FXPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + assimilator(_derivative: Address): Address { + let result = super.call("assimilator", "assimilator(address):(address)", [ + ethereum.Value.fromAddress(_derivative) + ]); + + return result[0].toAddress(); + } + + try_assimilator(_derivative: Address): ethereum.CallResult
{ + let result = super.tryCall( + "assimilator", + "assimilator(address):(address)", + [ethereum.Value.fromAddress(_derivative)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + collectorAddress(): Address { + let result = super.call( + "collectorAddress", + "collectorAddress():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_collectorAddress(): ethereum.CallResult
{ + let result = super.tryCall( + "collectorAddress", + "collectorAddress():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + curve(): FXPool__curveResult { + let result = super.call( + "curve", + "curve():(int128,int128,int128,int128,int128,uint256,address,address,bytes32)", + [] + ); + + return new FXPool__curveResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt(), + result[5].toBigInt(), + result[6].toAddress(), + result[7].toAddress(), + result[8].toBytes() + ); + } + + try_curve(): ethereum.CallResult { + let result = super.tryCall( + "curve", + "curve():(int128,int128,int128,int128,int128,uint256,address,address,bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__curveResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt(), + value[5].toBigInt(), + value[6].toAddress(), + value[7].toAddress(), + value[8].toBytes() + ) + ); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + derivatives(param0: BigInt): Address { + let result = super.call("derivatives", "derivatives(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + + return result[0].toAddress(); + } + + try_derivatives(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall( + "derivatives", + "derivatives(uint256):(address)", + [ethereum.Value.fromUnsignedBigInt(param0)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + emergency(): boolean { + let result = super.call("emergency", "emergency():(bool)", []); + + return result[0].toBoolean(); + } + + try_emergency(): ethereum.CallResult { + let result = super.tryCall("emergency", "emergency():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + liquidity(): FXPool__liquidityResult { + let result = super.call("liquidity", "liquidity():(uint256,uint256[])", []); + + return new FXPool__liquidityResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_liquidity(): ethereum.CallResult { + let result = super.tryCall( + "liquidity", + "liquidity():(uint256,uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__liquidityResult(value[0].toBigInt(), value[1].toBigIntArray()) + ); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + numeraires(param0: BigInt): Address { + let result = super.call("numeraires", "numeraires(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + + return result[0].toAddress(); + } + + try_numeraires(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall("numeraires", "numeraires(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + param2: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): FXPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(param2), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + + return new FXPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + param2: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(param2), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + param1: Address, + recipient: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): FXPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + + return new FXPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + param1: Address, + recipient: Address, + param3: Array, + param4: BigInt, + param5: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(param1), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(param3), + ethereum.Value.fromUnsignedBigInt(param4), + ethereum.Value.fromUnsignedBigInt(param5), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: FXPool__onSwapInputSwapRequestStruct, + param1: BigInt, + param2: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(param1), + ethereum.Value.fromUnsignedBigInt(param2) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: FXPool__onSwapInputSwapRequestStruct, + param1: BigInt, + param2: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(param1), + ethereum.Value.fromUnsignedBigInt(param2) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + paused(): boolean { + let result = super.call("paused", "paused():(bool)", []); + + return result[0].toBoolean(); + } + + try_paused(): ethereum.CallResult { + let result = super.tryCall("paused", "paused():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + protocolPercentFee(): BigInt { + let result = super.call( + "protocolPercentFee", + "protocolPercentFee():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_protocolPercentFee(): ethereum.CallResult { + let result = super.tryCall( + "protocolPercentFee", + "protocolPercentFee():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + reserves(param0: BigInt): Address { + let result = super.call("reserves", "reserves(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + + return result[0].toAddress(); + } + + try_reserves(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall("reserves", "reserves(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + totalUnclaimedFeesInNumeraire(): BigInt { + let result = super.call( + "totalUnclaimedFeesInNumeraire", + "totalUnclaimedFeesInNumeraire():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_totalUnclaimedFeesInNumeraire(): ethereum.CallResult { + let result = super.tryCall( + "totalUnclaimedFeesInNumeraire", + "totalUnclaimedFeesInNumeraire():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + viewDeposit(totalDepositNumeraire: BigInt): FXPool__viewDepositResult { + let result = super.call( + "viewDeposit", + "viewDeposit(uint256):(uint256,uint256[])", + [ethereum.Value.fromUnsignedBigInt(totalDepositNumeraire)] + ); + + return new FXPool__viewDepositResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_viewDeposit( + totalDepositNumeraire: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "viewDeposit", + "viewDeposit(uint256):(uint256,uint256[])", + [ethereum.Value.fromUnsignedBigInt(totalDepositNumeraire)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__viewDepositResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + viewParameters(): FXPool__viewParametersResult { + let result = super.call( + "viewParameters", + "viewParameters():(uint256,uint256,uint256,uint256,uint256)", + [] + ); + + return new FXPool__viewParametersResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt() + ); + } + + try_viewParameters(): ethereum.CallResult { + let result = super.tryCall( + "viewParameters", + "viewParameters():(uint256,uint256,uint256,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new FXPool__viewParametersResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt() + ) + ); + } + + viewWithdraw(_curvesToBurn: BigInt): Array { + let result = super.call( + "viewWithdraw", + "viewWithdraw(uint256):(uint256[])", + [ethereum.Value.fromUnsignedBigInt(_curvesToBurn)] + ); + + return result[0].toBigIntArray(); + } + + try_viewWithdraw(_curvesToBurn: BigInt): ethereum.CallResult> { + let result = super.tryCall( + "viewWithdraw", + "viewWithdraw(uint256):(uint256[])", + [ethereum.Value.fromUnsignedBigInt(_curvesToBurn)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _assetsToRegister(): Array
{ + return this._call.inputValues[0].value.toAddressArray(); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get _protocolPercentFee(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _name(): string { + return this._call.inputValues[3].value.toString(); + } + + get _symbol(): string { + return this._call.inputValues[4].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class InitializeCall extends ethereum.Call { + get inputs(): InitializeCall__Inputs { + return new InitializeCall__Inputs(this); + } + + get outputs(): InitializeCall__Outputs { + return new InitializeCall__Outputs(this); + } +} + +export class InitializeCall__Inputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } + + get _assets(): Array
{ + return this._call.inputValues[0].value.toAddressArray(); + } + + get _assetWeights(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } +} + +export class InitializeCall__Outputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value2(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get value3(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get value4(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get value5(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get amountsOut(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get value1(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get value3(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get value4(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get value5(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get amountsIn(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get swapRequest(): OnSwapCallSwapRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get value1(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get value2(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class SetCapCall extends ethereum.Call { + get inputs(): SetCapCall__Inputs { + return new SetCapCall__Inputs(this); + } + + get outputs(): SetCapCall__Outputs { + return new SetCapCall__Outputs(this); + } +} + +export class SetCapCall__Inputs { + _call: SetCapCall; + + constructor(call: SetCapCall) { + this._call = call; + } + + get _cap(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetCapCall__Outputs { + _call: SetCapCall; + + constructor(call: SetCapCall) { + this._call = call; + } +} + +export class SetCollectorAddressCall extends ethereum.Call { + get inputs(): SetCollectorAddressCall__Inputs { + return new SetCollectorAddressCall__Inputs(this); + } + + get outputs(): SetCollectorAddressCall__Outputs { + return new SetCollectorAddressCall__Outputs(this); + } +} + +export class SetCollectorAddressCall__Inputs { + _call: SetCollectorAddressCall; + + constructor(call: SetCollectorAddressCall) { + this._call = call; + } + + get _collectorAddress(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetCollectorAddressCall__Outputs { + _call: SetCollectorAddressCall; + + constructor(call: SetCollectorAddressCall) { + this._call = call; + } +} + +export class SetEmergencyCall extends ethereum.Call { + get inputs(): SetEmergencyCall__Inputs { + return new SetEmergencyCall__Inputs(this); + } + + get outputs(): SetEmergencyCall__Outputs { + return new SetEmergencyCall__Outputs(this); + } +} + +export class SetEmergencyCall__Inputs { + _call: SetEmergencyCall; + + constructor(call: SetEmergencyCall) { + this._call = call; + } + + get _emergency(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetEmergencyCall__Outputs { + _call: SetEmergencyCall; + + constructor(call: SetEmergencyCall) { + this._call = call; + } +} + +export class SetParamsCall extends ethereum.Call { + get inputs(): SetParamsCall__Inputs { + return new SetParamsCall__Inputs(this); + } + + get outputs(): SetParamsCall__Outputs { + return new SetParamsCall__Outputs(this); + } +} + +export class SetParamsCall__Inputs { + _call: SetParamsCall; + + constructor(call: SetParamsCall) { + this._call = call; + } + + get _alpha(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _beta(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get _feeAtHalt(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _epsilon(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get _lambda(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } +} + +export class SetParamsCall__Outputs { + _call: SetParamsCall; + + constructor(call: SetParamsCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetProtocolPercentFeeCall extends ethereum.Call { + get inputs(): SetProtocolPercentFeeCall__Inputs { + return new SetProtocolPercentFeeCall__Inputs(this); + } + + get outputs(): SetProtocolPercentFeeCall__Outputs { + return new SetProtocolPercentFeeCall__Outputs(this); + } +} + +export class SetProtocolPercentFeeCall__Inputs { + _call: SetProtocolPercentFeeCall; + + constructor(call: SetProtocolPercentFeeCall) { + this._call = call; + } + + get _protocolPercentFee(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetProtocolPercentFeeCall__Outputs { + _call: SetProtocolPercentFeeCall; + + constructor(call: SetProtocolPercentFeeCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/generated/templates/Gyro2Pool/Gyro2Pool.ts b/generated/templates/Gyro2Pool/Gyro2Pool.ts new file mode 100644 index 000000000..2af8c16ff --- /dev/null +++ b/generated/templates/Gyro2Pool/Gyro2Pool.ts @@ -0,0 +1,2621 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class CapManagerUpdated extends ethereum.Event { + get params(): CapManagerUpdated__Params { + return new CapManagerUpdated__Params(this); + } +} + +export class CapManagerUpdated__Params { + _event: CapManagerUpdated; + + constructor(event: CapManagerUpdated) { + this._event = event; + } + + get capManager(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class CapParamsUpdated extends ethereum.Event { + get params(): CapParamsUpdated__Params { + return new CapParamsUpdated__Params(this); + } +} + +export class CapParamsUpdated__Params { + _event: CapParamsUpdated; + + constructor(event: CapParamsUpdated) { + this._event = event; + } + + get params(): CapParamsUpdatedParamsStruct { + return changetype( + this._event.parameters[0].value.toTuple() + ); + } +} + +export class CapParamsUpdatedParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class OracleEnabledChanged extends ethereum.Event { + get params(): OracleEnabledChanged__Params { + return new OracleEnabledChanged__Params(this); + } +} + +export class OracleEnabledChanged__Params { + _event: OracleEnabledChanged; + + constructor(event: OracleEnabledChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PauseManagerChanged extends ethereum.Event { + get params(): PauseManagerChanged__Params { + return new PauseManagerChanged__Params(this); + } +} + +export class PauseManagerChanged__Params { + _event: PauseManagerChanged; + + constructor(event: PauseManagerChanged) { + this._event = event; + } + + get oldPauseManager(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newPauseManager(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class PausedLocally extends ethereum.Event { + get params(): PausedLocally__Params { + return new PausedLocally__Params(this); + } +} + +export class PausedLocally__Params { + _event: PausedLocally; + + constructor(event: PausedLocally) { + this._event = event; + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class UnpausedLocally extends ethereum.Event { + get params(): UnpausedLocally__Params { + return new UnpausedLocally__Params(this); + } +} + +export class UnpausedLocally__Params { + _event: UnpausedLocally; + + constructor(event: UnpausedLocally) { + this._event = event; + } +} + +export class Gyro2Pool__calculateCurrentValuesResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Gyro2Pool__capParamsResultValue0Struct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class Gyro2Pool__getMiscDataResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: boolean; + value5: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: boolean, + value5: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromBoolean(this.value4)); + map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); + return map; + } +} + +export class Gyro2Pool__getPastAccumulatorsInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get ago(): BigInt { + return this[1].toBigInt(); + } +} + +export class Gyro2Pool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Gyro2Pool__getSampleResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + value5: BigInt; + value6: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt, + value5: BigInt, + value6: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromSignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromSignedBigInt(this.value4)); + map.set("value5", ethereum.Value.fromSignedBigInt(this.value5)); + map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); + return map; + } +} + +export class Gyro2Pool__getTimeWeightedAverageInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get secs(): BigInt { + return this[1].toBigInt(); + } + + get ago(): BigInt { + return this[2].toBigInt(); + } +} + +export class Gyro2Pool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro2Pool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro2Pool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class Gyro2Pool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro2Pool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro2Pool extends ethereum.SmartContract { + static bind(address: Address): Gyro2Pool { + return new Gyro2Pool("Gyro2Pool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + calculateCurrentValues( + balanceTokenIn: BigInt, + balanceTokenOut: BigInt, + tokenInIsToken0: boolean + ): Gyro2Pool__calculateCurrentValuesResult { + let result = super.call( + "calculateCurrentValues", + "calculateCurrentValues(uint256,uint256,bool):(uint256,uint256,uint256)", + [ + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut), + ethereum.Value.fromBoolean(tokenInIsToken0) + ] + ); + + return new Gyro2Pool__calculateCurrentValuesResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_calculateCurrentValues( + balanceTokenIn: BigInt, + balanceTokenOut: BigInt, + tokenInIsToken0: boolean + ): ethereum.CallResult { + let result = super.tryCall( + "calculateCurrentValues", + "calculateCurrentValues(uint256,uint256,bool):(uint256,uint256,uint256)", + [ + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut), + ethereum.Value.fromBoolean(tokenInIsToken0) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__calculateCurrentValuesResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + capManager(): Address { + let result = super.call("capManager", "capManager():(address)", []); + + return result[0].toAddress(); + } + + try_capManager(): ethereum.CallResult
{ + let result = super.tryCall("capManager", "capManager():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + capParams(): Gyro2Pool__capParamsResultValue0Struct { + let result = super.call( + "capParams", + "capParams():((bool,uint120,uint128))", + [] + ); + + return changetype( + result[0].toTuple() + ); + } + + try_capParams(): ethereum.CallResult { + let result = super.tryCall( + "capParams", + "capParams():((bool,uint120,uint128))", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype(value[0].toTuple()) + ); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLargestSafeQueryWindow(): BigInt { + let result = super.call( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLargestSafeQueryWindow(): ethereum.CallResult { + let result = super.tryCall( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): BigInt { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLatest(variable: i32): BigInt { + let result = super.call("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + + return result[0].toBigInt(); + } + + try_getLatest(variable: i32): ethereum.CallResult { + let result = super.tryCall("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMiscData(): Gyro2Pool__getMiscDataResult { + let result = super.call( + "getMiscData", + "getMiscData():(int256,int256,uint256,uint256,bool,uint256)", + [] + ); + + return new Gyro2Pool__getMiscDataResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBoolean(), + result[5].toBigInt() + ); + } + + try_getMiscData(): ethereum.CallResult { + let result = super.tryCall( + "getMiscData", + "getMiscData():(int256,int256,uint256,uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__getMiscDataResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBoolean(), + value[5].toBigInt() + ) + ); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPastAccumulators( + queries: Array + ): Array { + let result = super.call( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getPastAccumulators( + queries: Array + ): ethereum.CallResult> { + let result = super.tryCall( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getPausedState(): Gyro2Pool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new Gyro2Pool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSample(index: BigInt): Gyro2Pool__getSampleResult { + let result = super.call( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + + return new Gyro2Pool__getSampleResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt(), + result[5].toBigInt(), + result[6].toBigInt() + ); + } + + try_getSample( + index: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__getSampleResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt(), + value[5].toBigInt(), + value[6].toBigInt() + ) + ); + } + + getSqrtParameters(): Array { + let result = super.call( + "getSqrtParameters", + "getSqrtParameters():(uint256[2])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getSqrtParameters(): ethereum.CallResult> { + let result = super.tryCall( + "getSqrtParameters", + "getSqrtParameters():(uint256[2])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTimeWeightedAverage( + queries: Array + ): Array { + let result = super.call( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getTimeWeightedAverage( + queries: Array + ): ethereum.CallResult> { + let result = super.tryCall( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getTotalSamples(): BigInt { + let result = super.call( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getTotalSamples(): ethereum.CallResult { + let result = super.tryCall( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVirtualParameters(): Array { + let result = super.call( + "getVirtualParameters", + "getVirtualParameters():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getVirtualParameters(): ethereum.CallResult> { + let result = super.tryCall( + "getVirtualParameters", + "getVirtualParameters():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + gyroConfig(): Address { + let result = super.call("gyroConfig", "gyroConfig():(address)", []); + + return result[0].toAddress(); + } + + try_gyroConfig(): ethereum.CallResult
{ + let result = super.tryCall("gyroConfig", "gyroConfig():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro2Pool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro2Pool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro2Pool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro2Pool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: Gyro2Pool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: Gyro2Pool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + pauseManager(): Address { + let result = super.call("pauseManager", "pauseManager():(address)", []); + + return result[0].toAddress(); + } + + try_pauseManager(): ethereum.CallResult
{ + let result = super.tryCall("pauseManager", "pauseManager():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro2Pool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro2Pool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro2Pool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro2Pool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro2Pool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get configAddress(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get baseParams(): ConstructorCallParamsBaseParamsStruct { + return changetype(this[0].toTuple()); + } + + get sqrtAlpha(): BigInt { + return this[1].toBigInt(); + } + + get sqrtBeta(): BigInt { + return this[2].toBigInt(); + } + + get capManager(): Address { + return this[3].toAddress(); + } + + get capParams(): ConstructorCallParamsCapParamsStruct { + return changetype(this[4].toTuple()); + } + + get pauseManager(): Address { + return this[5].toAddress(); + } +} + +export class ConstructorCallParamsBaseParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get name(): string { + return this[1].toString(); + } + + get symbol(): string { + return this[2].toString(); + } + + get token0(): Address { + return this[3].toAddress(); + } + + get token1(): Address { + return this[4].toAddress(); + } + + get swapFeePercentage(): BigInt { + return this[5].toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this[6].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[7].toBigInt(); + } + + get oracleEnabled(): boolean { + return this[8].toBoolean(); + } + + get owner(): Address { + return this[9].toAddress(); + } +} + +export class ConstructorCallParamsCapParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class ChangePauseManagerCall extends ethereum.Call { + get inputs(): ChangePauseManagerCall__Inputs { + return new ChangePauseManagerCall__Inputs(this); + } + + get outputs(): ChangePauseManagerCall__Outputs { + return new ChangePauseManagerCall__Outputs(this); + } +} + +export class ChangePauseManagerCall__Inputs { + _call: ChangePauseManagerCall; + + constructor(call: ChangePauseManagerCall) { + this._call = call; + } + + get _pauseManager(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class ChangePauseManagerCall__Outputs { + _call: ChangePauseManagerCall; + + constructor(call: ChangePauseManagerCall) { + this._call = call; + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DirtyUninitializedOracleSamplesCall extends ethereum.Call { + get inputs(): DirtyUninitializedOracleSamplesCall__Inputs { + return new DirtyUninitializedOracleSamplesCall__Inputs(this); + } + + get outputs(): DirtyUninitializedOracleSamplesCall__Outputs { + return new DirtyUninitializedOracleSamplesCall__Outputs(this); + } +} + +export class DirtyUninitializedOracleSamplesCall__Inputs { + _call: DirtyUninitializedOracleSamplesCall; + + constructor(call: DirtyUninitializedOracleSamplesCall) { + this._call = call; + } + + get startIndex(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endIndex(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DirtyUninitializedOracleSamplesCall__Outputs { + _call: DirtyUninitializedOracleSamplesCall; + + constructor(call: DirtyUninitializedOracleSamplesCall) { + this._call = call; + } +} + +export class EnableOracleCall extends ethereum.Call { + get inputs(): EnableOracleCall__Inputs { + return new EnableOracleCall__Inputs(this); + } + + get outputs(): EnableOracleCall__Outputs { + return new EnableOracleCall__Outputs(this); + } +} + +export class EnableOracleCall__Inputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class EnableOracleCall__Outputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get amountsIn(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetCapManagerCall extends ethereum.Call { + get inputs(): SetCapManagerCall__Inputs { + return new SetCapManagerCall__Inputs(this); + } + + get outputs(): SetCapManagerCall__Outputs { + return new SetCapManagerCall__Outputs(this); + } +} + +export class SetCapManagerCall__Inputs { + _call: SetCapManagerCall; + + constructor(call: SetCapManagerCall) { + this._call = call; + } + + get _capManager(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetCapManagerCall__Outputs { + _call: SetCapManagerCall; + + constructor(call: SetCapManagerCall) { + this._call = call; + } +} + +export class SetCapParamsCall extends ethereum.Call { + get inputs(): SetCapParamsCall__Inputs { + return new SetCapParamsCall__Inputs(this); + } + + get outputs(): SetCapParamsCall__Outputs { + return new SetCapParamsCall__Outputs(this); + } +} + +export class SetCapParamsCall__Inputs { + _call: SetCapParamsCall; + + constructor(call: SetCapParamsCall) { + this._call = call; + } + + get params(): SetCapParamsCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class SetCapParamsCall__Outputs { + _call: SetCapParamsCall; + + constructor(call: SetCapParamsCall) { + this._call = call; + } +} + +export class SetCapParamsCallParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/templates/Gyro3Pool/Gyro3Pool.ts b/generated/templates/Gyro3Pool/Gyro3Pool.ts new file mode 100644 index 000000000..f9f3fcaa7 --- /dev/null +++ b/generated/templates/Gyro3Pool/Gyro3Pool.ts @@ -0,0 +1,2193 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class CapManagerUpdated extends ethereum.Event { + get params(): CapManagerUpdated__Params { + return new CapManagerUpdated__Params(this); + } +} + +export class CapManagerUpdated__Params { + _event: CapManagerUpdated; + + constructor(event: CapManagerUpdated) { + this._event = event; + } + + get capManager(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class CapParamsUpdated extends ethereum.Event { + get params(): CapParamsUpdated__Params { + return new CapParamsUpdated__Params(this); + } +} + +export class CapParamsUpdated__Params { + _event: CapParamsUpdated; + + constructor(event: CapParamsUpdated) { + this._event = event; + } + + get params(): CapParamsUpdatedParamsStruct { + return changetype( + this._event.parameters[0].value.toTuple() + ); + } +} + +export class CapParamsUpdatedParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class PauseManagerChanged extends ethereum.Event { + get params(): PauseManagerChanged__Params { + return new PauseManagerChanged__Params(this); + } +} + +export class PauseManagerChanged__Params { + _event: PauseManagerChanged; + + constructor(event: PauseManagerChanged) { + this._event = event; + } + + get oldPauseManager(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newPauseManager(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class PausedLocally extends ethereum.Event { + get params(): PausedLocally__Params { + return new PausedLocally__Params(this); + } +} + +export class PausedLocally__Params { + _event: PausedLocally; + + constructor(event: PausedLocally) { + this._event = event; + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class UnpausedLocally extends ethereum.Event { + get params(): UnpausedLocally__Params { + return new UnpausedLocally__Params(this); + } +} + +export class UnpausedLocally__Params { + _event: UnpausedLocally; + + constructor(event: UnpausedLocally) { + this._event = event; + } +} + +export class Gyro3Pool__capParamsResultValue0Struct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class Gyro3Pool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class Gyro3Pool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro3Pool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro3Pool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class Gyro3Pool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro3Pool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class Gyro3Pool extends ethereum.SmartContract { + static bind(address: Address): Gyro3Pool { + return new Gyro3Pool("Gyro3Pool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + capManager(): Address { + let result = super.call("capManager", "capManager():(address)", []); + + return result[0].toAddress(); + } + + try_capManager(): ethereum.CallResult
{ + let result = super.tryCall("capManager", "capManager():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + capParams(): Gyro3Pool__capParamsResultValue0Struct { + let result = super.call( + "capParams", + "capParams():((bool,uint120,uint128))", + [] + ); + + return changetype( + result[0].toTuple() + ); + } + + try_capParams(): ethereum.CallResult { + let result = super.tryCall( + "capParams", + "capParams():((bool,uint120,uint128))", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype(value[0].toTuple()) + ); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): BigInt { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): Gyro3Pool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new Gyro3Pool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro3Pool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getRoot3Alpha(): BigInt { + let result = super.call("getRoot3Alpha", "getRoot3Alpha():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRoot3Alpha(): ethereum.CallResult { + let result = super.tryCall( + "getRoot3Alpha", + "getRoot3Alpha():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + gyroConfig(): Address { + let result = super.call("gyroConfig", "gyroConfig():(address)", []); + + return result[0].toAddress(); + } + + try_gyroConfig(): ethereum.CallResult
{ + let result = super.tryCall("gyroConfig", "gyroConfig():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro3Pool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro3Pool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro3Pool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro3Pool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro3Pool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro3Pool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: Gyro3Pool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: Gyro3Pool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + pauseManager(): Address { + let result = super.call("pauseManager", "pauseManager():(address)", []); + + return result[0].toAddress(); + } + + try_pauseManager(): ethereum.CallResult
{ + let result = super.tryCall("pauseManager", "pauseManager():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro3Pool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro3Pool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro3Pool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): Gyro3Pool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new Gyro3Pool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Gyro3Pool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get configAddress(): Address { + return this[1].toAddress(); + } + + get config(): ConstructorCallParamsConfigStruct { + return changetype(this[2].toTuple()); + } + + get pauseWindowDuration(): BigInt { + return this[3].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[4].toBigInt(); + } +} + +export class ConstructorCallParamsConfigStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[3].toBigInt(); + } + + get root3Alpha(): BigInt { + return this[4].toBigInt(); + } + + get owner(): Address { + return this[5].toAddress(); + } + + get capManager(): Address { + return this[6].toAddress(); + } + + get capParams(): ConstructorCallParamsConfigCapParamsStruct { + return changetype( + this[7].toTuple() + ); + } + + get pauseManager(): Address { + return this[8].toAddress(); + } +} + +export class ConstructorCallParamsConfigCapParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class ChangePauseManagerCall extends ethereum.Call { + get inputs(): ChangePauseManagerCall__Inputs { + return new ChangePauseManagerCall__Inputs(this); + } + + get outputs(): ChangePauseManagerCall__Outputs { + return new ChangePauseManagerCall__Outputs(this); + } +} + +export class ChangePauseManagerCall__Inputs { + _call: ChangePauseManagerCall; + + constructor(call: ChangePauseManagerCall) { + this._call = call; + } + + get _pauseManager(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class ChangePauseManagerCall__Outputs { + _call: ChangePauseManagerCall; + + constructor(call: ChangePauseManagerCall) { + this._call = call; + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetCapManagerCall extends ethereum.Call { + get inputs(): SetCapManagerCall__Inputs { + return new SetCapManagerCall__Inputs(this); + } + + get outputs(): SetCapManagerCall__Outputs { + return new SetCapManagerCall__Outputs(this); + } +} + +export class SetCapManagerCall__Inputs { + _call: SetCapManagerCall; + + constructor(call: SetCapManagerCall) { + this._call = call; + } + + get _capManager(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetCapManagerCall__Outputs { + _call: SetCapManagerCall; + + constructor(call: SetCapManagerCall) { + this._call = call; + } +} + +export class SetCapParamsCall extends ethereum.Call { + get inputs(): SetCapParamsCall__Inputs { + return new SetCapParamsCall__Inputs(this); + } + + get outputs(): SetCapParamsCall__Outputs { + return new SetCapParamsCall__Outputs(this); + } +} + +export class SetCapParamsCall__Inputs { + _call: SetCapParamsCall; + + constructor(call: SetCapParamsCall) { + this._call = call; + } + + get params(): SetCapParamsCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class SetCapParamsCall__Outputs { + _call: SetCapParamsCall; + + constructor(call: SetCapParamsCall) { + this._call = call; + } +} + +export class SetCapParamsCallParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/templates/GyroEPool/GyroEPool.ts b/generated/templates/GyroEPool/GyroEPool.ts new file mode 100644 index 000000000..c7df91208 --- /dev/null +++ b/generated/templates/GyroEPool/GyroEPool.ts @@ -0,0 +1,3061 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class CapManagerUpdated extends ethereum.Event { + get params(): CapManagerUpdated__Params { + return new CapManagerUpdated__Params(this); + } +} + +export class CapManagerUpdated__Params { + _event: CapManagerUpdated; + + constructor(event: CapManagerUpdated) { + this._event = event; + } + + get capManager(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class CapParamsUpdated extends ethereum.Event { + get params(): CapParamsUpdated__Params { + return new CapParamsUpdated__Params(this); + } +} + +export class CapParamsUpdated__Params { + _event: CapParamsUpdated; + + constructor(event: CapParamsUpdated) { + this._event = event; + } + + get params(): CapParamsUpdatedParamsStruct { + return changetype( + this._event.parameters[0].value.toTuple() + ); + } +} + +export class CapParamsUpdatedParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class ECLPDerivedParamsValidated extends ethereum.Event { + get params(): ECLPDerivedParamsValidated__Params { + return new ECLPDerivedParamsValidated__Params(this); + } +} + +export class ECLPDerivedParamsValidated__Params { + _event: ECLPDerivedParamsValidated; + + constructor(event: ECLPDerivedParamsValidated) { + this._event = event; + } + + get derivedParamsValidated(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ECLPParamsValidated extends ethereum.Event { + get params(): ECLPParamsValidated__Params { + return new ECLPParamsValidated__Params(this); + } +} + +export class ECLPParamsValidated__Params { + _event: ECLPParamsValidated; + + constructor(event: ECLPParamsValidated) { + this._event = event; + } + + get paramsValidated(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class InvariantAterInitializeJoin extends ethereum.Event { + get params(): InvariantAterInitializeJoin__Params { + return new InvariantAterInitializeJoin__Params(this); + } +} + +export class InvariantAterInitializeJoin__Params { + _event: InvariantAterInitializeJoin; + + constructor(event: InvariantAterInitializeJoin) { + this._event = event; + } + + get invariantAfterJoin(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class InvariantOldAndNew extends ethereum.Event { + get params(): InvariantOldAndNew__Params { + return new InvariantOldAndNew__Params(this); + } +} + +export class InvariantOldAndNew__Params { + _event: InvariantOldAndNew; + + constructor(event: InvariantOldAndNew) { + this._event = event; + } + + get oldInvariant(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get newInvariant(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class OracleEnabledChanged extends ethereum.Event { + get params(): OracleEnabledChanged__Params { + return new OracleEnabledChanged__Params(this); + } +} + +export class OracleEnabledChanged__Params { + _event: OracleEnabledChanged; + + constructor(event: OracleEnabledChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class OracleIndexUpdated extends ethereum.Event { + get params(): OracleIndexUpdated__Params { + return new OracleIndexUpdated__Params(this); + } +} + +export class OracleIndexUpdated__Params { + _event: OracleIndexUpdated; + + constructor(event: OracleIndexUpdated) { + this._event = event; + } + + get oracleUpdatedIndex(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class PauseManagerChanged extends ethereum.Event { + get params(): PauseManagerChanged__Params { + return new PauseManagerChanged__Params(this); + } +} + +export class PauseManagerChanged__Params { + _event: PauseManagerChanged; + + constructor(event: PauseManagerChanged) { + this._event = event; + } + + get oldPauseManager(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newPauseManager(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class PausedLocally extends ethereum.Event { + get params(): PausedLocally__Params { + return new PausedLocally__Params(this); + } +} + +export class PausedLocally__Params { + _event: PausedLocally; + + constructor(event: PausedLocally) { + this._event = event; + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class SwapParams extends ethereum.Event { + get params(): SwapParams__Params { + return new SwapParams__Params(this); + } +} + +export class SwapParams__Params { + _event: SwapParams; + + constructor(event: SwapParams) { + this._event = event; + } + + get balances(): Array { + return this._event.parameters[0].value.toBigIntArray(); + } + + get invariant(): SwapParamsInvariantStruct { + return changetype( + this._event.parameters[1].value.toTuple() + ); + } + + get amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class SwapParamsInvariantStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class UnpausedLocally extends ethereum.Event { + get params(): UnpausedLocally__Params { + return new UnpausedLocally__Params(this); + } +} + +export class UnpausedLocally__Params { + _event: UnpausedLocally; + + constructor(event: UnpausedLocally) { + this._event = event; + } +} + +export class GyroEPool__capParamsResultValue0Struct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class GyroEPool__getECLPParamsResultParamsStruct extends ethereum.Tuple { + get alpha(): BigInt { + return this[0].toBigInt(); + } + + get beta(): BigInt { + return this[1].toBigInt(); + } + + get c(): BigInt { + return this[2].toBigInt(); + } + + get s(): BigInt { + return this[3].toBigInt(); + } + + get lambda(): BigInt { + return this[4].toBigInt(); + } +} + +export class GyroEPool__getECLPParamsResultDStruct extends ethereum.Tuple { + get tauAlpha(): GyroEPool__getECLPParamsResultDTauAlphaStruct { + return changetype( + this[0].toTuple() + ); + } + + get tauBeta(): GyroEPool__getECLPParamsResultDTauBetaStruct { + return changetype( + this[1].toTuple() + ); + } + + get u(): BigInt { + return this[2].toBigInt(); + } + + get v(): BigInt { + return this[3].toBigInt(); + } + + get w(): BigInt { + return this[4].toBigInt(); + } + + get z(): BigInt { + return this[5].toBigInt(); + } + + get dSq(): BigInt { + return this[6].toBigInt(); + } +} + +export class GyroEPool__getECLPParamsResultDTauAlphaStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class GyroEPool__getECLPParamsResultDTauBetaStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class GyroEPool__getECLPParamsResult { + value0: GyroEPool__getECLPParamsResultParamsStruct; + value1: GyroEPool__getECLPParamsResultDStruct; + + constructor( + value0: GyroEPool__getECLPParamsResultParamsStruct, + value1: GyroEPool__getECLPParamsResultDStruct + ) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromTuple(this.value0)); + map.set("value1", ethereum.Value.fromTuple(this.value1)); + return map; + } +} + +export class GyroEPool__getMiscDataResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: boolean; + value5: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: boolean, + value5: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromBoolean(this.value4)); + map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); + return map; + } +} + +export class GyroEPool__getPastAccumulatorsInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get ago(): BigInt { + return this[1].toBigInt(); + } +} + +export class GyroEPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class GyroEPool__getSampleResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + value5: BigInt; + value6: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt, + value5: BigInt, + value6: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromSignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromSignedBigInt(this.value4)); + map.set("value5", ethereum.Value.fromSignedBigInt(this.value5)); + map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); + return map; + } +} + +export class GyroEPool__getTimeWeightedAverageInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get secs(): BigInt { + return this[1].toBigInt(); + } + + get ago(): BigInt { + return this[2].toBigInt(); + } +} + +export class GyroEPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class GyroEPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class GyroEPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class GyroEPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class GyroEPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class GyroEPool extends ethereum.SmartContract { + static bind(address: Address): GyroEPool { + return new GyroEPool("GyroEPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + _dSq(): BigInt { + let result = super.call("_dSq", "_dSq():(int256)", []); + + return result[0].toBigInt(); + } + + try__dSq(): ethereum.CallResult { + let result = super.tryCall("_dSq", "_dSq():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _paramsAlpha(): BigInt { + let result = super.call("_paramsAlpha", "_paramsAlpha():(int256)", []); + + return result[0].toBigInt(); + } + + try__paramsAlpha(): ethereum.CallResult { + let result = super.tryCall("_paramsAlpha", "_paramsAlpha():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _paramsBeta(): BigInt { + let result = super.call("_paramsBeta", "_paramsBeta():(int256)", []); + + return result[0].toBigInt(); + } + + try__paramsBeta(): ethereum.CallResult { + let result = super.tryCall("_paramsBeta", "_paramsBeta():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _paramsC(): BigInt { + let result = super.call("_paramsC", "_paramsC():(int256)", []); + + return result[0].toBigInt(); + } + + try__paramsC(): ethereum.CallResult { + let result = super.tryCall("_paramsC", "_paramsC():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _paramsLambda(): BigInt { + let result = super.call("_paramsLambda", "_paramsLambda():(int256)", []); + + return result[0].toBigInt(); + } + + try__paramsLambda(): ethereum.CallResult { + let result = super.tryCall("_paramsLambda", "_paramsLambda():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _paramsS(): BigInt { + let result = super.call("_paramsS", "_paramsS():(int256)", []); + + return result[0].toBigInt(); + } + + try__paramsS(): ethereum.CallResult { + let result = super.tryCall("_paramsS", "_paramsS():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _tauAlphaX(): BigInt { + let result = super.call("_tauAlphaX", "_tauAlphaX():(int256)", []); + + return result[0].toBigInt(); + } + + try__tauAlphaX(): ethereum.CallResult { + let result = super.tryCall("_tauAlphaX", "_tauAlphaX():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _tauAlphaY(): BigInt { + let result = super.call("_tauAlphaY", "_tauAlphaY():(int256)", []); + + return result[0].toBigInt(); + } + + try__tauAlphaY(): ethereum.CallResult { + let result = super.tryCall("_tauAlphaY", "_tauAlphaY():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _tauBetaX(): BigInt { + let result = super.call("_tauBetaX", "_tauBetaX():(int256)", []); + + return result[0].toBigInt(); + } + + try__tauBetaX(): ethereum.CallResult { + let result = super.tryCall("_tauBetaX", "_tauBetaX():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _tauBetaY(): BigInt { + let result = super.call("_tauBetaY", "_tauBetaY():(int256)", []); + + return result[0].toBigInt(); + } + + try__tauBetaY(): ethereum.CallResult { + let result = super.tryCall("_tauBetaY", "_tauBetaY():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _u(): BigInt { + let result = super.call("_u", "_u():(int256)", []); + + return result[0].toBigInt(); + } + + try__u(): ethereum.CallResult { + let result = super.tryCall("_u", "_u():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _v(): BigInt { + let result = super.call("_v", "_v():(int256)", []); + + return result[0].toBigInt(); + } + + try__v(): ethereum.CallResult { + let result = super.tryCall("_v", "_v():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _w(): BigInt { + let result = super.call("_w", "_w():(int256)", []); + + return result[0].toBigInt(); + } + + try__w(): ethereum.CallResult { + let result = super.tryCall("_w", "_w():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + _z(): BigInt { + let result = super.call("_z", "_z():(int256)", []); + + return result[0].toBigInt(); + } + + try__z(): ethereum.CallResult { + let result = super.tryCall("_z", "_z():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + capManager(): Address { + let result = super.call("capManager", "capManager():(address)", []); + + return result[0].toAddress(); + } + + try_capManager(): ethereum.CallResult
{ + let result = super.tryCall("capManager", "capManager():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + capParams(): GyroEPool__capParamsResultValue0Struct { + let result = super.call( + "capParams", + "capParams():((bool,uint120,uint128))", + [] + ); + + return changetype( + result[0].toTuple() + ); + } + + try_capParams(): ethereum.CallResult { + let result = super.tryCall( + "capParams", + "capParams():((bool,uint120,uint128))", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype(value[0].toTuple()) + ); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getECLPParams(): GyroEPool__getECLPParamsResult { + let result = super.call( + "getECLPParams", + "getECLPParams():((int256,int256,int256,int256,int256),((int256,int256),(int256,int256),int256,int256,int256,int256,int256))", + [] + ); + + return changetype( + new GyroEPool__getECLPParamsResult( + changetype( + result[0].toTuple() + ), + changetype(result[1].toTuple()) + ) + ); + } + + try_getECLPParams(): ethereum.CallResult { + let result = super.tryCall( + "getECLPParams", + "getECLPParams():((int256,int256,int256,int256,int256),((int256,int256),(int256,int256),int256,int256,int256,int256,int256))", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype( + new GyroEPool__getECLPParamsResult( + changetype( + value[0].toTuple() + ), + changetype(value[1].toTuple()) + ) + ) + ); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLargestSafeQueryWindow(): BigInt { + let result = super.call( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLargestSafeQueryWindow(): ethereum.CallResult { + let result = super.tryCall( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): BigInt { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLatest(variable: i32): BigInt { + let result = super.call("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + + return result[0].toBigInt(); + } + + try_getLatest(variable: i32): ethereum.CallResult { + let result = super.tryCall("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMiscData(): GyroEPool__getMiscDataResult { + let result = super.call( + "getMiscData", + "getMiscData():(int256,int256,uint256,uint256,bool,uint256)", + [] + ); + + return new GyroEPool__getMiscDataResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBoolean(), + result[5].toBigInt() + ); + } + + try_getMiscData(): ethereum.CallResult { + let result = super.tryCall( + "getMiscData", + "getMiscData():(int256,int256,uint256,uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new GyroEPool__getMiscDataResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBoolean(), + value[5].toBigInt() + ) + ); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPastAccumulators( + queries: Array + ): Array { + let result = super.call( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getPastAccumulators( + queries: Array + ): ethereum.CallResult> { + let result = super.tryCall( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getPausedState(): GyroEPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new GyroEPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new GyroEPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSample(index: BigInt): GyroEPool__getSampleResult { + let result = super.call( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + + return new GyroEPool__getSampleResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt(), + result[5].toBigInt(), + result[6].toBigInt() + ); + } + + try_getSample( + index: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new GyroEPool__getSampleResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt(), + value[5].toBigInt(), + value[6].toBigInt() + ) + ); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTimeWeightedAverage( + queries: Array + ): Array { + let result = super.call( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getTimeWeightedAverage( + queries: Array + ): ethereum.CallResult> { + let result = super.tryCall( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getTotalSamples(): BigInt { + let result = super.call( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getTotalSamples(): ethereum.CallResult { + let result = super.tryCall( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + gyroConfig(): Address { + let result = super.call("gyroConfig", "gyroConfig():(address)", []); + + return result[0].toAddress(); + } + + try_gyroConfig(): ethereum.CallResult
{ + let result = super.tryCall("gyroConfig", "gyroConfig():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): GyroEPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new GyroEPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new GyroEPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): GyroEPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new GyroEPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new GyroEPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: GyroEPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: GyroEPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + pauseManager(): Address { + let result = super.call("pauseManager", "pauseManager():(address)", []); + + return result[0].toAddress(); + } + + try_pauseManager(): ethereum.CallResult
{ + let result = super.tryCall("pauseManager", "pauseManager():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): GyroEPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new GyroEPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new GyroEPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): GyroEPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new GyroEPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new GyroEPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get configAddress(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get baseParams(): ConstructorCallParamsBaseParamsStruct { + return changetype(this[0].toTuple()); + } + + get eclpParams(): ConstructorCallParamsEclpParamsStruct { + return changetype(this[1].toTuple()); + } + + get derivedEclpParams(): ConstructorCallParamsDerivedEclpParamsStruct { + return changetype( + this[2].toTuple() + ); + } + + get capManager(): Address { + return this[3].toAddress(); + } + + get capParams(): ConstructorCallParamsCapParamsStruct { + return changetype(this[4].toTuple()); + } + + get pauseManager(): Address { + return this[5].toAddress(); + } +} + +export class ConstructorCallParamsBaseParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get name(): string { + return this[1].toString(); + } + + get symbol(): string { + return this[2].toString(); + } + + get token0(): Address { + return this[3].toAddress(); + } + + get token1(): Address { + return this[4].toAddress(); + } + + get swapFeePercentage(): BigInt { + return this[5].toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this[6].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[7].toBigInt(); + } + + get oracleEnabled(): boolean { + return this[8].toBoolean(); + } + + get owner(): Address { + return this[9].toAddress(); + } +} + +export class ConstructorCallParamsEclpParamsStruct extends ethereum.Tuple { + get alpha(): BigInt { + return this[0].toBigInt(); + } + + get beta(): BigInt { + return this[1].toBigInt(); + } + + get c(): BigInt { + return this[2].toBigInt(); + } + + get s(): BigInt { + return this[3].toBigInt(); + } + + get lambda(): BigInt { + return this[4].toBigInt(); + } +} + +export class ConstructorCallParamsDerivedEclpParamsStruct extends ethereum.Tuple { + get tauAlpha(): ConstructorCallParamsDerivedEclpParamsTauAlphaStruct { + return changetype( + this[0].toTuple() + ); + } + + get tauBeta(): ConstructorCallParamsDerivedEclpParamsTauBetaStruct { + return changetype( + this[1].toTuple() + ); + } + + get u(): BigInt { + return this[2].toBigInt(); + } + + get v(): BigInt { + return this[3].toBigInt(); + } + + get w(): BigInt { + return this[4].toBigInt(); + } + + get z(): BigInt { + return this[5].toBigInt(); + } + + get dSq(): BigInt { + return this[6].toBigInt(); + } +} + +export class ConstructorCallParamsDerivedEclpParamsTauAlphaStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class ConstructorCallParamsDerivedEclpParamsTauBetaStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class ConstructorCallParamsCapParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class ChangePauseManagerCall extends ethereum.Call { + get inputs(): ChangePauseManagerCall__Inputs { + return new ChangePauseManagerCall__Inputs(this); + } + + get outputs(): ChangePauseManagerCall__Outputs { + return new ChangePauseManagerCall__Outputs(this); + } +} + +export class ChangePauseManagerCall__Inputs { + _call: ChangePauseManagerCall; + + constructor(call: ChangePauseManagerCall) { + this._call = call; + } + + get _pauseManager(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class ChangePauseManagerCall__Outputs { + _call: ChangePauseManagerCall; + + constructor(call: ChangePauseManagerCall) { + this._call = call; + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DirtyUninitializedOracleSamplesCall extends ethereum.Call { + get inputs(): DirtyUninitializedOracleSamplesCall__Inputs { + return new DirtyUninitializedOracleSamplesCall__Inputs(this); + } + + get outputs(): DirtyUninitializedOracleSamplesCall__Outputs { + return new DirtyUninitializedOracleSamplesCall__Outputs(this); + } +} + +export class DirtyUninitializedOracleSamplesCall__Inputs { + _call: DirtyUninitializedOracleSamplesCall; + + constructor(call: DirtyUninitializedOracleSamplesCall) { + this._call = call; + } + + get startIndex(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endIndex(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DirtyUninitializedOracleSamplesCall__Outputs { + _call: DirtyUninitializedOracleSamplesCall; + + constructor(call: DirtyUninitializedOracleSamplesCall) { + this._call = call; + } +} + +export class EnableOracleCall extends ethereum.Call { + get inputs(): EnableOracleCall__Inputs { + return new EnableOracleCall__Inputs(this); + } + + get outputs(): EnableOracleCall__Outputs { + return new EnableOracleCall__Outputs(this); + } +} + +export class EnableOracleCall__Inputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class EnableOracleCall__Outputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get amountsIn(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetCapManagerCall extends ethereum.Call { + get inputs(): SetCapManagerCall__Inputs { + return new SetCapManagerCall__Inputs(this); + } + + get outputs(): SetCapManagerCall__Outputs { + return new SetCapManagerCall__Outputs(this); + } +} + +export class SetCapManagerCall__Inputs { + _call: SetCapManagerCall; + + constructor(call: SetCapManagerCall) { + this._call = call; + } + + get _capManager(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetCapManagerCall__Outputs { + _call: SetCapManagerCall; + + constructor(call: SetCapManagerCall) { + this._call = call; + } +} + +export class SetCapParamsCall extends ethereum.Call { + get inputs(): SetCapParamsCall__Inputs { + return new SetCapParamsCall__Inputs(this); + } + + get outputs(): SetCapParamsCall__Outputs { + return new SetCapParamsCall__Outputs(this); + } +} + +export class SetCapParamsCall__Inputs { + _call: SetCapParamsCall; + + constructor(call: SetCapParamsCall) { + this._call = call; + } + + get params(): SetCapParamsCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class SetCapParamsCall__Outputs { + _call: SetCapParamsCall; + + constructor(call: SetCapParamsCall) { + this._call = call; + } +} + +export class SetCapParamsCallParamsStruct extends ethereum.Tuple { + get capEnabled(): boolean { + return this[0].toBoolean(); + } + + get perAddressCap(): BigInt { + return this[1].toBigInt(); + } + + get globalCap(): BigInt { + return this[2].toBigInt(); + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/templates/InvestmentPool/InvestmentPool.ts b/generated/templates/InvestmentPool/InvestmentPool.ts new file mode 100644 index 000000000..c2486333c --- /dev/null +++ b/generated/templates/InvestmentPool/InvestmentPool.ts @@ -0,0 +1,2156 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class GradualWeightUpdateScheduled extends ethereum.Event { + get params(): GradualWeightUpdateScheduled__Params { + return new GradualWeightUpdateScheduled__Params(this); + } +} + +export class GradualWeightUpdateScheduled__Params { + _event: GradualWeightUpdateScheduled; + + constructor(event: GradualWeightUpdateScheduled) { + this._event = event; + } + + get startTime(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startWeights(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } + + get endWeights(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } +} + +export class ManagementFeePercentageChanged extends ethereum.Event { + get params(): ManagementFeePercentageChanged__Params { + return new ManagementFeePercentageChanged__Params(this); + } +} + +export class ManagementFeePercentageChanged__Params { + _event: ManagementFeePercentageChanged; + + constructor(event: ManagementFeePercentageChanged) { + this._event = event; + } + + get managementFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class ManagementFeesCollected extends ethereum.Event { + get params(): ManagementFeesCollected__Params { + return new ManagementFeesCollected__Params(this); + } +} + +export class ManagementFeesCollected__Params { + _event: ManagementFeesCollected; + + constructor(event: ManagementFeesCollected) { + this._event = event; + } + + get tokens(): Array
{ + return this._event.parameters[0].value.toAddressArray(); + } + + get amounts(): Array { + return this._event.parameters[1].value.toBigIntArray(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapEnabledSet extends ethereum.Event { + get params(): SwapEnabledSet__Params { + return new SwapEnabledSet__Params(this); + } +} + +export class SwapEnabledSet__Params { + _event: SwapEnabledSet; + + constructor(event: SwapEnabledSet) { + this._event = event; + } + + get swapEnabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class InvestmentPool__getCollectedManagementFeesResult { + value0: Array
; + value1: Array; + + constructor(value0: Array
, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddressArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class InvestmentPool__getGradualWeightUpdateParamsResult { + value0: BigInt; + value1: BigInt; + value2: Array; + + constructor(value0: BigInt, value1: BigInt, value2: Array) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigIntArray(this.value2)); + return map; + } +} + +export class InvestmentPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class InvestmentPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class InvestmentPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class InvestmentPool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class InvestmentPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class InvestmentPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class InvestmentPool extends ethereum.SmartContract { + static bind(address: Address): InvestmentPool { + return new InvestmentPool("InvestmentPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCollectedManagementFees(): InvestmentPool__getCollectedManagementFeesResult { + let result = super.call( + "getCollectedManagementFees", + "getCollectedManagementFees():(address[],uint256[])", + [] + ); + + return new InvestmentPool__getCollectedManagementFeesResult( + result[0].toAddressArray(), + result[1].toBigIntArray() + ); + } + + try_getCollectedManagementFees(): ethereum.CallResult< + InvestmentPool__getCollectedManagementFeesResult + > { + let result = super.tryCall( + "getCollectedManagementFees", + "getCollectedManagementFees():(address[],uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new InvestmentPool__getCollectedManagementFeesResult( + value[0].toAddressArray(), + value[1].toBigIntArray() + ) + ); + } + + getGradualWeightUpdateParams(): InvestmentPool__getGradualWeightUpdateParamsResult { + let result = super.call( + "getGradualWeightUpdateParams", + "getGradualWeightUpdateParams():(uint256,uint256,uint256[])", + [] + ); + + return new InvestmentPool__getGradualWeightUpdateParamsResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigIntArray() + ); + } + + try_getGradualWeightUpdateParams(): ethereum.CallResult< + InvestmentPool__getGradualWeightUpdateParamsResult + > { + let result = super.tryCall( + "getGradualWeightUpdateParams", + "getGradualWeightUpdateParams():(uint256,uint256,uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new InvestmentPool__getGradualWeightUpdateParamsResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigIntArray() + ) + ); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): BigInt { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getManagementSwapFeePercentage(): BigInt { + let result = super.call( + "getManagementSwapFeePercentage", + "getManagementSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getManagementSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getManagementSwapFeePercentage", + "getManagementSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMinimumWeightChangeDuration(): BigInt { + let result = super.call( + "getMinimumWeightChangeDuration", + "getMinimumWeightChangeDuration():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinimumWeightChangeDuration(): ethereum.CallResult { + let result = super.tryCall( + "getMinimumWeightChangeDuration", + "getMinimumWeightChangeDuration():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): InvestmentPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new InvestmentPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + InvestmentPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new InvestmentPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapEnabled(): boolean { + let result = super.call("getSwapEnabled", "getSwapEnabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_getSwapEnabled(): ethereum.CallResult { + let result = super.tryCall("getSwapEnabled", "getSwapEnabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): InvestmentPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new InvestmentPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new InvestmentPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): InvestmentPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new InvestmentPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new InvestmentPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: InvestmentPool__onSwapInputSwapRequestStruct, + currentBalanceTokenIn: BigInt, + currentBalanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenIn), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: InvestmentPool__onSwapInputSwapRequestStruct, + currentBalanceTokenIn: BigInt, + currentBalanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenIn), + ethereum.Value.fromUnsignedBigInt(currentBalanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): InvestmentPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new InvestmentPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new InvestmentPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): InvestmentPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new InvestmentPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new InvestmentPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get name(): string { + return this[1].toString(); + } + + get symbol(): string { + return this[2].toString(); + } + + get tokens(): Array
{ + return this[3].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[4].toBigIntArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this[7].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[8].toBigInt(); + } + + get owner(): Address { + return this[9].toAddress(); + } + + get swapEnabledOnStart(): boolean { + return this[10].toBoolean(); + } + + get managementSwapFeePercentage(): BigInt { + return this[11].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get swapRequest(): OnSwapCallSwapRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get currentBalanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get currentBalanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapEnabledCall extends ethereum.Call { + get inputs(): SetSwapEnabledCall__Inputs { + return new SetSwapEnabledCall__Inputs(this); + } + + get outputs(): SetSwapEnabledCall__Outputs { + return new SetSwapEnabledCall__Outputs(this); + } +} + +export class SetSwapEnabledCall__Inputs { + _call: SetSwapEnabledCall; + + constructor(call: SetSwapEnabledCall) { + this._call = call; + } + + get swapEnabled(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetSwapEnabledCall__Outputs { + _call: SetSwapEnabledCall; + + constructor(call: SetSwapEnabledCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UpdateWeightsGraduallyCall extends ethereum.Call { + get inputs(): UpdateWeightsGraduallyCall__Inputs { + return new UpdateWeightsGraduallyCall__Inputs(this); + } + + get outputs(): UpdateWeightsGraduallyCall__Outputs { + return new UpdateWeightsGraduallyCall__Outputs(this); + } +} + +export class UpdateWeightsGraduallyCall__Inputs { + _call: UpdateWeightsGraduallyCall; + + constructor(call: UpdateWeightsGraduallyCall) { + this._call = call; + } + + get startTime(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get endWeights(): Array { + return this._call.inputValues[2].value.toBigIntArray(); + } +} + +export class UpdateWeightsGraduallyCall__Outputs { + _call: UpdateWeightsGraduallyCall; + + constructor(call: UpdateWeightsGraduallyCall) { + this._call = call; + } +} + +export class WithdrawCollectedManagementFeesCall extends ethereum.Call { + get inputs(): WithdrawCollectedManagementFeesCall__Inputs { + return new WithdrawCollectedManagementFeesCall__Inputs(this); + } + + get outputs(): WithdrawCollectedManagementFeesCall__Outputs { + return new WithdrawCollectedManagementFeesCall__Outputs(this); + } +} + +export class WithdrawCollectedManagementFeesCall__Inputs { + _call: WithdrawCollectedManagementFeesCall; + + constructor(call: WithdrawCollectedManagementFeesCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class WithdrawCollectedManagementFeesCall__Outputs { + _call: WithdrawCollectedManagementFeesCall; + + constructor(call: WithdrawCollectedManagementFeesCall) { + this._call = call; + } +} diff --git a/generated/templates/LinearPool/LinearPool.ts b/generated/templates/LinearPool/LinearPool.ts new file mode 100644 index 000000000..77085c07e --- /dev/null +++ b/generated/templates/LinearPool/LinearPool.ts @@ -0,0 +1,1721 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class TargetsSet extends ethereum.Event { + get params(): TargetsSet__Params { + return new TargetsSet__Params(this); + } +} + +export class TargetsSet__Params { + _event: TargetsSet; + + constructor(event: TargetsSet) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get lowerTarget(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get upperTarget(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class LinearPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class LinearPool__getTargetsResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class LinearPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LinearPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LinearPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class LinearPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LinearPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LinearPool extends ethereum.SmartContract { + static bind(address: Address): LinearPool { + return new LinearPool("LinearPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getBptIndex(): BigInt { + let result = super.call("getBptIndex", "getBptIndex():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getBptIndex(): ethereum.CallResult { + let result = super.tryCall("getBptIndex", "getBptIndex():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMainIndex(): BigInt { + let result = super.call("getMainIndex", "getMainIndex():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getMainIndex(): ethereum.CallResult { + let result = super.tryCall("getMainIndex", "getMainIndex():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMainToken(): Address { + let result = super.call("getMainToken", "getMainToken():(address)", []); + + return result[0].toAddress(); + } + + try_getMainToken(): ethereum.CallResult
{ + let result = super.tryCall("getMainToken", "getMainToken():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): LinearPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new LinearPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LinearPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTargets(): LinearPool__getTargetsResult { + let result = super.call("getTargets", "getTargets():(uint256,uint256)", []); + + return new LinearPool__getTargetsResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getTargets(): ethereum.CallResult { + let result = super.tryCall( + "getTargets", + "getTargets():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LinearPool__getTargetsResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVirtualSupply(): BigInt { + let result = super.call( + "getVirtualSupply", + "getVirtualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getVirtualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getVirtualSupply", + "getVirtualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getWrappedIndex(): BigInt { + let result = super.call( + "getWrappedIndex", + "getWrappedIndex():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getWrappedIndex(): ethereum.CallResult { + let result = super.tryCall( + "getWrappedIndex", + "getWrappedIndex():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getWrappedToken(): Address { + let result = super.call( + "getWrappedToken", + "getWrappedToken():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getWrappedToken(): ethereum.CallResult
{ + let result = super.tryCall( + "getWrappedToken", + "getWrappedToken():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getWrappedTokenRate(): BigInt { + let result = super.call( + "getWrappedTokenRate", + "getWrappedTokenRate():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getWrappedTokenRate(): ethereum.CallResult { + let result = super.tryCall( + "getWrappedTokenRate", + "getWrappedTokenRate():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LinearPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LinearPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LinearPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LinearPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LinearPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LinearPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: LinearPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: LinearPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LinearPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LinearPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LinearPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LinearPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LinearPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LinearPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class InitializeCall extends ethereum.Call { + get inputs(): InitializeCall__Inputs { + return new InitializeCall__Inputs(this); + } + + get outputs(): InitializeCall__Outputs { + return new InitializeCall__Outputs(this); + } +} + +export class InitializeCall__Inputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } +} + +export class InitializeCall__Outputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class SetTargetsCall extends ethereum.Call { + get inputs(): SetTargetsCall__Inputs { + return new SetTargetsCall__Inputs(this); + } + + get outputs(): SetTargetsCall__Outputs { + return new SetTargetsCall__Outputs(this); + } +} + +export class SetTargetsCall__Inputs { + _call: SetTargetsCall; + + constructor(call: SetTargetsCall) { + this._call = call; + } + + get newLowerTarget(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get newUpperTarget(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class SetTargetsCall__Outputs { + _call: SetTargetsCall; + + constructor(call: SetTargetsCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/templates/LiquidityBootstrappingPool/LiquidityBootstrappingPool.ts b/generated/templates/LiquidityBootstrappingPool/LiquidityBootstrappingPool.ts new file mode 100644 index 000000000..47e46367d --- /dev/null +++ b/generated/templates/LiquidityBootstrappingPool/LiquidityBootstrappingPool.ts @@ -0,0 +1,1872 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class GradualWeightUpdateScheduled extends ethereum.Event { + get params(): GradualWeightUpdateScheduled__Params { + return new GradualWeightUpdateScheduled__Params(this); + } +} + +export class GradualWeightUpdateScheduled__Params { + _event: GradualWeightUpdateScheduled; + + constructor(event: GradualWeightUpdateScheduled) { + this._event = event; + } + + get startTime(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startWeights(): Array { + return this._event.parameters[2].value.toBigIntArray(); + } + + get endWeights(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapEnabledSet extends ethereum.Event { + get params(): SwapEnabledSet__Params { + return new SwapEnabledSet__Params(this); + } +} + +export class SwapEnabledSet__Params { + _event: SwapEnabledSet; + + constructor(event: SwapEnabledSet) { + this._event = event; + } + + get swapEnabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class LiquidityBootstrappingPool__getGradualWeightUpdateParamsResult { + value0: BigInt; + value1: BigInt; + value2: Array; + + constructor(value0: BigInt, value1: BigInt, value2: Array) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigIntArray(this.value2)); + return map; + } +} + +export class LiquidityBootstrappingPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class LiquidityBootstrappingPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LiquidityBootstrappingPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LiquidityBootstrappingPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class LiquidityBootstrappingPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LiquidityBootstrappingPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class LiquidityBootstrappingPool extends ethereum.SmartContract { + static bind(address: Address): LiquidityBootstrappingPool { + return new LiquidityBootstrappingPool( + "LiquidityBootstrappingPool", + address + ); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getGradualWeightUpdateParams(): LiquidityBootstrappingPool__getGradualWeightUpdateParamsResult { + let result = super.call( + "getGradualWeightUpdateParams", + "getGradualWeightUpdateParams():(uint256,uint256,uint256[])", + [] + ); + + return new LiquidityBootstrappingPool__getGradualWeightUpdateParamsResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigIntArray() + ); + } + + try_getGradualWeightUpdateParams(): ethereum.CallResult< + LiquidityBootstrappingPool__getGradualWeightUpdateParamsResult + > { + let result = super.tryCall( + "getGradualWeightUpdateParams", + "getGradualWeightUpdateParams():(uint256,uint256,uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LiquidityBootstrappingPool__getGradualWeightUpdateParamsResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigIntArray() + ) + ); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): BigInt { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): LiquidityBootstrappingPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new LiquidityBootstrappingPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + LiquidityBootstrappingPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LiquidityBootstrappingPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapEnabled(): boolean { + let result = super.call("getSwapEnabled", "getSwapEnabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_getSwapEnabled(): ethereum.CallResult { + let result = super.tryCall("getSwapEnabled", "getSwapEnabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LiquidityBootstrappingPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LiquidityBootstrappingPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LiquidityBootstrappingPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LiquidityBootstrappingPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LiquidityBootstrappingPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LiquidityBootstrappingPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: LiquidityBootstrappingPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: LiquidityBootstrappingPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LiquidityBootstrappingPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LiquidityBootstrappingPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LiquidityBootstrappingPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): LiquidityBootstrappingPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new LiquidityBootstrappingPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new LiquidityBootstrappingPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get tokens(): Array
{ + return this._call.inputValues[3].value.toAddressArray(); + } + + get normalizedWeights(): Array { + return this._call.inputValues[4].value.toBigIntArray(); + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[8].value.toAddress(); + } + + get swapEnabledOnStart(): boolean { + return this._call.inputValues[9].value.toBoolean(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapEnabledCall extends ethereum.Call { + get inputs(): SetSwapEnabledCall__Inputs { + return new SetSwapEnabledCall__Inputs(this); + } + + get outputs(): SetSwapEnabledCall__Outputs { + return new SetSwapEnabledCall__Outputs(this); + } +} + +export class SetSwapEnabledCall__Inputs { + _call: SetSwapEnabledCall; + + constructor(call: SetSwapEnabledCall) { + this._call = call; + } + + get swapEnabled(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetSwapEnabledCall__Outputs { + _call: SetSwapEnabledCall; + + constructor(call: SetSwapEnabledCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UpdateWeightsGraduallyCall extends ethereum.Call { + get inputs(): UpdateWeightsGraduallyCall__Inputs { + return new UpdateWeightsGraduallyCall__Inputs(this); + } + + get outputs(): UpdateWeightsGraduallyCall__Outputs { + return new UpdateWeightsGraduallyCall__Outputs(this); + } +} + +export class UpdateWeightsGraduallyCall__Inputs { + _call: UpdateWeightsGraduallyCall; + + constructor(call: UpdateWeightsGraduallyCall) { + this._call = call; + } + + get startTime(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get endWeights(): Array { + return this._call.inputValues[2].value.toBigIntArray(); + } +} + +export class UpdateWeightsGraduallyCall__Outputs { + _call: UpdateWeightsGraduallyCall; + + constructor(call: UpdateWeightsGraduallyCall) { + this._call = call; + } +} diff --git a/generated/templates/MarginTradingPool/MarginTradingPool.ts b/generated/templates/MarginTradingPool/MarginTradingPool.ts new file mode 100644 index 000000000..2541a5dbc --- /dev/null +++ b/generated/templates/MarginTradingPool/MarginTradingPool.ts @@ -0,0 +1,2057 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class MarginOffer extends ethereum.Event { + get params(): MarginOffer__Params { + return new MarginOffer__Params(this); + } +} + +export class MarginOffer__Params { + _event: MarginOffer; + + constructor(event: MarginOffer) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get securityType(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get minOrderSize(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get margin(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get collateral(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get CfiCode(): Bytes { + return this._event.parameters[6].value.toBytes(); + } + + get orderBook(): Address { + return this._event.parameters[7].value.toAddress(); + } + + get issueManager(): Address { + return this._event.parameters[8].value.toAddress(); + } +} + +export class MarginOrderBook extends ethereum.Event { + get params(): MarginOrderBook__Params { + return new MarginOrderBook__Params(this); + } +} + +export class MarginOrderBook__Params { + _event: MarginOrderBook; + + constructor(event: MarginOrderBook) { + this._event = event; + } + + get creator(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountOffered(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get priceOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get stoplossPrice(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get timestamp(): BigInt { + return this._event.parameters[6].value.toBigInt(); + } + + get orderRef(): Bytes { + return this._event.parameters[7].value.toBytes(); + } +} + +export class MarginTradeReport extends ethereum.Event { + get params(): MarginTradeReport__Params { + return new MarginTradeReport__Params(this); + } +} + +export class MarginTradeReport__Params { + _event: MarginTradeReport; + + constructor(event: MarginTradeReport) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderRef(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get party(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get counterparty(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get orderType(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get price(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[6].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[8].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class MarginTradingPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class MarginTradingPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class MarginTradingPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MarginTradingPool extends ethereum.SmartContract { + static bind(address: Address): MarginTradingPool { + return new MarginTradingPool("MarginTradingPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + _orderbook(): Address { + let result = super.call("_orderbook", "_orderbook():(address)", []); + + return result[0].toAddress(); + } + + try__orderbook(): ethereum.CallResult
{ + let result = super.tryCall("_orderbook", "_orderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCollateral(): BigInt { + let result = super.call("getCollateral", "getCollateral():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getCollateral(): ethereum.CallResult { + let result = super.tryCall( + "getCollateral", + "getCollateral():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getMargin(): BigInt { + let result = super.call("getMargin", "getMargin():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getMargin(): ethereum.CallResult { + let result = super.tryCall("getMargin", "getMargin():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMinOrderSize(): BigInt { + let result = super.call( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOrderbook(): Address { + let result = super.call("getOrderbook", "getOrderbook():(address)", []); + + return result[0].toAddress(); + } + + try_getOrderbook(): ethereum.CallResult
{ + let result = super.tryCall("getOrderbook", "getOrderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): MarginTradingPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new MarginTradingPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + MarginTradingPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: MarginTradingPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: MarginTradingPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MarginTradingPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MarginTradingPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MarginTradingPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get factoryPoolParams(): ConstructorCallFactoryPoolParamsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[4].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get securityType(): Bytes { + return this[3].toBytes(); + } + + get currency(): Address { + return this[4].toAddress(); + } + + get cficode(): Bytes { + return this[5].toBytes(); + } + + get minOrderSize(): BigInt { + return this[6].toBigInt(); + } + + get margin(): BigInt { + return this[7].toBigInt(); + } + + get collateral(): BigInt { + return this[8].toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this[9].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/templates/MarginTradingPool/WeightedPool.ts b/generated/templates/MarginTradingPool/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/templates/MarginTradingPool/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/MetaStablePool/MetaStablePool.ts b/generated/templates/MetaStablePool/MetaStablePool.ts new file mode 100644 index 000000000..6a49e08ca --- /dev/null +++ b/generated/templates/MetaStablePool/MetaStablePool.ts @@ -0,0 +1,2530 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class OracleEnabledChanged extends ethereum.Event { + get params(): OracleEnabledChanged__Params { + return new OracleEnabledChanged__Params(this); + } +} + +export class OracleEnabledChanged__Params { + _event: OracleEnabledChanged; + + constructor(event: OracleEnabledChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PriceRateCacheUpdated extends ethereum.Event { + get params(): PriceRateCacheUpdated__Params { + return new PriceRateCacheUpdated__Params(this); + } +} + +export class PriceRateCacheUpdated__Params { + _event: PriceRateCacheUpdated; + + constructor(event: PriceRateCacheUpdated) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get rate(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class PriceRateProviderSet extends ethereum.Event { + get params(): PriceRateProviderSet__Params { + return new PriceRateProviderSet__Params(this); + } +} + +export class PriceRateProviderSet__Params { + _event: PriceRateProviderSet; + + constructor(event: PriceRateProviderSet) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get provider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get cacheDuration(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class MetaStablePool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class MetaStablePool__getLastInvariantResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class MetaStablePool__getOracleMiscDataResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: boolean; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: boolean + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromBoolean(this.value4)); + return map; + } +} + +export class MetaStablePool__getPastAccumulatorsInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get ago(): BigInt { + return this[1].toBigInt(); + } +} + +export class MetaStablePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class MetaStablePool__getPriceRateCacheResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class MetaStablePool__getSampleResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + value5: BigInt; + value6: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt, + value5: BigInt, + value6: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromSignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromSignedBigInt(this.value4)); + map.set("value5", ethereum.Value.fromSignedBigInt(this.value5)); + map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); + return map; + } +} + +export class MetaStablePool__getTimeWeightedAverageInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get secs(): BigInt { + return this[1].toBigInt(); + } + + get ago(): BigInt { + return this[2].toBigInt(); + } +} + +export class MetaStablePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MetaStablePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MetaStablePool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class MetaStablePool__onSwap1InputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class MetaStablePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MetaStablePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class MetaStablePool extends ethereum.SmartContract { + static bind(address: Address): MetaStablePool { + return new MetaStablePool("MetaStablePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAmplificationParameter(): MetaStablePool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new MetaStablePool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + MetaStablePool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getLargestSafeQueryWindow(): BigInt { + let result = super.call( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLargestSafeQueryWindow(): ethereum.CallResult { + let result = super.tryCall( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): MetaStablePool__getLastInvariantResult { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256,uint256)", + [] + ); + + return new MetaStablePool__getLastInvariantResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getLastInvariant(): ethereum.CallResult< + MetaStablePool__getLastInvariantResult + > { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__getLastInvariantResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getLatest(variable: i32): BigInt { + let result = super.call("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + + return result[0].toBigInt(); + } + + try_getLatest(variable: i32): ethereum.CallResult { + let result = super.tryCall("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOracleMiscData(): MetaStablePool__getOracleMiscDataResult { + let result = super.call( + "getOracleMiscData", + "getOracleMiscData():(int256,int256,uint256,uint256,bool)", + [] + ); + + return new MetaStablePool__getOracleMiscDataResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBoolean() + ); + } + + try_getOracleMiscData(): ethereum.CallResult< + MetaStablePool__getOracleMiscDataResult + > { + let result = super.tryCall( + "getOracleMiscData", + "getOracleMiscData():(int256,int256,uint256,uint256,bool)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__getOracleMiscDataResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBoolean() + ) + ); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPastAccumulators( + queries: Array + ): Array { + let result = super.call( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getPastAccumulators( + queries: Array + ): ethereum.CallResult> { + let result = super.tryCall( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getPausedState(): MetaStablePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new MetaStablePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + MetaStablePool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getPriceRateCache(token: Address): MetaStablePool__getPriceRateCacheResult { + let result = super.call( + "getPriceRateCache", + "getPriceRateCache(address):(uint256,uint256,uint256)", + [ethereum.Value.fromAddress(token)] + ); + + return new MetaStablePool__getPriceRateCacheResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPriceRateCache( + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getPriceRateCache", + "getPriceRateCache(address):(uint256,uint256,uint256)", + [ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__getPriceRateCacheResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getSample(index: BigInt): MetaStablePool__getSampleResult { + let result = super.call( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + + return new MetaStablePool__getSampleResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt(), + result[5].toBigInt(), + result[6].toBigInt() + ); + } + + try_getSample( + index: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__getSampleResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt(), + value[5].toBigInt(), + value[6].toBigInt() + ) + ); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTimeWeightedAverage( + queries: Array + ): Array { + let result = super.call( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getTimeWeightedAverage( + queries: Array + ): ethereum.CallResult> { + let result = super.tryCall( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getTotalSamples(): BigInt { + let result = super.call( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getTotalSamples(): ethereum.CallResult { + let result = super.tryCall( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MetaStablePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MetaStablePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MetaStablePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MetaStablePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: MetaStablePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: MetaStablePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onSwap1( + request: MetaStablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap1( + request: MetaStablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MetaStablePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MetaStablePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): MetaStablePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new MetaStablePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MetaStablePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get name(): string { + return this[1].toString(); + } + + get symbol(): string { + return this[2].toString(); + } + + get tokens(): Array
{ + return this[3].toAddressArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get priceRateCacheDuration(): Array { + return this[5].toBigIntArray(); + } + + get amplificationParameter(): BigInt { + return this[6].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[7].toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this[8].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[9].toBigInt(); + } + + get oracleEnabled(): boolean { + return this[10].toBoolean(); + } + + get owner(): Address { + return this[11].toAddress(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class EnableOracleCall extends ethereum.Call { + get inputs(): EnableOracleCall__Inputs { + return new EnableOracleCall__Inputs(this); + } + + get outputs(): EnableOracleCall__Outputs { + return new EnableOracleCall__Outputs(this); + } +} + +export class EnableOracleCall__Inputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class EnableOracleCall__Outputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get amountsOut(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get amountsIn(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class OnSwap1Call extends ethereum.Call { + get inputs(): OnSwap1Call__Inputs { + return new OnSwap1Call__Inputs(this); + } + + get outputs(): OnSwap1Call__Outputs { + return new OnSwap1Call__Outputs(this); + } +} + +export class OnSwap1Call__Inputs { + _call: OnSwap1Call; + + constructor(call: OnSwap1Call) { + this._call = call; + } + + get request(): OnSwap1CallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwap1Call__Outputs { + _call: OnSwap1Call; + + constructor(call: OnSwap1Call) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwap1CallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetPriceRateCacheDurationCall extends ethereum.Call { + get inputs(): SetPriceRateCacheDurationCall__Inputs { + return new SetPriceRateCacheDurationCall__Inputs(this); + } + + get outputs(): SetPriceRateCacheDurationCall__Outputs { + return new SetPriceRateCacheDurationCall__Outputs(this); + } +} + +export class SetPriceRateCacheDurationCall__Inputs { + _call: SetPriceRateCacheDurationCall; + + constructor(call: SetPriceRateCacheDurationCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get duration(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class SetPriceRateCacheDurationCall__Outputs { + _call: SetPriceRateCacheDurationCall; + + constructor(call: SetPriceRateCacheDurationCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UpdatePriceRateCacheCall extends ethereum.Call { + get inputs(): UpdatePriceRateCacheCall__Inputs { + return new UpdatePriceRateCacheCall__Inputs(this); + } + + get outputs(): UpdatePriceRateCacheCall__Outputs { + return new UpdatePriceRateCacheCall__Outputs(this); + } +} + +export class UpdatePriceRateCacheCall__Inputs { + _call: UpdatePriceRateCacheCall; + + constructor(call: UpdatePriceRateCacheCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class UpdatePriceRateCacheCall__Outputs { + _call: UpdatePriceRateCacheCall; + + constructor(call: UpdatePriceRateCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/MetaStablePool/StablePool.ts b/generated/templates/MetaStablePool/StablePool.ts new file mode 100644 index 000000000..626dd6b59 --- /dev/null +++ b/generated/templates/MetaStablePool/StablePool.ts @@ -0,0 +1,1860 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class StablePool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__onSwap1InputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool extends ethereum.SmartContract { + static bind(address: Address): StablePool { + return new StablePool("StablePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAmplificationParameter(): StablePool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new StablePool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + StablePool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): StablePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new StablePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get tokens(): Array
{ + return this._call.inputValues[3].value.toAddressArray(); + } + + get amplificationParameter(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[8].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/templates/OffchainAggregator/AccessControlledOffchainAggregator.ts b/generated/templates/OffchainAggregator/AccessControlledOffchainAggregator.ts new file mode 100644 index 000000000..9e770d642 --- /dev/null +++ b/generated/templates/OffchainAggregator/AccessControlledOffchainAggregator.ts @@ -0,0 +1,2007 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AddedAccess extends ethereum.Event { + get params(): AddedAccess__Params { + return new AddedAccess__Params(this); + } +} + +export class AddedAccess__Params { + _event: AddedAccess; + + constructor(event: AddedAccess) { + this._event = event; + } + + get user(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class AnswerUpdated extends ethereum.Event { + get params(): AnswerUpdated__Params { + return new AnswerUpdated__Params(this); + } +} + +export class AnswerUpdated__Params { + _event: AnswerUpdated; + + constructor(event: AnswerUpdated) { + this._event = event; + } + + get current(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get roundId(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get updatedAt(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class BillingAccessControllerSet extends ethereum.Event { + get params(): BillingAccessControllerSet__Params { + return new BillingAccessControllerSet__Params(this); + } +} + +export class BillingAccessControllerSet__Params { + _event: BillingAccessControllerSet; + + constructor(event: BillingAccessControllerSet) { + this._event = event; + } + + get old(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get current(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class BillingSet extends ethereum.Event { + get params(): BillingSet__Params { + return new BillingSet__Params(this); + } +} + +export class BillingSet__Params { + _event: BillingSet; + + constructor(event: BillingSet) { + this._event = event; + } + + get maximumGasPrice(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get reasonableGasPrice(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get microLinkPerEth(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get linkGweiPerObservation(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get linkGweiPerTransmission(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } +} + +export class CheckAccessDisabled extends ethereum.Event { + get params(): CheckAccessDisabled__Params { + return new CheckAccessDisabled__Params(this); + } +} + +export class CheckAccessDisabled__Params { + _event: CheckAccessDisabled; + + constructor(event: CheckAccessDisabled) { + this._event = event; + } +} + +export class CheckAccessEnabled extends ethereum.Event { + get params(): CheckAccessEnabled__Params { + return new CheckAccessEnabled__Params(this); + } +} + +export class CheckAccessEnabled__Params { + _event: CheckAccessEnabled; + + constructor(event: CheckAccessEnabled) { + this._event = event; + } +} + +export class ConfigSet extends ethereum.Event { + get params(): ConfigSet__Params { + return new ConfigSet__Params(this); + } +} + +export class ConfigSet__Params { + _event: ConfigSet; + + constructor(event: ConfigSet) { + this._event = event; + } + + get previousConfigBlockNumber(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get configCount(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get signers(): Array
{ + return this._event.parameters[2].value.toAddressArray(); + } + + get transmitters(): Array
{ + return this._event.parameters[3].value.toAddressArray(); + } + + get threshold(): i32 { + return this._event.parameters[4].value.toI32(); + } + + get encodedConfigVersion(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get encoded(): Bytes { + return this._event.parameters[6].value.toBytes(); + } +} + +export class LinkTokenSet extends ethereum.Event { + get params(): LinkTokenSet__Params { + return new LinkTokenSet__Params(this); + } +} + +export class LinkTokenSet__Params { + _event: LinkTokenSet; + + constructor(event: LinkTokenSet) { + this._event = event; + } + + get _oldLinkToken(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get _newLinkToken(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class NewRound extends ethereum.Event { + get params(): NewRound__Params { + return new NewRound__Params(this); + } +} + +export class NewRound__Params { + _event: NewRound; + + constructor(event: NewRound) { + this._event = event; + } + + get roundId(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get startedBy(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get startedAt(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class NewTransmission extends ethereum.Event { + get params(): NewTransmission__Params { + return new NewTransmission__Params(this); + } +} + +export class NewTransmission__Params { + _event: NewTransmission; + + constructor(event: NewTransmission) { + this._event = event; + } + + get aggregatorRoundId(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get answer(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get transmitter(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get observations(): Array { + return this._event.parameters[3].value.toBigIntArray(); + } + + get observers(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get rawReportContext(): Bytes { + return this._event.parameters[5].value.toBytes(); + } +} + +export class OraclePaid extends ethereum.Event { + get params(): OraclePaid__Params { + return new OraclePaid__Params(this); + } +} + +export class OraclePaid__Params { + _event: OraclePaid; + + constructor(event: OraclePaid) { + this._event = event; + } + + get transmitter(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get payee(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get linkToken(): Address { + return this._event.parameters[3].value.toAddress(); + } +} + +export class OwnershipTransferRequested extends ethereum.Event { + get params(): OwnershipTransferRequested__Params { + return new OwnershipTransferRequested__Params(this); + } +} + +export class OwnershipTransferRequested__Params { + _event: OwnershipTransferRequested; + + constructor(event: OwnershipTransferRequested) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class PayeeshipTransferRequested extends ethereum.Event { + get params(): PayeeshipTransferRequested__Params { + return new PayeeshipTransferRequested__Params(this); + } +} + +export class PayeeshipTransferRequested__Params { + _event: PayeeshipTransferRequested; + + constructor(event: PayeeshipTransferRequested) { + this._event = event; + } + + get transmitter(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get current(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get proposed(): Address { + return this._event.parameters[2].value.toAddress(); + } +} + +export class PayeeshipTransferred extends ethereum.Event { + get params(): PayeeshipTransferred__Params { + return new PayeeshipTransferred__Params(this); + } +} + +export class PayeeshipTransferred__Params { + _event: PayeeshipTransferred; + + constructor(event: PayeeshipTransferred) { + this._event = event; + } + + get transmitter(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get previous(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get current(): Address { + return this._event.parameters[2].value.toAddress(); + } +} + +export class RemovedAccess extends ethereum.Event { + get params(): RemovedAccess__Params { + return new RemovedAccess__Params(this); + } +} + +export class RemovedAccess__Params { + _event: RemovedAccess; + + constructor(event: RemovedAccess) { + this._event = event; + } + + get user(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class RequesterAccessControllerSet extends ethereum.Event { + get params(): RequesterAccessControllerSet__Params { + return new RequesterAccessControllerSet__Params(this); + } +} + +export class RequesterAccessControllerSet__Params { + _event: RequesterAccessControllerSet; + + constructor(event: RequesterAccessControllerSet) { + this._event = event; + } + + get old(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get current(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class RoundRequested extends ethereum.Event { + get params(): RoundRequested__Params { + return new RoundRequested__Params(this); + } +} + +export class RoundRequested__Params { + _event: RoundRequested; + + constructor(event: RoundRequested) { + this._event = event; + } + + get requester(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get configDigest(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get epoch(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get round(): i32 { + return this._event.parameters[3].value.toI32(); + } +} + +export class ValidatorConfigSet extends ethereum.Event { + get params(): ValidatorConfigSet__Params { + return new ValidatorConfigSet__Params(this); + } +} + +export class ValidatorConfigSet__Params { + _event: ValidatorConfigSet; + + constructor(event: ValidatorConfigSet) { + this._event = event; + } + + get previousValidator(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get previousGasLimit(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get currentValidator(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get currentGasLimit(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AccessControlledOffchainAggregator__getBillingResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); + return map; + } +} + +export class AccessControlledOffchainAggregator__getRoundDataResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); + return map; + } +} + +export class AccessControlledOffchainAggregator__latestConfigDetailsResult { + value0: BigInt; + value1: BigInt; + value2: Bytes; + + constructor(value0: BigInt, value1: BigInt, value2: Bytes) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromFixedBytes(this.value2)); + return map; + } +} + +export class AccessControlledOffchainAggregator__latestRoundDataResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); + return map; + } +} + +export class AccessControlledOffchainAggregator__latestTransmissionDetailsResult { + value0: Bytes; + value1: BigInt; + value2: i32; + value3: BigInt; + value4: BigInt; + + constructor( + value0: Bytes, + value1: BigInt, + value2: i32, + value3: BigInt, + value4: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromFixedBytes(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set( + "value2", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) + ); + map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromUnsignedBigInt(this.value4)); + return map; + } +} + +export class AccessControlledOffchainAggregator__validatorConfigResult { + value0: Address; + value1: BigInt; + + constructor(value0: Address, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class AccessControlledOffchainAggregator extends ethereum.SmartContract { + static bind(address: Address): AccessControlledOffchainAggregator { + return new AccessControlledOffchainAggregator( + "AccessControlledOffchainAggregator", + address + ); + } + + billingAccessController(): Address { + let result = super.call( + "billingAccessController", + "billingAccessController():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_billingAccessController(): ethereum.CallResult
{ + let result = super.tryCall( + "billingAccessController", + "billingAccessController():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + checkEnabled(): boolean { + let result = super.call("checkEnabled", "checkEnabled():(bool)", []); + + return result[0].toBoolean(); + } + + try_checkEnabled(): ethereum.CallResult { + let result = super.tryCall("checkEnabled", "checkEnabled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + description(): string { + let result = super.call("description", "description():(string)", []); + + return result[0].toString(); + } + + try_description(): ethereum.CallResult { + let result = super.tryCall("description", "description():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + getAnswer(_roundId: BigInt): BigInt { + let result = super.call("getAnswer", "getAnswer(uint256):(int256)", [ + ethereum.Value.fromUnsignedBigInt(_roundId) + ]); + + return result[0].toBigInt(); + } + + try_getAnswer(_roundId: BigInt): ethereum.CallResult { + let result = super.tryCall("getAnswer", "getAnswer(uint256):(int256)", [ + ethereum.Value.fromUnsignedBigInt(_roundId) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getBilling(): AccessControlledOffchainAggregator__getBillingResult { + let result = super.call( + "getBilling", + "getBilling():(uint32,uint32,uint32,uint32,uint32)", + [] + ); + + return new AccessControlledOffchainAggregator__getBillingResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt() + ); + } + + try_getBilling(): ethereum.CallResult< + AccessControlledOffchainAggregator__getBillingResult + > { + let result = super.tryCall( + "getBilling", + "getBilling():(uint32,uint32,uint32,uint32,uint32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new AccessControlledOffchainAggregator__getBillingResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt() + ) + ); + } + + getLinkToken(): Address { + let result = super.call("getLinkToken", "getLinkToken():(address)", []); + + return result[0].toAddress(); + } + + try_getLinkToken(): ethereum.CallResult
{ + let result = super.tryCall("getLinkToken", "getLinkToken():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRoundData( + _roundId: BigInt + ): AccessControlledOffchainAggregator__getRoundDataResult { + let result = super.call( + "getRoundData", + "getRoundData(uint80):(uint80,int256,uint256,uint256,uint80)", + [ethereum.Value.fromUnsignedBigInt(_roundId)] + ); + + return new AccessControlledOffchainAggregator__getRoundDataResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt() + ); + } + + try_getRoundData( + _roundId: BigInt + ): ethereum.CallResult< + AccessControlledOffchainAggregator__getRoundDataResult + > { + let result = super.tryCall( + "getRoundData", + "getRoundData(uint80):(uint80,int256,uint256,uint256,uint80)", + [ethereum.Value.fromUnsignedBigInt(_roundId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new AccessControlledOffchainAggregator__getRoundDataResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt() + ) + ); + } + + getTimestamp(_roundId: BigInt): BigInt { + let result = super.call("getTimestamp", "getTimestamp(uint256):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(_roundId) + ]); + + return result[0].toBigInt(); + } + + try_getTimestamp(_roundId: BigInt): ethereum.CallResult { + let result = super.tryCall( + "getTimestamp", + "getTimestamp(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(_roundId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hasAccess(_user: Address, _calldata: Bytes): boolean { + let result = super.call("hasAccess", "hasAccess(address,bytes):(bool)", [ + ethereum.Value.fromAddress(_user), + ethereum.Value.fromBytes(_calldata) + ]); + + return result[0].toBoolean(); + } + + try_hasAccess( + _user: Address, + _calldata: Bytes + ): ethereum.CallResult { + let result = super.tryCall("hasAccess", "hasAccess(address,bytes):(bool)", [ + ethereum.Value.fromAddress(_user), + ethereum.Value.fromBytes(_calldata) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + latestAnswer(): BigInt { + let result = super.call("latestAnswer", "latestAnswer():(int256)", []); + + return result[0].toBigInt(); + } + + try_latestAnswer(): ethereum.CallResult { + let result = super.tryCall("latestAnswer", "latestAnswer():(int256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + latestConfigDetails(): AccessControlledOffchainAggregator__latestConfigDetailsResult { + let result = super.call( + "latestConfigDetails", + "latestConfigDetails():(uint32,uint32,bytes16)", + [] + ); + + return new AccessControlledOffchainAggregator__latestConfigDetailsResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBytes() + ); + } + + try_latestConfigDetails(): ethereum.CallResult< + AccessControlledOffchainAggregator__latestConfigDetailsResult + > { + let result = super.tryCall( + "latestConfigDetails", + "latestConfigDetails():(uint32,uint32,bytes16)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new AccessControlledOffchainAggregator__latestConfigDetailsResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBytes() + ) + ); + } + + latestRound(): BigInt { + let result = super.call("latestRound", "latestRound():(uint256)", []); + + return result[0].toBigInt(); + } + + try_latestRound(): ethereum.CallResult { + let result = super.tryCall("latestRound", "latestRound():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + latestRoundData(): AccessControlledOffchainAggregator__latestRoundDataResult { + let result = super.call( + "latestRoundData", + "latestRoundData():(uint80,int256,uint256,uint256,uint80)", + [] + ); + + return new AccessControlledOffchainAggregator__latestRoundDataResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt() + ); + } + + try_latestRoundData(): ethereum.CallResult< + AccessControlledOffchainAggregator__latestRoundDataResult + > { + let result = super.tryCall( + "latestRoundData", + "latestRoundData():(uint80,int256,uint256,uint256,uint80)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new AccessControlledOffchainAggregator__latestRoundDataResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt() + ) + ); + } + + latestTimestamp(): BigInt { + let result = super.call( + "latestTimestamp", + "latestTimestamp():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_latestTimestamp(): ethereum.CallResult { + let result = super.tryCall( + "latestTimestamp", + "latestTimestamp():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + latestTransmissionDetails(): AccessControlledOffchainAggregator__latestTransmissionDetailsResult { + let result = super.call( + "latestTransmissionDetails", + "latestTransmissionDetails():(bytes16,uint32,uint8,int192,uint64)", + [] + ); + + return new AccessControlledOffchainAggregator__latestTransmissionDetailsResult( + result[0].toBytes(), + result[1].toBigInt(), + result[2].toI32(), + result[3].toBigInt(), + result[4].toBigInt() + ); + } + + try_latestTransmissionDetails(): ethereum.CallResult< + AccessControlledOffchainAggregator__latestTransmissionDetailsResult + > { + let result = super.tryCall( + "latestTransmissionDetails", + "latestTransmissionDetails():(bytes16,uint32,uint8,int192,uint64)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new AccessControlledOffchainAggregator__latestTransmissionDetailsResult( + value[0].toBytes(), + value[1].toBigInt(), + value[2].toI32(), + value[3].toBigInt(), + value[4].toBigInt() + ) + ); + } + + linkAvailableForPayment(): BigInt { + let result = super.call( + "linkAvailableForPayment", + "linkAvailableForPayment():(int256)", + [] + ); + + return result[0].toBigInt(); + } + + try_linkAvailableForPayment(): ethereum.CallResult { + let result = super.tryCall( + "linkAvailableForPayment", + "linkAvailableForPayment():(int256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + maxAnswer(): BigInt { + let result = super.call("maxAnswer", "maxAnswer():(int192)", []); + + return result[0].toBigInt(); + } + + try_maxAnswer(): ethereum.CallResult { + let result = super.tryCall("maxAnswer", "maxAnswer():(int192)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + minAnswer(): BigInt { + let result = super.call("minAnswer", "minAnswer():(int192)", []); + + return result[0].toBigInt(); + } + + try_minAnswer(): ethereum.CallResult { + let result = super.tryCall("minAnswer", "minAnswer():(int192)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + oracleObservationCount(_signerOrTransmitter: Address): i32 { + let result = super.call( + "oracleObservationCount", + "oracleObservationCount(address):(uint16)", + [ethereum.Value.fromAddress(_signerOrTransmitter)] + ); + + return result[0].toI32(); + } + + try_oracleObservationCount( + _signerOrTransmitter: Address + ): ethereum.CallResult { + let result = super.tryCall( + "oracleObservationCount", + "oracleObservationCount(address):(uint16)", + [ethereum.Value.fromAddress(_signerOrTransmitter)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + owedPayment(_transmitter: Address): BigInt { + let result = super.call("owedPayment", "owedPayment(address):(uint256)", [ + ethereum.Value.fromAddress(_transmitter) + ]); + + return result[0].toBigInt(); + } + + try_owedPayment(_transmitter: Address): ethereum.CallResult { + let result = super.tryCall( + "owedPayment", + "owedPayment(address):(uint256)", + [ethereum.Value.fromAddress(_transmitter)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + requestNewRound(): BigInt { + let result = super.call( + "requestNewRound", + "requestNewRound():(uint80)", + [] + ); + + return result[0].toBigInt(); + } + + try_requestNewRound(): ethereum.CallResult { + let result = super.tryCall( + "requestNewRound", + "requestNewRound():(uint80)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + requesterAccessController(): Address { + let result = super.call( + "requesterAccessController", + "requesterAccessController():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_requesterAccessController(): ethereum.CallResult
{ + let result = super.tryCall( + "requesterAccessController", + "requesterAccessController():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + transmitters(): Array
{ + let result = super.call("transmitters", "transmitters():(address[])", []); + + return result[0].toAddressArray(); + } + + try_transmitters(): ethereum.CallResult> { + let result = super.tryCall( + "transmitters", + "transmitters():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + typeAndVersion(): string { + let result = super.call("typeAndVersion", "typeAndVersion():(string)", []); + + return result[0].toString(); + } + + try_typeAndVersion(): ethereum.CallResult { + let result = super.tryCall( + "typeAndVersion", + "typeAndVersion():(string)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + validatorConfig(): AccessControlledOffchainAggregator__validatorConfigResult { + let result = super.call( + "validatorConfig", + "validatorConfig():(address,uint32)", + [] + ); + + return new AccessControlledOffchainAggregator__validatorConfigResult( + result[0].toAddress(), + result[1].toBigInt() + ); + } + + try_validatorConfig(): ethereum.CallResult< + AccessControlledOffchainAggregator__validatorConfigResult + > { + let result = super.tryCall( + "validatorConfig", + "validatorConfig():(address,uint32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new AccessControlledOffchainAggregator__validatorConfigResult( + value[0].toAddress(), + value[1].toBigInt() + ) + ); + } + + version(): BigInt { + let result = super.call("version", "version():(uint256)", []); + + return result[0].toBigInt(); + } + + try_version(): ethereum.CallResult { + let result = super.tryCall("version", "version():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _maximumGasPrice(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _reasonableGasPrice(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get _microLinkPerEth(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _linkGweiPerObservation(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get _linkGweiPerTransmission(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get _link(): Address { + return this._call.inputValues[5].value.toAddress(); + } + + get _minAnswer(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get _maxAnswer(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get _billingAccessController(): Address { + return this._call.inputValues[8].value.toAddress(); + } + + get _requesterAccessController(): Address { + return this._call.inputValues[9].value.toAddress(); + } + + get _decimals(): i32 { + return this._call.inputValues[10].value.toI32(); + } + + get description(): string { + return this._call.inputValues[11].value.toString(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class AcceptOwnershipCall extends ethereum.Call { + get inputs(): AcceptOwnershipCall__Inputs { + return new AcceptOwnershipCall__Inputs(this); + } + + get outputs(): AcceptOwnershipCall__Outputs { + return new AcceptOwnershipCall__Outputs(this); + } +} + +export class AcceptOwnershipCall__Inputs { + _call: AcceptOwnershipCall; + + constructor(call: AcceptOwnershipCall) { + this._call = call; + } +} + +export class AcceptOwnershipCall__Outputs { + _call: AcceptOwnershipCall; + + constructor(call: AcceptOwnershipCall) { + this._call = call; + } +} + +export class AcceptPayeeshipCall extends ethereum.Call { + get inputs(): AcceptPayeeshipCall__Inputs { + return new AcceptPayeeshipCall__Inputs(this); + } + + get outputs(): AcceptPayeeshipCall__Outputs { + return new AcceptPayeeshipCall__Outputs(this); + } +} + +export class AcceptPayeeshipCall__Inputs { + _call: AcceptPayeeshipCall; + + constructor(call: AcceptPayeeshipCall) { + this._call = call; + } + + get _transmitter(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class AcceptPayeeshipCall__Outputs { + _call: AcceptPayeeshipCall; + + constructor(call: AcceptPayeeshipCall) { + this._call = call; + } +} + +export class AddAccessCall extends ethereum.Call { + get inputs(): AddAccessCall__Inputs { + return new AddAccessCall__Inputs(this); + } + + get outputs(): AddAccessCall__Outputs { + return new AddAccessCall__Outputs(this); + } +} + +export class AddAccessCall__Inputs { + _call: AddAccessCall; + + constructor(call: AddAccessCall) { + this._call = call; + } + + get _user(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class AddAccessCall__Outputs { + _call: AddAccessCall; + + constructor(call: AddAccessCall) { + this._call = call; + } +} + +export class DisableAccessCheckCall extends ethereum.Call { + get inputs(): DisableAccessCheckCall__Inputs { + return new DisableAccessCheckCall__Inputs(this); + } + + get outputs(): DisableAccessCheckCall__Outputs { + return new DisableAccessCheckCall__Outputs(this); + } +} + +export class DisableAccessCheckCall__Inputs { + _call: DisableAccessCheckCall; + + constructor(call: DisableAccessCheckCall) { + this._call = call; + } +} + +export class DisableAccessCheckCall__Outputs { + _call: DisableAccessCheckCall; + + constructor(call: DisableAccessCheckCall) { + this._call = call; + } +} + +export class EnableAccessCheckCall extends ethereum.Call { + get inputs(): EnableAccessCheckCall__Inputs { + return new EnableAccessCheckCall__Inputs(this); + } + + get outputs(): EnableAccessCheckCall__Outputs { + return new EnableAccessCheckCall__Outputs(this); + } +} + +export class EnableAccessCheckCall__Inputs { + _call: EnableAccessCheckCall; + + constructor(call: EnableAccessCheckCall) { + this._call = call; + } +} + +export class EnableAccessCheckCall__Outputs { + _call: EnableAccessCheckCall; + + constructor(call: EnableAccessCheckCall) { + this._call = call; + } +} + +export class RemoveAccessCall extends ethereum.Call { + get inputs(): RemoveAccessCall__Inputs { + return new RemoveAccessCall__Inputs(this); + } + + get outputs(): RemoveAccessCall__Outputs { + return new RemoveAccessCall__Outputs(this); + } +} + +export class RemoveAccessCall__Inputs { + _call: RemoveAccessCall; + + constructor(call: RemoveAccessCall) { + this._call = call; + } + + get _user(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class RemoveAccessCall__Outputs { + _call: RemoveAccessCall; + + constructor(call: RemoveAccessCall) { + this._call = call; + } +} + +export class RequestNewRoundCall extends ethereum.Call { + get inputs(): RequestNewRoundCall__Inputs { + return new RequestNewRoundCall__Inputs(this); + } + + get outputs(): RequestNewRoundCall__Outputs { + return new RequestNewRoundCall__Outputs(this); + } +} + +export class RequestNewRoundCall__Inputs { + _call: RequestNewRoundCall; + + constructor(call: RequestNewRoundCall) { + this._call = call; + } +} + +export class RequestNewRoundCall__Outputs { + _call: RequestNewRoundCall; + + constructor(call: RequestNewRoundCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class SetBillingCall extends ethereum.Call { + get inputs(): SetBillingCall__Inputs { + return new SetBillingCall__Inputs(this); + } + + get outputs(): SetBillingCall__Outputs { + return new SetBillingCall__Outputs(this); + } +} + +export class SetBillingCall__Inputs { + _call: SetBillingCall; + + constructor(call: SetBillingCall) { + this._call = call; + } + + get _maximumGasPrice(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _reasonableGasPrice(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get _microLinkPerEth(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _linkGweiPerObservation(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get _linkGweiPerTransmission(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } +} + +export class SetBillingCall__Outputs { + _call: SetBillingCall; + + constructor(call: SetBillingCall) { + this._call = call; + } +} + +export class SetBillingAccessControllerCall extends ethereum.Call { + get inputs(): SetBillingAccessControllerCall__Inputs { + return new SetBillingAccessControllerCall__Inputs(this); + } + + get outputs(): SetBillingAccessControllerCall__Outputs { + return new SetBillingAccessControllerCall__Outputs(this); + } +} + +export class SetBillingAccessControllerCall__Inputs { + _call: SetBillingAccessControllerCall; + + constructor(call: SetBillingAccessControllerCall) { + this._call = call; + } + + get _billingAccessController(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetBillingAccessControllerCall__Outputs { + _call: SetBillingAccessControllerCall; + + constructor(call: SetBillingAccessControllerCall) { + this._call = call; + } +} + +export class SetConfigCall extends ethereum.Call { + get inputs(): SetConfigCall__Inputs { + return new SetConfigCall__Inputs(this); + } + + get outputs(): SetConfigCall__Outputs { + return new SetConfigCall__Outputs(this); + } +} + +export class SetConfigCall__Inputs { + _call: SetConfigCall; + + constructor(call: SetConfigCall) { + this._call = call; + } + + get _signers(): Array
{ + return this._call.inputValues[0].value.toAddressArray(); + } + + get _transmitters(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } + + get _threshold(): i32 { + return this._call.inputValues[2].value.toI32(); + } + + get _encodedConfigVersion(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get _encoded(): Bytes { + return this._call.inputValues[4].value.toBytes(); + } +} + +export class SetConfigCall__Outputs { + _call: SetConfigCall; + + constructor(call: SetConfigCall) { + this._call = call; + } +} + +export class SetLinkTokenCall extends ethereum.Call { + get inputs(): SetLinkTokenCall__Inputs { + return new SetLinkTokenCall__Inputs(this); + } + + get outputs(): SetLinkTokenCall__Outputs { + return new SetLinkTokenCall__Outputs(this); + } +} + +export class SetLinkTokenCall__Inputs { + _call: SetLinkTokenCall; + + constructor(call: SetLinkTokenCall) { + this._call = call; + } + + get _linkToken(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class SetLinkTokenCall__Outputs { + _call: SetLinkTokenCall; + + constructor(call: SetLinkTokenCall) { + this._call = call; + } +} + +export class SetPayeesCall extends ethereum.Call { + get inputs(): SetPayeesCall__Inputs { + return new SetPayeesCall__Inputs(this); + } + + get outputs(): SetPayeesCall__Outputs { + return new SetPayeesCall__Outputs(this); + } +} + +export class SetPayeesCall__Inputs { + _call: SetPayeesCall; + + constructor(call: SetPayeesCall) { + this._call = call; + } + + get _transmitters(): Array
{ + return this._call.inputValues[0].value.toAddressArray(); + } + + get _payees(): Array
{ + return this._call.inputValues[1].value.toAddressArray(); + } +} + +export class SetPayeesCall__Outputs { + _call: SetPayeesCall; + + constructor(call: SetPayeesCall) { + this._call = call; + } +} + +export class SetRequesterAccessControllerCall extends ethereum.Call { + get inputs(): SetRequesterAccessControllerCall__Inputs { + return new SetRequesterAccessControllerCall__Inputs(this); + } + + get outputs(): SetRequesterAccessControllerCall__Outputs { + return new SetRequesterAccessControllerCall__Outputs(this); + } +} + +export class SetRequesterAccessControllerCall__Inputs { + _call: SetRequesterAccessControllerCall; + + constructor(call: SetRequesterAccessControllerCall) { + this._call = call; + } + + get _requesterAccessController(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetRequesterAccessControllerCall__Outputs { + _call: SetRequesterAccessControllerCall; + + constructor(call: SetRequesterAccessControllerCall) { + this._call = call; + } +} + +export class SetValidatorConfigCall extends ethereum.Call { + get inputs(): SetValidatorConfigCall__Inputs { + return new SetValidatorConfigCall__Inputs(this); + } + + get outputs(): SetValidatorConfigCall__Outputs { + return new SetValidatorConfigCall__Outputs(this); + } +} + +export class SetValidatorConfigCall__Inputs { + _call: SetValidatorConfigCall; + + constructor(call: SetValidatorConfigCall) { + this._call = call; + } + + get _newValidator(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _newGasLimit(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class SetValidatorConfigCall__Outputs { + _call: SetValidatorConfigCall; + + constructor(call: SetValidatorConfigCall) { + this._call = call; + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get _to(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} + +export class TransferPayeeshipCall extends ethereum.Call { + get inputs(): TransferPayeeshipCall__Inputs { + return new TransferPayeeshipCall__Inputs(this); + } + + get outputs(): TransferPayeeshipCall__Outputs { + return new TransferPayeeshipCall__Outputs(this); + } +} + +export class TransferPayeeshipCall__Inputs { + _call: TransferPayeeshipCall; + + constructor(call: TransferPayeeshipCall) { + this._call = call; + } + + get _transmitter(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _proposed(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class TransferPayeeshipCall__Outputs { + _call: TransferPayeeshipCall; + + constructor(call: TransferPayeeshipCall) { + this._call = call; + } +} + +export class TransmitCall extends ethereum.Call { + get inputs(): TransmitCall__Inputs { + return new TransmitCall__Inputs(this); + } + + get outputs(): TransmitCall__Outputs { + return new TransmitCall__Outputs(this); + } +} + +export class TransmitCall__Inputs { + _call: TransmitCall; + + constructor(call: TransmitCall) { + this._call = call; + } + + get _report(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get _rs(): Array { + return this._call.inputValues[1].value.toBytesArray(); + } + + get _ss(): Array { + return this._call.inputValues[2].value.toBytesArray(); + } + + get _rawVs(): Bytes { + return this._call.inputValues[3].value.toBytes(); + } +} + +export class TransmitCall__Outputs { + _call: TransmitCall; + + constructor(call: TransmitCall) { + this._call = call; + } +} + +export class WithdrawFundsCall extends ethereum.Call { + get inputs(): WithdrawFundsCall__Inputs { + return new WithdrawFundsCall__Inputs(this); + } + + get outputs(): WithdrawFundsCall__Outputs { + return new WithdrawFundsCall__Outputs(this); + } +} + +export class WithdrawFundsCall__Inputs { + _call: WithdrawFundsCall; + + constructor(call: WithdrawFundsCall) { + this._call = call; + } + + get _recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class WithdrawFundsCall__Outputs { + _call: WithdrawFundsCall; + + constructor(call: WithdrawFundsCall) { + this._call = call; + } +} + +export class WithdrawPaymentCall extends ethereum.Call { + get inputs(): WithdrawPaymentCall__Inputs { + return new WithdrawPaymentCall__Inputs(this); + } + + get outputs(): WithdrawPaymentCall__Outputs { + return new WithdrawPaymentCall__Outputs(this); + } +} + +export class WithdrawPaymentCall__Inputs { + _call: WithdrawPaymentCall; + + constructor(call: WithdrawPaymentCall) { + this._call = call; + } + + get _transmitter(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class WithdrawPaymentCall__Outputs { + _call: WithdrawPaymentCall; + + constructor(call: WithdrawPaymentCall) { + this._call = call; + } +} diff --git a/generated/templates/OffchainSecondariesPool/OffchainSecondariesPool.ts b/generated/templates/OffchainSecondariesPool/OffchainSecondariesPool.ts new file mode 100644 index 000000000..1e544679b --- /dev/null +++ b/generated/templates/OffchainSecondariesPool/OffchainSecondariesPool.ts @@ -0,0 +1,1964 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Offer extends ethereum.Event { + get params(): Offer__Params { + return new Offer__Params(this); + } +} + +export class Offer__Params { + _event: Offer; + + constructor(event: Offer) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get orderBook(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get issueManager(): Address { + return this._event.parameters[4].value.toAddress(); + } +} + +export class OrderBook extends ethereum.Event { + get params(): OrderBook__Params { + return new OrderBook__Params(this); + } +} + +export class OrderBook__Params { + _event: OrderBook; + + constructor(event: OrderBook) { + this._event = event; + } + + get creator(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountOffered(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get priceOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get timestamp(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get orderRef(): Bytes { + return this._event.parameters[6].value.toBytes(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class TradeReport extends ethereum.Event { + get params(): TradeReport__Params { + return new TradeReport__Params(this); + } +} + +export class TradeReport__Params { + _event: TradeReport; + + constructor(event: TradeReport) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderRef(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get party(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get counterparty(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get orderType(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get price(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[6].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[8].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class OffchainSecondariesPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class OffchainSecondariesPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class OffchainSecondariesPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class OffchainSecondariesPool extends ethereum.SmartContract { + static bind(address: Address): OffchainSecondariesPool { + return new OffchainSecondariesPool("OffchainSecondariesPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + _orderbook(): Address { + let result = super.call("_orderbook", "_orderbook():(address)", []); + + return result[0].toAddress(); + } + + try__orderbook(): ethereum.CallResult
{ + let result = super.tryCall("_orderbook", "_orderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getMinOrderSize(): BigInt { + let result = super.call( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): OffchainSecondariesPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new OffchainSecondariesPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + OffchainSecondariesPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: OffchainSecondariesPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: OffchainSecondariesPool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): OffchainSecondariesPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new OffchainSecondariesPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new OffchainSecondariesPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get security(): Address { + return this._call.inputValues[3].value.toAddress(); + } + + get currency(): Address { + return this._call.inputValues[4].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[8].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[9].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/templates/OffchainSecondariesPool/WeightedPool.ts b/generated/templates/OffchainSecondariesPool/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/templates/OffchainSecondariesPool/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/PrimaryIssuePool/PrimaryIssuePool.ts b/generated/templates/PrimaryIssuePool/PrimaryIssuePool.ts new file mode 100644 index 000000000..83faccd83 --- /dev/null +++ b/generated/templates/PrimaryIssuePool/PrimaryIssuePool.ts @@ -0,0 +1,2080 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class OpenIssue extends ethereum.Event { + get params(): OpenIssue__Params { + return new OpenIssue__Params(this); + } +} + +export class OpenIssue__Params { + _event: OpenIssue; + + constructor(event: OpenIssue) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get minimumOrderSize(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get minimumPrice(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get securityOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get cutoffTime(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get offeringDocs(): string { + return this._event.parameters[6].value.toString(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class Subscription extends ethereum.Event { + get params(): Subscription__Params { + return new Subscription__Params(this); + } +} + +export class Subscription__Params { + _event: Subscription; + + constructor(event: Subscription) { + this._event = event; + } + + get assetIn(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get assetOut(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get subscription(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get investor(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get price(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PrimaryIssuePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class PrimaryIssuePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PrimaryIssuePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class PrimaryIssuePool extends ethereum.SmartContract { + static bind(address: Address): PrimaryIssuePool { + return new PrimaryIssuePool("PrimaryIssuePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getBptIndex(): BigInt { + let result = super.call("getBptIndex", "getBptIndex():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getBptIndex(): ethereum.CallResult { + let result = super.tryCall("getBptIndex", "getBptIndex():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCurrencyIndex(): BigInt { + let result = super.call( + "getCurrencyIndex", + "getCurrencyIndex():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getCurrencyIndex(): ethereum.CallResult { + let result = super.tryCall( + "getCurrencyIndex", + "getCurrencyIndex():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getIssueCutoffTime(): BigInt { + let result = super.call( + "getIssueCutoffTime", + "getIssueCutoffTime():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getIssueCutoffTime(): ethereum.CallResult { + let result = super.tryCall( + "getIssueCutoffTime", + "getIssueCutoffTime():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMinimumOrderSize(): BigInt { + let result = super.call( + "getMinimumOrderSize", + "getMinimumOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinimumOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinimumOrderSize", + "getMinimumOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMinimumPrice(): BigInt { + let result = super.call( + "getMinimumPrice", + "getMinimumPrice():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinimumPrice(): ethereum.CallResult { + let result = super.tryCall( + "getMinimumPrice", + "getMinimumPrice():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOfferingDocuments(): string { + let result = super.call( + "getOfferingDocuments", + "getOfferingDocuments():(string)", + [] + ); + + return result[0].toString(); + } + + try_getOfferingDocuments(): ethereum.CallResult { + let result = super.tryCall( + "getOfferingDocuments", + "getOfferingDocuments():(string)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): PrimaryIssuePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new PrimaryIssuePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + PrimaryIssuePool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSecurityIndex(): BigInt { + let result = super.call( + "getSecurityIndex", + "getSecurityIndex():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSecurityIndex(): ethereum.CallResult { + let result = super.tryCall( + "getSecurityIndex", + "getSecurityIndex():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSecurityOffered(): BigInt { + let result = super.call( + "getSecurityOffered", + "getSecurityOffered():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSecurityOffered(): ethereum.CallResult { + let result = super.tryCall( + "getSecurityOffered", + "getSecurityOffered():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: PrimaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: PrimaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): PrimaryIssuePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new PrimaryIssuePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new PrimaryIssuePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get factoryPoolParams(): ConstructorCallFactoryPoolParamsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[4].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallFactoryPoolParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get security(): Address { + return this[2].toAddress(); + } + + get currency(): Address { + return this[3].toAddress(); + } + + get minimumPrice(): BigInt { + return this[4].toBigInt(); + } + + get minimumOrderSize(): BigInt { + return this[5].toBigInt(); + } + + get maxAmountsIn(): BigInt { + return this[6].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[7].toBigInt(); + } + + get cutOffTime(): BigInt { + return this[8].toBigInt(); + } + + get offeringDocs(): string { + return this[9].toString(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/templates/PrimaryIssuePool/WeightedPool.ts b/generated/templates/PrimaryIssuePool/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/templates/PrimaryIssuePool/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/SecondaryIssuePool/SecondaryIssuePool.ts b/generated/templates/SecondaryIssuePool/SecondaryIssuePool.ts new file mode 100644 index 000000000..22b63f0fb --- /dev/null +++ b/generated/templates/SecondaryIssuePool/SecondaryIssuePool.ts @@ -0,0 +1,1964 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Offer extends ethereum.Event { + get params(): Offer__Params { + return new Offer__Params(this); + } +} + +export class Offer__Params { + _event: Offer; + + constructor(event: Offer) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get orderBook(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get issueManager(): Address { + return this._event.parameters[4].value.toAddress(); + } +} + +export class OrderBook extends ethereum.Event { + get params(): OrderBook__Params { + return new OrderBook__Params(this); + } +} + +export class OrderBook__Params { + _event: OrderBook; + + constructor(event: OrderBook) { + this._event = event; + } + + get creator(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get tokenIn(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get tokenOut(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get amountOffered(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } + + get priceOffered(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get timestamp(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get orderRef(): Bytes { + return this._event.parameters[6].value.toBytes(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class TradeReport extends ethereum.Event { + get params(): TradeReport__Params { + return new TradeReport__Params(this); + } +} + +export class TradeReport__Params { + _event: TradeReport; + + constructor(event: TradeReport) { + this._event = event; + } + + get security(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get orderRef(): Bytes { + return this._event.parameters[1].value.toBytes(); + } + + get party(): Address { + return this._event.parameters[2].value.toAddress(); + } + + get counterparty(): Address { + return this._event.parameters[3].value.toAddress(); + } + + get orderType(): Bytes { + return this._event.parameters[4].value.toBytes(); + } + + get price(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get currency(): Address { + return this._event.parameters[6].value.toAddress(); + } + + get amount(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } + + get executionDate(): BigInt { + return this._event.parameters[8].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class SecondaryIssuePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class SecondaryIssuePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class SecondaryIssuePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class SecondaryIssuePool extends ethereum.SmartContract { + static bind(address: Address): SecondaryIssuePool { + return new SecondaryIssuePool("SecondaryIssuePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + _orderbook(): Address { + let result = super.call("_orderbook", "_orderbook():(address)", []); + + return result[0].toAddress(); + } + + try__orderbook(): ethereum.CallResult
{ + let result = super.tryCall("_orderbook", "_orderbook():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getCurrency(): Address { + let result = super.call("getCurrency", "getCurrency():(address)", []); + + return result[0].toAddress(); + } + + try_getCurrency(): ethereum.CallResult
{ + let result = super.tryCall("getCurrency", "getCurrency():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getMinOrderSize(): BigInt { + let result = super.call( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getMinOrderSize(): ethereum.CallResult { + let result = super.tryCall( + "getMinOrderSize", + "getMinOrderSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): SecondaryIssuePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new SecondaryIssuePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + SecondaryIssuePool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSecurity(): Address { + let result = super.call("getSecurity", "getSecurity():(address)", []); + + return result[0].toAddress(); + } + + try_getSecurity(): ethereum.CallResult
{ + let result = super.tryCall("getSecurity", "getSecurity():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: SecondaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: SecondaryIssuePool__onSwapInputRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): SecondaryIssuePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new SecondaryIssuePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new SecondaryIssuePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get security(): Address { + return this._call.inputValues[3].value.toAddress(); + } + + get currency(): Address { + return this._call.inputValues[4].value.toAddress(); + } + + get minOrderSize(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get tradeFeePercentage(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[8].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[9].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} diff --git a/generated/templates/SecondaryIssuePool/WeightedPool.ts b/generated/templates/SecondaryIssuePool/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/templates/SecondaryIssuePool/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/StablePhantomPool/StablePhantomPool.ts b/generated/templates/StablePhantomPool/StablePhantomPool.ts new file mode 100644 index 000000000..716bdd447 --- /dev/null +++ b/generated/templates/StablePhantomPool/StablePhantomPool.ts @@ -0,0 +1,2438 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class CachedProtocolSwapFeePercentageUpdated extends ethereum.Event { + get params(): CachedProtocolSwapFeePercentageUpdated__Params { + return new CachedProtocolSwapFeePercentageUpdated__Params(this); + } +} + +export class CachedProtocolSwapFeePercentageUpdated__Params { + _event: CachedProtocolSwapFeePercentageUpdated; + + constructor(event: CachedProtocolSwapFeePercentageUpdated) { + this._event = event; + } + + get protocolSwapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class DueProtocolFeeIncreased extends ethereum.Event { + get params(): DueProtocolFeeIncreased__Params { + return new DueProtocolFeeIncreased__Params(this); + } +} + +export class DueProtocolFeeIncreased__Params { + _event: DueProtocolFeeIncreased; + + constructor(event: DueProtocolFeeIncreased) { + this._event = event; + } + + get bptAmount(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class TokenRateCacheUpdated extends ethereum.Event { + get params(): TokenRateCacheUpdated__Params { + return new TokenRateCacheUpdated__Params(this); + } +} + +export class TokenRateCacheUpdated__Params { + _event: TokenRateCacheUpdated; + + constructor(event: TokenRateCacheUpdated) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get rate(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class TokenRateProviderSet extends ethereum.Event { + get params(): TokenRateProviderSet__Params { + return new TokenRateProviderSet__Params(this); + } +} + +export class TokenRateProviderSet__Params { + _event: TokenRateProviderSet; + + constructor(event: TokenRateProviderSet) { + this._event = event; + } + + get token(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get provider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get cacheDuration(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class StablePhantomPool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePhantomPool__getLastInvariantResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class StablePhantomPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePhantomPool__getTokenRateCacheResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePhantomPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePhantomPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePhantomPool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePhantomPool__onSwap1InputParam0Struct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePhantomPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePhantomPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePhantomPool extends ethereum.SmartContract { + static bind(address: Address): StablePhantomPool { + return new StablePhantomPool("StablePhantomPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAmplificationParameter(): StablePhantomPool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new StablePhantomPool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + StablePhantomPool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getBptIndex(): BigInt { + let result = super.call("getBptIndex", "getBptIndex():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getBptIndex(): ethereum.CallResult { + let result = super.tryCall("getBptIndex", "getBptIndex():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getCachedProtocolSwapFeePercentage(): BigInt { + let result = super.call( + "getCachedProtocolSwapFeePercentage", + "getCachedProtocolSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getCachedProtocolSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getCachedProtocolSwapFeePercentage", + "getCachedProtocolSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getDueProtocolFeeBptAmount(): BigInt { + let result = super.call( + "getDueProtocolFeeBptAmount", + "getDueProtocolFeeBptAmount():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getDueProtocolFeeBptAmount(): ethereum.CallResult { + let result = super.tryCall( + "getDueProtocolFeeBptAmount", + "getDueProtocolFeeBptAmount():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): StablePhantomPool__getLastInvariantResult { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256,uint256)", + [] + ); + + return new StablePhantomPool__getLastInvariantResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getLastInvariant(): ethereum.CallResult< + StablePhantomPool__getLastInvariantResult + > { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__getLastInvariantResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getMinimumBpt(): BigInt { + let result = super.call("getMinimumBpt", "getMinimumBpt():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getMinimumBpt(): ethereum.CallResult { + let result = super.tryCall( + "getMinimumBpt", + "getMinimumBpt():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): StablePhantomPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new StablePhantomPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + StablePhantomPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactor(token: Address): BigInt { + let result = super.call( + "getScalingFactor", + "getScalingFactor(address):(uint256)", + [ethereum.Value.fromAddress(token)] + ); + + return result[0].toBigInt(); + } + + try_getScalingFactor(token: Address): ethereum.CallResult { + let result = super.tryCall( + "getScalingFactor", + "getScalingFactor(address):(uint256)", + [ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTokenRate(token: Address): BigInt { + let result = super.call("getTokenRate", "getTokenRate(address):(uint256)", [ + ethereum.Value.fromAddress(token) + ]); + + return result[0].toBigInt(); + } + + try_getTokenRate(token: Address): ethereum.CallResult { + let result = super.tryCall( + "getTokenRate", + "getTokenRate(address):(uint256)", + [ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTokenRateCache( + token: Address + ): StablePhantomPool__getTokenRateCacheResult { + let result = super.call( + "getTokenRateCache", + "getTokenRateCache(address):(uint256,uint256,uint256)", + [ethereum.Value.fromAddress(token)] + ); + + return new StablePhantomPool__getTokenRateCacheResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getTokenRateCache( + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getTokenRateCache", + "getTokenRateCache(address):(uint256,uint256,uint256)", + [ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__getTokenRateCacheResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getVirtualSupply(): BigInt { + let result = super.call( + "getVirtualSupply", + "getVirtualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getVirtualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getVirtualSupply", + "getVirtualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePhantomPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePhantomPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePhantomPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePhantomPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: StablePhantomPool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: StablePhantomPool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onSwap1( + param0: StablePhantomPool__onSwap1InputParam0Struct, + param1: BigInt, + param2: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(param0), + ethereum.Value.fromUnsignedBigInt(param1), + ethereum.Value.fromUnsignedBigInt(param2) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap1( + param0: StablePhantomPool__onSwap1InputParam0Struct, + param1: BigInt, + param2: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(param0), + ethereum.Value.fromUnsignedBigInt(param1), + ethereum.Value.fromUnsignedBigInt(param2) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePhantomPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePhantomPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePhantomPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePhantomPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePhantomPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get name(): string { + return this[1].toString(); + } + + get symbol(): string { + return this[2].toString(); + } + + get tokens(): Array
{ + return this[3].toAddressArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get tokenRateCacheDurations(): Array { + return this[5].toBigIntArray(); + } + + get amplificationParameter(): BigInt { + return this[6].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[7].toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this[8].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[9].toBigInt(); + } + + get owner(): Address { + return this[10].toAddress(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get swapRequest(): OnSwapCallSwapRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class SetTokenRateCacheDurationCall extends ethereum.Call { + get inputs(): SetTokenRateCacheDurationCall__Inputs { + return new SetTokenRateCacheDurationCall__Inputs(this); + } + + get outputs(): SetTokenRateCacheDurationCall__Outputs { + return new SetTokenRateCacheDurationCall__Outputs(this); + } +} + +export class SetTokenRateCacheDurationCall__Inputs { + _call: SetTokenRateCacheDurationCall; + + constructor(call: SetTokenRateCacheDurationCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get duration(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class SetTokenRateCacheDurationCall__Outputs { + _call: SetTokenRateCacheDurationCall; + + constructor(call: SetTokenRateCacheDurationCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UpdateCachedProtocolSwapFeePercentageCall extends ethereum.Call { + get inputs(): UpdateCachedProtocolSwapFeePercentageCall__Inputs { + return new UpdateCachedProtocolSwapFeePercentageCall__Inputs(this); + } + + get outputs(): UpdateCachedProtocolSwapFeePercentageCall__Outputs { + return new UpdateCachedProtocolSwapFeePercentageCall__Outputs(this); + } +} + +export class UpdateCachedProtocolSwapFeePercentageCall__Inputs { + _call: UpdateCachedProtocolSwapFeePercentageCall; + + constructor(call: UpdateCachedProtocolSwapFeePercentageCall) { + this._call = call; + } +} + +export class UpdateCachedProtocolSwapFeePercentageCall__Outputs { + _call: UpdateCachedProtocolSwapFeePercentageCall; + + constructor(call: UpdateCachedProtocolSwapFeePercentageCall) { + this._call = call; + } +} + +export class UpdateTokenRateCacheCall extends ethereum.Call { + get inputs(): UpdateTokenRateCacheCall__Inputs { + return new UpdateTokenRateCacheCall__Inputs(this); + } + + get outputs(): UpdateTokenRateCacheCall__Outputs { + return new UpdateTokenRateCacheCall__Outputs(this); + } +} + +export class UpdateTokenRateCacheCall__Inputs { + _call: UpdateTokenRateCacheCall; + + constructor(call: UpdateTokenRateCacheCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class UpdateTokenRateCacheCall__Outputs { + _call: UpdateTokenRateCacheCall; + + constructor(call: UpdateTokenRateCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/StablePhantomPool/StablePool.ts b/generated/templates/StablePhantomPool/StablePool.ts new file mode 100644 index 000000000..626dd6b59 --- /dev/null +++ b/generated/templates/StablePhantomPool/StablePool.ts @@ -0,0 +1,1860 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class StablePool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__onSwap1InputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool extends ethereum.SmartContract { + static bind(address: Address): StablePool { + return new StablePool("StablePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAmplificationParameter(): StablePool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new StablePool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + StablePool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): StablePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new StablePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get tokens(): Array
{ + return this._call.inputValues[3].value.toAddressArray(); + } + + get amplificationParameter(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[8].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/templates/StablePhantomPoolV2/ComposableStablePool.ts b/generated/templates/StablePhantomPoolV2/ComposableStablePool.ts new file mode 100644 index 000000000..cdcef698f --- /dev/null +++ b/generated/templates/StablePhantomPoolV2/ComposableStablePool.ts @@ -0,0 +1,2561 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class TokenRateCacheUpdated extends ethereum.Event { + get params(): TokenRateCacheUpdated__Params { + return new TokenRateCacheUpdated__Params(this); + } +} + +export class TokenRateCacheUpdated__Params { + _event: TokenRateCacheUpdated; + + constructor(event: TokenRateCacheUpdated) { + this._event = event; + } + + get tokenIndex(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get rate(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class TokenRateProviderSet extends ethereum.Event { + get params(): TokenRateProviderSet__Params { + return new TokenRateProviderSet__Params(this); + } +} + +export class TokenRateProviderSet__Params { + _event: TokenRateProviderSet; + + constructor(event: TokenRateProviderSet) { + this._event = event; + } + + get tokenIndex(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get provider(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get cacheDuration(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class ComposableStablePool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class ComposableStablePool__getLastJoinExitDataResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } +} + +export class ComposableStablePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class ComposableStablePool__getTokenRateCacheResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + + constructor(value0: BigInt, value1: BigInt, value2: BigInt, value3: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + return map; + } +} + +export class ComposableStablePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class ComposableStablePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class ComposableStablePool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class ComposableStablePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class ComposableStablePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class ComposableStablePool extends ethereum.SmartContract { + static bind(address: Address): ComposableStablePool { + return new ComposableStablePool("ComposableStablePool", address); + } + + DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL(): BigInt { + let result = super.call( + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL", + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL(): ethereum.CallResult { + let result = super.tryCall( + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL", + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAmplificationParameter(): ComposableStablePool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new ComposableStablePool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + ComposableStablePool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getBptIndex(): BigInt { + let result = super.call("getBptIndex", "getBptIndex():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getBptIndex(): ethereum.CallResult { + let result = super.tryCall("getBptIndex", "getBptIndex():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getLastJoinExitData(): ComposableStablePool__getLastJoinExitDataResult { + let result = super.call( + "getLastJoinExitData", + "getLastJoinExitData():(uint256,uint256)", + [] + ); + + return new ComposableStablePool__getLastJoinExitDataResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getLastJoinExitData(): ethereum.CallResult< + ComposableStablePool__getLastJoinExitDataResult + > { + let result = super.tryCall( + "getLastJoinExitData", + "getLastJoinExitData():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__getLastJoinExitDataResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + getMinimumBpt(): BigInt { + let result = super.call("getMinimumBpt", "getMinimumBpt():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getMinimumBpt(): ethereum.CallResult { + let result = super.tryCall( + "getMinimumBpt", + "getMinimumBpt():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): ComposableStablePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new ComposableStablePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + ComposableStablePool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getProtocolSwapFeeDelegation(): boolean { + let result = super.call( + "getProtocolSwapFeeDelegation", + "getProtocolSwapFeeDelegation():(bool)", + [] + ); + + return result[0].toBoolean(); + } + + try_getProtocolSwapFeeDelegation(): ethereum.CallResult { + let result = super.tryCall( + "getProtocolSwapFeeDelegation", + "getProtocolSwapFeeDelegation():(bool)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTokenRate(token: Address): BigInt { + let result = super.call("getTokenRate", "getTokenRate(address):(uint256)", [ + ethereum.Value.fromAddress(token) + ]); + + return result[0].toBigInt(); + } + + try_getTokenRate(token: Address): ethereum.CallResult { + let result = super.tryCall( + "getTokenRate", + "getTokenRate(address):(uint256)", + [ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTokenRateCache( + token: Address + ): ComposableStablePool__getTokenRateCacheResult { + let result = super.call( + "getTokenRateCache", + "getTokenRateCache(address):(uint256,uint256,uint256,uint256)", + [ethereum.Value.fromAddress(token)] + ); + + return new ComposableStablePool__getTokenRateCacheResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt() + ); + } + + try_getTokenRateCache( + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "getTokenRateCache", + "getTokenRateCache(address):(uint256,uint256,uint256,uint256)", + [ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__getTokenRateCacheResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt() + ) + ); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isTokenExemptFromYieldProtocolFee(token: Address): boolean { + let result = super.call( + "isTokenExemptFromYieldProtocolFee", + "isTokenExemptFromYieldProtocolFee(address):(bool)", + [ethereum.Value.fromAddress(token)] + ); + + return result[0].toBoolean(); + } + + try_isTokenExemptFromYieldProtocolFee( + token: Address + ): ethereum.CallResult { + let result = super.tryCall( + "isTokenExemptFromYieldProtocolFee", + "isTokenExemptFromYieldProtocolFee(address):(bool)", + [ethereum.Value.fromAddress(token)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ComposableStablePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new ComposableStablePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ComposableStablePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new ComposableStablePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: ComposableStablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: ComposableStablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ComposableStablePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new ComposableStablePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ComposableStablePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new ComposableStablePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new ComposableStablePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get protocolFeeProvider(): Address { + return this[1].toAddress(); + } + + get name(): string { + return this[2].toString(); + } + + get symbol(): string { + return this[3].toString(); + } + + get tokens(): Array
{ + return this[4].toAddressArray(); + } + + get rateProviders(): Array
{ + return this[5].toAddressArray(); + } + + get tokenRateCacheDurations(): Array { + return this[6].toBigIntArray(); + } + + get exemptFromYieldProtocolFeeFlags(): Array { + return this[7].toBooleanArray(); + } + + get amplificationParameter(): BigInt { + return this[8].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[9].toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this[10].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[11].toBigInt(); + } + + get owner(): Address { + return this[12].toAddress(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get swapRequest(): OnSwapCallSwapRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balances(): Array { + return this._call.inputValues[1].value.toBigIntArray(); + } + + get indexIn(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get indexOut(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class SetTokenRateCacheDurationCall extends ethereum.Call { + get inputs(): SetTokenRateCacheDurationCall__Inputs { + return new SetTokenRateCacheDurationCall__Inputs(this); + } + + get outputs(): SetTokenRateCacheDurationCall__Outputs { + return new SetTokenRateCacheDurationCall__Outputs(this); + } +} + +export class SetTokenRateCacheDurationCall__Inputs { + _call: SetTokenRateCacheDurationCall; + + constructor(call: SetTokenRateCacheDurationCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get duration(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class SetTokenRateCacheDurationCall__Outputs { + _call: SetTokenRateCacheDurationCall; + + constructor(call: SetTokenRateCacheDurationCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateTokenRateCacheCall extends ethereum.Call { + get inputs(): UpdateTokenRateCacheCall__Inputs { + return new UpdateTokenRateCacheCall__Inputs(this); + } + + get outputs(): UpdateTokenRateCacheCall__Outputs { + return new UpdateTokenRateCacheCall__Outputs(this); + } +} + +export class UpdateTokenRateCacheCall__Inputs { + _call: UpdateTokenRateCacheCall; + + constructor(call: UpdateTokenRateCacheCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class UpdateTokenRateCacheCall__Outputs { + _call: UpdateTokenRateCacheCall; + + constructor(call: UpdateTokenRateCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/StablePhantomPoolV2/StablePool.ts b/generated/templates/StablePhantomPoolV2/StablePool.ts new file mode 100644 index 000000000..626dd6b59 --- /dev/null +++ b/generated/templates/StablePhantomPoolV2/StablePool.ts @@ -0,0 +1,1860 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class StablePool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__onSwap1InputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool extends ethereum.SmartContract { + static bind(address: Address): StablePool { + return new StablePool("StablePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAmplificationParameter(): StablePool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new StablePool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + StablePool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): StablePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new StablePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get tokens(): Array
{ + return this._call.inputValues[3].value.toAddressArray(); + } + + get amplificationParameter(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[8].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/templates/StablePool/StablePool.ts b/generated/templates/StablePool/StablePool.ts new file mode 100644 index 000000000..626dd6b59 --- /dev/null +++ b/generated/templates/StablePool/StablePool.ts @@ -0,0 +1,1860 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class AmpUpdateStarted extends ethereum.Event { + get params(): AmpUpdateStarted__Params { + return new AmpUpdateStarted__Params(this); + } +} + +export class AmpUpdateStarted__Params { + _event: AmpUpdateStarted; + + constructor(event: AmpUpdateStarted) { + this._event = event; + } + + get startValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get endValue(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } + + get startTime(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get endTime(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class AmpUpdateStopped extends ethereum.Event { + get params(): AmpUpdateStopped__Params { + return new AmpUpdateStopped__Params(this); + } +} + +export class AmpUpdateStopped__Params { + _event: AmpUpdateStopped; + + constructor(event: AmpUpdateStopped) { + this._event = event; + } + + get currentValue(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class StablePool__getAmplificationParameterResult { + value0: BigInt; + value1: boolean; + value2: BigInt; + + constructor(value0: BigInt, value1: boolean, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromBoolean(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class StablePool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__onSwapInputSwapRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__onSwap1InputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class StablePool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class StablePool extends ethereum.SmartContract { + static bind(address: Address): StablePool { + return new StablePool("StablePool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAmplificationParameter(): StablePool__getAmplificationParameterResult { + let result = super.call( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + + return new StablePool__getAmplificationParameterResult( + result[0].toBigInt(), + result[1].toBoolean(), + result[2].toBigInt() + ); + } + + try_getAmplificationParameter(): ethereum.CallResult< + StablePool__getAmplificationParameterResult + > { + let result = super.tryCall( + "getAmplificationParameter", + "getAmplificationParameter():(uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getAmplificationParameterResult( + value[0].toBigInt(), + value[1].toBoolean(), + value[2].toBigInt() + ) + ); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): StablePool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new StablePool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + swapRequest: StablePool__onSwapInputSwapRequestStruct, + balances: Array, + indexIn: BigInt, + indexOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256[],uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(swapRequest), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(indexIn), + ethereum.Value.fromUnsignedBigInt(indexOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap1( + request: StablePool__onSwap1InputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): StablePool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new StablePool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new StablePool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get vault(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get name(): string { + return this._call.inputValues[1].value.toString(); + } + + get symbol(): string { + return this._call.inputValues[2].value.toString(); + } + + get tokens(): Array
{ + return this._call.inputValues[3].value.toAddressArray(); + } + + get amplificationParameter(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[6].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[7].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[8].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class StartAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StartAmplificationParameterUpdateCall__Inputs { + return new StartAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StartAmplificationParameterUpdateCall__Outputs { + return new StartAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StartAmplificationParameterUpdateCall__Inputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } + + get rawEndValue(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get endTime(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class StartAmplificationParameterUpdateCall__Outputs { + _call: StartAmplificationParameterUpdateCall; + + constructor(call: StartAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall extends ethereum.Call { + get inputs(): StopAmplificationParameterUpdateCall__Inputs { + return new StopAmplificationParameterUpdateCall__Inputs(this); + } + + get outputs(): StopAmplificationParameterUpdateCall__Outputs { + return new StopAmplificationParameterUpdateCall__Outputs(this); + } +} + +export class StopAmplificationParameterUpdateCall__Inputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class StopAmplificationParameterUpdateCall__Outputs { + _call: StopAmplificationParameterUpdateCall; + + constructor(call: StopAmplificationParameterUpdateCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/templates/WeightedPool/WeightedPool.ts b/generated/templates/WeightedPool/WeightedPool.ts new file mode 100644 index 000000000..64decd4bb --- /dev/null +++ b/generated/templates/WeightedPool/WeightedPool.ts @@ -0,0 +1,1981 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool extends ethereum.SmartContract { + static bind(address: Address): WeightedPool { + return new WeightedPool("WeightedPool", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPool__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/generated/templates/WeightedPool2Tokens/WeightedPool2Tokens.ts b/generated/templates/WeightedPool2Tokens/WeightedPool2Tokens.ts new file mode 100644 index 000000000..2d3bdc537 --- /dev/null +++ b/generated/templates/WeightedPool2Tokens/WeightedPool2Tokens.ts @@ -0,0 +1,1974 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class OracleEnabledChanged extends ethereum.Event { + get params(): OracleEnabledChanged__Params { + return new OracleEnabledChanged__Params(this); + } +} + +export class OracleEnabledChanged__Params { + _event: OracleEnabledChanged; + + constructor(event: OracleEnabledChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPool2Tokens__getMiscDataResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: boolean; + value5: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: boolean, + value5: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromBoolean(this.value4)); + map.set("value5", ethereum.Value.fromUnsignedBigInt(this.value5)); + return map; + } +} + +export class WeightedPool2Tokens__getPastAccumulatorsInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get ago(): BigInt { + return this[1].toBigInt(); + } +} + +export class WeightedPool2Tokens__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPool2Tokens__getSampleResult { + value0: BigInt; + value1: BigInt; + value2: BigInt; + value3: BigInt; + value4: BigInt; + value5: BigInt; + value6: BigInt; + + constructor( + value0: BigInt, + value1: BigInt, + value2: BigInt, + value3: BigInt, + value4: BigInt, + value5: BigInt, + value6: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + this.value4 = value4; + this.value5 = value5; + this.value6 = value6; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromSignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromSignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromSignedBigInt(this.value2)); + map.set("value3", ethereum.Value.fromSignedBigInt(this.value3)); + map.set("value4", ethereum.Value.fromSignedBigInt(this.value4)); + map.set("value5", ethereum.Value.fromSignedBigInt(this.value5)); + map.set("value6", ethereum.Value.fromUnsignedBigInt(this.value6)); + return map; + } +} + +export class WeightedPool2Tokens__getTimeWeightedAverageInputQueriesStruct extends ethereum.Tuple { + get variable(): i32 { + return this[0].toI32(); + } + + get secs(): BigInt { + return this[1].toBigInt(); + } + + get ago(): BigInt { + return this[2].toBigInt(); + } +} + +export class WeightedPool2Tokens__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool2Tokens__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool2Tokens__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPool2Tokens__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool2Tokens__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPool2Tokens extends ethereum.SmartContract { + static bind(address: Address): WeightedPool2Tokens { + return new WeightedPool2Tokens("WeightedPool2Tokens", address); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseApproval(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseApproval", + "decreaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseApproval( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseApproval", + "decreaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLargestSafeQueryWindow(): BigInt { + let result = super.call( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLargestSafeQueryWindow(): ethereum.CallResult { + let result = super.tryCall( + "getLargestSafeQueryWindow", + "getLargestSafeQueryWindow():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastInvariant(): BigInt { + let result = super.call( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastInvariant", + "getLastInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLatest(variable: i32): BigInt { + let result = super.call("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + + return result[0].toBigInt(); + } + + try_getLatest(variable: i32): ethereum.CallResult { + let result = super.tryCall("getLatest", "getLatest(uint8):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(variable)) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getMiscData(): WeightedPool2Tokens__getMiscDataResult { + let result = super.call( + "getMiscData", + "getMiscData():(int256,int256,uint256,uint256,bool,uint256)", + [] + ); + + return new WeightedPool2Tokens__getMiscDataResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBoolean(), + result[5].toBigInt() + ); + } + + try_getMiscData(): ethereum.CallResult< + WeightedPool2Tokens__getMiscDataResult + > { + let result = super.tryCall( + "getMiscData", + "getMiscData():(int256,int256,uint256,uint256,bool,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool2Tokens__getMiscDataResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBoolean(), + value[5].toBigInt() + ) + ); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPastAccumulators( + queries: Array + ): Array { + let result = super.call( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getPastAccumulators( + queries: Array + ): ethereum.CallResult> { + let result = super.tryCall( + "getPastAccumulators", + "getPastAccumulators((uint8,uint256)[]):(int256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getPausedState(): WeightedPool2Tokens__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPool2Tokens__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPool2Tokens__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool2Tokens__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getRate(): BigInt { + let result = super.call("getRate", "getRate():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getRate(): ethereum.CallResult { + let result = super.tryCall("getRate", "getRate():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getSample(index: BigInt): WeightedPool2Tokens__getSampleResult { + let result = super.call( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + + return new WeightedPool2Tokens__getSampleResult( + result[0].toBigInt(), + result[1].toBigInt(), + result[2].toBigInt(), + result[3].toBigInt(), + result[4].toBigInt(), + result[5].toBigInt(), + result[6].toBigInt() + ); + } + + try_getSample( + index: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getSample", + "getSample(uint256):(int256,int256,int256,int256,int256,int256,uint256)", + [ethereum.Value.fromUnsignedBigInt(index)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool2Tokens__getSampleResult( + value[0].toBigInt(), + value[1].toBigInt(), + value[2].toBigInt(), + value[3].toBigInt(), + value[4].toBigInt(), + value[5].toBigInt(), + value[6].toBigInt() + ) + ); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getTimeWeightedAverage( + queries: Array< + WeightedPool2Tokens__getTimeWeightedAverageInputQueriesStruct + > + ): Array { + let result = super.call( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + + return result[0].toBigIntArray(); + } + + try_getTimeWeightedAverage( + queries: Array< + WeightedPool2Tokens__getTimeWeightedAverageInputQueriesStruct + > + ): ethereum.CallResult> { + let result = super.tryCall( + "getTimeWeightedAverage", + "getTimeWeightedAverage((uint8,uint256,uint256)[]):(uint256[])", + [ethereum.Value.fromTupleArray(queries)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getTotalSamples(): BigInt { + let result = super.call( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getTotalSamples(): ethereum.CallResult { + let result = super.tryCall( + "getTotalSamples", + "getTotalSamples():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + increaseApproval(spender: Address, amount: BigInt): boolean { + let result = super.call( + "increaseApproval", + "increaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseApproval( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseApproval", + "increaseApproval(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool2Tokens__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool2Tokens__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool2Tokens__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool2Tokens__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool2Tokens__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool2Tokens__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPool2Tokens__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPool2Tokens__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool2Tokens__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool2Tokens__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool2Tokens__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPool2Tokens__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPool2Tokens__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPool2Tokens__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get vault(): Address { + return this[0].toAddress(); + } + + get name(): string { + return this[1].toString(); + } + + get symbol(): string { + return this[2].toString(); + } + + get token0(): Address { + return this[3].toAddress(); + } + + get token1(): Address { + return this[4].toAddress(); + } + + get normalizedWeight0(): BigInt { + return this[5].toBigInt(); + } + + get normalizedWeight1(): BigInt { + return this[6].toBigInt(); + } + + get swapFeePercentage(): BigInt { + return this[7].toBigInt(); + } + + get pauseWindowDuration(): BigInt { + return this[8].toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this[9].toBigInt(); + } + + get oracleEnabled(): boolean { + return this[10].toBoolean(); + } + + get owner(): Address { + return this[11].toAddress(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseApprovalCall extends ethereum.Call { + get inputs(): DecreaseApprovalCall__Inputs { + return new DecreaseApprovalCall__Inputs(this); + } + + get outputs(): DecreaseApprovalCall__Outputs { + return new DecreaseApprovalCall__Outputs(this); + } +} + +export class DecreaseApprovalCall__Inputs { + _call: DecreaseApprovalCall; + + constructor(call: DecreaseApprovalCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseApprovalCall__Outputs { + _call: DecreaseApprovalCall; + + constructor(call: DecreaseApprovalCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class EnableOracleCall extends ethereum.Call { + get inputs(): EnableOracleCall__Inputs { + return new EnableOracleCall__Inputs(this); + } + + get outputs(): EnableOracleCall__Outputs { + return new EnableOracleCall__Outputs(this); + } +} + +export class EnableOracleCall__Inputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class EnableOracleCall__Outputs { + _call: EnableOracleCall; + + constructor(call: EnableOracleCall) { + this._call = call; + } +} + +export class IncreaseApprovalCall extends ethereum.Call { + get inputs(): IncreaseApprovalCall__Inputs { + return new IncreaseApprovalCall__Inputs(this); + } + + get outputs(): IncreaseApprovalCall__Outputs { + return new IncreaseApprovalCall__Outputs(this); + } +} + +export class IncreaseApprovalCall__Inputs { + _call: IncreaseApprovalCall; + + constructor(call: IncreaseApprovalCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseApprovalCall__Outputs { + _call: IncreaseApprovalCall; + + constructor(call: IncreaseApprovalCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get amountsIn(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get dueProtocolFeeAmounts(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class SetPausedCall extends ethereum.Call { + get inputs(): SetPausedCall__Inputs { + return new SetPausedCall__Inputs(this); + } + + get outputs(): SetPausedCall__Outputs { + return new SetPausedCall__Outputs(this); + } +} + +export class SetPausedCall__Inputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } + + get paused(): boolean { + return this._call.inputValues[0].value.toBoolean(); + } +} + +export class SetPausedCall__Outputs { + _call: SetPausedCall; + + constructor(call: SetPausedCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} diff --git a/generated/templates/WeightedPoolV2/WeightedPoolV2.ts b/generated/templates/WeightedPoolV2/WeightedPoolV2.ts new file mode 100644 index 000000000..b84c7c40a --- /dev/null +++ b/generated/templates/WeightedPoolV2/WeightedPoolV2.ts @@ -0,0 +1,2151 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Approval extends ethereum.Event { + get params(): Approval__Params { + return new Approval__Params(this); + } +} + +export class Approval__Params { + _event: Approval; + + constructor(event: Approval) { + this._event = event; + } + + get owner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get spender(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class PausedStateChanged extends ethereum.Event { + get params(): PausedStateChanged__Params { + return new PausedStateChanged__Params(this); + } +} + +export class PausedStateChanged__Params { + _event: PausedStateChanged; + + constructor(event: PausedStateChanged) { + this._event = event; + } + + get paused(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class ProtocolFeePercentageCacheUpdated extends ethereum.Event { + get params(): ProtocolFeePercentageCacheUpdated__Params { + return new ProtocolFeePercentageCacheUpdated__Params(this); + } +} + +export class ProtocolFeePercentageCacheUpdated__Params { + _event: ProtocolFeePercentageCacheUpdated; + + constructor(event: ProtocolFeePercentageCacheUpdated) { + this._event = event; + } + + get feeType(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get protocolFeePercentage(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class RecoveryModeStateChanged extends ethereum.Event { + get params(): RecoveryModeStateChanged__Params { + return new RecoveryModeStateChanged__Params(this); + } +} + +export class RecoveryModeStateChanged__Params { + _event: RecoveryModeStateChanged; + + constructor(event: RecoveryModeStateChanged) { + this._event = event; + } + + get enabled(): boolean { + return this._event.parameters[0].value.toBoolean(); + } +} + +export class SwapFeePercentageChanged extends ethereum.Event { + get params(): SwapFeePercentageChanged__Params { + return new SwapFeePercentageChanged__Params(this); + } +} + +export class SwapFeePercentageChanged__Params { + _event: SwapFeePercentageChanged; + + constructor(event: SwapFeePercentageChanged) { + this._event = event; + } + + get swapFeePercentage(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class Transfer extends ethereum.Event { + get params(): Transfer__Params { + return new Transfer__Params(this); + } +} + +export class Transfer__Params { + _event: Transfer; + + constructor(event: Transfer) { + this._event = event; + } + + get from(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get to(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get value(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class WeightedPoolV2__getPausedStateResult { + value0: boolean; + value1: BigInt; + value2: BigInt; + + constructor(value0: boolean, value1: BigInt, value2: BigInt) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromBoolean(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } +} + +export class WeightedPoolV2__onExitPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPoolV2__onJoinPoolResult { + value0: Array; + value1: Array; + + constructor(value0: Array, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigIntArray(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPoolV2__onSwapInputRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class WeightedPoolV2__queryExitResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPoolV2__queryJoinResult { + value0: BigInt; + value1: Array; + + constructor(value0: BigInt, value1: Array) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigIntArray(this.value1)); + return map; + } +} + +export class WeightedPoolV2 extends ethereum.SmartContract { + static bind(address: Address): WeightedPoolV2 { + return new WeightedPoolV2("WeightedPoolV2", address); + } + + DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL(): BigInt { + let result = super.call( + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL", + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL(): ethereum.CallResult { + let result = super.tryCall( + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL", + "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + DOMAIN_SEPARATOR(): Bytes { + let result = super.call( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_DOMAIN_SEPARATOR(): ethereum.CallResult { + let result = super.tryCall( + "DOMAIN_SEPARATOR", + "DOMAIN_SEPARATOR():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + allowance(owner: Address, spender: Address): BigInt { + let result = super.call( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + + return result[0].toBigInt(); + } + + try_allowance(owner: Address, spender: Address): ethereum.CallResult { + let result = super.tryCall( + "allowance", + "allowance(address,address):(uint256)", + [ethereum.Value.fromAddress(owner), ethereum.Value.fromAddress(spender)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + approve(spender: Address, amount: BigInt): boolean { + let result = super.call("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_approve(spender: Address, amount: BigInt): ethereum.CallResult { + let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + balanceOf(account: Address): BigInt { + let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_balanceOf(account: Address): ethereum.CallResult { + let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + decimals(): i32 { + let result = super.call("decimals", "decimals():(uint8)", []); + + return result[0].toI32(); + } + + try_decimals(): ethereum.CallResult { + let result = super.tryCall("decimals", "decimals():(uint8)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + decreaseAllowance(spender: Address, amount: BigInt): boolean { + let result = super.call( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_decreaseAllowance( + spender: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "decreaseAllowance", + "decreaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getATHRateProduct(): BigInt { + let result = super.call( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getATHRateProduct(): ethereum.CallResult { + let result = super.tryCall( + "getATHRateProduct", + "getATHRateProduct():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getActionId(selector: Bytes): Bytes { + let result = super.call("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + + return result[0].toBytes(); + } + + try_getActionId(selector: Bytes): ethereum.CallResult { + let result = super.tryCall("getActionId", "getActionId(bytes4):(bytes32)", [ + ethereum.Value.fromFixedBytes(selector) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getActualSupply(): BigInt { + let result = super.call( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getActualSupply(): ethereum.CallResult { + let result = super.tryCall( + "getActualSupply", + "getActualSupply():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getAuthorizer(): Address { + let result = super.call("getAuthorizer", "getAuthorizer():(address)", []); + + return result[0].toAddress(); + } + + try_getAuthorizer(): ethereum.CallResult
{ + let result = super.tryCall( + "getAuthorizer", + "getAuthorizer():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getDomainSeparator(): Bytes { + let result = super.call( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + + return result[0].toBytes(); + } + + try_getDomainSeparator(): ethereum.CallResult { + let result = super.tryCall( + "getDomainSeparator", + "getDomainSeparator():(bytes32)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getInvariant(): BigInt { + let result = super.call("getInvariant", "getInvariant():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getInvariant(): ethereum.CallResult { + let result = super.tryCall("getInvariant", "getInvariant():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getLastPostJoinExitInvariant(): BigInt { + let result = super.call( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getLastPostJoinExitInvariant(): ethereum.CallResult { + let result = super.tryCall( + "getLastPostJoinExitInvariant", + "getLastPostJoinExitInvariant():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNextNonce(account: Address): BigInt { + let result = super.call("getNextNonce", "getNextNonce(address):(uint256)", [ + ethereum.Value.fromAddress(account) + ]); + + return result[0].toBigInt(); + } + + try_getNextNonce(account: Address): ethereum.CallResult { + let result = super.tryCall( + "getNextNonce", + "getNextNonce(address):(uint256)", + [ethereum.Value.fromAddress(account)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getNormalizedWeights(): Array { + let result = super.call( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getNormalizedWeights(): ethereum.CallResult> { + let result = super.tryCall( + "getNormalizedWeights", + "getNormalizedWeights():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getOwner(): Address { + let result = super.call("getOwner", "getOwner():(address)", []); + + return result[0].toAddress(); + } + + try_getOwner(): ethereum.CallResult
{ + let result = super.tryCall("getOwner", "getOwner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPausedState(): WeightedPoolV2__getPausedStateResult { + let result = super.call( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + + return new WeightedPoolV2__getPausedStateResult( + result[0].toBoolean(), + result[1].toBigInt(), + result[2].toBigInt() + ); + } + + try_getPausedState(): ethereum.CallResult< + WeightedPoolV2__getPausedStateResult + > { + let result = super.tryCall( + "getPausedState", + "getPausedState():(bool,uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPoolV2__getPausedStateResult( + value[0].toBoolean(), + value[1].toBigInt(), + value[2].toBigInt() + ) + ); + } + + getPoolId(): Bytes { + let result = super.call("getPoolId", "getPoolId():(bytes32)", []); + + return result[0].toBytes(); + } + + try_getPoolId(): ethereum.CallResult { + let result = super.tryCall("getPoolId", "getPoolId():(bytes32)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + getProtocolFeePercentageCache(feeType: BigInt): BigInt { + let result = super.call( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + + return result[0].toBigInt(); + } + + try_getProtocolFeePercentageCache( + feeType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getProtocolFeePercentageCache", + "getProtocolFeePercentageCache(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(feeType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getProtocolFeesCollector(): Address { + let result = super.call( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_getProtocolFeesCollector(): ethereum.CallResult
{ + let result = super.tryCall( + "getProtocolFeesCollector", + "getProtocolFeesCollector():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getProtocolSwapFeeDelegation(): boolean { + let result = super.call( + "getProtocolSwapFeeDelegation", + "getProtocolSwapFeeDelegation():(bool)", + [] + ); + + return result[0].toBoolean(); + } + + try_getProtocolSwapFeeDelegation(): ethereum.CallResult { + let result = super.tryCall( + "getProtocolSwapFeeDelegation", + "getProtocolSwapFeeDelegation():(bool)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + getRateProviders(): Array
{ + let result = super.call( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + + return result[0].toAddressArray(); + } + + try_getRateProviders(): ethereum.CallResult> { + let result = super.tryCall( + "getRateProviders", + "getRateProviders():(address[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddressArray()); + } + + getScalingFactors(): Array { + let result = super.call( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + + return result[0].toBigIntArray(); + } + + try_getScalingFactors(): ethereum.CallResult> { + let result = super.tryCall( + "getScalingFactors", + "getScalingFactors():(uint256[])", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + } + + getSwapFeePercentage(): BigInt { + let result = super.call( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getSwapFeePercentage(): ethereum.CallResult { + let result = super.tryCall( + "getSwapFeePercentage", + "getSwapFeePercentage():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVault(): Address { + let result = super.call("getVault", "getVault():(address)", []); + + return result[0].toAddress(); + } + + try_getVault(): ethereum.CallResult
{ + let result = super.tryCall("getVault", "getVault():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + inRecoveryMode(): boolean { + let result = super.call("inRecoveryMode", "inRecoveryMode():(bool)", []); + + return result[0].toBoolean(); + } + + try_inRecoveryMode(): ethereum.CallResult { + let result = super.tryCall("inRecoveryMode", "inRecoveryMode():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + increaseAllowance(spender: Address, addedValue: BigInt): boolean { + let result = super.call( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + + return result[0].toBoolean(); + } + + try_increaseAllowance( + spender: Address, + addedValue: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "increaseAllowance", + "increaseAllowance(address,uint256):(bool)", + [ + ethereum.Value.fromAddress(spender), + ethereum.Value.fromUnsignedBigInt(addedValue) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + name(): string { + let result = super.call("name", "name():(string)", []); + + return result[0].toString(); + } + + try_name(): ethereum.CallResult { + let result = super.tryCall("name", "name():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + nonces(owner: Address): BigInt { + let result = super.call("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + + return result[0].toBigInt(); + } + + try_nonces(owner: Address): ethereum.CallResult { + let result = super.tryCall("nonces", "nonces(address):(uint256)", [ + ethereum.Value.fromAddress(owner) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPoolV2__onExitPoolResult { + let result = super.call( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPoolV2__onExitPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onExitPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onExitPool", + "onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPoolV2__onExitPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPoolV2__onJoinPoolResult { + let result = super.call( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPoolV2__onJoinPoolResult( + result[0].toBigIntArray(), + result[1].toBigIntArray() + ); + } + + try_onJoinPool( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "onJoinPool", + "onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256[],uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPoolV2__onJoinPoolResult( + value[0].toBigIntArray(), + value[1].toBigIntArray() + ) + ); + } + + onSwap( + request: WeightedPoolV2__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): BigInt { + let result = super.call( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + + return result[0].toBigInt(); + } + + try_onSwap( + request: WeightedPoolV2__onSwapInputRequestStruct, + balanceTokenIn: BigInt, + balanceTokenOut: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "onSwap", + "onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256):(uint256)", + [ + ethereum.Value.fromTuple(request), + ethereum.Value.fromUnsignedBigInt(balanceTokenIn), + ethereum.Value.fromUnsignedBigInt(balanceTokenOut) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPoolV2__queryExitResult { + let result = super.call( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPoolV2__queryExitResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryExit( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryExit", + "queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPoolV2__queryExitResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): WeightedPoolV2__queryJoinResult { + let result = super.call( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + + return new WeightedPoolV2__queryJoinResult( + result[0].toBigInt(), + result[1].toBigIntArray() + ); + } + + try_queryJoin( + poolId: Bytes, + sender: Address, + recipient: Address, + balances: Array, + lastChangeBlock: BigInt, + protocolSwapFeePercentage: BigInt, + userData: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "queryJoin", + "queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes):(uint256,uint256[])", + [ + ethereum.Value.fromFixedBytes(poolId), + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigIntArray(balances), + ethereum.Value.fromUnsignedBigInt(lastChangeBlock), + ethereum.Value.fromUnsignedBigInt(protocolSwapFeePercentage), + ethereum.Value.fromBytes(userData) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new WeightedPoolV2__queryJoinResult( + value[0].toBigInt(), + value[1].toBigIntArray() + ) + ); + } + + symbol(): string { + let result = super.call("symbol", "symbol():(string)", []); + + return result[0].toString(); + } + + try_symbol(): ethereum.CallResult { + let result = super.tryCall("symbol", "symbol():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + totalSupply(): BigInt { + let result = super.call("totalSupply", "totalSupply():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSupply(): ethereum.CallResult { + let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + transfer(recipient: Address, amount: BigInt): boolean { + let result = super.call("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + + return result[0].toBoolean(); + } + + try_transfer( + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { + let result = super.call( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + + return result[0].toBoolean(); + } + + try_transferFrom( + sender: Address, + recipient: Address, + amount: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "transferFrom", + "transferFrom(address,address,uint256):(bool)", + [ + ethereum.Value.fromAddress(sender), + ethereum.Value.fromAddress(recipient), + ethereum.Value.fromUnsignedBigInt(amount) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get params(): ConstructorCallParamsStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get vault(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get protocolFeeProvider(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get pauseWindowDuration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get bufferPeriodDuration(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get owner(): Address { + return this._call.inputValues[5].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCallParamsStruct extends ethereum.Tuple { + get name(): string { + return this[0].toString(); + } + + get symbol(): string { + return this[1].toString(); + } + + get tokens(): Array
{ + return this[2].toAddressArray(); + } + + get normalizedWeights(): Array { + return this[3].toBigIntArray(); + } + + get rateProviders(): Array
{ + return this[4].toAddressArray(); + } + + get assetManagers(): Array
{ + return this[5].toAddressArray(); + } + + get swapFeePercentage(): BigInt { + return this[6].toBigInt(); + } +} + +export class ApproveCall extends ethereum.Call { + get inputs(): ApproveCall__Inputs { + return new ApproveCall__Inputs(this); + } + + get outputs(): ApproveCall__Outputs { + return new ApproveCall__Outputs(this); + } +} + +export class ApproveCall__Inputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ApproveCall__Outputs { + _call: ApproveCall; + + constructor(call: ApproveCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DecreaseAllowanceCall extends ethereum.Call { + get inputs(): DecreaseAllowanceCall__Inputs { + return new DecreaseAllowanceCall__Inputs(this); + } + + get outputs(): DecreaseAllowanceCall__Outputs { + return new DecreaseAllowanceCall__Outputs(this); + } +} + +export class DecreaseAllowanceCall__Inputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DecreaseAllowanceCall__Outputs { + _call: DecreaseAllowanceCall; + + constructor(call: DecreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class DisableRecoveryModeCall extends ethereum.Call { + get inputs(): DisableRecoveryModeCall__Inputs { + return new DisableRecoveryModeCall__Inputs(this); + } + + get outputs(): DisableRecoveryModeCall__Outputs { + return new DisableRecoveryModeCall__Outputs(this); + } +} + +export class DisableRecoveryModeCall__Inputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class DisableRecoveryModeCall__Outputs { + _call: DisableRecoveryModeCall; + + constructor(call: DisableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall extends ethereum.Call { + get inputs(): EnableRecoveryModeCall__Inputs { + return new EnableRecoveryModeCall__Inputs(this); + } + + get outputs(): EnableRecoveryModeCall__Outputs { + return new EnableRecoveryModeCall__Outputs(this); + } +} + +export class EnableRecoveryModeCall__Inputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class EnableRecoveryModeCall__Outputs { + _call: EnableRecoveryModeCall; + + constructor(call: EnableRecoveryModeCall) { + this._call = call; + } +} + +export class IncreaseAllowanceCall extends ethereum.Call { + get inputs(): IncreaseAllowanceCall__Inputs { + return new IncreaseAllowanceCall__Inputs(this); + } + + get outputs(): IncreaseAllowanceCall__Outputs { + return new IncreaseAllowanceCall__Outputs(this); + } +} + +export class IncreaseAllowanceCall__Inputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get spender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get addedValue(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class IncreaseAllowanceCall__Outputs { + _call: IncreaseAllowanceCall; + + constructor(call: IncreaseAllowanceCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class OnExitPoolCall extends ethereum.Call { + get inputs(): OnExitPoolCall__Inputs { + return new OnExitPoolCall__Inputs(this); + } + + get outputs(): OnExitPoolCall__Outputs { + return new OnExitPoolCall__Outputs(this); + } +} + +export class OnExitPoolCall__Inputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnExitPoolCall__Outputs { + _call: OnExitPoolCall; + + constructor(call: OnExitPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnJoinPoolCall extends ethereum.Call { + get inputs(): OnJoinPoolCall__Inputs { + return new OnJoinPoolCall__Inputs(this); + } + + get outputs(): OnJoinPoolCall__Outputs { + return new OnJoinPoolCall__Outputs(this); + } +} + +export class OnJoinPoolCall__Inputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class OnJoinPoolCall__Outputs { + _call: OnJoinPoolCall; + + constructor(call: OnJoinPoolCall) { + this._call = call; + } + + get value0(): Array { + return this._call.outputValues[0].value.toBigIntArray(); + } + + get value1(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class OnSwapCall extends ethereum.Call { + get inputs(): OnSwapCall__Inputs { + return new OnSwapCall__Inputs(this); + } + + get outputs(): OnSwapCall__Outputs { + return new OnSwapCall__Outputs(this); + } +} + +export class OnSwapCall__Inputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get request(): OnSwapCallRequestStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get balanceTokenIn(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } + + get balanceTokenOut(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class OnSwapCall__Outputs { + _call: OnSwapCall; + + constructor(call: OnSwapCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class OnSwapCallRequestStruct extends ethereum.Tuple { + get kind(): i32 { + return this[0].toI32(); + } + + get tokenIn(): Address { + return this[1].toAddress(); + } + + get tokenOut(): Address { + return this[2].toAddress(); + } + + get amount(): BigInt { + return this[3].toBigInt(); + } + + get poolId(): Bytes { + return this[4].toBytes(); + } + + get lastChangeBlock(): BigInt { + return this[5].toBigInt(); + } + + get from(): Address { + return this[6].toAddress(); + } + + get to(): Address { + return this[7].toAddress(); + } + + get userData(): Bytes { + return this[8].toBytes(); + } +} + +export class PauseCall extends ethereum.Call { + get inputs(): PauseCall__Inputs { + return new PauseCall__Inputs(this); + } + + get outputs(): PauseCall__Outputs { + return new PauseCall__Outputs(this); + } +} + +export class PauseCall__Inputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PauseCall__Outputs { + _call: PauseCall; + + constructor(call: PauseCall) { + this._call = call; + } +} + +export class PermitCall extends ethereum.Call { + get inputs(): PermitCall__Inputs { + return new PermitCall__Inputs(this); + } + + get outputs(): PermitCall__Outputs { + return new PermitCall__Outputs(this); + } +} + +export class PermitCall__Inputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } + + get owner(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get spender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get value(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get deadline(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get v(): i32 { + return this._call.inputValues[4].value.toI32(); + } + + get r(): Bytes { + return this._call.inputValues[5].value.toBytes(); + } + + get s(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class PermitCall__Outputs { + _call: PermitCall; + + constructor(call: PermitCall) { + this._call = call; + } +} + +export class QueryExitCall extends ethereum.Call { + get inputs(): QueryExitCall__Inputs { + return new QueryExitCall__Inputs(this); + } + + get outputs(): QueryExitCall__Outputs { + return new QueryExitCall__Outputs(this); + } +} + +export class QueryExitCall__Inputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryExitCall__Outputs { + _call: QueryExitCall; + + constructor(call: QueryExitCall) { + this._call = call; + } + + get bptIn(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsOut(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class QueryJoinCall extends ethereum.Call { + get inputs(): QueryJoinCall__Inputs { + return new QueryJoinCall__Inputs(this); + } + + get outputs(): QueryJoinCall__Outputs { + return new QueryJoinCall__Outputs(this); + } +} + +export class QueryJoinCall__Inputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get poolId(): Bytes { + return this._call.inputValues[0].value.toBytes(); + } + + get sender(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get balances(): Array { + return this._call.inputValues[3].value.toBigIntArray(); + } + + get lastChangeBlock(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get protocolSwapFeePercentage(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } + + get userData(): Bytes { + return this._call.inputValues[6].value.toBytes(); + } +} + +export class QueryJoinCall__Outputs { + _call: QueryJoinCall; + + constructor(call: QueryJoinCall) { + this._call = call; + } + + get bptOut(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } + + get amountsIn(): Array { + return this._call.outputValues[1].value.toBigIntArray(); + } +} + +export class SetAssetManagerPoolConfigCall extends ethereum.Call { + get inputs(): SetAssetManagerPoolConfigCall__Inputs { + return new SetAssetManagerPoolConfigCall__Inputs(this); + } + + get outputs(): SetAssetManagerPoolConfigCall__Outputs { + return new SetAssetManagerPoolConfigCall__Outputs(this); + } +} + +export class SetAssetManagerPoolConfigCall__Inputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } + + get token(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get poolConfig(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class SetAssetManagerPoolConfigCall__Outputs { + _call: SetAssetManagerPoolConfigCall; + + constructor(call: SetAssetManagerPoolConfigCall) { + this._call = call; + } +} + +export class SetSwapFeePercentageCall extends ethereum.Call { + get inputs(): SetSwapFeePercentageCall__Inputs { + return new SetSwapFeePercentageCall__Inputs(this); + } + + get outputs(): SetSwapFeePercentageCall__Outputs { + return new SetSwapFeePercentageCall__Outputs(this); + } +} + +export class SetSwapFeePercentageCall__Inputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } + + get swapFeePercentage(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class SetSwapFeePercentageCall__Outputs { + _call: SetSwapFeePercentageCall; + + constructor(call: SetSwapFeePercentageCall) { + this._call = call; + } +} + +export class TransferCall extends ethereum.Call { + get inputs(): TransferCall__Inputs { + return new TransferCall__Inputs(this); + } + + get outputs(): TransferCall__Outputs { + return new TransferCall__Outputs(this); + } +} + +export class TransferCall__Inputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get recipient(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TransferCall__Outputs { + _call: TransferCall; + + constructor(call: TransferCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class TransferFromCall extends ethereum.Call { + get inputs(): TransferFromCall__Inputs { + return new TransferFromCall__Inputs(this); + } + + get outputs(): TransferFromCall__Outputs { + return new TransferFromCall__Outputs(this); + } +} + +export class TransferFromCall__Inputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get sender(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get recipient(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } +} + +export class TransferFromCall__Outputs { + _call: TransferFromCall; + + constructor(call: TransferFromCall) { + this._call = call; + } + + get value0(): boolean { + return this._call.outputValues[0].value.toBoolean(); + } +} + +export class UnpauseCall extends ethereum.Call { + get inputs(): UnpauseCall__Inputs { + return new UnpauseCall__Inputs(this); + } + + get outputs(): UnpauseCall__Outputs { + return new UnpauseCall__Outputs(this); + } +} + +export class UnpauseCall__Inputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UnpauseCall__Outputs { + _call: UnpauseCall; + + constructor(call: UnpauseCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall extends ethereum.Call { + get inputs(): UpdateProtocolFeePercentageCacheCall__Inputs { + return new UpdateProtocolFeePercentageCacheCall__Inputs(this); + } + + get outputs(): UpdateProtocolFeePercentageCacheCall__Outputs { + return new UpdateProtocolFeePercentageCacheCall__Outputs(this); + } +} + +export class UpdateProtocolFeePercentageCacheCall__Inputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} + +export class UpdateProtocolFeePercentageCacheCall__Outputs { + _call: UpdateProtocolFeePercentageCacheCall; + + constructor(call: UpdateProtocolFeePercentageCacheCall) { + this._call = call; + } +} diff --git a/manifest.template.yaml b/manifest.template.yaml index db67e606b..1e18c568e 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -1708,7 +1708,7 @@ templates: handler: handleTransfer - event: SwapFeePercentageChanged(uint256) handler: handleSwapFeePercentageChange - - event: OpenIssue(indexed address,uint256,uint256,address,uint256,uint256,string,address) + - event: OpenIssue(indexed address,uint256,uint256,address,uint256,uint256,string) handler: handleOpenIssue - event: Subscription(indexed address,address,uint256,address,uint256,uint256) handler: handleSubscription diff --git a/networks.yaml b/networks.yaml index a69ba862c..b29f50a44 100644 --- a/networks.yaml +++ b/networks.yaml @@ -114,8 +114,8 @@ goerli: # address: "0xA5bf2ddF098bb0Ef6d120C98217dD6B141c74EE0" # startBlock: 4716924 PrimaryIssuePoolFactory: - address: "0x588b63ca44F637C1Ffa9C70c512363C7BE6A1072" - startBlock: 9121129 + address: "0x4823be69546f9e1Ab8a87f315108c19dDC8E48b4" + startBlock: 8586768 SecondaryIssuePoolFactory: address: "0xe3e79e4106327e6eAeFBD03C1fD3A4A531c59b10" startBlock: 9012992 @@ -123,8 +123,8 @@ goerli: address: "0xCFE47c774245Ef9EE6Ed0d7C58219fFd7BB60852" startBlock: 8853132 MarginTradingPoolFactory: - address: "0x2E98aa5C69ef93dAc5305dFAd3dDFba5e29d8387" - startBlock: 8853121 + address: "0x4133189077C15278e893473c311D4DC5FCdDCb43" + startBlock: 9952072 # StablePoolFactory: # address: "0x44afeb87c871D8fEA9398a026DeA2BD3A13F5769" # startBlock: 6992992 diff --git a/subgraph.yaml b/subgraph.yaml index fdd7f825d..d939d62ad 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -74,9 +74,9 @@ dataSources: name: PrimaryIssuePoolFactory network: goerli source: - address: '0x588b63ca44F637C1Ffa9C70c512363C7BE6A1072' + address: '0x4823be69546f9e1Ab8a87f315108c19dDC8E48b4' abi: PrimaryIssuePoolFactory - startBlock: 9121129 + startBlock: 8586768 mapping: kind: ethereum/events apiVersion: 0.0.5 @@ -161,9 +161,9 @@ dataSources: name: MarginTradingPoolFactory network: goerli source: - address: '0x2E98aa5C69ef93dAc5305dFAd3dDFba5e29d8387' + address: '0x4133189077C15278e893473c311D4DC5FCdDCb43' abi: MarginTradingPoolFactory - startBlock: 8853121 + startBlock: 9952072 mapping: kind: ethereum/events apiVersion: 0.0.5 @@ -547,7 +547,7 @@ templates: handler: handleTransfer - event: SwapFeePercentageChanged(uint256) handler: handleSwapFeePercentageChange - - event: OpenIssue(indexed address,uint256,uint256,address,uint256,uint256,string,address) + - event: OpenIssue(indexed address,uint256,uint256,address,uint256,uint256,string) handler: handleOpenIssue - event: Subscription(indexed address,address,uint256,address,uint256,uint256) handler: handleSubscription