@boostxyz/sdk 7.1.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +46 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +395 -345
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +79 -68
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +84 -73
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +179 -175
- package/package.json +1 -1
- package/src/Actions/EventAction.test.ts +90 -0
- package/src/Actions/EventAction.ts +119 -2
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts +24 -5
- package/src/Incentives/ERC20VariableCriteriaIncentiveV2.ts +25 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { d as y, bC as D, bD as
|
|
2
|
-
import { getTransactionReceipt as
|
|
3
|
-
import { parseEventLogs as
|
|
4
|
-
import { f as
|
|
5
|
-
import { SignatureType as
|
|
6
|
-
import { DeployableTarget as
|
|
7
|
-
import { prepareClaimPayload as
|
|
8
|
-
import { NoMatchingLogsError as
|
|
9
|
-
import { RegistryType as
|
|
10
|
-
const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6122ba806100895f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146107a9578063fe9fbb80146107bc578063fee81cf4146107db575f80fd5b8063ec87621c14610782578063f04e283e14610796575f80fd5b8063db09da12116100ac578063db09da121461072f578063dcc213611461074e578063dcc59b6f1461076d575f80fd5b8063c884ef83146106ec578063d54ad2a11461071a575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461069a578063be4994f8146106b9578063c213f3f9146106d8575f80fd5b8063a4d66daf14610664578063a871ced214610679575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106225780639214fa4d1461063a575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046119c5565b61080c565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611a0b565b610867565b005b610313610323366004611a4a565b610874565b348015610333575f80fd5b506102ce610342366004611a4a565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361088a565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e366004611a72565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611a0b565b6108d7565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a366004611ad3565b610993565b3480156104aa575f80fd5b506103136104b9366004611b7d565b610a8d565b3480156104c9575f80fd5b506104dd6104d8366004611b7d565b610e1c565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b610313610515366004611a4a565b610f7e565b348015610525575f80fd5b50610539610534366004611b7d565b610f90565b6040516102da9190611c08565b348015610551575f80fd5b506102ce610560366004611a4a565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b61031361102a565b610313611063565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546106119260ff90811692918082169173ffffffffffffffffffffffffffffffffffffffff61010083041691750100000000000000000000000000000000000000000090041685565b6040516102da959493929190611c57565b34801561062d575f80fd5b50638b78c6d81954610389565b348015610645575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b34801561066f575f80fd5b506102f260085481565b348015610684575f80fd5b5061068d611076565b6040516102da9190611d0a565b3480156106a5575f80fd5b506102ce6106b4366004611d18565b61115c565b3480156106c4575f80fd5b506103136106d3366004611ad3565b611389565b3480156106e3575f80fd5b50600b546102f2565b3480156106f7575f80fd5b506102ce610706366004611a72565b60016020525f908152604090205460ff1681565b348015610725575f80fd5b506102f260095481565b34801561073a575f80fd5b506102ce610749366004611d18565b611427565b348015610759575f80fd5b50610313610768366004611ad3565b61149a565b348015610778575f80fd5b506102f260075481565b34801561078d575f80fd5b506102f2600181565b6103136107a4366004611a72565b611538565b6103136107b7366004611a72565b611572565b3480156107c7575f80fd5b506102ce6107d6366004611a72565b611598565b3480156107e6575f80fd5b506102f26107f5366004611a72565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c90000000000000000000000000000000000000000000000000000000014806108615750610861826115f7565b92915050565b610871338261164c565b50565b61087c611657565b6108868282611671565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108e28161167d565b815f0361091b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109409073ffffffffffffffffffffffffffffffffffffffff163330856116ae565b8160085f8282546109519190611d94565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b600261099e8161167d565b8382146109d7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85575f8484838181106109f4576109f4611da7565b9050602002016020810190610a099190611dd4565b9050801515600103610a4b57610a46878784818110610a2a57610a2a611da7565b9050602002016020810190610a3f9190611a72565b6001611671565b610a7c565b610a7c878784818110610a6057610a60611da7565b9050602002016020810190610a759190611a72565b600161164c565b506001016109d9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ade5760018160011c14303b10610ad55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610aec83850185611e9b565b905080606001515f03610b2b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b549073ffffffffffffffffffffffffffffffffffffffff1630611710565b905081811015610bbd5782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c7157610c71611c1a565b021790555060208201516001808301919091556040830151600283018054606086015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090911660ff90931692909217919091178082556080850151927fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909116907501000000000000000000000000000000000000000000908490811115610d3657610d36611c1a565b0217905550905050610d4733611743565b610d568460800151600161178b565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167f2610f3b22dbb1fc9e125919ede742dad90b4f3dd49ce0c10118c6ef34410e3c98660400151876060015188608001518960a001518a60c00151604051610dd6959493929190611fa1565b60405180910390a3505050508015610e17576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e298161167d565b5f610e3685870187612093565b90505f8160200151806020019051810190610e519190612110565b90508060085f828254610e649190612127565b90915550508151600654610e919173ffffffffffffffffffffffffffffffffffffffff90911690836117cc565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610f4f91611c08565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f86611657565b610886828261164c565b60605f610f9f83850185611e9b565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092611011920161213a565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61106b611657565b6110745f61181f565b565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101919091526040805160a0810190915260038054829060ff1660018111156110c5576110c5611c1a565b60018111156110d6576110d6611c1a565b81526001828101546020830152600283015460ff808216604085015273ffffffffffffffffffffffffffffffffffffffff61010083041660608501526080909301927501000000000000000000000000000000000000000000909104169081111561114357611143611c1a565b600181111561115457611154611c1a565b905250919050565b5f611165611657565b5f611172838501856121b8565b90505f816020015180602001905181019061118d9190612110565b90505f80545f0361119f5750806111c2565b670de0b6b3a7640000825f546111b59190612235565b6111bf919061224c565b90505b600b54158015906111d45750600b5481115b156111de5750600b545b6111e781611869565b61121d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008548160095461122e9190611d94565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546112779190611d94565b92505081905550600160075f8282546112909190611d94565b90915550506006546112b99073ffffffffffffffffffffffffffffffffffffffff1688836117cc565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261137491611c08565b60405180910390a25060019695505050505050565b60026113948161167d565b8382146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a855761141f8686838181106113ec576113ec611da7565b90506020020160208101906114019190611a72565b85858481811061141357611413611da7565b90506020020135611671565b6001016113cf565b5f8080611436848601866121b8565b90505f81602001518060200190518101906114519190612110565b90505f545f0361146357809250611486565b670de0b6b3a7640000815f546114799190612235565b611483919061224c565b92505b61148f83611869565b979650505050505050565b60026114a58161167d565b8382146114de576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85576115308686838181106114fd576114fd611da7565b90506020020160208101906115129190611a72565b85858481811061152457611524611da7565b9050602002013561164c565b6001016114e0565b611540611657565b63389a75e1600c52805f526020600c20805442111561156657636f5e88185f526004601cfd5b5f90556108718161181f565b61157a611657565b8060601b61158f57637448fbae5f526004601cfd5b6108718161181f565b5f8173ffffffffffffffffffffffffffffffffffffffff166115bd638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108615750638b78c6d8600c9081525f83905260209020546003161515610861565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f56586338000000000000000000000000000000000000000000000000000000001480610861575061086182611883565b61088682825f6118d8565b638b78c6d819543314611074576382b429005f526004601cfd5b610886828260016118d8565b638b78c6d81954331461087157638b78c6d8600c52335f52806020600c205416610871576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661170257803d873b15171061170257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661181557803d853b151710611815576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f6008548260095461187b9190611d94565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061086157506108618261192f565b638b78c6d8600c52825f526020600c208054838117836118f9575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061086157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610861565b5f602082840312156119d5575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611a04575f80fd5b9392505050565b5f60208284031215611a1b575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a45575f80fd5b919050565b5f8060408385031215611a5b575f80fd5b611a6483611a22565b946020939093013593505050565b5f60208284031215611a82575f80fd5b611a0482611a22565b5f8083601f840112611a9b575f80fd5b50813567ffffffffffffffff811115611ab2575f80fd5b6020830191508360208260051b8501011115611acc575f80fd5b9250929050565b5f805f8060408587031215611ae6575f80fd5b843567ffffffffffffffff811115611afc575f80fd5b611b0887828801611a8b565b909550935050602085013567ffffffffffffffff811115611b27575f80fd5b611b3387828801611a8b565b95989497509550505050565b5f8083601f840112611b4f575f80fd5b50813567ffffffffffffffff811115611b66575f80fd5b602083019150836020828501011115611acc575f80fd5b5f8060208385031215611b8e575f80fd5b823567ffffffffffffffff811115611ba4575f80fd5b611bb085828601611b3f565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611a046020830184611bbc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061087157610871611c1a565b60a08101611c6487611c47565b86825285602083015260ff8516604083015273ffffffffffffffffffffffffffffffffffffffff84166060830152611c9b83611c47565b8260808301529695505050505050565b8051611cb681611c47565b808352506020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301526080810151611cff81611c47565b806080840152505050565b60a081016108618284611cab565b5f805f60408486031215611d2a575f80fd5b611d3384611a22565b9250602084013567ffffffffffffffff811115611d4e575f80fd5b611d5a86828701611b3f565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561086157610861611d67565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611de4575f80fd5b81358015158114611a04575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611e4357611e43611df3565b60405290565b60405160a0810167ffffffffffffffff81118282101715611e4357611e43611df3565b6040805190810167ffffffffffffffff81118282101715611e4357611e43611df3565b60028110610871575f80fd5b5f81830361016081128015611eae575f80fd5b50611eb7611e20565b611ec084611a22565b8152611ece60208501611a22565b60208201526040848101359082015260608085013590820152611ef360808501611a22565b608082015260a084810135818301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611f2f575f80fd5b611f37611e49565b915060c0840135611f4781611e8f565b825260e0840135602083015261010084013560ff81168114611f67575f80fd5b6040830152611f796101208501611a22565b6060830152610140840135611f8d81611e8f565b608083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101208101611fe06080830184611cab565b9695505050505050565b5f82601f830112611ff9575f80fd5b813567ffffffffffffffff81111561201357612013611df3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561206057612060611df3565b604052818152838201602001851015612077575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156120a3575f80fd5b813567ffffffffffffffff8111156120b9575f80fd5b8201604081850312156120ca575f80fd5b6120d2611e6c565b6120db82611a22565b8152602082013567ffffffffffffffff8111156120f6575f80fd5b61210286828501611fea565b602083015250949350505050565b5f60208284031215612120575f80fd5b5051919050565b8181038181111561086157610861611d67565b602081525f82516003811061215157612151611c1a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526121b060a0840182611bbc565b949350505050565b5f602082840312156121c8575f80fd5b813567ffffffffffffffff8111156121de575f80fd5b8201604081850312156121ef575f80fd5b6121f7611e6c565b813567ffffffffffffffff81111561220d575f80fd5b61221986828501611fea565b825250602082013567ffffffffffffffff8111156120f6575f80fd5b808202811582820484141761086157610861611d67565b5f8261227f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212204e4cf647127c9375d9d4d84240a56dd4ae0f1f1727bcc814e7c0f19d99a9cc9664736f6c634300081a0033", u = class u extends K {
|
|
1
|
+
import { d as y, bC as D, bD as V, bE as R, bF as _, bG as E, bH as P, bI as N, bJ as O, bK as $, bL as F, bM as B, bN as G, bO as M, bP as S, bQ as U, bR as k, bS as H } from "../generated-CINzoGbl.js";
|
|
2
|
+
import { getTransactionReceipt as L, getTransaction as q } from "@wagmi/core";
|
|
3
|
+
import { parseEventLogs as z, decodeFunctionData as J, zeroAddress as n, zeroHash as K, encodeAbiParameters as g, decodeAbiParameters as o, parseEther as p } from "viem";
|
|
4
|
+
import { f as j } from "../deployments-DKtAq6BT.js";
|
|
5
|
+
import { SignatureType as h, isCriteriaFieldIndexTuple as w, getScalarValueFromTuple as C } from "../Actions/EventAction.js";
|
|
6
|
+
import { DeployableTarget as Q } from "../Deployable/DeployableTarget.js";
|
|
7
|
+
import { prepareClaimPayload as A } from "../claiming.js";
|
|
8
|
+
import { NoMatchingLogsError as v, DecodedArgsError as l, InvalidCriteriaTypeError as W, IncentiveCriteriaNotFoundError as X } from "../errors.js";
|
|
9
|
+
import { RegistryType as Z, CheatCodes as Y } from "../utils.js";
|
|
10
|
+
const f0 = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6122ba806100895f395ff3fe6080604052600436106102ab575f3560e01c8063715018a611610165578063c884ef83116100c6578063ec87621c1161007c578063f2fde38b11610062578063f2fde38b146107a9578063fe9fbb80146107bc578063fee81cf4146107db575f80fd5b8063ec87621c14610782578063f04e283e14610796575f80fd5b8063db09da12116100ac578063db09da121461072f578063dcc213611461074e578063dcc59b6f1461076d575f80fd5b8063c884ef83146106ec578063d54ad2a11461071a575f80fd5b8063a4d66daf1161011b578063bb1757cf11610101578063bb1757cf1461069a578063be4994f8146106b9578063c213f3f9146106d8575f80fd5b8063a4d66daf14610664578063a871ced214610679575f80fd5b8063775486871161014b57806377548687146105b45780638da5cb5b146106225780639214fa4d1461063a575f80fd5b8063715018a61461059857806375b238fc146105a0575f80fd5b806330db555f1161020f5780634a4ee7b1116101c5578063514e62fc116101ab578063514e62fc14610546578063547d18641461057b57806354d1f13d14610590575f80fd5b80634a4ee7b1146105075780634e7165a21461051a575f80fd5b80634359d28a116101f55780634359d28a14610480578063439fab911461049f578063474f5a44146104be575f80fd5b806330db555f1461043557806338d52e0f14610454575f80fd5b80631f1cb62b11610264578063256929621161024a57806325692962146103c257806328d6183b146103ca5780632de9480714610404575f80fd5b80631f1cb62b1461035d578063228cb733146103ae575f80fd5b8063183a4f6e11610294578063183a4f6e146103005780631c10893f146103155780631cd64df414610328575f80fd5b806301ffc9a7146102af57806307621eca146102e3575b5f80fd5b3480156102ba575f80fd5b506102ce6102c93660046119c5565b61080c565b60405190151581526020015b60405180910390f35b3480156102ee575f80fd5b505f545b6040519081526020016102da565b61031361030e366004611a0b565b610867565b005b610313610323366004611a4a565b610874565b348015610333575f80fd5b506102ce610342366004611a4a565b638b78c6d8600c9081525f9290925260209091205481161490565b348015610368575f80fd5b50600a546103899073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102da565b3480156103b9575f80fd5b506102f25f5481565b61031361088a565b3480156103d5575f80fd5b506040517ff60c99c90000000000000000000000000000000000000000000000000000000081526020016102da565b34801561040f575f80fd5b506102f261041e366004611a72565b638b78c6d8600c9081525f91909152602090205490565b348015610440575f80fd5b5061031361044f366004611a0b565b6108d7565b34801561045f575f80fd5b506006546103899073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048b575f80fd5b5061031361049a366004611ad3565b610993565b3480156104aa575f80fd5b506103136104b9366004611b7d565b610a8d565b3480156104c9575f80fd5b506104dd6104d8366004611b7d565b610e1c565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016102da565b610313610515366004611a4a565b610f7e565b348015610525575f80fd5b50610539610534366004611b7d565b610f90565b6040516102da9190611c08565b348015610551575f80fd5b506102ce610560366004611a4a565b638b78c6d8600c9081525f9290925260209091205416151590565b348015610586575f80fd5b506102f260025481565b61031361102a565b610313611063565b3480156105ab575f80fd5b506102f2600281565b3480156105bf575f80fd5b506003546004546005546106119260ff90811692918082169173ffffffffffffffffffffffffffffffffffffffff61010083041691750100000000000000000000000000000000000000000090041685565b6040516102da959493929190611c57565b34801561062d575f80fd5b50638b78c6d81954610389565b348015610645575f80fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff16610389565b34801561066f575f80fd5b506102f260085481565b348015610684575f80fd5b5061068d611076565b6040516102da9190611d0a565b3480156106a5575f80fd5b506102ce6106b4366004611d18565b61115c565b3480156106c4575f80fd5b506103136106d3366004611ad3565b611389565b3480156106e3575f80fd5b50600b546102f2565b3480156106f7575f80fd5b506102ce610706366004611a72565b60016020525f908152604090205460ff1681565b348015610725575f80fd5b506102f260095481565b34801561073a575f80fd5b506102ce610749366004611d18565b611427565b348015610759575f80fd5b50610313610768366004611ad3565b61149a565b348015610778575f80fd5b506102f260075481565b34801561078d575f80fd5b506102f2600181565b6103136107a4366004611a72565b611538565b6103136107b7366004611a72565b611572565b3480156107c7575f80fd5b506102ce6107d6366004611a72565b611598565b3480156107e6575f80fd5b506102f26107f5366004611a72565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167ff60c99c90000000000000000000000000000000000000000000000000000000014806108615750610861826115f7565b92915050565b610871338261164c565b50565b61087c611657565b6108868282611671565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60016108e28161167d565b815f0361091b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546109409073ffffffffffffffffffffffffffffffffffffffff163330856116ae565b8160085f8282546109519190611d94565b909155505060408051338152602081018490527fa64c2da41decbd538f8629e54c8fa0b7362c9102b691386a0fb6a1797454e9c6910160405180910390a15050565b600261099e8161167d565b8382146109d7576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85575f8484838181106109f4576109f4611da7565b9050602002016020810190610a099190611dd4565b9050801515600103610a4b57610a46878784818110610a2a57610a2a611da7565b9050602002016020810190610a3f9190611a72565b6001611671565b610a7c565b610a7c878784818110610a6057610a60611da7565b9050602002016020810190610a759190611a72565b600161164c565b506001016109d9565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011328054600382558015610ade5760018160011c14303b10610ad55763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f610aec83850185611e9b565b905080606001515f03610b2b576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081015181515f90610b549073ffffffffffffffffffffffffffffffffffffffff1630611710565b905081811015610bbd5782516040517f5c54305e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018290526044810183905260640160405180910390fd5b60c083015183516006805473ffffffffffffffffffffffffffffffffffffffff9283167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556020860151600a805491909316911617905560408401515f55606084015160085560a0840151600b5580516003805483929082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018381811115610c7157610c71611c1a565b021790555060208201516001808301919091556040830151600283018054606086015173ffffffffffffffffffffffffffffffffffffffff16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090911660ff90931692909217919091178082556080850151927fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909116907501000000000000000000000000000000000000000000908490811115610d3657610d36611c1a565b0217905550905050610d4733611743565b610d568460800151600161178b565b836020015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff167f2610f3b22dbb1fc9e125919ede742dad90b4f3dd49ce0c10118c6ef34410e3c98660400151876060015188608001518960a001518a60c00151604051610dd6959493929190611fa1565b60405180910390a3505050508015610e17576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806001610e298161167d565b5f610e3685870187612093565b90505f8160200151806020019051810190610e519190612110565b90508060085f828254610e649190612127565b90915550508151600654610e919173ffffffffffffffffffffffffffffffffffffffff90911690836117cc565b81516006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529183901b90911660348201526048810183905273ffffffffffffffffffffffffffffffffffffffff909116907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610f4f91611c08565b60405180910390a260065490945073ffffffffffffffffffffffffffffffffffffffff16925050509250929050565b610f86611657565b610886828261164c565b60605f610f9f83850185611e9b565b6060818101516040805160808101825260018152845173ffffffffffffffffffffffffffffffffffffffff16602080830191909152308284015282518082018452849052825180820185905283518082038301815290840184529482019490945290519394509092611011920161213a565b6040516020818303038152906040529250505092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61106b611657565b6110745f61181f565b565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101919091526040805160a0810190915260038054829060ff1660018111156110c5576110c5611c1a565b60018111156110d6576110d6611c1a565b81526001828101546020830152600283015460ff808216604085015273ffffffffffffffffffffffffffffffffffffffff61010083041660608501526080909301927501000000000000000000000000000000000000000000909104169081111561114357611143611c1a565b600181111561115457611154611c1a565b905250919050565b5f611165611657565b5f611172838501856121b8565b90505f816020015180602001905181019061118d9190612110565b90505f80545f0361119f5750806111c2565b670de0b6b3a7640000825f546111b59190612235565b6111bf919061224c565b90505b600b54158015906111d45750600b5481115b156111de5750600b545b6111e781611869565b61121d576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008548160095461122e9190611d94565b1115611266576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060095f8282546112779190611d94565b92505081905550600160075f8282546112909190611d94565b90915550506006546112b99073ffffffffffffffffffffffffffffffffffffffff1688836117cc565b6006546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b811660208301529189901b90911660348201526048810182905273ffffffffffffffffffffffffffffffffffffffff8816907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261137491611c08565b60405180910390a25060019695505050505050565b60026113948161167d565b8382146113cd576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a855761141f8686838181106113ec576113ec611da7565b90506020020160208101906114019190611a72565b85858481811061141357611413611da7565b90506020020135611671565b6001016113cf565b5f8080611436848601866121b8565b90505f81602001518060200190518101906114519190612110565b90505f545f0361146357809250611486565b670de0b6b3a7640000815f546114799190612235565b611483919061224c565b92505b61148f83611869565b979650505050505050565b60026114a58161167d565b8382146114de576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610a85576115308686838181106114fd576114fd611da7565b90506020020160208101906115129190611a72565b85858481811061152457611524611da7565b9050602002013561164c565b6001016114e0565b611540611657565b63389a75e1600c52805f526020600c20805442111561156657636f5e88185f526004601cfd5b5f90556108718161181f565b61157a611657565b8060601b61158f57637448fbae5f526004601cfd5b6108718161181f565b5f8173ffffffffffffffffffffffffffffffffffffffff166115bd638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806108615750638b78c6d8600c9081525f83905260209020546003161515610861565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f56586338000000000000000000000000000000000000000000000000000000001480610861575061086182611883565b61088682825f6118d8565b638b78c6d819543314611074576382b429005f526004601cfd5b610886828260016118d8565b638b78c6d81954331461087157638b78c6d8600c52335f52806020600c205416610871576382b429005f526004601cfd5b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af18060015f51141661170257803d873b15171061170257637939f4245f526004601cfd5b505f60605260405250505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d8600c52815f52806020600c205580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a35050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af18060015f51141661181557803d853b151710611815576390b8ec185f526004601cfd5b505f603452505050565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f6008548260095461187b9190611d94565b111592915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa921670500000000000000000000000000000000000000000000000000000000148061086157506108618261192f565b638b78c6d8600c52825f526020600c208054838117836118f9575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061086157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610861565b5f602082840312156119d5575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611a04575f80fd5b9392505050565b5f60208284031215611a1b575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611a45575f80fd5b919050565b5f8060408385031215611a5b575f80fd5b611a6483611a22565b946020939093013593505050565b5f60208284031215611a82575f80fd5b611a0482611a22565b5f8083601f840112611a9b575f80fd5b50813567ffffffffffffffff811115611ab2575f80fd5b6020830191508360208260051b8501011115611acc575f80fd5b9250929050565b5f805f8060408587031215611ae6575f80fd5b843567ffffffffffffffff811115611afc575f80fd5b611b0887828801611a8b565b909550935050602085013567ffffffffffffffff811115611b27575f80fd5b611b3387828801611a8b565b95989497509550505050565b5f8083601f840112611b4f575f80fd5b50813567ffffffffffffffff811115611b66575f80fd5b602083019150836020828501011115611acc575f80fd5b5f8060208385031215611b8e575f80fd5b823567ffffffffffffffff811115611ba4575f80fd5b611bb085828601611b3f565b90969095509350505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f611a046020830184611bbc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061087157610871611c1a565b60a08101611c6487611c47565b86825285602083015260ff8516604083015273ffffffffffffffffffffffffffffffffffffffff84166060830152611c9b83611c47565b8260808301529695505050505050565b8051611cb681611c47565b808352506020810151602083015260ff604082015116604083015273ffffffffffffffffffffffffffffffffffffffff60608201511660608301526080810151611cff81611c47565b806080840152505050565b60a081016108618284611cab565b5f805f60408486031215611d2a575f80fd5b611d3384611a22565b9250602084013567ffffffffffffffff811115611d4e575f80fd5b611d5a86828701611b3f565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561086157610861611d67565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611de4575f80fd5b81358015158114611a04575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160e0810167ffffffffffffffff81118282101715611e4357611e43611df3565b60405290565b60405160a0810167ffffffffffffffff81118282101715611e4357611e43611df3565b6040805190810167ffffffffffffffff81118282101715611e4357611e43611df3565b60028110610871575f80fd5b5f81830361016081128015611eae575f80fd5b50611eb7611e20565b611ec084611a22565b8152611ece60208501611a22565b60208201526040848101359082015260608085013590820152611ef360808501611a22565b608082015260a084810135818301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4083011215611f2f575f80fd5b611f37611e49565b915060c0840135611f4781611e8f565b825260e0840135602083015261010084013560ff81168114611f67575f80fd5b6040830152611f796101208501611a22565b6060830152610140840135611f8d81611e8f565b608083015260c08101919091529392505050565b8581526020810185905273ffffffffffffffffffffffffffffffffffffffff84166040820152606081018390526101208101611fe06080830184611cab565b9695505050505050565b5f82601f830112611ff9575f80fd5b813567ffffffffffffffff81111561201357612013611df3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff8111828210171561206057612060611df3565b604052818152838201602001851015612077575f80fd5b816020850160208301375f918101602001919091529392505050565b5f602082840312156120a3575f80fd5b813567ffffffffffffffff8111156120b9575f80fd5b8201604081850312156120ca575f80fd5b6120d2611e6c565b6120db82611a22565b8152602082013567ffffffffffffffff8111156120f6575f80fd5b61210286828501611fea565b602083015250949350505050565b5f60208284031215612120575f80fd5b5051919050565b8181038181111561086157610861611d67565b602081525f82516003811061215157612151611c1a565b8060208401525073ffffffffffffffffffffffffffffffffffffffff602084015116604083015273ffffffffffffffffffffffffffffffffffffffff604084015116606083015260608301516080808401526121b060a0840182611bbc565b949350505050565b5f602082840312156121c8575f80fd5b813567ffffffffffffffff8111156121de575f80fd5b8201604081850312156121ef575f80fd5b6121f7611e6c565b813567ffffffffffffffff81111561220d575f80fd5b61221986828501611fea565b825250602082013567ffffffffffffffff8111156120f6575f80fd5b808202811582820484141761086157610861611d67565b5f8261227f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea26469706673582212204e4cf647127c9375d9d4d84240a56dd4ae0f1f1727bcc814e7c0f19d99a9cc9664736f6c634300081a0033", u = class u extends Q {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments), this.abi = y;
|
|
13
13
|
}
|
|
@@ -36,7 +36,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
36
36
|
* @returns {Promise<bigint>} - The current reward
|
|
37
37
|
*/
|
|
38
38
|
async currentReward(f) {
|
|
39
|
-
return await
|
|
39
|
+
return await V(
|
|
40
40
|
this._config,
|
|
41
41
|
{
|
|
42
42
|
address: this.assertValidAddress(),
|
|
@@ -55,7 +55,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
55
55
|
* @returns {Promise<bigint>} The maximum reward amount per claim
|
|
56
56
|
*/
|
|
57
57
|
async getMaxReward(f) {
|
|
58
|
-
return await
|
|
58
|
+
return await R(
|
|
59
59
|
this._config,
|
|
60
60
|
{
|
|
61
61
|
...f,
|
|
@@ -74,61 +74,72 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
74
74
|
async getIncentiveScalar({ chainId: f, hash: a, knownSignatures: b }, t) {
|
|
75
75
|
var d;
|
|
76
76
|
const e = await this.getIncentiveCriteria(t);
|
|
77
|
-
if (e.criteriaType ===
|
|
78
|
-
const
|
|
77
|
+
if (e.criteriaType === h.EVENT) {
|
|
78
|
+
const s = await L(this._config, {
|
|
79
79
|
chainId: f,
|
|
80
80
|
hash: a
|
|
81
81
|
});
|
|
82
|
-
if (e.fieldIndex ===
|
|
83
|
-
return
|
|
84
|
-
(
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
throw new
|
|
82
|
+
if (e.fieldIndex === Y.GAS_REBATE_INCENTIVE)
|
|
83
|
+
return s.gasUsed * s.effectiveGasPrice + // Normal gas cost
|
|
84
|
+
(s.blobGasUsed ?? 0n) * (s.blobGasPrice ?? 0n);
|
|
85
|
+
const r = s.logs;
|
|
86
|
+
if (r.length === 0)
|
|
87
|
+
throw new v(
|
|
88
88
|
`No logs found for event signature ${e.signature}`
|
|
89
89
|
);
|
|
90
90
|
try {
|
|
91
|
-
const
|
|
92
|
-
abi: [
|
|
93
|
-
logs:
|
|
91
|
+
const i = b[e.signature], c = z({
|
|
92
|
+
abi: [i],
|
|
93
|
+
logs: r
|
|
94
94
|
});
|
|
95
|
-
if (
|
|
96
|
-
throw new
|
|
95
|
+
if (c == null || c.length === 0)
|
|
96
|
+
throw new v(
|
|
97
97
|
`No logs found for event signature ${e.signature}`
|
|
98
98
|
);
|
|
99
|
-
|
|
99
|
+
if (w(e.fieldIndex))
|
|
100
|
+
return C(
|
|
101
|
+
(d = c[0]) == null ? void 0 : d.args,
|
|
102
|
+
e.fieldIndex
|
|
103
|
+
);
|
|
104
|
+
const m = c[0] && c[0].args ? c[0].args[e.fieldIndex] : void 0;
|
|
100
105
|
if (m === void 0)
|
|
101
106
|
throw new l(
|
|
102
107
|
`Decoded argument at index ${e.fieldIndex} is undefined`
|
|
103
108
|
);
|
|
104
109
|
return BigInt(m);
|
|
105
|
-
} catch (
|
|
110
|
+
} catch (i) {
|
|
106
111
|
throw new l(
|
|
107
|
-
`Failed to decode event log for signature ${e.signature}: ${
|
|
112
|
+
`Failed to decode event log for signature ${e.signature}: ${i.message}`
|
|
108
113
|
);
|
|
109
114
|
}
|
|
110
|
-
} else if (e.criteriaType ===
|
|
111
|
-
const
|
|
115
|
+
} else if (e.criteriaType === h.FUNC) {
|
|
116
|
+
const s = await q(this._config, {
|
|
112
117
|
chainId: f,
|
|
113
118
|
hash: a
|
|
114
119
|
});
|
|
115
120
|
try {
|
|
116
|
-
const
|
|
117
|
-
abi: [
|
|
118
|
-
data:
|
|
119
|
-
})
|
|
120
|
-
if (
|
|
121
|
+
const r = b[e.signature], i = J({
|
|
122
|
+
abi: [r],
|
|
123
|
+
data: s.input
|
|
124
|
+
});
|
|
125
|
+
if (w(e.fieldIndex))
|
|
126
|
+
return C(
|
|
127
|
+
i.args,
|
|
128
|
+
e.fieldIndex
|
|
129
|
+
);
|
|
130
|
+
const c = i.args[e.fieldIndex];
|
|
131
|
+
if (c == null)
|
|
121
132
|
throw new l(
|
|
122
133
|
`Decoded argument at index ${e.fieldIndex} is undefined`
|
|
123
134
|
);
|
|
124
|
-
return BigInt(
|
|
125
|
-
} catch (
|
|
135
|
+
return BigInt(c);
|
|
136
|
+
} catch (r) {
|
|
126
137
|
throw new l(
|
|
127
|
-
`Failed to decode function data for signature ${e.signature}: ${
|
|
138
|
+
`Failed to decode function data for signature ${e.signature}: ${r.message}`
|
|
128
139
|
);
|
|
129
140
|
}
|
|
130
141
|
} else
|
|
131
|
-
throw new
|
|
142
|
+
throw new W(
|
|
132
143
|
`Invalid criteria type ${e.criteriaType}`
|
|
133
144
|
);
|
|
134
145
|
}
|
|
@@ -141,7 +152,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
141
152
|
* @returns {Promise<bigint>}
|
|
142
153
|
*/
|
|
143
154
|
async claims(f) {
|
|
144
|
-
return await
|
|
155
|
+
return await _(
|
|
145
156
|
this._config,
|
|
146
157
|
{
|
|
147
158
|
address: this.assertValidAddress(),
|
|
@@ -160,7 +171,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
160
171
|
* @returns {Promise<bigint>}
|
|
161
172
|
*/
|
|
162
173
|
async totalClaimed(f) {
|
|
163
|
-
return await
|
|
174
|
+
return await E(
|
|
164
175
|
this._config,
|
|
165
176
|
{
|
|
166
177
|
address: this.assertValidAddress(),
|
|
@@ -180,7 +191,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
180
191
|
* @returns {Promise<boolean>}
|
|
181
192
|
*/
|
|
182
193
|
async claimed(f, a) {
|
|
183
|
-
return await
|
|
194
|
+
return await P(
|
|
184
195
|
this._config,
|
|
185
196
|
{
|
|
186
197
|
address: this.assertValidAddress(),
|
|
@@ -199,7 +210,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
199
210
|
* @returns {Promise<Address>}
|
|
200
211
|
*/
|
|
201
212
|
async asset(f) {
|
|
202
|
-
return await
|
|
213
|
+
return await N(this._config, {
|
|
203
214
|
address: this.assertValidAddress(),
|
|
204
215
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
205
216
|
...f
|
|
@@ -214,7 +225,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
214
225
|
* @returns {Promise<Address>}
|
|
215
226
|
*/
|
|
216
227
|
async peg(f) {
|
|
217
|
-
return await
|
|
228
|
+
return await O(this._config, {
|
|
218
229
|
address: this.assertValidAddress(),
|
|
219
230
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
220
231
|
...f
|
|
@@ -229,7 +240,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
229
240
|
* @returns {Promise<bigint>}
|
|
230
241
|
*/
|
|
231
242
|
async reward(f) {
|
|
232
|
-
return await
|
|
243
|
+
return await $(
|
|
233
244
|
this._config,
|
|
234
245
|
{
|
|
235
246
|
address: this.assertValidAddress(),
|
|
@@ -247,7 +258,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
247
258
|
* @returns {Promise<bigint>}
|
|
248
259
|
*/
|
|
249
260
|
async limit(f) {
|
|
250
|
-
return await
|
|
261
|
+
return await F(this._config, {
|
|
251
262
|
address: this.assertValidAddress(),
|
|
252
263
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
253
264
|
...f
|
|
@@ -275,14 +286,14 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
275
286
|
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed
|
|
276
287
|
*/
|
|
277
288
|
async claimRaw(f, a) {
|
|
278
|
-
const { request: b, result: t } = await
|
|
289
|
+
const { request: b, result: t } = await B(this._config, {
|
|
279
290
|
address: this.assertValidAddress(),
|
|
280
|
-
args: [
|
|
291
|
+
args: [A(f)],
|
|
281
292
|
...this.optionallyAttachAccount(),
|
|
282
293
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
283
294
|
...a
|
|
284
295
|
});
|
|
285
|
-
return { hash: await
|
|
296
|
+
return { hash: await G(
|
|
286
297
|
this._config,
|
|
287
298
|
b
|
|
288
299
|
), result: t };
|
|
@@ -309,17 +320,17 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
309
320
|
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked
|
|
310
321
|
*/
|
|
311
322
|
async clawbackRaw(f, a) {
|
|
312
|
-
const { request: b, result: t } = await
|
|
323
|
+
const { request: b, result: t } = await M(
|
|
313
324
|
this._config,
|
|
314
325
|
{
|
|
315
326
|
address: this.assertValidAddress(),
|
|
316
|
-
args: [
|
|
327
|
+
args: [A(f)],
|
|
317
328
|
...this.optionallyAttachAccount(),
|
|
318
329
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
319
330
|
...a
|
|
320
331
|
}
|
|
321
332
|
);
|
|
322
|
-
return { hash: await
|
|
333
|
+
return { hash: await S(
|
|
323
334
|
this._config,
|
|
324
335
|
b
|
|
325
336
|
), result: t };
|
|
@@ -334,7 +345,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
334
345
|
* @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload
|
|
335
346
|
*/
|
|
336
347
|
async isClaimable(f, a) {
|
|
337
|
-
return await
|
|
348
|
+
return await U(
|
|
338
349
|
this._config,
|
|
339
350
|
{
|
|
340
351
|
address: this.assertValidAddress(),
|
|
@@ -353,7 +364,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
353
364
|
* @returns {Promise<Address>} = The address of the token the reward is pegged to
|
|
354
365
|
*/
|
|
355
366
|
async getPeg(f) {
|
|
356
|
-
return await
|
|
367
|
+
return await k(
|
|
357
368
|
this._config,
|
|
358
369
|
{
|
|
359
370
|
address: this.assertValidAddress(),
|
|
@@ -412,7 +423,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
412
423
|
*/
|
|
413
424
|
async getIncentiveCriteria(f) {
|
|
414
425
|
try {
|
|
415
|
-
return await
|
|
426
|
+
return await H(
|
|
416
427
|
this._config,
|
|
417
428
|
{
|
|
418
429
|
...f,
|
|
@@ -420,7 +431,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
420
431
|
}
|
|
421
432
|
);
|
|
422
433
|
} catch (a) {
|
|
423
|
-
throw new
|
|
434
|
+
throw new X(a);
|
|
424
435
|
}
|
|
425
436
|
}
|
|
426
437
|
/**
|
|
@@ -434,7 +445,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
434
445
|
*/
|
|
435
446
|
async getTopupPayload(f) {
|
|
436
447
|
var a, b, t, e, d;
|
|
437
|
-
return
|
|
448
|
+
return I({
|
|
438
449
|
asset: await this.asset() ?? n,
|
|
439
450
|
peg: ((a = this.payload) == null ? void 0 : a.peg) ?? n,
|
|
440
451
|
reward: ((b = this.payload) == null ? void 0 : b.reward) ?? 0n,
|
|
@@ -443,7 +454,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
443
454
|
manager: ((e = this.payload) == null ? void 0 : e.manager) ?? n,
|
|
444
455
|
criteria: ((d = this.payload) == null ? void 0 : d.criteria) ?? {
|
|
445
456
|
criteriaType: 0,
|
|
446
|
-
signature:
|
|
457
|
+
signature: K,
|
|
447
458
|
fieldIndex: 0,
|
|
448
459
|
targetContract: n,
|
|
449
460
|
valueType: 0
|
|
@@ -465,8 +476,8 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
465
476
|
);
|
|
466
477
|
return {
|
|
467
478
|
abi: y,
|
|
468
|
-
bytecode:
|
|
469
|
-
args: [
|
|
479
|
+
bytecode: f0,
|
|
480
|
+
args: [I(b)],
|
|
470
481
|
...this.optionallyAttachAccount(t.account)
|
|
471
482
|
};
|
|
472
483
|
}
|
|
@@ -524,7 +535,7 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
524
535
|
this.reward(),
|
|
525
536
|
this.getMaxReward()
|
|
526
537
|
]);
|
|
527
|
-
return e === 0n || (t = e * b /
|
|
538
|
+
return e === 0n || (t = e * b / p("1"), d !== 0n && t > d && (t = d)), t;
|
|
528
539
|
}
|
|
529
540
|
/**
|
|
530
541
|
* Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.
|
|
@@ -555,15 +566,15 @@ const Z = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd19805
|
|
|
555
566
|
t[0].incentiveData
|
|
556
567
|
)[0];
|
|
557
568
|
let d = e;
|
|
558
|
-
return a === 0n || (d = a * e /
|
|
569
|
+
return a === 0n || (d = a * e / p("1"), b !== 0n && d > b && (d = b)), d;
|
|
559
570
|
}
|
|
560
571
|
};
|
|
561
572
|
u.bases = {
|
|
562
573
|
31337: void 0,
|
|
563
|
-
...
|
|
564
|
-
}, u.registryType =
|
|
565
|
-
let
|
|
566
|
-
function
|
|
574
|
+
...j
|
|
575
|
+
}, u.registryType = Z.INCENTIVE;
|
|
576
|
+
let x = u;
|
|
577
|
+
function I({
|
|
567
578
|
asset: T,
|
|
568
579
|
peg: f,
|
|
569
580
|
reward: a,
|
|
@@ -618,8 +629,8 @@ function v({
|
|
|
618
629
|
);
|
|
619
630
|
}
|
|
620
631
|
export {
|
|
621
|
-
|
|
632
|
+
x as ERC20PeggedVariableCriteriaIncentiveV2,
|
|
622
633
|
y as erc20PeggedVariableCriteriaIncentiveV2Abi,
|
|
623
|
-
|
|
634
|
+
I as prepareERC20PeggedVariableCriteriaIncentiveV2Payload
|
|
624
635
|
};
|
|
625
636
|
//# sourceMappingURL=ERC20PeggedVariableCriteriaIncentiveV2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.js","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts"],"sourcesContent":["import {\n erc20PeggedVariableCriteriaIncentiveV2Abi,\n readErc20PeggedVariableCriteriaIncentiveV2Asset,\n readErc20PeggedVariableCriteriaIncentiveV2Claimed,\n readErc20PeggedVariableCriteriaIncentiveV2Claims,\n readErc20PeggedVariableCriteriaIncentiveV2CurrentReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetPeg,\n readErc20PeggedVariableCriteriaIncentiveV2IsClaimable,\n readErc20PeggedVariableCriteriaIncentiveV2Limit,\n readErc20PeggedVariableCriteriaIncentiveV2Owner,\n readErc20PeggedVariableCriteriaIncentiveV2Peg,\n readErc20PeggedVariableCriteriaIncentiveV2Reward,\n readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveV2Claim,\n simulateErc20PeggedVariableCriteriaIncentiveV2Clawback,\n writeErc20PeggedVariableCriteriaIncentiveV2Claim,\n writeErc20PeggedVariableCriteriaIncentiveV2Clawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentiveV2.sol/ERC20PeggedVariableCriteriaIncentiveV2.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport type { AbiEvent } from 'abitype';\nimport {\n type AbiFunction,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentiveV2 as ERC20PeggedVariableCriteriaIncentiveV2Bases } from '../../dist/deployments.json';\nimport { SignatureType } from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport {\n CheatCodes,\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\nimport type {\n GetIncentiveScalarV2Params,\n IncentiveCriteriaV2,\n} from './ERC20VariableCriteriaIncentiveV2';\n\nexport { erc20PeggedVariableCriteriaIncentiveV2Abi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentiveV2.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentiveV2\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2}\n */\nexport interface ERC20PeggedVariableCriteriaIncentiveV2Payload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The peg to normalize to.\n *\n * @type {Address}\n */\n peg: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * Total spend for the incentive.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * Maximum reward each claim is elligible for.\n *\n * @type {bigint}\n */\n maxReward: bigint;\n /**\n * (Optional) The address of the entity that can managed the incentive.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteriaV2;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentiveV2` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2Log}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveV2Log<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveV2Abi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentiveV2}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentiveV2>}\n */\nexport class ERC20PeggedVariableCriteriaIncentiveV2 extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentiveV2Payload,\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveV2Abi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env\n .VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE,\n ...(ERC20PeggedVariableCriteriaIncentiveV2Bases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Owner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2CurrentReward(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * Retrieves the maximum reward amount per claim.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The maximum reward amount per claim\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward =\n await readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures }: GetIncentiveScalarV2Params,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n const logs = transactionReceipt.logs;\n\n if (logs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n // Decode function data\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n const scalarValue = (decodedEvents[0]?.args as string[])[\n criteria.fieldIndex\n ];\n\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\n }\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Claims(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Claimed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Asset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the pegged ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async peg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Peg(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Reward(\n this._config,\n {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * The limit (max possible rewards payout in reward token)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Limit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Claim(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeErc20PeggedVariableCriteriaIncentiveV2Claim(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Clawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20PeggedVariableCriteriaIncentiveV2Clawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2IsClaimable(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * read the peg token for the incentive.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} = The address of the token the reward is pegged to\n */\n public async getPeg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2GetPeg(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteriaV2> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset: (await this.asset()) ?? zeroAddress,\n peg: this.payload?.peg ?? zeroAddress,\n reward: this.payload?.reward ?? 0n,\n limit: netAmount,\n maxReward: this.payload?.maxReward ?? 0n,\n manager: this.payload?.manager ?? zeroAddress,\n criteria: this.payload?.criteria ?? {\n criteriaType: 0,\n signature: zeroHash,\n fieldIndex: 0,\n targetContract: zeroAddress,\n valueType: 0,\n },\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentiveV2Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveV2Abi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentiveV2Payload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.\n *\n * @public\n * @param {bigint} signedAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentiveV2Payload.\n */\n public buildClaimData(signedAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'signedAmount' }],\n [signedAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<bigint>} Returns the reward amount from a claim data payload\n */\n public async decodeClaimData(claimData: Hex) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n const [reward, maxReward] = await Promise.all([\n this.reward(),\n this.getMaxReward(),\n ]);\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n * Use this function instead of `decodeClaimData` if you have reward details.\n *\n * @public\n * @param {Hex} claimData\n * @param {bigint} [reward]\n * @param {bigint} [maxReward]\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimDataWithRewardDetails(\n claimData: Hex,\n reward: bigint,\n maxReward: bigint,\n ) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n}\n\n/**\n * Given a {@link ERC20PeggedVariableCriteriaIncentiveV2Payload}, properly encode a `ERC20PeggedVariableCriteriaIncentiveV2Payload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentiveV2Payload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentiveV2Payload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {Address} param0.peg - The peg to normalize to.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can manage the incentive.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentiveV2Payload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'peg' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint8', name: 'valueType' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset,\n peg,\n reward,\n limit,\n manager,\n maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n valueType: criteria.valueType,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20PeggedVariableCriteriaIncentiveV2","DeployableTarget","erc20PeggedVariableCriteriaIncentiveV2Abi","params","readErc20PeggedVariableCriteriaIncentiveV2Owner","readErc20PeggedVariableCriteriaIncentiveV2CurrentReward","readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","scalarValue","_a","DecodedArgsError","e","transaction","getTransaction","func","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveV2Claims","readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed","address","readErc20PeggedVariableCriteriaIncentiveV2Claimed","readErc20PeggedVariableCriteriaIncentiveV2Asset","readErc20PeggedVariableCriteriaIncentiveV2Peg","readErc20PeggedVariableCriteriaIncentiveV2Reward","readErc20PeggedVariableCriteriaIncentiveV2Limit","payload","request","result","simulateErc20PeggedVariableCriteriaIncentiveV2Claim","prepareClaimPayload","writeErc20PeggedVariableCriteriaIncentiveV2Claim","simulateErc20PeggedVariableCriteriaIncentiveV2Clawback","writeErc20PeggedVariableCriteriaIncentiveV2Clawback","readErc20PeggedVariableCriteriaIncentiveV2IsClaimable","readErc20PeggedVariableCriteriaIncentiveV2GetPeg","totalClaimed","limit","readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria","IncentiveCriteriaNotFoundError","netAmount","prepareERC20PeggedVariableCriteriaIncentiveV2Payload","zeroAddress","_b","_c","_d","_e","zeroHash","_payload","_options","options","bytecode","amount","encodeAbiParameters","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","reward","maxReward","parseEther","ERC20PeggedVariableCriteriaIncentiveV2Bases","RegistryType","ERC20PeggedVariableCriteriaIncentiveV2","asset","peg","manager"],"mappings":";;;;;;;;;spjBA4IaA,IAAN,MAAMA,UAA+CC,EAG1D;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8B/B,MAAa,MAAMC,GAAqB;AAC/B,WAAA,MAAMC,EAAgD,KAAK,SAAS;AAAA,MACzE,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA;AAAA,MAEP,GAAID;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA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C;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE,OAAAY;AAAA,QACA,KAAAC;AAAA,QACA,QAAAP;AAAA,QACA,OAAAtB;AAAA,QACA,SAAA8B;AAAA,QACA,WAAAP;AAAA,QACA,UAAU;AAAA,UACR,cAAc7D,EAAS;AAAA,UACvB,WAAWA,EAAS;AAAA,UACpB,YAAYA,EAAS;AAAA,UACrB,gBAAgBA,EAAS;AAAA,UACzB,WAAWA,EAAS;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ERC20PeggedVariableCriteriaIncentiveV2.js","sources":["../../src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts"],"sourcesContent":["import {\n erc20PeggedVariableCriteriaIncentiveV2Abi,\n readErc20PeggedVariableCriteriaIncentiveV2Asset,\n readErc20PeggedVariableCriteriaIncentiveV2Claimed,\n readErc20PeggedVariableCriteriaIncentiveV2Claims,\n readErc20PeggedVariableCriteriaIncentiveV2CurrentReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria,\n readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward,\n readErc20PeggedVariableCriteriaIncentiveV2GetPeg,\n readErc20PeggedVariableCriteriaIncentiveV2IsClaimable,\n readErc20PeggedVariableCriteriaIncentiveV2Limit,\n readErc20PeggedVariableCriteriaIncentiveV2Owner,\n readErc20PeggedVariableCriteriaIncentiveV2Peg,\n readErc20PeggedVariableCriteriaIncentiveV2Reward,\n readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed,\n simulateErc20PeggedVariableCriteriaIncentiveV2Claim,\n simulateErc20PeggedVariableCriteriaIncentiveV2Clawback,\n writeErc20PeggedVariableCriteriaIncentiveV2Claim,\n writeErc20PeggedVariableCriteriaIncentiveV2Clawback,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/ERC20PeggedVariableCriteriaIncentiveV2.sol/ERC20PeggedVariableCriteriaIncentiveV2.json';\nimport { getTransaction, getTransactionReceipt } from '@wagmi/core';\nimport type { AbiEvent } from 'abitype';\nimport {\n type AbiFunction,\n type Address,\n type ContractEventName,\n type Hex,\n decodeAbiParameters,\n decodeFunctionData,\n encodeAbiParameters,\n parseEther,\n parseEventLogs,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { ERC20PeggedVariableCriteriaIncentiveV2 as ERC20PeggedVariableCriteriaIncentiveV2Bases } from '../../dist/deployments.json';\nimport {\n SignatureType,\n getScalarValueFromTuple,\n isCriteriaFieldIndexTuple,\n} from '../Actions/EventAction';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n DecodedArgsError,\n IncentiveCriteriaNotFoundError,\n InvalidCriteriaTypeError,\n NoMatchingLogsError,\n} from '../errors';\nimport {\n CheatCodes,\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\nimport type {\n GetIncentiveScalarV2Params,\n IncentiveCriteriaV2,\n} from './ERC20VariableCriteriaIncentiveV2';\n\nexport { erc20PeggedVariableCriteriaIncentiveV2Abi };\n\n/**\n * The object representation of a `Erc20PeggedVariableCriteriaIncentiveV2.InitPayload`\n *\n * @export\n * @interface Erc20PeggedVariableCriteriaIncentiveV2\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2}\n */\nexport interface ERC20PeggedVariableCriteriaIncentiveV2Payload {\n /**\n * The address of the incentivized asset.\n *\n * @type {Address}\n */\n asset: Address;\n /**\n * The peg to normalize to.\n *\n * @type {Address}\n */\n peg: Address;\n /**\n * The amount of the asset to distribute.\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * Total spend for the incentive.\n *\n * @type {bigint}\n */\n limit: bigint;\n /**\n * Maximum reward each claim is elligible for.\n *\n * @type {bigint}\n */\n maxReward: bigint;\n /**\n * (Optional) The address of the entity that can managed the incentive.\n *\n * @type {Address}\n * @optional\n */\n manager?: Address;\n /**\n * The criteria for the incentive that determines how the reward is distributed.\n *\n * @type {IncentiveCriteria}\n */\n criteria: IncentiveCriteriaV2;\n}\n\n/**\n * A generic `viem.Log` event with support for `Erc20PeggedVariableCriteriaIncentiveV2` event types.\n *\n * @export\n * @typedef {Erc20PeggedVariableCriteriaIncentiveV2Log}\n * @template {ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>} [event=ContractEventName<\n * typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n * >]\n */\nexport type Erc20PeggedVariableCriteriaIncentiveV2Log<\n event extends ContractEventName<\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n > = ContractEventName<typeof erc20PeggedVariableCriteriaIncentiveV2Abi>,\n> = GenericLog<typeof erc20PeggedVariableCriteriaIncentiveV2Abi, event>;\n\n/**\n * A simple ERC20 incentive implementation that allows claiming of tokens\n *\n * @export\n * @class Erc20PeggedVariableCriteriaIncentive\n * @typedef {ERC20PeggedVariableCriteriaIncentiveV2}\n * @extends {DeployableTarget<ERC20PeggedVariableCriteriaIncentiveV2>}\n */\nexport class ERC20PeggedVariableCriteriaIncentiveV2 extends DeployableTarget<\n ERC20PeggedVariableCriteriaIncentiveV2Payload,\n typeof erc20PeggedVariableCriteriaIncentiveV2Abi\n> {\n public override readonly abi = erc20PeggedVariableCriteriaIncentiveV2Abi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Record<number, Address>}\n */\n public static override bases: Record<number, Address> = {\n 31337: import.meta.env\n .VITE_ERC20_PEGGED_VARIABLE_CRITERIA_INCENTIVE_V2_BASE,\n ...(ERC20PeggedVariableCriteriaIncentiveV2Bases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.INCENTIVE;\n\n /**\n * The owner of the incentive\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async owner(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Owner(this._config, {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Calculates the current reward based on the time since the last claim. The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget. For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The current reward\n */\n public async currentReward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2CurrentReward(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * Retrieves the maximum reward amount per claim.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The maximum reward amount per claim\n */\n public async getMaxReward(params?: ReadParams): Promise<bigint> {\n const maxReward =\n await readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return maxReward;\n }\n\n /**\n * Fetches the incentive scalar from a transaction hash\n *\n * @param {GetIncentiveScalarParams} params\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n * @throws {InvalidCriteriaTypeError | NoMatchingLogsError | DecodedArgsError}\n */\n public async getIncentiveScalar(\n { chainId, hash, knownSignatures }: GetIncentiveScalarV2Params,\n params?: ReadParams,\n ): Promise<bigint> {\n const criteria = await this.getIncentiveCriteria(params);\n if (criteria.criteriaType === SignatureType.EVENT) {\n const transactionReceipt = await getTransactionReceipt(this._config, {\n chainId,\n hash,\n });\n if (criteria.fieldIndex === CheatCodes.GAS_REBATE_INCENTIVE) {\n const totalCost =\n transactionReceipt.gasUsed * transactionReceipt.effectiveGasPrice + // Normal gas cost\n (transactionReceipt.blobGasUsed ?? 0n) *\n (transactionReceipt.blobGasPrice ?? 0n); // Blob gas cost - account for potential undefined values\n return totalCost;\n }\n const logs = transactionReceipt.logs;\n\n if (logs.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n // Decode the event log\n try {\n const eventAbi = knownSignatures[criteria.signature] as AbiEvent;\n const decodedEvents = parseEventLogs({\n abi: [eventAbi],\n logs,\n });\n if (decodedEvents == undefined || decodedEvents.length === 0) {\n throw new NoMatchingLogsError(\n `No logs found for event signature ${criteria.signature}`,\n );\n }\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedEvents[0]?.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue =\n decodedEvents[0] && decodedEvents[0].args\n ? (decodedEvents[0].args as string[])[criteria.fieldIndex]\n : undefined;\n if (scalarValue === undefined) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode event log for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else if (criteria.criteriaType === SignatureType.FUNC) {\n // Fetch the transaction data\n const transaction = await getTransaction(this._config, {\n chainId,\n hash,\n });\n try {\n // Decode function data\n const func = knownSignatures[criteria.signature] as AbiFunction;\n const decodedFunction = decodeFunctionData({\n abi: [func],\n data: transaction.input,\n });\n\n if (isCriteriaFieldIndexTuple(criteria.fieldIndex)) {\n return getScalarValueFromTuple(\n decodedFunction.args as unknown[],\n criteria.fieldIndex,\n );\n }\n\n const scalarValue = decodedFunction.args[criteria.fieldIndex] as string;\n if (scalarValue === undefined || scalarValue === null) {\n throw new DecodedArgsError(\n `Decoded argument at index ${criteria.fieldIndex} is undefined`,\n );\n }\n return BigInt(scalarValue);\n } catch (e) {\n throw new DecodedArgsError(\n `Failed to decode function data for signature ${criteria.signature}: ${(e as Error).message}`,\n );\n }\n } else {\n throw new InvalidCriteriaTypeError(\n `Invalid criteria type ${criteria.criteriaType}`,\n );\n }\n }\n\n /**\n * The number of claims that have been made\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async claims(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Claims(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * The total amount of rewards claimed\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async totalClaimed(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * A mapping of address to claim status\n *\n * @public\n * @async\n * @param {Address} address\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>}\n */\n public async claimed(address: Address, params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Claimed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * The address of the ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async asset(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Asset(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The address of the pegged ERC20-like token\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async peg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Peg(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async reward(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Reward(\n this._config,\n {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * The limit (max possible rewards payout in reward token)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2Limit(this._config, {\n address: this.assertValidAddress(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - Returns true if successfully claimed\n */\n protected async claim(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.claimRaw(payload, params));\n }\n\n /**\n * Claim the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - Returns true if successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Claim(this._config, {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n const hash = await writeErc20PeggedVariableCriteriaIncentiveV2Claim(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<boolean>} - True if the assets were successfully clawbacked\n */\n public async clawback(payload: ClaimPayload, params?: WriteParams) {\n return await this.awaitResult(this.clawbackRaw(payload, params));\n }\n\n /**\n * Clawback assets from the incentive\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the assets were successfully clawbacked\n */\n public async clawbackRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } =\n await simulateErc20PeggedVariableCriteriaIncentiveV2Clawback(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [prepareClaimPayload(payload)],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeErc20PeggedVariableCriteriaIncentiveV2Clawback(\n this._config,\n request,\n );\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n *\n * @public\n * @async\n * @param {ClaimPayload} payload\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} = True if the incentive is claimable based on the data payload\n */\n public async isClaimable(payload: ClaimPayload, params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2IsClaimable(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [payload.target, payload.data],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * read the peg token for the incentive.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} = The address of the token the reward is pegged to\n */\n public async getPeg(params?: ReadParams) {\n return await readErc20PeggedVariableCriteriaIncentiveV2GetPeg(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n }\n\n /**\n * Get the maximum amount that can be claimed by this incentive. Useful when used in conjunction with `BoostCore.calculateProtocolFee`\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} = Return a bigint representing that maximum amount that can be distributed by this incentive.\n */\n public async getTotalBudget(params?: ReadParams) {\n return await this.limit(params);\n }\n\n /**\n * Check if any claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if total claims is less than limit\n */\n public async canBeClaimed(params?: ReadParams) {\n return (await this.getRemainingClaimPotential(params)) > 0n;\n }\n\n /**\n * Check how many claims remain by comparing the incentive's total claims against its limit. Does not take requesting user's elligibility into account.\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - True if total claims is less than limit\n */\n public async getRemainingClaimPotential(params?: ReadParams) {\n const [totalClaimed, limit] = await Promise.all([\n this.totalClaimed(params),\n this.limit(params),\n ]);\n return limit - totalClaimed;\n }\n\n /**\n *Functions from the ERC20VariableIncentive contract\n */\n\n /**\n * Fetches the IncentiveCriteria struct from the contract\n *\n * @param {?ReadParams} [params]\n * @returns {Promise<IncentiveCriteria>} Incentive criteria structure\n * @throws {IncentiveCriteriaNotFoundError}\n */\n public async getIncentiveCriteria(\n params?: ReadParams,\n ): Promise<IncentiveCriteriaV2> {\n try {\n const criteria =\n await readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria(\n this._config,\n {\n ...params,\n address: this.assertValidAddress(),\n },\n );\n\n return criteria;\n } catch (e) {\n throw new IncentiveCriteriaNotFoundError(e as Error);\n }\n }\n\n /**\n * Generates a top-up payload for the ERC20PeggedIncentive contract by incrementing\n * the existing `limit` field by `netAmount`. The entire payload is then re-encoded\n * via `prepareERC20PeggedIncentivePayload(...)`.\n *\n * @public\n * @param {bigint} netAmount - The additional limit to add to this incentive.\n * @returns {Hex} The ABI-encoded payload with the updated `limit`.\n */\n public async getTopupPayload(netAmount: bigint): Promise<Hex> {\n return prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset: (await this.asset()) ?? zeroAddress,\n peg: this.payload?.peg ?? zeroAddress,\n reward: this.payload?.reward ?? 0n,\n limit: netAmount,\n maxReward: this.payload?.maxReward ?? 0n,\n manager: this.payload?.manager ?? zeroAddress,\n criteria: this.payload?.criteria ?? {\n criteriaType: 0,\n signature: zeroHash,\n fieldIndex: 0,\n targetContract: zeroAddress,\n valueType: 0,\n },\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?ERC20PeggedVariableCriteriaIncentiveV2Payload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: ERC20PeggedVariableCriteriaIncentiveV2Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: erc20PeggedVariableCriteriaIncentiveV2Abi,\n bytecode: bytecode as Hex,\n args: [prepareERC20PeggedVariableCriteriaIncentiveV2Payload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Encodes an amount to clawback from the incentive\n *\n * @public\n * @param {bigint} amount - How much of the asset to clawback\n * @returns {Hex} - Returns an encoded uint256\n */\n public buildClawbackData(amount: bigint) {\n return encodeAbiParameters([{ type: 'uint256' }], [amount]);\n }\n\n /**\n * Builds the claim data for the ERC20PeggedVariableCriteriaIncentivePayload.\n *\n * @public\n * @param {bigint} signedAmount\n * @returns {Hash} Returns the encoded claim data\n * @description This function returns the encoded claim data for the ERC20PeggedVariableCriteriaIncentiveV2Payload.\n */\n public buildClaimData(signedAmount: bigint) {\n return encodeAbiParameters(\n [{ type: 'uint256', name: 'signedAmount' }],\n [signedAmount],\n );\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n *\n * @public\n * @param {Hex} claimData\n * @returns {Promise<bigint>} Returns the reward amount from a claim data payload\n */\n public async decodeClaimData(claimData: Hex) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n const [reward, maxReward] = await Promise.all([\n this.reward(),\n this.getMaxReward(),\n ]);\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n\n /**\n * Decodes claim data for the ERC20PeggedVariableCriteriaIncentiveV2, returning the claim amount.\n * Useful when deriving amount claimed from logs.\n * Use this function instead of `decodeClaimData` if you have reward details.\n *\n * @public\n * @param {Hex} claimData\n * @param {bigint} [reward]\n * @param {bigint} [maxReward]\n * @returns {BigInt} Returns the reward amount from a claim data payload\n */\n public decodeClaimDataWithRewardDetails(\n claimData: Hex,\n reward: bigint,\n maxReward: bigint,\n ) {\n const boostClaimData = decodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'BoostClaimData',\n components: [\n { type: 'bytes', name: 'validatorData' },\n { type: 'bytes', name: 'incentiveData' },\n ],\n },\n ],\n claimData,\n );\n const signedAmount = decodeAbiParameters(\n [{ type: 'uint256' }],\n boostClaimData[0].incentiveData,\n )[0];\n let claimAmount = signedAmount;\n\n if (reward === 0n) {\n return claimAmount;\n } else {\n claimAmount = (reward * signedAmount) / parseEther('1');\n }\n\n if (maxReward !== 0n && claimAmount > maxReward) {\n claimAmount = maxReward;\n }\n\n return claimAmount;\n }\n}\n\n/**\n * Given a {@link ERC20PeggedVariableCriteriaIncentiveV2Payload}, properly encode a `ERC20PeggedVariableCriteriaIncentiveV2Payload.InitPayload` for use with {@link ERC20PeggedVariableCriteriaIncentiveV2Payload} initialization.\n *\n * @param {ERC20PeggedVariableCriteriaIncentiveV2Payload} param0\n * @param {Address} param0.asset - The address of the incentivized asset.\n * @param {Address} param0.peg - The peg to normalize to.\n * @param {bigint} param0.reward - The amount of the asset to distribute.\n * @param {bigint} param0.limit - How many times can this incentive be claimed.\n * @param {Address} [param0.manager=zeroAddress] - The entity that can manage the incentive.\n * @param {IncentiveCriteria} param0.criteria - The incentive criteria for reward distribution.\n * @returns {Hex}\n */\nexport function prepareERC20PeggedVariableCriteriaIncentiveV2Payload({\n asset,\n peg,\n reward,\n limit,\n maxReward = 0n,\n manager = zeroAddress,\n criteria,\n}: ERC20PeggedVariableCriteriaIncentiveV2Payload) {\n return encodeAbiParameters(\n [\n {\n type: 'tuple',\n name: 'initPayloadExtended',\n components: [\n { type: 'address', name: 'asset' },\n { type: 'address', name: 'peg' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n { type: 'address', name: 'manager' },\n { type: 'uint256', name: 'maxReward' },\n {\n type: 'tuple',\n name: 'criteria',\n components: [\n { type: 'uint8', name: 'criteriaType' },\n { type: 'bytes32', name: 'signature' },\n { type: 'uint8', name: 'fieldIndex' },\n { type: 'address', name: 'targetContract' },\n { type: 'uint8', name: 'valueType' },\n ],\n },\n ],\n },\n ],\n [\n {\n asset,\n peg,\n reward,\n limit,\n manager,\n maxReward,\n criteria: {\n criteriaType: criteria.criteriaType,\n signature: criteria.signature,\n fieldIndex: criteria.fieldIndex,\n targetContract: criteria.targetContract,\n valueType: criteria.valueType,\n },\n },\n ],\n );\n}\n"],"names":["_ERC20PeggedVariableCriteriaIncentiveV2","DeployableTarget","erc20PeggedVariableCriteriaIncentiveV2Abi","params","readErc20PeggedVariableCriteriaIncentiveV2Owner","readErc20PeggedVariableCriteriaIncentiveV2CurrentReward","readErc20PeggedVariableCriteriaIncentiveV2GetMaxReward","chainId","hash","knownSignatures","criteria","SignatureType","transactionReceipt","getTransactionReceipt","CheatCodes","logs","NoMatchingLogsError","eventAbi","decodedEvents","parseEventLogs","isCriteriaFieldIndexTuple","getScalarValueFromTuple","_a","scalarValue","DecodedArgsError","e","transaction","getTransaction","func","decodedFunction","decodeFunctionData","InvalidCriteriaTypeError","readErc20PeggedVariableCriteriaIncentiveV2Claims","readErc20PeggedVariableCriteriaIncentiveV2TotalClaimed","address","readErc20PeggedVariableCriteriaIncentiveV2Claimed","readErc20PeggedVariableCriteriaIncentiveV2Asset","readErc20PeggedVariableCriteriaIncentiveV2Peg","readErc20PeggedVariableCriteriaIncentiveV2Reward","readErc20PeggedVariableCriteriaIncentiveV2Limit","payload","request","result","simulateErc20PeggedVariableCriteriaIncentiveV2Claim","prepareClaimPayload","writeErc20PeggedVariableCriteriaIncentiveV2Claim","simulateErc20PeggedVariableCriteriaIncentiveV2Clawback","writeErc20PeggedVariableCriteriaIncentiveV2Clawback","readErc20PeggedVariableCriteriaIncentiveV2IsClaimable","readErc20PeggedVariableCriteriaIncentiveV2GetPeg","totalClaimed","limit","readErc20PeggedVariableCriteriaIncentiveV2GetIncentiveCriteria","IncentiveCriteriaNotFoundError","netAmount","prepareERC20PeggedVariableCriteriaIncentiveV2Payload","zeroAddress","_b","_c","_d","_e","zeroHash","_payload","_options","options","bytecode","amount","encodeAbiParameters","signedAmount","claimData","boostClaimData","decodeAbiParameters","claimAmount","reward","maxReward","parseEther","ERC20PeggedVariableCriteriaIncentiveV2Bases","RegistryType","ERC20PeggedVariableCriteriaIncentiveV2","asset","peg","manager"],"mappings":";;;;;;;;;upjBAgJaA,I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