@boostxyz/sdk 6.1.3 → 7.0.0-canary.1
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/README.md +1 -1
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.js +7 -7
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +10 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +77 -76
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +5 -5
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +17 -17
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +1894 -267
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +831 -520
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +48 -48
- package/dist/Budget-BgGihcwx.js +1124 -0
- package/dist/Budget-BgGihcwx.js.map +1 -0
- package/dist/Budget-DYlTLLwg.cjs +2 -0
- package/dist/Budget-DYlTLLwg.cjs.map +1 -0
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.d.ts +5 -4
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +9 -6
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +4 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +22 -22
- package/dist/Budgets/ManagedBudgetWithFees.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFees.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts +4 -0
- package/dist/Budgets/ManagedBudgetWithFeesV2.d.ts.map +1 -1
- package/dist/Budgets/TransparentBudget.d.ts +944 -0
- package/dist/Budgets/TransparentBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +4 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +20 -20
- package/dist/Incentive-BDqkFt0J.cjs +2 -0
- package/dist/Incentive-BDqkFt0J.cjs.map +1 -0
- package/dist/Incentive-DPOADY1f.js +449 -0
- package/dist/Incentive-DPOADY1f.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +14 -14
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +11 -11
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +14 -14
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs +2 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.cjs.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +3 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js +604 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.js.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts +1103 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js +625 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +11 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +112 -80
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs +2 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.cjs.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts +903 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js +242 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentiveV2.js.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +3 -3
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +22 -22
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +8 -6
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +19 -14
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.js +9 -9
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-B_AcmgYq.cjs +2 -0
- package/dist/{SimpleDenyList-DgjVf7FK.cjs.map → SimpleDenyList-B_AcmgYq.cjs.map} +1 -1
- package/dist/SimpleDenyList-BbDLzRw7.js +133 -0
- package/dist/{SimpleDenyList-BKfPoTo1.js.map → SimpleDenyList-BbDLzRw7.js.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs.map +1 -1
- package/dist/Validators/LimitedSignerValidator.js +13 -13
- package/dist/Validators/LimitedSignerValidator.js.map +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.js +52 -52
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/componentInterfaces-C5ig8mCK.cjs +2 -0
- package/dist/componentInterfaces-C5ig8mCK.cjs.map +1 -0
- package/dist/componentInterfaces-Ddus5rIA.js +23 -0
- package/dist/componentInterfaces-Ddus5rIA.js.map +1 -0
- package/dist/deployments-C17nvui-.cjs +2 -0
- package/dist/deployments-C17nvui-.cjs.map +1 -0
- package/dist/deployments-CH4Xmkbv.js +132 -0
- package/dist/{deployments-W_LUj833.js.map → deployments-CH4Xmkbv.js.map} +1 -1
- package/dist/deployments.json +63 -48
- package/dist/{generated-CElkFqkY.js → generated-CINzoGbl.js} +2611 -955
- package/dist/generated-CINzoGbl.js.map +1 -0
- package/dist/generated-C_JEoLDO.cjs +3 -0
- package/dist/generated-C_JEoLDO.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +167 -154
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +20 -2
- package/src/Actions/EventAction.ts +11 -0
- package/src/BoostCore.test.ts +14 -9
- package/src/BoostCore.ts +428 -26
- package/src/Budgets/Budget.ts +8 -1
- package/src/Budgets/TransparentBudget.test.ts +70 -0
- package/src/Budgets/TransparentBudget.ts +334 -0
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Incentives/ERC20PeggedIncentive.ts +1 -1
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +3 -1
- package/src/Incentives/{ERC20PeggedVariableCriteriaIncentive.test.ts → ERC20PeggedVariableCriteriaIncentiveV2.test.ts} +20 -16
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentiveV2.ts +872 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +50 -1
- package/src/Incentives/{ERC20VariableCriteriaIncentive.test.ts → ERC20VariableCriteriaIncentiveV2.test.ts} +24 -19
- package/src/Incentives/ERC20VariableCriteriaIncentiveV2.ts +447 -0
- package/src/Incentives/ERC20VariableIncentive.ts +4 -2
- package/src/Incentives/Incentive.ts +13 -2
- package/src/index.test.ts +2 -2
- package/src/index.ts +3 -0
- package/src/utils.ts +1 -1
- package/dist/Budget-BjfL8dVX.cjs +0 -2
- package/dist/Budget-BjfL8dVX.cjs.map +0 -1
- package/dist/Budget-DD7IPuDx.js +0 -922
- package/dist/Budget-DD7IPuDx.js.map +0 -1
- package/dist/Incentive-V1RjH38L.js +0 -1036
- package/dist/Incentive-V1RjH38L.js.map +0 -1
- package/dist/Incentive-gVTfsnMB.cjs +0 -2
- package/dist/Incentive-gVTfsnMB.cjs.map +0 -1
- package/dist/SimpleDenyList-BKfPoTo1.js +0 -133
- package/dist/SimpleDenyList-DgjVf7FK.cjs +0 -2
- package/dist/componentInterfaces-CA1UIqWL.js +0 -20
- package/dist/componentInterfaces-CA1UIqWL.js.map +0 -1
- package/dist/componentInterfaces-aBgBbB7r.cjs +0 -2
- package/dist/componentInterfaces-aBgBbB7r.cjs.map +0 -1
- package/dist/deployments-CwTZr-cK.cjs +0 -2
- package/dist/deployments-CwTZr-cK.cjs.map +0 -1
- package/dist/deployments-W_LUj833.js +0 -117
- package/dist/generated-BPiHi7W2.cjs +0 -3
- package/dist/generated-BPiHi7W2.cjs.map +0 -1
- package/dist/generated-CElkFqkY.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z as c, bT as r, bU as n, bV as o, bW as l, bX as m, bY as h, bZ as u, b_ as y, b$ as p, c0 as g } from "../generated-CINzoGbl.js";
|
|
2
2
|
import { encodeAbiParameters as t, zeroAddress as w, zeroHash as A } from "viem";
|
|
3
|
-
import { P as V } from "../deployments-
|
|
4
|
-
import { DeployableTarget as
|
|
5
|
-
import { prepareClaimPayload as
|
|
6
|
-
import { RegistryType as
|
|
7
|
-
const _ = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b8160c01c808260011c146073578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6113ca806100855f395ff3fe6080604052600436106101af575f3560e01c8063514e62fc116100e7578063c884ef8311610087578063ea3d508a11610062578063ea3d508a14610543578063f04e283e1461055c578063f2fde38b1461056f578063fee81cf414610582575f80fd5b8063c884ef83146104e1578063db09da121461050f578063dcc59b6f1461052e575f80fd5b80638da5cb5b116100c25780638da5cb5b1461044e578063a270a73714610481578063a4d66daf146104ad578063bb1757cf146104c2575f80fd5b8063514e62fc1461040957806354d1f13d1461043e578063715018a614610446575f80fd5b806328d6183b11610152578063439fab911161012d578063439fab9114610354578063474f5a44146103735780634a4ee7b1146103bc5780634e7165a2146103cf575f80fd5b806328d6183b1461027d5780632de94807146102dc57806338d52e0f1461030d575f80fd5b80631c10893f1161018d5780631c10893f146102195780631cd64df41461022c578063228cb733146102615780632569296214610275575f80fd5b806301ffc9a7146101b357806307621eca146101e7578063183a4f6e14610204575b5f80fd5b3480156101be575f80fd5b506101d26101cd36600461108b565b6105b3565b60405190151581526020015b60405180910390f35b3480156101f2575f80fd5b505f545b6040519081526020016101de565b6102176102123660046110ab565b61060e565b005b6102176102273660046110e3565b61061b565b348015610237575f80fd5b506101d26102463660046110e3565b638b78c6d8600c9081525f9290925260209091205481161490565b34801561026c575f80fd5b506101f65f5481565b610217610631565b348015610288575f80fd5b507f0d36a40d000000000000000000000000000000000000000000000000000000005b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101de565b3480156102e7575f80fd5b506101f66102f636600461110d565b638b78c6d8600c9081525f91909152602090205490565b348015610318575f80fd5b5073deaddeaddeaddeaddeaddeaddeaddeaddeaddead5b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b34801561035f575f80fd5b5061021761036e36600461116d565b61067e565b34801561037e575f80fd5b5061039261038d36600461116d565b610890565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016101de565b6102176103ca3660046110e3565b6108c4565b3480156103da575f80fd5b506103fc6103e936600461116d565b5050604080515f81526020810190915290565b6040516101de91906111ac565b348015610414575f80fd5b506101d26104233660046110e3565b638b78c6d8600c9081525f9290925260209091205416151590565b6102176108d6565b61021761090f565b348015610459575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275461032f565b34801561048c575f80fd5b5060025461032f9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156104b8575f80fd5b506101f660035481565b3480156104cd575f80fd5b506101d26104dc3660046111ff565b610922565b3480156104ec575f80fd5b506101d26104fb36600461110d565b60016020525f908152604090205460ff1681565b34801561051a575f80fd5b506101d26105293660046111ff565b610d52565b348015610539575f80fd5b506101f660055481565b34801561054e575f80fd5b506004546102ab9060e01b81565b61021761056a36600461110d565b610d64565b61021761057d36600461110d565b610d9e565b34801561058d575f80fd5b506101f661059c36600461110d565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f0d36a40d000000000000000000000000000000000000000000000000000000001480610608575061060882610dc4565b92915050565b6106183382610e19565b50565b610623610e24565b61062d8282610e59565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156106cf5760018160011c14303b106106c65763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f6106dd83850185611250565b905080604001515f14806106f357506060810151155b1561072a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020810151600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001660e09290921c91909117905560408101515f5560608101516003556107bf33610e65565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161084d939291907fffffffff000000000000000000000000000000000000000000000000000000009390931683526020830191909152604082015260600190565b60405180910390a250801561088b576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108cc610e24565b61062d8282610e19565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610917610e24565b6109205f610ec8565b565b5f61092b610e24565b600254604080517f8da5cb5b000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169130918391638da5cb5b916004808201926020929091908290030181865afa15801561099d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109c191906112e8565b73ffffffffffffffffffffffffffffffffffffffff1614158015610a7a57506040517f514e62fc0000000000000000000000000000000000000000000000000000000081523060048201526002602482015273ffffffffffffffffffffffffffffffffffffffff82169063514e62fc90604401602060405180830381865afa158015610a4f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a739190611303565b1515600114155b15610ab1576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aba85610f2d565b610af0576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058054905f610aff83611322565b909155505073ffffffffffffffffffffffffffffffffffffffff8581165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690921790915560025460045483549251602481019590955260448501929092529193919091169160e09190911b90606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051610c0a919061137e565b5f604051808303815f865af19150503d805f8114610c43576040519150601f19603f3d011682016040523d82523d5f602084013e610c48565b606091505b5050905080610c83576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529289901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8716907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610d3e916111ac565b60405180910390a250600195945050505050565b5f610d5c84610f2d565b949350505050565b610d6c610e24565b63389a75e1600c52805f526020600c208054421115610d9257636f5e88185f526004601cfd5b5f905561061881610ec8565b610da6610e24565b8060601b610dbb57637448fbae5f526004601cfd5b61061881610ec8565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610608575061060882610f6a565b61062d82825f611000565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610920576382b429005f526004601cfd5b61062d82826001611000565b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561060857506003546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061060857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610608565b638b78c6d8600c52825f526020600c20805483811783611021575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b80357fffffffff0000000000000000000000000000000000000000000000000000000081168114611086575f80fd5b919050565b5f6020828403121561109b575f80fd5b6110a482611057565b9392505050565b5f602082840312156110bb575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610618575f80fd5b5f80604083850312156110f4575f80fd5b82356110ff816110c2565b946020939093013593505050565b5f6020828403121561111d575f80fd5b81356110a4816110c2565b5f8083601f840112611138575f80fd5b50813567ffffffffffffffff81111561114f575f80fd5b602083019150836020828501011115611166575f80fd5b9250929050565b5f806020838503121561117e575f80fd5b823567ffffffffffffffff811115611194575f80fd5b6111a085828601611128565b90969095509350505050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b5f805f60408486031215611211575f80fd5b833561121c816110c2565b9250602084013567ffffffffffffffff811115611237575f80fd5b61124386828701611128565b9497909650939450505050565b5f6080828403128015611261575f80fd5b506040516080810167ffffffffffffffff811182821017156112aa577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405282356112b8816110c2565b81526112c660208401611057565b6020820152604083810135908201526060928301359281019290925250919050565b5f602082840312156112f8575f80fd5b81516110a4816110c2565b5f60208284031215611313575f80fd5b815180151581146110a4575f80fd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611377577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f82518060208501845e5f92019182525091905056fea264697066735822122079bb08e80a9bd9117e174b7d6f5a63383597f9fcb4a121e18bc1685a513d4f3f64736f6c634300081a0033", e = class e extends C {
|
|
3
|
+
import { P as V } from "../deployments-CH4Xmkbv.js";
|
|
4
|
+
import { DeployableTarget as _ } from "../Deployable/DeployableTarget.js";
|
|
5
|
+
import { prepareClaimPayload as C } from "../claiming.js";
|
|
6
|
+
import { RegistryType as P } from "../utils.js";
|
|
7
|
+
const R = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6113ca806100895f395ff3fe6080604052600436106101af575f3560e01c8063514e62fc116100e7578063c884ef8311610087578063ea3d508a11610062578063ea3d508a14610543578063f04e283e1461055c578063f2fde38b1461056f578063fee81cf414610582575f80fd5b8063c884ef83146104e1578063db09da121461050f578063dcc59b6f1461052e575f80fd5b80638da5cb5b116100c25780638da5cb5b1461044e578063a270a73714610481578063a4d66daf146104ad578063bb1757cf146104c2575f80fd5b8063514e62fc1461040957806354d1f13d1461043e578063715018a614610446575f80fd5b806328d6183b11610152578063439fab911161012d578063439fab9114610354578063474f5a44146103735780634a4ee7b1146103bc5780634e7165a2146103cf575f80fd5b806328d6183b1461027d5780632de94807146102dc57806338d52e0f1461030d575f80fd5b80631c10893f1161018d5780631c10893f146102195780631cd64df41461022c578063228cb733146102615780632569296214610275575f80fd5b806301ffc9a7146101b357806307621eca146101e7578063183a4f6e14610204575b5f80fd5b3480156101be575f80fd5b506101d26101cd36600461108b565b6105b3565b60405190151581526020015b60405180910390f35b3480156101f2575f80fd5b505f545b6040519081526020016101de565b6102176102123660046110ab565b61060e565b005b6102176102273660046110e3565b61061b565b348015610237575f80fd5b506101d26102463660046110e3565b638b78c6d8600c9081525f9290925260209091205481161490565b34801561026c575f80fd5b506101f65f5481565b610217610631565b348015610288575f80fd5b507f0d36a40d000000000000000000000000000000000000000000000000000000005b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101de565b3480156102e7575f80fd5b506101f66102f636600461110d565b638b78c6d8600c9081525f91909152602090205490565b348015610318575f80fd5b5073deaddeaddeaddeaddeaddeaddeaddeaddeaddead5b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b34801561035f575f80fd5b5061021761036e36600461116d565b61067e565b34801561037e575f80fd5b5061039261038d36600461116d565b610890565b6040805192835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016101de565b6102176103ca3660046110e3565b6108c4565b3480156103da575f80fd5b506103fc6103e936600461116d565b5050604080515f81526020810190915290565b6040516101de91906111ac565b348015610414575f80fd5b506101d26104233660046110e3565b638b78c6d8600c9081525f9290925260209091205416151590565b6102176108d6565b61021761090f565b348015610459575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275461032f565b34801561048c575f80fd5b5060025461032f9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156104b8575f80fd5b506101f660035481565b3480156104cd575f80fd5b506101d26104dc3660046111ff565b610922565b3480156104ec575f80fd5b506101d26104fb36600461110d565b60016020525f908152604090205460ff1681565b34801561051a575f80fd5b506101d26105293660046111ff565b610d52565b348015610539575f80fd5b506101f660055481565b34801561054e575f80fd5b506004546102ab9060e01b81565b61021761056a36600461110d565b610d64565b61021761057d36600461110d565b610d9e565b34801561058d575f80fd5b506101f661059c36600461110d565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f0d36a40d000000000000000000000000000000000000000000000000000000001480610608575061060882610dc4565b92915050565b6106183382610e19565b50565b610623610e24565b61062d8282610e59565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156106cf5760018160011c14303b106106c65763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f6106dd83850185611250565b905080604001515f14806106f357506060810151155b1561072a576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790556020810151600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001660e09290921c91909117905560408101515f5560608101516003556107bf33610e65565b805f015173ffffffffffffffffffffffffffffffffffffffff167fef49c8fd80435c15980f0f55660ffaac9417e5843768f7f21566cfad2d19bfe782602001518360400151846060015160405161084d939291907fffffffff000000000000000000000000000000000000000000000000000000009390931683526020830191909152604082015260600190565b60405180910390a250801561088b576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f806040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108cc610e24565b61062d8282610e19565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610917610e24565b6109205f610ec8565b565b5f61092b610e24565b600254604080517f8da5cb5b000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169130918391638da5cb5b916004808201926020929091908290030181865afa15801561099d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109c191906112e8565b73ffffffffffffffffffffffffffffffffffffffff1614158015610a7a57506040517f514e62fc0000000000000000000000000000000000000000000000000000000081523060048201526002602482015273ffffffffffffffffffffffffffffffffffffffff82169063514e62fc90604401602060405180830381865afa158015610a4f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a739190611303565b1515600114155b15610ab1576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aba85610f2d565b610af0576040517f6247a84e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60058054905f610aff83611322565b909155505073ffffffffffffffffffffffffffffffffffffffff8581165f81815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690921790915560025460045483549251602481019590955260448501929092529193919091169160e09190911b90606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051610c0a919061137e565b5f604051808303815f865af19150503d805f8114610c43576040519150601f19603f3d011682016040523d82523d5f602084013e610c48565b606091505b5050905080610c83576040517f360e42e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002545f546040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811660208301529289901b9092166034830152604882015273ffffffffffffffffffffffffffffffffffffffff8716907f9ad2e7a4af16dceda9cce4274b2f59c328d8c012eb0e15eb5e1e73b7d8f264d390606801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610d3e916111ac565b60405180910390a250600195945050505050565b5f610d5c84610f2d565b949350505050565b610d6c610e24565b63389a75e1600c52805f526020600c208054421115610d9257636f5e88185f526004601cfd5b5f905561061881610ec8565b610da6610e24565b8060601b610dbb57637448fbae5f526004601cfd5b61061881610ec8565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fa9216705000000000000000000000000000000000000000000000000000000001480610608575061060882610f6a565b61062d82825f611000565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610920576382b429005f526004601cfd5b61062d82826001611000565b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001602052604081205460ff1615801561060857506003546005541092915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061060857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610608565b638b78c6d8600c52825f526020600c20805483811783611021575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b80357fffffffff0000000000000000000000000000000000000000000000000000000081168114611086575f80fd5b919050565b5f6020828403121561109b575f80fd5b6110a482611057565b9392505050565b5f602082840312156110bb575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610618575f80fd5b5f80604083850312156110f4575f80fd5b82356110ff816110c2565b946020939093013593505050565b5f6020828403121561111d575f80fd5b81356110a4816110c2565b5f8083601f840112611138575f80fd5b50813567ffffffffffffffff81111561114f575f80fd5b602083019150836020828501011115611166575f80fd5b9250929050565b5f806020838503121561117e575f80fd5b823567ffffffffffffffff811115611194575f80fd5b6111a085828601611128565b90969095509350505050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b5f805f60408486031215611211575f80fd5b833561121c816110c2565b9250602084013567ffffffffffffffff811115611237575f80fd5b61124386828701611128565b9497909650939450505050565b5f6080828403128015611261575f80fd5b506040516080810167ffffffffffffffff811182821017156112aa577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405282356112b8816110c2565b81526112c660208401611057565b6020820152604083810135908201526060928301359281019290925250919050565b5f602082840312156112f8575f80fd5b81516110a4816110c2565b5f60208284031215611313575f80fd5b815180151581146110a4575f80fd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611377577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f82518060208501845e5f92019182525091905056fea2646970667358221220ffbdb425e855f60328c6ebf81b28965fc1d20a52c81e723566d80b77f491fc3964736f6c634300081a0033", e = class e extends _ {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments), this.abi = c;
|
|
10
10
|
}
|
|
@@ -144,7 +144,7 @@ const _ = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
144
144
|
this._config,
|
|
145
145
|
{
|
|
146
146
|
address: this.assertValidAddress(),
|
|
147
|
-
args: [
|
|
147
|
+
args: [C(f)],
|
|
148
148
|
...this.optionallyAttachAccount(),
|
|
149
149
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
150
150
|
...b
|
|
@@ -212,7 +212,7 @@ const _ = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
212
212
|
);
|
|
213
213
|
return {
|
|
214
214
|
abi: c,
|
|
215
|
-
bytecode:
|
|
215
|
+
bytecode: R,
|
|
216
216
|
args: [T(a)],
|
|
217
217
|
...this.optionallyAttachAccount(d.account)
|
|
218
218
|
};
|
|
@@ -253,7 +253,7 @@ const _ = "0x6080604052348015600e575f80fd5b5060156019565b6078565b63409feecd19805
|
|
|
253
253
|
e.bases = {
|
|
254
254
|
31337: void 0,
|
|
255
255
|
...V
|
|
256
|
-
}, e.registryType =
|
|
256
|
+
}, e.registryType = P.INCENTIVE;
|
|
257
257
|
let s = e;
|
|
258
258
|
const T = ({
|
|
259
259
|
venue: i,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointsIncentive.js","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\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.VITE_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 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 readPointsIncentiveClaims(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 * The current reward\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 readPointsIncentiveCurrentReward(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 * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(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 * 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 readPointsIncentiveClaimed(this._config, {\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 * The address of the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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>} - True if the incentive was 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; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * The recipient must not have already claimed the incentive.\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 readPointsIncentiveIsClaimable(this._config, {\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 * 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 [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Generates a top-up payload for the PointsIncentive contract.\n *\n * @public\n * @param {bigint} netAmount The net reward amount to be added to the incentive.\n * @returns {Hex} The ABI-encoded top-up payload.\n */\n public getTopupPayload(netAmount: bigint): Hex {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'amount' },\n ],\n [\n this.payload?.venue ?? zeroAddress,\n this.payload?.selector ?? '0x00000000',\n netAmount,\n ],\n );\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","netAmount","encodeAbiParameters","_a","zeroAddress","_b","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"PointsIncentive.js","sources":["../../src/Incentives/PointsIncentive.ts"],"sourcesContent":["import {\n pointsIncentiveAbi,\n readPointsIncentiveClaimed,\n readPointsIncentiveClaims,\n readPointsIncentiveCurrentReward,\n readPointsIncentiveIsClaimable,\n readPointsIncentiveLimit,\n readPointsIncentiveReward,\n readPointsIncentiveSelector,\n readPointsIncentiveVenue,\n simulatePointsIncentiveClaim,\n writePointsIncentiveClaim,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/incentives/PointsIncentive.sol/PointsIncentive.json';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { PointsIncentive as PointsIncentiveBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { type ClaimPayload, prepareClaimPayload } from '../claiming';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { pointsIncentiveAbi };\n\n/**\n * The object representation of a `PointsIncentive.InitPayload`\n *\n * @export\n * @interface PointsIncentivePayload\n * @typedef {PointsIncentivePayload}\n */\nexport interface PointsIncentivePayload {\n /**\n * The address of the points contract\n *\n * @type {Address}\n */\n venue: Address;\n /**\n * The selector for the issuance function on the points contract\n *\n * @type {Hex}\n */\n selector: Hex;\n /**\n * The reward amount issued for each claim\n *\n * @type {bigint}\n */\n reward: bigint;\n /**\n * The maximum number of claims that can be made (one per address)\n *\n * @type {bigint}\n */\n limit: bigint;\n}\n\n/**\n * A generic `viem.Log` event with support for `PointsIncentive` event types.\n *\n * @export\n * @typedef {PointsIncentiveLog}\n * @template {ContractEventName<\n * typeof pointsIncentiveAbi\n * >} [event=ContractEventName<typeof pointsIncentiveAbi>]\n */\nexport type PointsIncentiveLog<\n event extends ContractEventName<\n typeof pointsIncentiveAbi\n > = ContractEventName<typeof pointsIncentiveAbi>,\n> = GenericLog<typeof pointsIncentiveAbi, event>;\n\n/**\n * A simple on-chain points incentive implementation that allows claiming of soulbound tokens.\n *\n * In order for any claim to be successful:\n * - The claimer must not have already claimed the incentive; and\n * - The maximum number of claims must not have been reached; and\n * - This contract must be authorized to operate the points contract's issuance function\n *\n * @export\n * @class PointsIncentive\n * @typedef {PointsIncentive}\n * @extends {DeployableTarget<PointsIncentivePayload>}\n */\nexport class PointsIncentive extends DeployableTarget<\n PointsIncentivePayload,\n typeof pointsIncentiveAbi\n> {\n public override readonly abi = pointsIncentiveAbi;\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.VITE_POINTS_INCENTIVE_BASE,\n ...(PointsIncentiveBases 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 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 readPointsIncentiveClaims(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 * The current reward\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 readPointsIncentiveCurrentReward(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 * The reward amount issued for each claim\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} The reward amount issued for each claim\n */\n public async reward(params?: ReadParams) {\n return await readPointsIncentiveReward(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 * 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 readPointsIncentiveClaimed(this._config, {\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 * The address of the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>}\n */\n public async venue(params?: ReadParams) {\n return await readPointsIncentiveVenue(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 maximum number of claims that can be made (one per address)\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>}\n */\n public async limit(params?: ReadParams) {\n return await readPointsIncentiveLimit(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 selector for the issuance function on the points contract\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Hex>}\n */\n public async selector(params?: ReadParams) {\n return await readPointsIncentiveSelector(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>} - True if the incentive was 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; }>} - True if the incentive was successfully claimed\n */\n protected async claimRaw(payload: ClaimPayload, params?: WriteParams) {\n const { request, result } = await simulatePointsIncentiveClaim(\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 writePointsIncentiveClaim(this._config, request);\n return { hash, result };\n }\n\n /**\n * Check if an incentive is claimable.\n * For the POOL strategy, the `bytes data` portion of the payload ignored.\n * The recipient must not have already claimed the incentive.\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 readPointsIncentiveIsClaimable(this._config, {\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 * 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 [claims, limit] = await Promise.all([\n this.claims(params),\n this.limit(params),\n ]);\n return limit - claims;\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PointsIncentivePayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: PointsIncentivePayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n return {\n abi: pointsIncentiveAbi,\n bytecode: bytecode as Hex,\n args: [preparePointsIncentivePayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n\n /**\n * Generates a top-up payload for the PointsIncentive contract.\n *\n * @public\n * @param {bigint} netAmount The net reward amount to be added to the incentive.\n * @returns {Hex} The ABI-encoded top-up payload.\n */\n public getTopupPayload(netAmount: bigint): Hex {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'amount' },\n ],\n [\n this.payload?.venue ?? zeroAddress,\n this.payload?.selector ?? '0x00000000',\n netAmount,\n ],\n );\n }\n\n /**\n * Builds the claim data for the PointsIncentive.\n *\n * @public\n * @returns {Hash} A `zeroHash`, as PointsIncentive doesn't require specific claim data.\n * @description This function returns `zeroHash` because PointsIncentive doesn't use any specific claim data.\n */\n public buildClaimData() {\n return zeroHash;\n }\n}\n\n/**\n * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.\n *\n * @param {PointsIncentivePayload} param0\n * @param {Address} param0.venue - The address of the points contract\n * @param {Hex} param0.selector - The selector for the issuance function on the points contract\n * @param {bigint} param0.reward - The reward amount issued for each claim\n * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)\n * @returns {*}\n */\nexport const preparePointsIncentivePayload = ({\n venue,\n selector,\n reward,\n limit,\n}: PointsIncentivePayload) => {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'venue' },\n { type: 'bytes4', name: 'selector' },\n { type: 'uint256', name: 'reward' },\n { type: 'uint256', name: 'limit' },\n ],\n [venue, selector, reward, limit],\n );\n};\n"],"names":["_PointsIncentive","DeployableTarget","pointsIncentiveAbi","params","readPointsIncentiveClaims","readPointsIncentiveCurrentReward","readPointsIncentiveReward","address","readPointsIncentiveClaimed","readPointsIncentiveVenue","readPointsIncentiveLimit","readPointsIncentiveSelector","payload","request","result","simulatePointsIncentiveClaim","prepareClaimPayload","writePointsIncentiveClaim","readPointsIncentiveIsClaimable","claims","limit","_payload","_options","options","bytecode","preparePointsIncentivePayload","netAmount","encodeAbiParameters","_a","zeroAddress","_b","zeroHash","PointsIncentiveBases","RegistryType","PointsIncentive","venue","selector","reward"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const a=require("./generated-C_JEoLDO.cjs"),h=require("@wagmi/core"),r=require("viem"),y=require("./deployments-C17nvui-.cjs"),p=require("./Deployable/DeployableTargetWithRBAC.cjs"),w=require("./errors.cjs"),g=require("./utils.cjs"),o="0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611161806100895f395ff3fe608060405260043610610183575f3560e01c806354d1f13d116100d1578063e3f756de1161007c578063f2fde38b11610057578063f2fde38b14610446578063fe9fbb8014610459578063fee81cf414610478575f80fd5b8063e3f756de146103d8578063ec87621c1461041f578063f04e283e14610433575f80fd5b80638da5cb5b116100ac5780638da5cb5b14610362578063be4994f81461039a578063dcc21361146103b9575f80fd5b806354d1f13d1461033e578063715018a61461034657806375b238fc1461034e575f80fd5b806328d6183b11610131578063439fab911161010c578063439fab91146102d75780634a4ee7b1146102f6578063514e62fc14610309575f80fd5b806328d6183b1461023f5780632de94807146102795780634359d28a146102b8575f80fd5b80631c10893f116101615780631c10893f146101ef5780631cd64df4146102025780632569296214610237575f80fd5b806301ffc9a714610187578063141973b0146101bb578063183a4f6e146101dc575b5f80fd5b348015610192575f80fd5b506101a66101a1366004610d5f565b6104a9565b60405190151581526020015b60405180910390f35b3480156101c6575f80fd5b506101da6101d5366004610ded565b610504565b005b6101da6101ea366004610e59565b610637565b6101da6101fd366004610ea1565b610644565b34801561020d575f80fd5b506101a661021c366004610ea1565b638b78c6d8600c9081525f9290925260209091205481161490565b6101da61065a565b34801561024a575f80fd5b506040517f3d30a22c0000000000000000000000000000000000000000000000000000000081526020016101b2565b348015610284575f80fd5b506102aa610293366004610ecb565b638b78c6d8600c9081525f91909152602090205490565b6040519081526020016101b2565b3480156102c3575f80fd5b506101da6102d2366004610ded565b6106a7565b3480156102e2575f80fd5b506101da6102f1366004610f24565b6107a1565b6101da610304366004610ea1565b6108d0565b348015610314575f80fd5b506101a6610323366004610ea1565b638b78c6d8600c9081525f9290925260209091205416151590565b6101da6108e2565b6101da61091b565b348015610359575f80fd5b506102aa600281565b34801561036d575f80fd5b50638b78c6d8195460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b2565b3480156103a5575f80fd5b506101da6103b4366004610ded565b61092e565b3480156103c4575f80fd5b506101da6103d3366004610ded565b6109cc565b3480156103e3575f80fd5b506101a66103f2366004610f63565b505073ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205460ff161590565b34801561042a575f80fd5b506102aa600181565b6101da610441366004610ecb565b610a6a565b6101da610454366004610ecb565b610aa4565b348015610464575f80fd5b506101a6610473366004610ecb565b610aca565b348015610483575f80fd5b506102aa610492366004610ecb565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f3d30a22c0000000000000000000000000000000000000000000000000000000014806104fe57506104fe82610b29565b92915050565b61050d33610aca565b610543576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82811461057c576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156106305782828281811061059857610598610fb4565b90506020020160208101906105ad9190610fe1565b5f808787858181106105c1576105c1610fb4565b90506020020160208101906105d69190610ecb565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560010161057e565b5050505050565b6106413382610b7e565b50565b61064c610b89565b6106568282610ba3565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60026106b281610baf565b8382146106eb576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610799575f84848381811061070857610708610fb4565b905060200201602081019061071d9190610fe1565b905080151560010361075f5761075a87878481811061073e5761073e610fb4565b90506020020160208101906107539190610ecb565b6001610ba3565b610790565b61079087878481811061077457610774610fb4565b90506020020160208101906107899190610ecb565b6001610b7e565b506001016106ed565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156107f25760018160011c14303b106107e95763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f806108018486018661102d565b9150915061080e82610be0565b5f5b81518110156108935760015f8084848151811061082f5761082f610fb4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610810565b50505080156108cb576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6108d8610b89565b6106568282610b7e565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610923610b89565b61092c5f610c28565b565b600261093981610baf565b838214610972576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610799576109c486868381811061099157610991610fb4565b90506020020160208101906109a69190610ecb565b8585848181106109b8576109b8610fb4565b90506020020135610ba3565b600101610974565b60026109d781610baf565b838214610a10576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8481101561079957610a62868683818110610a2f57610a2f610fb4565b9050602002016020810190610a449190610ecb565b858584818110610a5657610a56610fb4565b90506020020135610b7e565b600101610a12565b610a72610b89565b63389a75e1600c52805f526020600c208054421115610a9857636f5e88185f526004601cfd5b5f905561064181610c28565b610aac610b89565b8060601b610ac157637448fbae5f526004601cfd5b61064181610c28565b5f8173ffffffffffffffffffffffffffffffffffffffff16610aef638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806104fe5750638b78c6d8600c9081525f839052602090205460031615156104fe565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fe2089f790000000000000000000000000000000000000000000000000000000014806104fe57506104fe82610c72565b61065682825f610d08565b638b78c6d81954331461092c576382b429005f526004601cfd5b61065682826001610d08565b638b78c6d81954331461064157638b78c6d8600c52335f52806020600c205416610641576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806104fe57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104fe565b638b78c6d8600c52825f526020600c20805483811783610d29575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f60208284031215610d6f575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d9e575f80fd5b9392505050565b5f8083601f840112610db5575f80fd5b50813567ffffffffffffffff811115610dcc575f80fd5b6020830191508360208260051b8501011115610de6575f80fd5b9250929050565b5f805f8060408587031215610e00575f80fd5b843567ffffffffffffffff811115610e16575f80fd5b610e2287828801610da5565b909550935050602085013567ffffffffffffffff811115610e41575f80fd5b610e4d87828801610da5565b95989497509550505050565b5f60208284031215610e69575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610641575f80fd5b8035610e9c81610e70565b919050565b5f8060408385031215610eb2575f80fd5b8235610ebd81610e70565b946020939093013593505050565b5f60208284031215610edb575f80fd5b8135610d9e81610e70565b5f8083601f840112610ef6575f80fd5b50813567ffffffffffffffff811115610f0d575f80fd5b602083019150836020828501011115610de6575f80fd5b5f8060208385031215610f35575f80fd5b823567ffffffffffffffff811115610f4b575f80fd5b610f5785828601610ee6565b90969095509350505050565b5f805f60408486031215610f75575f80fd5b8335610f8081610e70565b9250602084013567ffffffffffffffff811115610f9b575f80fd5b610fa786828701610ee6565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610ff1575f80fd5b81358015158114610d9e575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f806040838503121561103e575f80fd5b823561104981610e70565b9150602083013567ffffffffffffffff811115611064575f80fd5b8301601f81018513611074575f80fd5b803567ffffffffffffffff81111561108e5761108e611000565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811067ffffffffffffffff821117156110d9576110d9611000565b6040529182526020818401810192908101888411156110f6575f80fd5b6020850194505b8385101561111c5761110e85610e91565b8152602094850194016110fd565b5080945050505050925092905056fea26469706673582212204d69d936427ed13e47d0a46a2354492a587c169d0bded852cb9b8d6f720204b864736f6c634300081a0033",t=class t extends p.DeployableTargetWithRBAC{constructor(){super(...arguments),this.abi=a.k}async owner(f){return await a.EW(this._config,{...this.optionallyAttachAccount(),...f,address:this.assertValidAddress(),args:[]})}async isAllowed(f,b){return await a.wG(this._config,{address:this.assertValidAddress(),args:[f,r.zeroHash],...this.optionallyAttachAccount(),...b})}async setDenied(f,b,c){return await this.awaitResult(this.setDeniedRaw(f,b,c))}async setDeniedRaw(f,b,c){const{request:e,result:d}=await a.KG(this._config,{address:this.assertValidAddress(),args:[f,b],...this.optionallyAttachAccount(),...c});return{hash:await a.PG(this._config,e),result:d}}buildParameters(f,b){var s;const[c,e]=this.validateDeploymentConfig(f,b),d=c;if(!d.owner||d.owner===r.zeroAddress){const i=e.account?e.account.address:e.config?h.getAccount(e.config).address:(s=this._account)==null?void 0:s.address;if(i)d.owner=i;else throw new w.DeployableUnknownOwnerProvidedError}return{abi:a.k,bytecode:o,args:[u(d)],...this.optionallyAttachAccount(e.account)}}};t.bases={31337:void 0,...y.SimpleDenyList},t.registryType=g.RegistryType.ALLOW_LIST;let n=t;function u({owner:l,denied:f}){return r.encodeAbiParameters([{type:"address",name:"owner"},{type:"address[]",name:"denied"}],[l,f])}exports.SimpleDenyList=n;exports.bytecode=o;exports.prepareSimpleDenyListPayload=u;
|
|
2
|
+
//# sourceMappingURL=SimpleDenyList-B_AcmgYq.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleDenyList-
|
|
1
|
+
{"version":3,"file":"SimpleDenyList-B_AcmgYq.cjs","sources":["../src/AllowLists/SimpleDenyList.ts"],"sourcesContent":["import {\n readSimpleAllowListOwner,\n readSimpleDenyListIsAllowed,\n simpleDenyListAbi,\n simulateSimpleDenyListSetDenied,\n writeSimpleDenyListSetDenied,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { SimpleDenyList as SimpleDenyListBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleDenyListAbi };\n\n/**\n * Object representation of a {@link SimpleDenyList} initialization payload.\n *\n * @export\n * @interface SimpleDenyListPayload\n * @typedef {SimpleDenyListPayload}\n */\nexport interface SimpleDenyListPayload {\n /**\n * The allow list's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of denied addresses.\n *\n * @type {Address[]}\n */\n denied: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleDenyList` event types.\n *\n * @export\n * @typedef {SimpleDenyListLog}\n * @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<\n * typeof simpleDenyListAbi\n * >]\n */\nexport type SimpleDenyListLog<\n event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<\n typeof simpleDenyListAbi\n >,\n> = GenericLog<typeof simpleDenyListAbi, event>;\n\n/**\n * A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list\n *\n * @export\n * @class SimpleDenyList\n * @typedef {SimpleDenyList}\n * @extends {DeployableTargetWithRBAC<SimpleDenyListPayload>}\n */\nexport class SimpleDenyList<\n Payload = SimpleDenyListPayload,\n> extends DeployableTargetWithRBAC<\n Payload | undefined,\n typeof simpleDenyListAbi\n> {\n public override readonly abi = simpleDenyListAbi;\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.VITE_SIMPLE_DENYLIST_BASE,\n ...(SimpleDenyListBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Retrieves the owner\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} - The address of the owner\n */\n public async owner(params?: ReadParams): Promise<Address> {\n return await readSimpleAllowListOwner(this._config, {\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 address: this.assertValidAddress(),\n args: [],\n });\n }\n\n /**\n * Check if a user is authorized (i.e. not denied)\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams,\n ): Promise<boolean> {\n return await readSimpleDenyListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\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\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setDenied(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setDeniedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setDeniedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n const { request, result } = await simulateSimpleDenyListSetDenied(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\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 writeSimpleDenyListSetDenied(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleDenyListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [p, options] = this.validateDeploymentConfig(_payload, _options);\n const payload = p as SimpleDenyListPayload;\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleDenyListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleDenyListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleDenyListPayload} param0\n * @param {Address} param0.owner - The allow list's owner\n * @param {Address[]} param0.denied - List of denied addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleDenyListPayload({\n owner,\n denied,\n}: SimpleDenyListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'denied' },\n ],\n [owner, denied],\n );\n}\n"],"names":["_SimpleDenyList","DeployableTargetWithRBAC","simpleDenyListAbi","params","readSimpleAllowListOwner","address","readSimpleDenyListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleDenyListSetDenied","writeSimpleDenyListSetDenied","_payload","_options","p","options","payload","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","SimpleDenyListBases","RegistryType","SimpleDenyList","denied","encodeAbiParameters"],"mappings":"itSA8EaA,EAAN,MAAMA,UAEHC,EAAAA,wBAGR,CALK,aAAA,CAAA,MAAA,GAAA,SAAA,EAML,KAAyB,IAAMC,GAAA,CA6B/B,MAAa,MAAMC,EAAuC,CACjD,OAAA,MAAMC,EAAAA,GAAyB,KAAK,QAAS,CAClD,GAAG,KAAK,wBAAwB,EAEhC,GAAID,EACJ,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAAC,CAAA,CACR,CACH,CAWA,MAAa,UACXE,EACAF,EACkB,CACX,OAAA,MAAMG,EAAAA,GAA4B,KAAK,QAAS,CACrD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACD,EAASE,UAAQ,EACxB,GAAG,KAAK,wBAAwB,EAEhC,GAAIJ,CAAA,CACL,CACH,CAYA,MAAa,UACXK,EACAC,EACAN,EACA,CACA,OAAO,MAAM,KAAK,YAChB,KAAK,aAAaK,EAAWC,EAASN,CAAM,CAAA,CAEhD,CAYA,MAAa,aACXK,EACAC,EACAN,EACA,CACA,KAAM,CAAE,QAAAO,EAAS,OAAAC,CAAO,EAAI,MAAMC,EAAA,GAChC,KAAK,QACL,CACE,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACJ,EAAWC,CAAO,EACzB,GAAG,KAAK,wBAAwB,EAEhC,GAAIN,CACN,CAAA,EAGK,MAAA,CAAE,KADI,MAAMU,EAA6B,GAAA,KAAK,QAASH,CAAO,EACtD,OAAAC,EACjB,CAUgB,gBACdG,EACAC,EACyB,OACzB,KAAM,CAACC,EAAGC,CAAO,EAAI,KAAK,yBAAyBH,EAAUC,CAAQ,EAC/DG,EAAUF,EAChB,GAAI,CAACE,EAAQ,OAASA,EAAQ,QAAUC,EAAAA,YAAa,CACnD,MAAMC,EAAQH,EAAQ,QAClBA,EAAQ,QAAQ,QAChBA,EAAQ,OACNI,EAAA,WAAWJ,EAAQ,MAAM,EAAE,SAC3BK,EAAA,KAAK,WAAL,YAAAA,EAAe,QACrB,GAAIF,EACFF,EAAQ,MAAQE,MAEhB,OAAM,IAAIG,EAAoC,mCAElD,CACO,MAAA,CACL,IAAKrB,EAAA,EACL,SAAAsB,EACA,KAAM,CAACC,EAA6BP,CAAO,CAAC,EAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO,CAAA,CAEnD,CACF,EAvIEjB,EAAuB,MAAiC,CACtD,MAAO,OACP,GAAI0B,EAAA,cAAA,EASN1B,EAAuB,aAA6B2B,EAAa,aAAA,WAzB5D,IAAMC,EAAN5B,EA+JA,SAASyB,EAA6B,CAC3C,MAAAL,EACA,OAAAS,CACF,EAA0B,CACjB,OAAAC,EAAA,oBACL,CACE,CAAE,KAAM,UAAW,KAAM,OAAQ,EACjC,CAAE,KAAM,YAAa,KAAM,QAAS,CACtC,EACA,CAACV,EAAOS,CAAM,CAAA,CAElB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { k as r, aw as n, aA as h, aB as l, aC as p } from "./generated-CINzoGbl.js";
|
|
2
|
+
import { getAccount as u } from "@wagmi/core";
|
|
3
|
+
import { zeroHash as w, zeroAddress as m, encodeAbiParameters as y } from "viem";
|
|
4
|
+
import { a as A } from "./deployments-CH4Xmkbv.js";
|
|
5
|
+
import { DeployableTargetWithRBAC as g } from "./Deployable/DeployableTargetWithRBAC.js";
|
|
6
|
+
import { DeployableUnknownOwnerProvidedError as D } from "./errors.js";
|
|
7
|
+
import { RegistryType as P } from "./utils.js";
|
|
8
|
+
const R = "0x6080604052348015600e575f80fd5b5060156019565b607c565b63409feecd198054600181161560365763f92ee8a95f526004601cfd5b6001600160401b03808260011c146077578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b611161806100895f395ff3fe608060405260043610610183575f3560e01c806354d1f13d116100d1578063e3f756de1161007c578063f2fde38b11610057578063f2fde38b14610446578063fe9fbb8014610459578063fee81cf414610478575f80fd5b8063e3f756de146103d8578063ec87621c1461041f578063f04e283e14610433575f80fd5b80638da5cb5b116100ac5780638da5cb5b14610362578063be4994f81461039a578063dcc21361146103b9575f80fd5b806354d1f13d1461033e578063715018a61461034657806375b238fc1461034e575f80fd5b806328d6183b11610131578063439fab911161010c578063439fab91146102d75780634a4ee7b1146102f6578063514e62fc14610309575f80fd5b806328d6183b1461023f5780632de94807146102795780634359d28a146102b8575f80fd5b80631c10893f116101615780631c10893f146101ef5780631cd64df4146102025780632569296214610237575f80fd5b806301ffc9a714610187578063141973b0146101bb578063183a4f6e146101dc575b5f80fd5b348015610192575f80fd5b506101a66101a1366004610d5f565b6104a9565b60405190151581526020015b60405180910390f35b3480156101c6575f80fd5b506101da6101d5366004610ded565b610504565b005b6101da6101ea366004610e59565b610637565b6101da6101fd366004610ea1565b610644565b34801561020d575f80fd5b506101a661021c366004610ea1565b638b78c6d8600c9081525f9290925260209091205481161490565b6101da61065a565b34801561024a575f80fd5b506040517f3d30a22c0000000000000000000000000000000000000000000000000000000081526020016101b2565b348015610284575f80fd5b506102aa610293366004610ecb565b638b78c6d8600c9081525f91909152602090205490565b6040519081526020016101b2565b3480156102c3575f80fd5b506101da6102d2366004610ded565b6106a7565b3480156102e2575f80fd5b506101da6102f1366004610f24565b6107a1565b6101da610304366004610ea1565b6108d0565b348015610314575f80fd5b506101a6610323366004610ea1565b638b78c6d8600c9081525f9290925260209091205416151590565b6101da6108e2565b6101da61091b565b348015610359575f80fd5b506102aa600281565b34801561036d575f80fd5b50638b78c6d8195460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b2565b3480156103a5575f80fd5b506101da6103b4366004610ded565b61092e565b3480156103c4575f80fd5b506101da6103d3366004610ded565b6109cc565b3480156103e3575f80fd5b506101a66103f2366004610f63565b505073ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205460ff161590565b34801561042a575f80fd5b506102aa600181565b6101da610441366004610ecb565b610a6a565b6101da610454366004610ecb565b610aa4565b348015610464575f80fd5b506101a6610473366004610ecb565b610aca565b348015610483575f80fd5b506102aa610492366004610ecb565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f3d30a22c0000000000000000000000000000000000000000000000000000000014806104fe57506104fe82610b29565b92915050565b61050d33610aca565b610543576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82811461057c576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156106305782828281811061059857610598610fb4565b90506020020160208101906105ad9190610fe1565b5f808787858181106105c1576105c1610fb4565b90506020020160208101906105d69190610ecb565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905560010161057e565b5050505050565b6106413382610b7e565b50565b61064c610b89565b6106568282610ba3565b5050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b60026106b281610baf565b8382146106eb576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610799575f84848381811061070857610708610fb4565b905060200201602081019061071d9190610fe1565b905080151560010361075f5761075a87878481811061073e5761073e610fb4565b90506020020160208101906107539190610ecb565b6001610ba3565b610790565b61079087878481811061077457610774610fb4565b90506020020160208101906107899190610ecb565b6001610b7e565b506001016106ed565b505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf60113280546003825580156107f25760018160011c14303b106107e95763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f806108018486018661102d565b9150915061080e82610be0565b5f5b81518110156108935760015f8084848151811061082f5761082f610fb4565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610810565b50505080156108cb576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6108d8610b89565b6106568282610b7e565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610923610b89565b61092c5f610c28565b565b600261093981610baf565b838214610972576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b84811015610799576109c486868381811061099157610991610fb4565b90506020020160208101906109a69190610ecb565b8585848181106109b8576109b8610fb4565b90506020020135610ba3565b600101610974565b60026109d781610baf565b838214610a10576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8481101561079957610a62868683818110610a2f57610a2f610fb4565b9050602002016020810190610a449190610ecb565b858584818110610a5657610a56610fb4565b90506020020135610b7e565b600101610a12565b610a72610b89565b63389a75e1600c52805f526020600c208054421115610a9857636f5e88185f526004601cfd5b5f905561064181610c28565b610aac610b89565b8060601b610ac157637448fbae5f526004601cfd5b61064181610c28565b5f8173ffffffffffffffffffffffffffffffffffffffff16610aef638b78c6d8195490565b73ffffffffffffffffffffffffffffffffffffffff1614806104fe5750638b78c6d8600c9081525f839052602090205460031615156104fe565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fe2089f790000000000000000000000000000000000000000000000000000000014806104fe57506104fe82610c72565b61065682825f610d08565b638b78c6d81954331461092c576382b429005f526004601cfd5b61065682826001610d08565b638b78c6d81954331461064157638b78c6d8600c52335f52806020600c205416610641576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff16638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b638b78c6d819805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d0000000000000000000000000000000000000000000000000000000014806104fe57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104fe565b638b78c6d8600c52825f526020600c20805483811783610d29575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f60208284031215610d6f575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d9e575f80fd5b9392505050565b5f8083601f840112610db5575f80fd5b50813567ffffffffffffffff811115610dcc575f80fd5b6020830191508360208260051b8501011115610de6575f80fd5b9250929050565b5f805f8060408587031215610e00575f80fd5b843567ffffffffffffffff811115610e16575f80fd5b610e2287828801610da5565b909550935050602085013567ffffffffffffffff811115610e41575f80fd5b610e4d87828801610da5565b95989497509550505050565b5f60208284031215610e69575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610641575f80fd5b8035610e9c81610e70565b919050565b5f8060408385031215610eb2575f80fd5b8235610ebd81610e70565b946020939093013593505050565b5f60208284031215610edb575f80fd5b8135610d9e81610e70565b5f8083601f840112610ef6575f80fd5b50813567ffffffffffffffff811115610f0d575f80fd5b602083019150836020828501011115610de6575f80fd5b5f8060208385031215610f35575f80fd5b823567ffffffffffffffff811115610f4b575f80fd5b610f5785828601610ee6565b90969095509350505050565b5f805f60408486031215610f75575f80fd5b8335610f8081610e70565b9250602084013567ffffffffffffffff811115610f9b575f80fd5b610fa786828701610ee6565b9497909650939450505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610ff1575f80fd5b81358015158114610d9e575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f806040838503121561103e575f80fd5b823561104981610e70565b9150602083013567ffffffffffffffff811115611064575f80fd5b8301601f81018513611074575f80fd5b803567ffffffffffffffff81111561108e5761108e611000565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811067ffffffffffffffff821117156110d9576110d9611000565b6040529182526020818401810192908101888411156110f6575f80fd5b6020850194505b8385101561111c5761110e85610e91565b8152602094850194016110fd565b5080945050505050925092905056fea26469706673582212204d69d936427ed13e47d0a46a2354492a587c169d0bded852cb9b8d6f720204b864736f6c634300081a0033", c = class c extends g {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments), this.abi = r;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves the owner
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
* @async
|
|
17
|
+
* @param {?ReadParams} [params]
|
|
18
|
+
* @returns {Promise<Address>} - The address of the owner
|
|
19
|
+
*/
|
|
20
|
+
async owner(f) {
|
|
21
|
+
return await n(this._config, {
|
|
22
|
+
...this.optionallyAttachAccount(),
|
|
23
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
24
|
+
...f,
|
|
25
|
+
address: this.assertValidAddress(),
|
|
26
|
+
args: []
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if a user is authorized (i.e. not denied)
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
* @async
|
|
34
|
+
* @param {Address} address - The address of the user
|
|
35
|
+
* @param {?ReadParams} [params]
|
|
36
|
+
* @returns {Promise<boolean>} - True if the user is authorized
|
|
37
|
+
*/
|
|
38
|
+
async isAllowed(f, b) {
|
|
39
|
+
return await h(this._config, {
|
|
40
|
+
address: this.assertValidAddress(),
|
|
41
|
+
args: [f, w],
|
|
42
|
+
...this.optionallyAttachAccount(),
|
|
43
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
44
|
+
...b
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
* @async
|
|
52
|
+
* @param {Address[]} addresses - The list of users to update
|
|
53
|
+
* @param {boolean[]} allowed - The denied status of each user
|
|
54
|
+
* @param {?WriteParams} [params]
|
|
55
|
+
* @returns {Promise<void>}
|
|
56
|
+
*/
|
|
57
|
+
async setDenied(f, b, a) {
|
|
58
|
+
return await this.awaitResult(
|
|
59
|
+
this.setDeniedRaw(f, b, a)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
* @async
|
|
67
|
+
* @param {Address[]} addresses - The list of users to update
|
|
68
|
+
* @param {boolean[]} allowed - The denied status of each user
|
|
69
|
+
* @param {?WriteParams} [params]
|
|
70
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
71
|
+
*/
|
|
72
|
+
async setDeniedRaw(f, b, a) {
|
|
73
|
+
const { request: e, result: d } = await l(
|
|
74
|
+
this._config,
|
|
75
|
+
{
|
|
76
|
+
address: this.assertValidAddress(),
|
|
77
|
+
args: [f, b],
|
|
78
|
+
...this.optionallyAttachAccount(),
|
|
79
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
80
|
+
...a
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
return { hash: await p(this._config, e), result: d };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @inheritdoc
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
* @param {?SimpleDenyListPayload} [_payload]
|
|
90
|
+
* @param {?DeployableOptions} [_options]
|
|
91
|
+
* @returns {GenericDeployableParams}
|
|
92
|
+
*/
|
|
93
|
+
buildParameters(f, b) {
|
|
94
|
+
var t;
|
|
95
|
+
const [a, e] = this.validateDeploymentConfig(f, b), d = a;
|
|
96
|
+
if (!d.owner || d.owner === m) {
|
|
97
|
+
const s = e.account ? e.account.address : e.config ? u(e.config).address : (t = this._account) == null ? void 0 : t.address;
|
|
98
|
+
if (s)
|
|
99
|
+
d.owner = s;
|
|
100
|
+
else
|
|
101
|
+
throw new D();
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
abi: r,
|
|
105
|
+
bytecode: R,
|
|
106
|
+
args: [T(d)],
|
|
107
|
+
...this.optionallyAttachAccount(e.account)
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
c.bases = {
|
|
112
|
+
31337: void 0,
|
|
113
|
+
...A
|
|
114
|
+
}, c.registryType = P.ALLOW_LIST;
|
|
115
|
+
let o = c;
|
|
116
|
+
function T({
|
|
117
|
+
owner: i,
|
|
118
|
+
denied: f
|
|
119
|
+
}) {
|
|
120
|
+
return y(
|
|
121
|
+
[
|
|
122
|
+
{ type: "address", name: "owner" },
|
|
123
|
+
{ type: "address[]", name: "denied" }
|
|
124
|
+
],
|
|
125
|
+
[i, f]
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
o as S,
|
|
130
|
+
R as b,
|
|
131
|
+
T as p
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=SimpleDenyList-BbDLzRw7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleDenyList-
|
|
1
|
+
{"version":3,"file":"SimpleDenyList-BbDLzRw7.js","sources":["../src/AllowLists/SimpleDenyList.ts"],"sourcesContent":["import {\n readSimpleAllowListOwner,\n readSimpleDenyListIsAllowed,\n simpleDenyListAbi,\n simulateSimpleDenyListSetDenied,\n writeSimpleDenyListSetDenied,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport { SimpleDenyList as SimpleDenyListBases } from '../../dist/deployments.json';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleDenyListAbi };\n\n/**\n * Object representation of a {@link SimpleDenyList} initialization payload.\n *\n * @export\n * @interface SimpleDenyListPayload\n * @typedef {SimpleDenyListPayload}\n */\nexport interface SimpleDenyListPayload {\n /**\n * The allow list's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of denied addresses.\n *\n * @type {Address[]}\n */\n denied: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleDenyList` event types.\n *\n * @export\n * @typedef {SimpleDenyListLog}\n * @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<\n * typeof simpleDenyListAbi\n * >]\n */\nexport type SimpleDenyListLog<\n event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<\n typeof simpleDenyListAbi\n >,\n> = GenericLog<typeof simpleDenyListAbi, event>;\n\n/**\n * A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list\n *\n * @export\n * @class SimpleDenyList\n * @typedef {SimpleDenyList}\n * @extends {DeployableTargetWithRBAC<SimpleDenyListPayload>}\n */\nexport class SimpleDenyList<\n Payload = SimpleDenyListPayload,\n> extends DeployableTargetWithRBAC<\n Payload | undefined,\n typeof simpleDenyListAbi\n> {\n public override readonly abi = simpleDenyListAbi;\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.VITE_SIMPLE_DENYLIST_BASE,\n ...(SimpleDenyListBases as Record<number, Address>),\n };\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Retrieves the owner\n *\n * @public\n * @async\n * @param {?ReadParams} [params]\n * @returns {Promise<Address>} - The address of the owner\n */\n public async owner(params?: ReadParams): Promise<Address> {\n return await readSimpleAllowListOwner(this._config, {\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 address: this.assertValidAddress(),\n args: [],\n });\n }\n\n /**\n * Check if a user is authorized (i.e. not denied)\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams,\n ): Promise<boolean> {\n return await readSimpleDenyListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\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\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams} [params]\n * @returns {Promise<void>}\n */\n public async setDenied(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n return await this.awaitResult(\n this.setDeniedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams} [params]\n * @returns {Promise<{ hash: `0x${string}`; result: void; }>}\n */\n public async setDeniedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams,\n ) {\n const { request, result } = await simulateSimpleDenyListSetDenied(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\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 writeSimpleDenyListSetDenied(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleDenyListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [p, options] = this.validateDeploymentConfig(_payload, _options);\n const payload = p as SimpleDenyListPayload;\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleDenyListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleDenyListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleDenyListPayload} param0\n * @param {Address} param0.owner - The allow list's owner\n * @param {Address[]} param0.denied - List of denied addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleDenyListPayload({\n owner,\n denied,\n}: SimpleDenyListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'denied' },\n ],\n [owner, denied],\n );\n}\n"],"names":["_SimpleDenyList","DeployableTargetWithRBAC","simpleDenyListAbi","params","readSimpleAllowListOwner","address","readSimpleDenyListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleDenyListSetDenied","writeSimpleDenyListSetDenied","_payload","_options","p","options","payload","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","SimpleDenyListBases","RegistryType","SimpleDenyList","denied","encodeAbiParameters"],"mappings":";;;;;;;o+RA8EaA,IAAN,MAAMA,UAEHC,EAGR;AAAA,EALK,cAAA;AAAA,UAAA,GAAA,SAAA,GAML,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B/B,MAAa,MAAMC,GAAuC;AACjD,WAAA,MAAMC,EAAyB,KAAK,SAAS;AAAA,MAClD,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAID;AAAA,MACJ,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAAC;AAAA,IAAA,CACR;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,UACXE,GACAF,GACkB;AACX,WAAA,MAAMG,EAA4B,KAAK,SAAS;AAAA,MACrD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACD,GAASE,CAAQ;AAAA,MACxB,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIJ;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,UACXK,GACAC,GACAN,GACA;AACA,WAAO,MAAM,KAAK;AAAA,MAChB,KAAK,aAAaK,GAAWC,GAASN,CAAM;AAAA,IAAA;AAAA,EAEhD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,aACXK,GACAC,GACAN,GACA;AACA,UAAM,EAAE,SAAAO,GAAS,QAAAC,EAAO,IAAI,MAAMC;AAAAA,MAChC,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAACJ,GAAWC,CAAO;AAAA,QACzB,GAAG,KAAK,wBAAwB;AAAA;AAAA,QAEhC,GAAIN;AAAA,MACN;AAAA,IAAA;AAGK,WAAA,EAAE,MADI,MAAMU,EAA6B,KAAK,SAASH,CAAO,GACtD,QAAAC;EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdG,GACAC,GACyB;;AACzB,UAAM,CAACC,GAAGC,CAAO,IAAI,KAAK,yBAAyBH,GAAUC,CAAQ,GAC/DG,IAAUF;AAChB,QAAI,CAACE,EAAQ,SAASA,EAAQ,UAAUC,GAAa;AACnD,YAAMC,IAAQH,EAAQ,UAClBA,EAAQ,QAAQ,UAChBA,EAAQ,SACNI,EAAWJ,EAAQ,MAAM,EAAE,WAC3BK,IAAA,KAAK,aAAL,gBAAAA,EAAe;AACrB,UAAIF;AACF,QAAAF,EAAQ,QAAQE;AAAA;AAEhB,cAAM,IAAIG,EAAoC;AAAA,IAElD;AACO,WAAA;AAAA,MACL,KAAKrB;AAAAA,MACL,UAAAsB;AAAA,MACA,MAAM,CAACC,EAA6BP,CAAO,CAAC;AAAA,MAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AAvIEjB,EAAuB,QAAiC;AAAA,EACtD,OAAO;AAAA,EACP,GAAI0B;AAAA,GASN1B,EAAuB,eAA6B2B,EAAa;AAzB5D,IAAMC,IAAN5B;AA+JA,SAASyB,EAA6B;AAAA,EAC3C,OAAAL;AAAA,EACA,QAAAS;AACF,GAA0B;AACjB,SAAAC;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,aAAa,MAAM,SAAS;AAAA,IACtC;AAAA,IACA,CAACV,GAAOS,CAAM;AAAA,EAAA;AAElB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-BPiHi7W2.cjs"),r=require("viem"),p=require("../deployments-CwTZr-cK.cjs"),g=require("../Deployable/DeployableTarget.cjs"),A=require("../utils.cjs"),w="0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e081905261010052610030610035565b610096565b63409feecd19805460018116156100535763f92ee8a95f526004601cfd5b8160c01c808260011c14610091578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60805160a05160c05160e0516101005161194d6100c45f395f50505f50505f50505f50505f505061194d5ff3fe60806040526004361061013d575f3560e01c8063715018a6116100bb578063ce5c134f11610071578063f04e283e11610057578063f04e283e1461036d578063f2fde38b14610380578063fee81cf414610393575f80fd5b8063ce5c134f14610339578063d3de6e751461034e575f80fd5b806384b0196e116100a157806384b0196e146102a05780638da5cb5b146102c7578063a1d2756f1461031a575f80fd5b8063715018a61461026a578063736c0d5b14610272575f80fd5b80632f9e058b11610110578063439fab91116100f6578063439fab911461023057806354d1f13d1461024f578063703b690014610257575f80fd5b80632f9e058b146101e65780634359d28a14610211575f80fd5b806301ffc9a7146101415780630668e9d41461017557806325692962146101a257806328d6183b146101ac575b5f80fd5b34801561014c575f80fd5b5061016061015b36600461110d565b6103c4565b60405190151581526020015b60405180910390f35b348015610180575f80fd5b5061019461018f36600461116d565b61041f565b60405190815260200161016c565b6101aa610480565b005b3480156101b7575f80fd5b506040517fc8ebc75800000000000000000000000000000000000000000000000000000000815260200161016c565b3480156101f1575f80fd5b506101946102003660046111a3565b60016020525f908152604090205481565b34801561021c575f80fd5b506101aa61022b366004611202565b6104cd565b34801561023b575f80fd5b506101aa61024a3660046112ac565b6105c9565b6101aa61075e565b6101606102653660046112eb565b610797565b6101aa61080d565b34801561027d575f80fd5b5061016061028c366004611350565b5f6020819052908152604090205460ff1681565b3480156102ab575f80fd5b506102b4610820565b60405161016c97969594939291906113b7565b3480156102d2575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016c565b348015610325575f80fd5b506101aa610334366004611350565b6108c8565b348015610344575f80fd5b5061019460025481565b348015610359575f80fd5b506101946103683660046115c0565b610917565b6101aa61037b366004611350565b6109aa565b6101aa61038e366004611350565b6109e7565b34801561039e575f80fd5b506101946103ad366004611350565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fc8ebc758000000000000000000000000000000000000000000000000000000001480610419575061041982610a0d565b92915050565b6040805160208101859052908101839052606082811b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016908201525f906074016040516020818303038152906040528051906020012090505b9392505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6104d5610a62565b82811461050e576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156105c25782828281811061052a5761052a611628565b905060200201602081019061053f9190611655565b5f8087878581811061055357610553611628565b90506020020160208101906105689190611350565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610510565b5050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf601132805460038255801561061a5760018160011c14303b106106115763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f808061062a85870187611684565b925092509250610652835f8151811061064557610645611628565b6020026020010151610a97565b60028190555f5b83518110156106dc5760015f8086848151811061067857610678611628565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610659565b5050600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055508015610759576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f6107a3868686610afa565b6107f6576040517f059b704500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024015b60405180910390fd5b6108038686868686610b54565b9695505050505050565b610815610a62565b61081e5f610cdc565b565b7f0f000000000000000000000000000000000000000000000000000000000000006060805f8080836108b6604080518082018252601681527f4c696d697465645369676e657256616c696461746f72000000000000000000006020808301919091528251808401909352600183527f31000000000000000000000000000000000000000000000000000000000000009083015291565b97989097965046955030945091925090565b6108d0610a62565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b8051602080830191909120604080517ffea51d5bd45bcd3c2ecc3679b43a3b80b0bd0923f8c16f822455b8cdecd9852f93810193909352820186905260ff8516606083015273ffffffffffffffffffffffffffffffffffffffff8416608083015260a08201525f906109a19060c00160405160208183030381529060405280519060200120610d41565b95945050505050565b6109b2610a62565b63389a75e1600c52805f526020600c2080544211156109d857636f5e88185f526004601cfd5b5f90556109e481610cdc565b50565b6109ef610a62565b8060601b610a0457637448fbae5f526004601cfd5b6109e481610cdc565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fc8ebc758000000000000000000000000000000000000000000000000000000001480610419575061041982610d6d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461081e576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b5f80610b0785858561041f565b5f8181526001602081905260408220549293509091610b2591611754565b9050600254811115610b3b575f92505050610479565b5f91825260016020819052604090922055949350505050565b6004545f9073ffffffffffffffffffffffffffffffffffffffff163314610ba7576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb48385018561178c565b90505f815f0151806020019051810190610bce919061184c565b90505f610be5898360400151898660200151610917565b905087826040015160ff1611610c395760408083015190517f17c66bc700000000000000000000000000000000000000000000000000000000815260ff9091166004820152602481018990526044016107ed565b815173ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205460ff16610c98576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ca46003828a610dc2565b60208201518251610ccf9173ffffffffffffffffffffffffffffffffffffffff909116908390610e50565b9998505050505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f610d4a610f5a565b6719010000000000005f908152601a91909152603a928352604260182092525090565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fb8ce7b22000000000000000000000000000000000000000000000000000000001480610419575061041982611027565b7f3f57fc5c000000000000000000000000000000000000000000000000000000007f4de1225a000000000000000000000000000000000000000000000000000000006007831115610e1957815f528260045260245ffd5b84602052835f5260405f206001841b81541880851c6001166001188015610e4657835f528560045260245ffd5b5090555050505050565b73ffffffffffffffffffffffffffffffffffffffff909216915f831561047957604051835f5260208301516040526040835103610ec9576040830151601b8160ff1c016020528060011b60011c606052506020600160805f60015afa805186183d1517610ec757505f606052604052506001610479565b505b6041835103610f0c5760608301515f1a60205260408301516060526020600160805f60015afa805186183d1517610f0a57505f606052604052506001610479565b505b5f60605280604052631626ba7e60e01b808252846004830152602482016040815284516020018060448501828860045afa505060208160443d01858a5afa9051909114169150509392505050565b5f805f80610fcc604080518082018252601681527f4c696d697465645369676e657256616c696461746f72000000000000000000006020808301919091528251808401909352600183527f31000000000000000000000000000000000000000000000000000000000000009083015291565b8151602092830120815191830191909120604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8152938401929092529082015246606082015230608082015260a09020949350505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f5912b89c0000000000000000000000000000000000000000000000000000000014806104195750610419825f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061041957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610419565b5f6020828403121561111d575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610479575f80fd5b73ffffffffffffffffffffffffffffffffffffffff811681146109e4575f80fd5b5f805f6060848603121561117f575f80fd5b833592506020840135915060408401356111988161114c565b809150509250925092565b5f602082840312156111b3575f80fd5b5035919050565b5f8083601f8401126111ca575f80fd5b50813567ffffffffffffffff8111156111e1575f80fd5b6020830191508360208260051b85010111156111fb575f80fd5b9250929050565b5f805f8060408587031215611215575f80fd5b843567ffffffffffffffff81111561122b575f80fd5b611237878288016111ba565b909550935050602085013567ffffffffffffffff811115611256575f80fd5b611262878288016111ba565b95989497509550505050565b5f8083601f84011261127e575f80fd5b50813567ffffffffffffffff811115611295575f80fd5b6020830191508360208285010111156111fb575f80fd5b5f80602083850312156112bd575f80fd5b823567ffffffffffffffff8111156112d3575f80fd5b6112df8582860161126e565b90969095509350505050565b5f805f805f608086880312156112ff575f80fd5b853594506020860135935060408601356113188161114c565b9250606086013567ffffffffffffffff811115611333575f80fd5b61133f8882890161126e565b969995985093965092949392505050565b5f60208284031215611360575f80fd5b81356104798161114c565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b7fff000000000000000000000000000000000000000000000000000000000000008816815260e060208201525f6113f160e083018961136b565b8281036040840152611403818961136b565b6060840188905273ffffffffffffffffffffffffffffffffffffffff8716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b81811015611465578351835260209384019390920191600101611447565b50909b9a5050505050505050505050565b60ff811681146109e4575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516060810167ffffffffffffffff811182821017156114d4576114d4611484565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561152157611521611484565b604052919050565b5f67ffffffffffffffff82111561154257611542611484565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f83011261157d575f80fd5b813561159061158b82611529565b6114da565b8181528460208386010111156115a4575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f80608085870312156115d3575f80fd5b8435935060208501356115e581611476565b925060408501356115f58161114c565b9150606085013567ffffffffffffffff811115611610575f80fd5b61161c8782880161156e565b91505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611665575f80fd5b81358015158114610479575f80fd5b803561167f8161114c565b919050565b5f805f60608486031215611696575f80fd5b833567ffffffffffffffff8111156116ac575f80fd5b8401601f810186136116bc575f80fd5b803567ffffffffffffffff8111156116d6576116d6611484565b8060051b6116e6602082016114da565b91825260208184018101929081019089841115611701575f80fd5b6020850194505b8385101561172f578435925061171d8361114c565b82825260209485019490910190611708565b809750505050505061174360208501611674565b929592945050506040919091013590565b80820180821115610419577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6020828403121561179c575f80fd5b813567ffffffffffffffff8111156117b2575f80fd5b8201604081850312156117c3575f80fd5b6040805190810167ffffffffffffffff811182821017156117e6576117e6611484565b604052813567ffffffffffffffff8111156117ff575f80fd5b61180b8682850161156e565b825250602082013567ffffffffffffffff811115611827575f80fd5b6118338682850161156e565b602083015250949350505050565b805161167f81611476565b5f6020828403121561185c575f80fd5b815167ffffffffffffffff811115611872575f80fd5b820160608185031215611883575f80fd5b61188b6114b1565b81516118968161114c565b8152602082015167ffffffffffffffff8111156118b1575f80fd5b8201601f810186136118c1575f80fd5b80516118cf61158b82611529565b8181528760208385010111156118e3575f80fd5b8160208401602083015e5f6020838301015280602085015250505061190a60408301611841565b604082015294935050505056fea264697066735822122063c3658c9a3036ea162ceac551ee8d1dfba428fee8f20bcb409727cb88030d5a64736f6c634300081a0033",i=class i extends g.DeployableTarget{constructor(){super(...arguments),this.abi=e.S}async signers(f,a){return await e.pz(this._config,{address:this.assertValidAddress(),args:[f],...a})}async hashSignerData(f,a){return await e.az(this._config,{address:this.assertValidAddress(),args:[f.boostId,f.incentiveQuantity,f.claimant,f.incentiveData],...a})}async validate(f,a){return await this.awaitResult(this.validateRaw(f,a))}async validateRaw(f,a){const{request:b,result:d}=await e.Ez(this._config,{address:this.assertValidAddress(),args:[f.boostId,f.incentiveId,f.claimant,f.claimData],...this.optionallyAttachAccount(),...a});return{hash:await e.Tz(this._config,b),result:d}}async setAuthorized(f,a,b){return await this.awaitResult(this.setAuthorizedRaw(f,a,b))}async setAuthorizedRaw(f,a,b){const{request:d,result:c}=await e.Rz(this._config,{address:this.assertValidAddress(),args:[f,a],...this.optionallyAttachAccount(),...b});return{hash:await e.fz(this._config,d),result:c}}async setValidatorCallerRaw(f,a){const{request:b,result:d}=await e.Oz(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...a});return{hash:await e.vz(this._config,b),result:d}}async setValidatorCaller(f,a){return await this.awaitResult(this.setValidatorCallerRaw(f,a))}async encodeClaimData(f){return await o({...f,validator:this.assertValidAddress()})}buildParameters(f,a){const[b,d]=this.validateDeploymentConfig(f,a);return{abi:e.S,bytecode:w,args:[u(b)],...this.optionallyAttachAccount(d.account)}}};i.bases={31337:void 0,...p.LimitedSignerValidator},i.registryType=A.RegistryType.VALIDATOR;let s=i;async function o({signer:t,incentiveData:f,chainId:a,validator:b,incentiveQuantity:d,claimant:c,boostId:n}){const y={domain:{name:"LimitedSignerValidator",version:"1",chainId:a,verifyingContract:b},types:{SignerValidatorData:[{name:"boostId",type:"uint256"},{name:"incentiveQuantity",type:"uint8"},{name:"claimant",type:"address"},{name:"incentiveData",type:"bytes"}]},primaryType:"SignerValidatorData",message:{boostId:n,incentiveQuantity:d,claimant:c,incentiveData:f}},m=await t.privateKey.signTypedData(y),h=l({signer:t.account,signature:m,incentiveQuantity:d});return r.encodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],[{validatorData:h,incentiveData:f}])}function l({signer:t,signature:f,incentiveQuantity:a}){return r.encodeAbiParameters([{type:"tuple",name:"SignerValidatorInputParams",components:[{type:"address",name:"signer"},{type:"bytes",name:"signature"},{type:"uint8",name:"incentiveQuantity"}]}],[{signer:t,signature:f,incentiveQuantity:a}])}function u({signers:t,validatorCaller:f,maxClaimCount:a}){return r.encodeAbiParameters([{type:"address[]",name:"signers"},{type:"address",name:"validatorCaller"},{type:"uint256",name:"maxClaimCount"}],[t,f,BigInt(a)])}exports.limitedSignerValidatorAbi=e.S;exports.LimitedSignerValidator=s;exports.prepareLimitedSignerValidatorClaimDataPayload=o;exports.prepareLimitedSignerValidatorInputParams=l;exports.prepareLimitedSignerValidatorPayload=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../generated-C_JEoLDO.cjs"),r=require("viem"),p=require("../deployments-C17nvui-.cjs"),g=require("../Deployable/DeployableTarget.cjs"),A=require("../utils.cjs"),D="0x610120604052348015610010575f80fd5b50306080524660a0525f60c081905260e081905261010052610030610035565b61009a565b63409feecd19805460018116156100535763f92ee8a95f526004601cfd5b6001600160401b03808260011c14610095578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60805160a05160c05160e051610100516119466100c85f395f50505f50505f50505f50505f50506119465ff3fe60806040526004361061013d575f3560e01c8063715018a6116100bb578063ce5c134f11610071578063f04e283e11610057578063f04e283e1461036d578063f2fde38b14610380578063fee81cf414610393575f80fd5b8063ce5c134f14610339578063d3de6e751461034e575f80fd5b806384b0196e116100a157806384b0196e146102a05780638da5cb5b146102c7578063a1d2756f1461031a575f80fd5b8063715018a61461026a578063736c0d5b14610272575f80fd5b80632f9e058b11610110578063439fab91116100f6578063439fab911461023057806354d1f13d1461024f578063703b690014610257575f80fd5b80632f9e058b146101e65780634359d28a14610211575f80fd5b806301ffc9a7146101415780630668e9d41461017557806325692962146101a257806328d6183b146101ac575b5f80fd5b34801561014c575f80fd5b5061016061015b366004611106565b6103c4565b60405190151581526020015b60405180910390f35b348015610180575f80fd5b5061019461018f366004611166565b61041f565b60405190815260200161016c565b6101aa610480565b005b3480156101b7575f80fd5b506040517fc8ebc75800000000000000000000000000000000000000000000000000000000815260200161016c565b3480156101f1575f80fd5b5061019461020036600461119c565b60016020525f908152604090205481565b34801561021c575f80fd5b506101aa61022b3660046111fb565b6104cd565b34801561023b575f80fd5b506101aa61024a3660046112a5565b6105c9565b6101aa61075e565b6101606102653660046112e4565b610797565b6101aa61080d565b34801561027d575f80fd5b5061016061028c366004611349565b5f6020819052908152604090205460ff1681565b3480156102ab575f80fd5b506102b4610820565b60405161016c97969594939291906113b0565b3480156102d2575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016c565b348015610325575f80fd5b506101aa610334366004611349565b6108c8565b348015610344575f80fd5b5061019460025481565b348015610359575f80fd5b506101946103683660046115b9565b610917565b6101aa61037b366004611349565b6109aa565b6101aa61038e366004611349565b6109e7565b34801561039e575f80fd5b506101946103ad366004611349565b63389a75e1600c9081525f91909152602090205490565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fc8ebc758000000000000000000000000000000000000000000000000000000001480610419575061041982610a0d565b92915050565b6040805160208101859052908101839052606082811b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016908201525f906074016040516020818303038152906040528051906020012090505b9392505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6104d5610a62565b82811461050e576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156105c25782828281811061052a5761052a611621565b905060200201602081019061053f919061164e565b5f8087878581811061055357610553611621565b90506020020160208101906105689190611349565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610510565b5050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf601132805460038255801561061a5760018160011c14303b106106115763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f808061062a8587018761167d565b925092509250610652835f8151811061064557610645611621565b6020026020010151610a97565b60028190555f5b83518110156106dc5760015f8086848151811061067857610678611621565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610659565b5050600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055508015610759576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f6107a3868686610afa565b6107f6576040517f059b704500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024015b60405180910390fd5b6108038686868686610b54565b9695505050505050565b610815610a62565b61081e5f610cdc565b565b7f0f000000000000000000000000000000000000000000000000000000000000006060805f8080836108b6604080518082018252601681527f4c696d697465645369676e657256616c696461746f72000000000000000000006020808301919091528251808401909352600183527f31000000000000000000000000000000000000000000000000000000000000009083015291565b97989097965046955030945091925090565b6108d0610a62565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b8051602080830191909120604080517ffea51d5bd45bcd3c2ecc3679b43a3b80b0bd0923f8c16f822455b8cdecd9852f93810193909352820186905260ff8516606083015273ffffffffffffffffffffffffffffffffffffffff8416608083015260a08201525f906109a19060c00160405160208183030381529060405280519060200120610d41565b95945050505050565b6109b2610a62565b63389a75e1600c52805f526020600c2080544211156109d857636f5e88185f526004601cfd5b5f90556109e481610cdc565b50565b6109ef610a62565b8060601b610a0457637448fbae5f526004601cfd5b6109e481610cdc565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fc8ebc758000000000000000000000000000000000000000000000000000000001480610419575061041982610d6d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461081e576382b429005f526004601cfd5b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b5f80610b0785858561041f565b5f8181526001602081905260408220549293509091610b259161174d565b9050600254811115610b3b575f92505050610479565b5f91825260016020819052604090922055949350505050565b6004545f9073ffffffffffffffffffffffffffffffffffffffff163314610ba7576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb483850185611785565b90505f815f0151806020019051810190610bce9190611845565b90505f610be5898360400151898660200151610917565b905087826040015160ff1611610c395760408083015190517f17c66bc700000000000000000000000000000000000000000000000000000000815260ff9091166004820152602481018990526044016107ed565b815173ffffffffffffffffffffffffffffffffffffffff165f9081526020819052604090205460ff16610c98576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ca46003828a610dc2565b60208201518251610ccf9173ffffffffffffffffffffffffffffffffffffffff909116908390610e50565b9998505050505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f610d4a610f53565b6719010000000000005f908152601a91909152603a928352604260182092525090565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167fb8ce7b22000000000000000000000000000000000000000000000000000000001480610419575061041982611020565b7f3f57fc5c000000000000000000000000000000000000000000000000000000007f4de1225a000000000000000000000000000000000000000000000000000000006007831115610e1957815f528260045260245ffd5b84602052835f5260405f206001841b81541880851c6001166001188015610e4657835f528560045260245ffd5b5090555050505050565b5f73ffffffffffffffffffffffffffffffffffffffff84161561047957604051843b610f0b57825160408114610e8e5760418114610ec85750610f4b565b604084015160ff81901c601b016020527f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff16606052610edb565b60608401515f1a60205260408401516060525b50835f5260208301516040526020600160805f60015afa5180861860601b3d119250505f60605280604052610f4b565b631626ba7e60e01b808252846004830152602482016040815284516020018060448501828860045afa905060208260443d01868b5afa9151911691141691505b509392505050565b5f805f80610fc5604080518082018252601681527f4c696d697465645369676e657256616c696461746f72000000000000000000006020808301919091528251808401909352600183527f31000000000000000000000000000000000000000000000000000000000000009083015291565b8151602092830120815191830191909120604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8152938401929092529082015246606082015230608082015260a09020949350505050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f5912b89c0000000000000000000000000000000000000000000000000000000014806104195750610419825f7fffffffff0000000000000000000000000000000000000000000000000000000082167f6ab67a0d00000000000000000000000000000000000000000000000000000000148061041957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610419565b5f60208284031215611116575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610479575f80fd5b73ffffffffffffffffffffffffffffffffffffffff811681146109e4575f80fd5b5f805f60608486031215611178575f80fd5b8335925060208401359150604084013561119181611145565b809150509250925092565b5f602082840312156111ac575f80fd5b5035919050565b5f8083601f8401126111c3575f80fd5b50813567ffffffffffffffff8111156111da575f80fd5b6020830191508360208260051b85010111156111f4575f80fd5b9250929050565b5f805f806040858703121561120e575f80fd5b843567ffffffffffffffff811115611224575f80fd5b611230878288016111b3565b909550935050602085013567ffffffffffffffff81111561124f575f80fd5b61125b878288016111b3565b95989497509550505050565b5f8083601f840112611277575f80fd5b50813567ffffffffffffffff81111561128e575f80fd5b6020830191508360208285010111156111f4575f80fd5b5f80602083850312156112b6575f80fd5b823567ffffffffffffffff8111156112cc575f80fd5b6112d885828601611267565b90969095509350505050565b5f805f805f608086880312156112f8575f80fd5b8535945060208601359350604086013561131181611145565b9250606086013567ffffffffffffffff81111561132c575f80fd5b61133888828901611267565b969995985093965092949392505050565b5f60208284031215611359575f80fd5b813561047981611145565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b7fff000000000000000000000000000000000000000000000000000000000000008816815260e060208201525f6113ea60e0830189611364565b82810360408401526113fc8189611364565b6060840188905273ffffffffffffffffffffffffffffffffffffffff8716608085015260a0840186905283810360c0850152845180825260208087019350909101905f5b8181101561145e578351835260209384019390920191600101611440565b50909b9a5050505050505050505050565b60ff811681146109e4575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516060810167ffffffffffffffff811182821017156114cd576114cd61147d565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561151a5761151a61147d565b604052919050565b5f67ffffffffffffffff82111561153b5761153b61147d565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f830112611576575f80fd5b813561158961158482611522565b6114d3565b81815284602083860101111561159d575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f80608085870312156115cc575f80fd5b8435935060208501356115de8161146f565b925060408501356115ee81611145565b9150606085013567ffffffffffffffff811115611609575f80fd5b61161587828801611567565b91505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f6020828403121561165e575f80fd5b81358015158114610479575f80fd5b803561167881611145565b919050565b5f805f6060848603121561168f575f80fd5b833567ffffffffffffffff8111156116a5575f80fd5b8401601f810186136116b5575f80fd5b803567ffffffffffffffff8111156116cf576116cf61147d565b8060051b6116df602082016114d3565b918252602081840181019290810190898411156116fa575f80fd5b6020850194505b83851015611728578435925061171683611145565b82825260209485019490910190611701565b809750505050505061173c6020850161166d565b929592945050506040919091013590565b80820180821115610419577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f60208284031215611795575f80fd5b813567ffffffffffffffff8111156117ab575f80fd5b8201604081850312156117bc575f80fd5b6040805190810167ffffffffffffffff811182821017156117df576117df61147d565b604052813567ffffffffffffffff8111156117f8575f80fd5b61180486828501611567565b825250602082013567ffffffffffffffff811115611820575f80fd5b61182c86828501611567565b602083015250949350505050565b80516116788161146f565b5f60208284031215611855575f80fd5b815167ffffffffffffffff81111561186b575f80fd5b82016060818503121561187c575f80fd5b6118846114aa565b815161188f81611145565b8152602082015167ffffffffffffffff8111156118aa575f80fd5b8201601f810186136118ba575f80fd5b80516118c861158482611522565b8181528760208385010111156118dc575f80fd5b8160208401602083015e5f602083830101528060208501525050506119036040830161183a565b604082015294935050505056fea26469706673582212208dd379a982138999bebe1c21725d91bdc06ecb08e219c3ba6e3f192e6c3a7ddf64736f6c634300081a0033",i=class i extends g.DeployableTarget{constructor(){super(...arguments),this.abi=e.D}async signers(f,a){return await e.$F(this._config,{address:this.assertValidAddress(),args:[f],...a})}async hashSignerData(f,a){return await e.WF(this._config,{address:this.assertValidAddress(),args:[f.boostId,f.incentiveQuantity,f.claimant,f.incentiveData],...a})}async validate(f,a){return await this.awaitResult(this.validateRaw(f,a))}async validateRaw(f,a){const{request:b,result:d}=await e.b0(this._config,{address:this.assertValidAddress(),args:[f.boostId,f.incentiveId,f.claimant,f.claimData],...this.optionallyAttachAccount(),...a});return{hash:await e.s0(this._config,b),result:d}}async setAuthorized(f,a,b){return await this.awaitResult(this.setAuthorizedRaw(f,a,b))}async setAuthorizedRaw(f,a,b){const{request:d,result:c}=await e.d0(this._config,{address:this.assertValidAddress(),args:[f,a],...this.optionallyAttachAccount(),...b});return{hash:await e.n0(this._config,d),result:c}}async setValidatorCallerRaw(f,a){const{request:b,result:d}=await e.c0(this._config,{address:this.assertValidAddress(),args:[f],...this.optionallyAttachAccount(),...a});return{hash:await e.a0(this._config,b),result:d}}async setValidatorCaller(f,a){return await this.awaitResult(this.setValidatorCallerRaw(f,a))}async encodeClaimData(f){return await o({...f,validator:this.assertValidAddress()})}buildParameters(f,a){const[b,d]=this.validateDeploymentConfig(f,a);return{abi:e.D,bytecode:D,args:[u(b)],...this.optionallyAttachAccount(d.account)}}};i.bases={31337:void 0,...p.LimitedSignerValidator},i.registryType=A.RegistryType.VALIDATOR;let s=i;async function o({signer:t,incentiveData:f,chainId:a,validator:b,incentiveQuantity:d,claimant:c,boostId:n}){const y={domain:{name:"LimitedSignerValidator",version:"1",chainId:a,verifyingContract:b},types:{SignerValidatorData:[{name:"boostId",type:"uint256"},{name:"incentiveQuantity",type:"uint8"},{name:"claimant",type:"address"},{name:"incentiveData",type:"bytes"}]},primaryType:"SignerValidatorData",message:{boostId:n,incentiveQuantity:d,claimant:c,incentiveData:f}},m=await t.privateKey.signTypedData(y),h=l({signer:t.account,signature:m,incentiveQuantity:d});return r.encodeAbiParameters([{type:"tuple",name:"BoostClaimData",components:[{type:"bytes",name:"validatorData"},{type:"bytes",name:"incentiveData"}]}],[{validatorData:h,incentiveData:f}])}function l({signer:t,signature:f,incentiveQuantity:a}){return r.encodeAbiParameters([{type:"tuple",name:"SignerValidatorInputParams",components:[{type:"address",name:"signer"},{type:"bytes",name:"signature"},{type:"uint8",name:"incentiveQuantity"}]}],[{signer:t,signature:f,incentiveQuantity:a}])}function u({signers:t,validatorCaller:f,maxClaimCount:a}){return r.encodeAbiParameters([{type:"address[]",name:"signers"},{type:"address",name:"validatorCaller"},{type:"uint256",name:"maxClaimCount"}],[t,f,BigInt(a)])}exports.limitedSignerValidatorAbi=e.D;exports.LimitedSignerValidator=s;exports.prepareLimitedSignerValidatorClaimDataPayload=o;exports.prepareLimitedSignerValidatorInputParams=l;exports.prepareLimitedSignerValidatorPayload=u;
|
|
2
2
|
//# sourceMappingURL=LimitedSignerValidator.cjs.map
|