@tokenops/sdk 1.6.0 → 2.0.0-alpha.2
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/CHANGELOG.md +77 -8
- package/CONTRIBUTING.md +4 -2
- package/README.md +146 -90
- package/SUPPORT.md +47 -0
- package/dist/{chunk-BD4LZBVF.cjs → chunk-3QHNYEQD.cjs} +18 -17
- package/dist/{chunk-YFIWCYHC.cjs → chunk-3YHBO2DL.cjs} +56 -54
- package/dist/{chunk-QET3Q4JP.js → chunk-44YJPMQC.js} +8 -6
- package/dist/{chunk-6WSNS3UV.js → chunk-4RAAATVY.js} +2 -4
- package/dist/{chunk-4KJ66YRH.js → chunk-4TSDNZQ3.js} +2 -2
- package/dist/chunk-66IHPTOK.cjs +20 -0
- package/dist/{chunk-2RNW4MIJ.cjs → chunk-67OV5CX2.cjs} +0 -18
- package/dist/{chunk-PD7ME2BT.js → chunk-6GNR22OV.js} +2 -1
- package/dist/{chunk-WOEETTH7.cjs → chunk-7AFPOE7N.cjs} +6 -6
- package/dist/{chunk-QKKBBH7I.js → chunk-A4DCEE33.js} +34 -7
- package/dist/chunk-AREQJHKA.cjs +713 -0
- package/dist/{chunk-U57COLUE.js → chunk-AXIPOR3C.js} +2 -2
- package/dist/chunk-EBLBPUPI.cjs +255 -0
- package/dist/chunk-EYDA6Q6C.js +245 -0
- package/dist/{chunk-SYHNZSZZ.cjs → chunk-FAXIIH5R.cjs} +3 -3
- package/dist/{chunk-AYGRYDBX.cjs → chunk-FEDX7B6T.cjs} +37 -35
- package/dist/{chunk-CBRL2PJA.cjs → chunk-FHWSBGWE.cjs} +12 -12
- package/dist/{chunk-WUXUWTFW.cjs → chunk-FT5H2Q7Y.cjs} +37 -7
- package/dist/chunk-GADGBQJO.js +423 -0
- package/dist/{chunk-VHSNYUYV.js → chunk-IGO5XSPS.js} +5 -5
- package/dist/chunk-IUKKNJ2R.cjs +433 -0
- package/dist/{chunk-VR3FREBX.cjs → chunk-JK4XMMKM.cjs} +3 -3
- package/dist/{chunk-4ZCXK4VI.cjs → chunk-KFRDLKMA.cjs} +14 -14
- package/dist/chunk-KWFFIJYX.js +11 -0
- package/dist/{chunk-7G7UOQV4.cjs → chunk-MM5BV5CS.cjs} +4 -4
- package/dist/{chunk-43RFBQ73.cjs → chunk-MVDQMV25.cjs} +29 -32
- package/dist/chunk-NWFMBLSQ.js +4 -0
- package/dist/{chunk-HETNKZEE.js → chunk-PYYSB5ZN.js} +1 -1
- package/dist/chunk-PZZK3O3S.cjs +9843 -0
- package/dist/{chunk-DRSPMIZ7.js → chunk-QBJ7O2B4.js} +1 -11
- package/dist/{chunk-WTK6JDSI.js → chunk-SPLNGUFF.js} +6 -4
- package/dist/{chunk-UJS4N2XM.cjs → chunk-TEBM66WA.cjs} +12 -12
- package/dist/{chunk-TN65XNTI.js → chunk-TWT3STIX.js} +8 -6
- package/dist/chunk-UG5RKLU2.cjs +6 -0
- package/dist/{chunk-EUKPOXWR.cjs → chunk-UHHMVBLU.cjs} +17 -15
- package/dist/chunk-VW356KR3.js +688 -0
- package/dist/{chunk-BK7YIVLK.cjs → chunk-WJLECC22.cjs} +75 -73
- package/dist/{chunk-V5D7BHW3.js → chunk-WJMEBBU7.js} +6 -4
- package/dist/{chunk-NFW7AUEX.js → chunk-WMACINXO.js} +1 -1
- package/dist/chunk-X7WBPCEU.js +9817 -0
- package/dist/{chunk-46T67CE2.js → chunk-ZA673I3O.js} +1 -1
- package/dist/{chunk-YPYCWLYP.js → chunk-ZWXJTBZO.js} +1 -1
- package/dist/core/addresses.d.ts +14 -2
- package/dist/core/brands.d.ts +8 -2
- package/dist/core/errors.d.ts +71 -10
- package/dist/core/preflight.d.ts +1 -0
- package/dist/fhe/erc7984-abi.d.ts +1 -0
- package/dist/fhe/index.cjs +64 -63
- package/dist/fhe/index.js +7 -6
- package/dist/fhe/operators.d.ts +22 -5
- package/dist/fhe/react/index.cjs +13 -12
- package/dist/fhe/react/index.js +6 -5
- package/dist/fhe/types.d.ts +8 -2
- package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
- package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
- package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
- package/dist/fhe-airdrop/abis/index.d.ts +5 -2
- package/dist/fhe-airdrop/abis/merkle.d.ts +1250 -0
- package/dist/fhe-airdrop/advanced/index.cjs +11 -12
- package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
- package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
- package/dist/fhe-airdrop/advanced/index.js +3 -8
- package/dist/fhe-airdrop/advanced/react/index.cjs +619 -51
- package/dist/fhe-airdrop/advanced/react/index.d.cts +43 -3
- package/dist/fhe-airdrop/advanced/react/index.d.ts +43 -3
- package/dist/fhe-airdrop/advanced/react/index.js +592 -52
- package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
- package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +35 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +47 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
- package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
- package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
- package/dist/fhe-airdrop/airdrop-base.d.ts +608 -0
- package/dist/fhe-airdrop/campaign.d.ts +338 -0
- package/dist/fhe-airdrop/compliance.d.ts +302 -0
- package/dist/fhe-airdrop/constants.d.ts +33 -0
- package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
- package/dist/fhe-airdrop/encryption.d.ts +92 -14
- package/dist/fhe-airdrop/errors.d.ts +273 -15
- package/dist/fhe-airdrop/factory.d.ts +533 -274
- package/dist/fhe-airdrop/guards.d.ts +317 -0
- package/dist/fhe-airdrop/index.cjs +233 -73
- package/dist/fhe-airdrop/index.d.cts +46 -8
- package/dist/fhe-airdrop/index.d.ts +46 -8
- package/dist/fhe-airdrop/index.js +11 -7
- package/dist/fhe-airdrop/merkle-tree.d.ts +97 -0
- package/dist/fhe-airdrop/merkle.d.ts +201 -0
- package/dist/fhe-airdrop/react/_shared.d.ts +156 -70
- package/dist/fhe-airdrop/react/index.cjs +1174 -384
- package/dist/fhe-airdrop/react/index.d.cts +99 -74
- package/dist/fhe-airdrop/react/index.d.ts +99 -74
- package/dist/fhe-airdrop/react/index.js +993 -303
- package/dist/fhe-airdrop/react/keys.d.ts +90 -0
- package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
- package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
- package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +29 -10
- package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
- package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
- package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +27 -9
- package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
- package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
- package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
- package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
- package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
- package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
- package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
- package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
- package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
- package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
- package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
- package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
- package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
- package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
- package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
- package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
- package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
- package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
- package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +24 -0
- package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
- package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
- package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
- package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
- package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
- package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
- package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
- package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
- package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
- package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
- package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
- package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
- package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
- package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +22 -0
- package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
- package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
- package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
- package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +51 -35
- package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
- package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
- package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
- package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +32 -21
- package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
- package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
- package/dist/fhe-airdrop/roles.d.ts +147 -0
- package/dist/fhe-airdrop/types.d.ts +78 -63
- package/dist/fhe-disperse/index.cjs +70 -68
- package/dist/fhe-disperse/index.js +10 -8
- package/dist/fhe-disperse/react/index.cjs +94 -92
- package/dist/fhe-disperse/react/index.js +13 -11
- package/dist/fhe-vesting/advanced/index.cjs +10 -8
- package/dist/fhe-vesting/advanced/index.js +8 -6
- package/dist/fhe-vesting/advanced/react/index.cjs +16 -14
- package/dist/fhe-vesting/advanced/react/index.js +13 -11
- package/dist/fhe-vesting/index.cjs +74 -72
- package/dist/fhe-vesting/index.js +11 -9
- package/dist/fhe-vesting/react/index.cjs +228 -226
- package/dist/fhe-vesting/react/index.js +15 -13
- package/dist/index.cjs +100 -87
- package/dist/index.js +3 -2
- package/dist/testnet-faucet/index.cjs +57 -55
- package/dist/testnet-faucet/index.js +7 -5
- package/dist/testnet-faucet/react/index.cjs +55 -53
- package/dist/testnet-faucet/react/index.js +9 -7
- package/package.json +6 -2
- package/dist/chunk-CNP4L3GF.js +0 -105
- package/dist/chunk-KSDSXJ34.js +0 -41
- package/dist/chunk-LBWRFZR3.cjs +0 -1681
- package/dist/chunk-OL6SHN3D.cjs +0 -44
- package/dist/chunk-S2XD75JM.js +0 -1637
- package/dist/chunk-SPGSO5SO.cjs +0 -1644
- package/dist/chunk-UE5XK2SY.js +0 -1673
- package/dist/chunk-WO72UBQD.cjs +0 -109
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
- package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
- package/dist/fhe-airdrop/airdrop.d.ts +0 -317
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -37
- package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
- package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
- package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
- package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useClaim.d.ts +0 -39
- package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
- package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
- package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
- package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
- package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
- package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
- package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
- package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
|
@@ -1,364 +1,623 @@
|
|
|
1
1
|
import type { Account, Address, Hex, PublicClient, WalletClient } from "viem";
|
|
2
|
-
import { type TxHash } from "../core/brands.js";
|
|
3
2
|
import { type SdkTelemetry } from "../core/telemetry.js";
|
|
4
|
-
import
|
|
5
|
-
import type {
|
|
3
|
+
import type { EncryptedInput } from "../fhe/types.js";
|
|
4
|
+
import type { WriteAccountOverride } from "./airdrop-base.js";
|
|
5
|
+
import { type DeploymentMode } from "./constants.js";
|
|
6
|
+
import { type EncryptorSource } from "./encryption.js";
|
|
7
|
+
import type { CommonAirdropParams, CreateAirdropArgs, CreateAirdropResult, EcdsaAirdropParams, MerkleAirdropParams } from "./types.js";
|
|
8
|
+
/** The on-chain `CommonAirdropParams` struct, field-for-field. */
|
|
9
|
+
interface ContractCommonParams {
|
|
10
|
+
token: Address;
|
|
11
|
+
startTime: number;
|
|
12
|
+
endTime: number;
|
|
13
|
+
canExtendClaimWindow: boolean;
|
|
14
|
+
unwrappable: boolean;
|
|
15
|
+
complianceAdmin: Address;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Convert the SDK's `"clone"` / `"uups"` name to the contract's
|
|
19
|
+
* `DeploymentMode` ordinal.
|
|
20
|
+
*
|
|
21
|
+
* The string union is the SDK's currency everywhere else; the ordinal exists
|
|
22
|
+
* only at the ABI edge. Keeping the conversion in one exported function makes
|
|
23
|
+
* an inverted mapping a one-line test failure rather than a silently
|
|
24
|
+
* upgradeable instance.
|
|
25
|
+
*
|
|
26
|
+
* @param mode Deployment shell to select.
|
|
27
|
+
* @returns The `uint8` the factory expects.
|
|
28
|
+
*/
|
|
29
|
+
export declare function toDeploymentModeOrdinal(mode: DeploymentMode): number;
|
|
30
|
+
/**
|
|
31
|
+
* Project {@link CommonAirdropParams} onto the contract's struct.
|
|
32
|
+
*
|
|
33
|
+
* The two shapes are already identical, so this is a re-assembly rather than a
|
|
34
|
+
* translation — and that is the point: it pins the field set and their order to
|
|
35
|
+
* the vendored ABI, so a struct change in a future contract commit surfaces
|
|
36
|
+
* here instead of as a silently mis-encoded tuple.
|
|
37
|
+
*
|
|
38
|
+
* @param common Create-time fields shared by both airdrop variants.
|
|
39
|
+
* @returns The struct in the ABI's declared field order.
|
|
40
|
+
*/
|
|
41
|
+
export declare function toContractCommonParams(common: CommonAirdropParams): ContractCommonParams;
|
|
42
|
+
/** @alpha */
|
|
6
43
|
export interface ConfidentialAirdropFactoryClientConfig {
|
|
7
44
|
publicClient: PublicClient;
|
|
8
45
|
walletClient?: WalletClient;
|
|
9
|
-
/** Override the on-chain factory address. Falls back to
|
|
46
|
+
/** Override the on-chain factory address. Falls back to {@link requireFheAirdropFactoryAddress} keyed by chain id. */
|
|
10
47
|
address?: Address;
|
|
11
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Chain id used for the support check and the default address lookup.
|
|
50
|
+
* Defaults to `publicClient.chain?.id`; one of the two must resolve, because
|
|
51
|
+
* the client refuses to talk to a chain it cannot name.
|
|
52
|
+
*/
|
|
12
53
|
chainId?: number | undefined;
|
|
13
54
|
/**
|
|
14
|
-
* Default encryptor
|
|
15
|
-
*
|
|
55
|
+
* Default encryptor for the fund methods. Optional here and required only at
|
|
56
|
+
* call time, so a React host can hand over a lazy factory that resolves
|
|
57
|
+
* against whatever relayer the provider currently holds.
|
|
16
58
|
*/
|
|
17
59
|
encryptor?: EncryptorSource | undefined;
|
|
18
60
|
/**
|
|
19
61
|
* Optional telemetry sink. When provided, the SDK emits a `fhe-airdrop.client.init`
|
|
20
62
|
* event on construction and brackets public write methods with named spans
|
|
21
|
-
* (`fhe-airdrop.factory.
|
|
22
|
-
*
|
|
63
|
+
* (`fhe-airdrop.factory.createEcdsaAirdrop`, …). Defaults to a no-op — zero
|
|
64
|
+
* overhead, zero leakage of consumer-side identifiers.
|
|
23
65
|
*
|
|
24
66
|
* The shape is structurally compatible with `NoopTelemetry` / `ConsoleTelemetry` /
|
|
25
67
|
* `TokenOpsTelemetry` exported from `@tokenops/sdk/telemetry`.
|
|
26
68
|
*/
|
|
27
69
|
telemetry?: SdkTelemetry | undefined;
|
|
28
70
|
}
|
|
29
|
-
export interface CreateAirdropArgs {
|
|
30
|
-
params: AirdropParams;
|
|
31
|
-
/** Any unique 32-byte salt. Combined with msg.sender to derive the CREATE2 salt. */
|
|
32
|
-
userSalt: Hex;
|
|
33
|
-
account?: Account | Address | undefined;
|
|
34
|
-
}
|
|
35
|
-
/** Common fields for {@link CreateAndFundAirdropArgs} — discriminated below. */
|
|
36
|
-
interface CreateAndFundAirdropArgsCommon {
|
|
37
|
-
params: AirdropParams;
|
|
38
|
-
userSalt: Hex;
|
|
39
|
-
/**
|
|
40
|
-
* Plaintext token amount. The SDK encrypts via `encryptor`. Mutually
|
|
41
|
-
* exclusive with `encryptedInput` — supply exactly one.
|
|
42
|
-
*/
|
|
43
|
-
amount?: bigint;
|
|
44
|
-
encryptor?: Encryptor;
|
|
45
|
-
/** Pre-encrypted input — mutually exclusive with `amount`. */
|
|
46
|
-
encryptedInput?: EncryptedInput;
|
|
47
|
-
account?: Account | Address;
|
|
48
|
-
}
|
|
49
71
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
72
|
+
* The encrypted pool amount for a fund-style write, as exactly one of a
|
|
73
|
+
* plaintext the SDK encrypts or a ciphertext the caller already built.
|
|
74
|
+
*
|
|
75
|
+
* The union is discriminated with `never` rather than left as two optional
|
|
76
|
+
* fields so that passing both is a compile error: a stale plaintext sitting
|
|
77
|
+
* next to a pre-built handle is a silent divergence from what actually moves
|
|
78
|
+
* on-chain.
|
|
79
|
+
*
|
|
80
|
+
* @alpha
|
|
52
81
|
*/
|
|
53
|
-
export type
|
|
54
|
-
/**
|
|
82
|
+
export type FundInput = {
|
|
83
|
+
/** Base units of the ERC-7984 token (6 decimals on the TokenOps tokens). */
|
|
55
84
|
amount: bigint;
|
|
56
|
-
encryptor
|
|
85
|
+
/** Overrides the client's default encryptor for this call. */
|
|
86
|
+
encryptor?: EncryptorSource | undefined;
|
|
57
87
|
encryptedInput?: never;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
88
|
+
} | {
|
|
89
|
+
/** Must be bound to `(factoryAddress, funderAddress)` — the factory is what calls `FHE.fromExternal`. */
|
|
60
90
|
encryptedInput: EncryptedInput;
|
|
61
91
|
amount?: never;
|
|
62
92
|
encryptor?: never;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Inputs for the address-prediction oracles.
|
|
96
|
+
*
|
|
97
|
+
* `params` is required because the ABI declares it, but the factory ignores
|
|
98
|
+
* it: an instance address commits only to `(implementation-for-variant, mode,
|
|
99
|
+
* deployer, userSalt)`. Changing the token, window, signer or root does NOT
|
|
100
|
+
* move the predicted address — only `mode`, `deployer` and `userSalt` do.
|
|
101
|
+
*
|
|
102
|
+
* @alpha
|
|
103
|
+
*/
|
|
104
|
+
export interface PredictArgs<P> {
|
|
105
|
+
params: P;
|
|
106
|
+
mode: DeploymentMode;
|
|
107
|
+
/** The account that will send `create*` — CREATE2 salts are per-deployer. */
|
|
69
108
|
deployer: Address;
|
|
70
|
-
|
|
71
|
-
* Gas fee in wei that was active for the deployer at airdrop creation time.
|
|
72
|
-
* Must match the value used when the clone was created (custom fee if one was
|
|
73
|
-
* set for that deployer, otherwise `defaultGasFee`). Determines the CREATE2
|
|
74
|
-
* salt and the predicted clone address — a mismatch will target the wrong address.
|
|
75
|
-
*
|
|
76
|
-
* Obtain via `factory.getCustomFee(deployer)` or `factory.defaultGasFee()`.
|
|
77
|
-
*/
|
|
78
|
-
gasFee: bigint;
|
|
79
|
-
/**
|
|
80
|
-
* Plaintext token amount. The SDK encrypts via `encryptor`. Mutually
|
|
81
|
-
* exclusive with `encryptedInput` — supply exactly one.
|
|
82
|
-
*/
|
|
83
|
-
amount?: bigint;
|
|
84
|
-
encryptor?: Encryptor;
|
|
85
|
-
/** Pre-encrypted input — mutually exclusive with `amount`. */
|
|
86
|
-
encryptedInput?: EncryptedInput;
|
|
87
|
-
account?: Account | Address;
|
|
109
|
+
userSalt: Hex;
|
|
88
110
|
}
|
|
89
111
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
112
|
+
* Inputs for the init-code-hash reads.
|
|
113
|
+
*
|
|
114
|
+
* Narrower than {@link PredictArgs} on purpose: the hash covers the proxy
|
|
115
|
+
* init-code only, so `deployer` and `userSalt` cannot affect it and are not
|
|
116
|
+
* worth making a caller invent.
|
|
117
|
+
*
|
|
118
|
+
* @alpha
|
|
92
119
|
*/
|
|
93
|
-
export type
|
|
94
|
-
/** Plaintext token amount. The SDK encrypts via `encryptor`. */
|
|
95
|
-
amount: bigint;
|
|
96
|
-
encryptor?: Encryptor | undefined;
|
|
97
|
-
encryptedInput?: never;
|
|
98
|
-
}) | (FundAirdropArgsCommon & {
|
|
99
|
-
/** Pre-encrypted input — bypasses `encryptor`. */
|
|
100
|
-
encryptedInput: EncryptedInput;
|
|
101
|
-
amount?: never;
|
|
102
|
-
encryptor?: never;
|
|
103
|
-
});
|
|
120
|
+
export type InitCodeHashArgs<P> = Pick<PredictArgs<P>, "params" | "mode">;
|
|
104
121
|
/**
|
|
105
|
-
*
|
|
106
|
-
* and {@link ConfidentialAirdropFactoryClient.createAndFundConfidentialAirdrop}.
|
|
122
|
+
* The on-chain `CustomFee` struct returned by `getCustomFee`.
|
|
107
123
|
*
|
|
108
|
-
*
|
|
109
|
-
* swap them at the destructure site.
|
|
124
|
+
* @alpha
|
|
110
125
|
*/
|
|
111
|
-
export interface
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
airdrop: Address;
|
|
126
|
+
export interface CustomFee {
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
/** Wei, `uint96` on-chain. */
|
|
129
|
+
gasFee: bigint;
|
|
116
130
|
}
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* clone already exists there (a repeat create with the same salt reverts).
|
|
127
|
-
*/
|
|
128
|
-
userSalt?: Hex;
|
|
129
|
-
/**
|
|
130
|
-
* Set `true` when the plan is `createAndFundConfidentialAirdrop` (or a
|
|
131
|
-
* follow-up `fundConfidentialAirdrop`). Funding pulls tokens from the
|
|
132
|
-
* creator via `confidentialTransferFrom`, so a missing factory-operator
|
|
133
|
-
* approval becomes a blocker. When `false`/omitted, the operator state is
|
|
134
|
-
* still reported (`isFactoryOperator`) but does not block a create-only tx.
|
|
135
|
-
*/
|
|
136
|
-
funding?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* The on-chain `CompliancePolicy` struct returned by `getCompliancePolicy`.
|
|
133
|
+
*
|
|
134
|
+
* @alpha
|
|
135
|
+
*/
|
|
136
|
+
export interface CompliancePolicy {
|
|
137
|
+
/** Whether this creator has a policy distinct from `effectiveDelegateToCompliance`'s factory default. */
|
|
138
|
+
overridden: boolean;
|
|
139
|
+
delegateToCompliance: boolean;
|
|
137
140
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
* Passing the wrong value produces a different address than the deployed clone.
|
|
148
|
-
*/
|
|
149
|
-
gasFee: bigint;
|
|
141
|
+
/**
|
|
142
|
+
* The on-chain `UpgradeabilityPolicy` struct returned by `getUpgradeabilityPolicy`.
|
|
143
|
+
*
|
|
144
|
+
* @alpha
|
|
145
|
+
*/
|
|
146
|
+
export interface UpgradeabilityPolicy {
|
|
147
|
+
/** Whether this creator has a policy distinct from `defaultUpgradeable`'s factory default. */
|
|
148
|
+
overridden: boolean;
|
|
149
|
+
allowed: boolean;
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
152
|
+
* States the live role-concentration fact plainly: this management surface
|
|
153
|
+
* wraps every fee, implementation, compliance and upgradeability admin entry
|
|
154
|
+
* point the factory exposes, and on the deployed Sepolia factory all of them
|
|
155
|
+
* are reachable from one key. See the class TSDoc for the full context —
|
|
156
|
+
* this string exists so a consumer can surface the same fact in their own UI
|
|
157
|
+
* (e.g. an admin panel warning) without re-deriving it.
|
|
158
|
+
*
|
|
159
|
+
* **Check it rather than trust it.** This is a fixed string describing one
|
|
160
|
+
* deployment at one point in time; role membership is mutable. The claim is
|
|
161
|
+
* verifiable on whatever chain you are actually connected to by reading the
|
|
162
|
+
* five role constants ({@link ConfidentialAirdropFactoryClient.DEFAULT_ADMIN_ROLE},
|
|
163
|
+
* `FEE_MANAGER_ROLE`, `IMPL_MANAGER_ROLE`, `COMPLIANCE_WIRING_ROLE`,
|
|
164
|
+
* `UPGRADE_MANAGER_ROLE`) and passing each to
|
|
165
|
+
* {@link ConfidentialAirdropFactoryClient.getRoleMembers} - see that method's
|
|
166
|
+
* example for the whole check in six lines. A UI that shows this warning
|
|
167
|
+
* should prefer the live reads and fall back to this string only when it has
|
|
168
|
+
* no client to read with.
|
|
169
|
+
*
|
|
170
|
+
* @alpha
|
|
171
|
+
*/
|
|
172
|
+
export declare const FACTORY_ROLE_CONCENTRATION_NOTE = "The live factory holds all five factory roles on the deployer account.";
|
|
173
|
+
/**
|
|
174
|
+
* Typed wrapper around the deployed airdrop v2 `AirdropFactory`.
|
|
175
|
+
*
|
|
176
|
+
* Encapsulates the three things a raw ABI call leaves to the caller: FHE
|
|
177
|
+
* encryption of the pool amount (bound to the factory, which is the contract
|
|
178
|
+
* that calls `FHE.fromExternal`), the `DeploymentMode` / `DedupMode` ordinal
|
|
179
|
+
* mapping, and resolving the deployed instance plus its compliance-manager
|
|
180
|
+
* clone out of the receipt.
|
|
181
|
+
*
|
|
182
|
+
* Also exposes the factory's fee, implementation, compliance and
|
|
183
|
+
* upgradeability admin surface. On the live Sepolia deployment all five
|
|
184
|
+
* factory roles (admin, feeManager, implManager, complianceWiring,
|
|
185
|
+
* upgradeManager) and the fee collector are held by the deploying account —
|
|
186
|
+
* the deploy script has no env var to split them. See
|
|
187
|
+
* {@link FACTORY_ROLE_CONCENTRATION_NOTE}. Nothing below implies separation
|
|
188
|
+
* exists; splitting roles is a contracts-repo decision, not something this
|
|
189
|
+
* client can arrange.
|
|
154
190
|
*
|
|
155
191
|
* @example
|
|
156
|
-
* const factory = createConfidentialAirdropFactoryClient({ publicClient, walletClient
|
|
157
|
-
* const
|
|
192
|
+
* const factory = createConfidentialAirdropFactoryClient({ publicClient, walletClient });
|
|
193
|
+
* const { airdrop, complianceManager } = await factory.createMerkleAirdrop({
|
|
194
|
+
* params, mode: "clone", userSalt,
|
|
195
|
+
* });
|
|
196
|
+
*
|
|
197
|
+
* @alpha
|
|
158
198
|
*/
|
|
159
199
|
export declare class ConfidentialAirdropFactoryClient {
|
|
160
200
|
#private;
|
|
161
201
|
readonly publicClient: PublicClient;
|
|
162
202
|
readonly walletClient?: WalletClient;
|
|
163
203
|
readonly address: Address;
|
|
204
|
+
readonly chainId: number;
|
|
164
205
|
readonly encryptor?: EncryptorSource;
|
|
165
206
|
constructor(config: ConfidentialAirdropFactoryClientConfig);
|
|
166
207
|
/**
|
|
167
|
-
* Deploy
|
|
168
|
-
* from the `ConfidentialAirdropCreated` event in the tx receipt.
|
|
208
|
+
* Deploy an ECDSA-authorised airdrop instance.
|
|
169
209
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* waits for and parses the event, so there's no reason to make consumers do
|
|
173
|
-
* it themselves.
|
|
210
|
+
* The factory injects `admin = msg.sender`; there is no admin field to set.
|
|
211
|
+
* Split roles afterwards rather than at create time.
|
|
174
212
|
*
|
|
175
|
-
*
|
|
176
|
-
* `
|
|
213
|
+
* Guardrailed before the send: the stock-wrapper probe when
|
|
214
|
+
* `params.common.unwrappable` is set, and a salt-collision
|
|
215
|
+
* check on the predicted address. See {@link preflightCreate} for the
|
|
216
|
+
* read-only form of the same checks.
|
|
177
217
|
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
218
|
+
* @param args Instance parameters, deployment shell and the caller's salt.
|
|
219
|
+
* @returns The tx hash, the deployed instance and its compliance-manager clone.
|
|
220
|
+
* @throws {@link NonStockWrapperError} when `unwrappable` is set on a token that is not a stock wrapper.
|
|
221
|
+
* @throws {@link SaltCollisionError} when this `(mode, deployer, userSalt)` tuple already deployed an instance.
|
|
222
|
+
* @throws {@link UpgradeabilityNotAllowedError} when `mode: "uups"` is not permitted for the creator.
|
|
223
|
+
* @throws {@link InvalidArgumentError} when `userSalt` was already consumed by this creator and mode.
|
|
181
224
|
*
|
|
182
225
|
* @example
|
|
183
|
-
* const {
|
|
184
|
-
* params,
|
|
226
|
+
* const { airdrop } = await factory.createEcdsaAirdrop({
|
|
227
|
+
* params: { common, signer, dedupMode: "perAddress" },
|
|
228
|
+
* mode: "clone",
|
|
229
|
+
* userSalt: keccak256(toBytes("campaign-42")),
|
|
185
230
|
* });
|
|
186
231
|
*/
|
|
187
|
-
|
|
232
|
+
createEcdsaAirdrop(args: CreateAirdropArgs<EcdsaAirdropParams> & WriteAccountOverride): Promise<CreateAirdropResult>;
|
|
188
233
|
/**
|
|
189
|
-
* Deploy
|
|
190
|
-
* address. The SDK encrypts `amount` into an `externalEuint64` before
|
|
191
|
-
* passing to the contract.
|
|
234
|
+
* Deploy a Merkle-proof airdrop instance.
|
|
192
235
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
236
|
+
* `mode: "uups"` is refused outright, before any RPC: the Merkle
|
|
237
|
+
* implementation's per-account claim state occupies an ERC-7201 namespaced
|
|
238
|
+
* slot that an earlier revision typed differently, so an in-place upgrade
|
|
239
|
+
* across that change reinterprets live storage. See
|
|
240
|
+
* {@link MerkleUupsUnsupportedError}.
|
|
195
241
|
*
|
|
196
|
-
*
|
|
242
|
+
* @param args Instance parameters, deployment shell and the caller's salt.
|
|
243
|
+
* @returns The tx hash, the deployed instance and its compliance-manager clone.
|
|
244
|
+
* @throws {@link MerkleUupsUnsupportedError} when `mode` is `"uups"`.
|
|
245
|
+
* @throws {@link NonStockWrapperError} when `unwrappable` is set on a token that is not a stock wrapper.
|
|
246
|
+
* @throws {@link SaltCollisionError} when this `(mode, deployer, userSalt)` tuple already deployed an instance.
|
|
247
|
+
* @throws {@link InvalidArgumentError} when the root is zero and `isMerkleRootMutable` is false, or the salt was already used.
|
|
248
|
+
*/
|
|
249
|
+
createMerkleAirdrop(args: CreateAirdropArgs<MerkleAirdropParams> & WriteAccountOverride): Promise<CreateAirdropResult>;
|
|
250
|
+
/**
|
|
251
|
+
* Deploy an ECDSA airdrop and seed its pool in the same transaction.
|
|
197
252
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
202
|
-
* transparent TTT test token uses 18 decimals.
|
|
253
|
+
* Prerequisite: the funder must have approved this factory as an ERC-7984
|
|
254
|
+
* operator on the token (`token.setOperator(factoryAddress, deadline)`) —
|
|
255
|
+
* the factory pulls the pool via `confidentialTransferFrom`.
|
|
203
256
|
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
257
|
+
* **Silent-zero transfers.** An ERC-7984 transfer does not revert when the
|
|
258
|
+
* sender's encrypted balance is short; it moves an encrypted zero instead,
|
|
259
|
+
* because reverting would leak the balance. A successful receipt therefore
|
|
260
|
+
* does not prove the pool was funded — confirm the funder's balance first.
|
|
207
261
|
*
|
|
208
|
-
* @
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* })
|
|
262
|
+
* @param args Create arguments plus exactly one of `amount` / `encryptedInput`.
|
|
263
|
+
* @returns The tx hash, the deployed instance and its compliance-manager clone.
|
|
264
|
+
* @throws {@link NonStockWrapperError} when `unwrappable` is set on a token that is not a stock wrapper.
|
|
265
|
+
* @throws {@link SaltCollisionError} when this `(mode, deployer, userSalt)` tuple already deployed an instance.
|
|
266
|
+
* @throws {@link MissingEncryptorError} when `amount` is given and no encryptor is resolvable.
|
|
212
267
|
*/
|
|
213
|
-
|
|
268
|
+
createAndFundEcdsaAirdrop(args: CreateAirdropArgs<EcdsaAirdropParams> & FundInput & WriteAccountOverride): Promise<CreateAirdropResult>;
|
|
214
269
|
/**
|
|
215
|
-
*
|
|
270
|
+
* Deploy a Merkle airdrop and seed its pool in the same transaction.
|
|
271
|
+
*
|
|
272
|
+
* Prerequisite: the funder must have approved this factory as an ERC-7984
|
|
273
|
+
* operator on the token (`token.setOperator(factoryAddress, deadline)`).
|
|
216
274
|
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
275
|
+
* **Silent-zero transfers.** An ERC-7984 transfer does not revert when the
|
|
276
|
+
* sender's encrypted balance is short; it moves an encrypted zero instead,
|
|
277
|
+
* because reverting would leak the balance. A successful receipt therefore
|
|
278
|
+
* does not prove the pool was funded.
|
|
219
279
|
*
|
|
220
|
-
*
|
|
280
|
+
* @param args Create arguments plus exactly one of `amount` / `encryptedInput`.
|
|
281
|
+
* @returns The tx hash, the deployed instance and its compliance-manager clone.
|
|
282
|
+
* @throws {@link MerkleUupsUnsupportedError} when `mode` is `"uups"`.
|
|
283
|
+
* @throws {@link NonStockWrapperError} when `unwrappable` is set on a token that is not a stock wrapper.
|
|
284
|
+
* @throws {@link SaltCollisionError} when this `(mode, deployer, userSalt)` tuple already deployed an instance.
|
|
285
|
+
* @throws {@link MissingEncryptorError} when `amount` is given and no encryptor is resolvable.
|
|
286
|
+
*/
|
|
287
|
+
createAndFundMerkleAirdrop(args: CreateAirdropArgs<MerkleAirdropParams> & FundInput & WriteAccountOverride): Promise<CreateAirdropResult>;
|
|
288
|
+
/**
|
|
289
|
+
* Top up the pool of an instance this factory already deployed.
|
|
221
290
|
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* transparent TTT test token uses 18 decimals.
|
|
291
|
+
* Funding always routes through the factory rather than the instance: the
|
|
292
|
+
* factory is what holds the operator approval, calls `FHE.fromExternal`, and
|
|
293
|
+
* grants the compliance-manager clone its ACL on the amount. Sending tokens
|
|
294
|
+
* to the instance directly leaves the pool unusable for compliance reads.
|
|
227
295
|
*
|
|
228
|
-
*
|
|
296
|
+
* **Silent-zero transfers.** A short encrypted balance moves an encrypted
|
|
297
|
+
* zero instead of reverting — the receipt cannot tell you value arrived.
|
|
298
|
+
*
|
|
299
|
+
* @param args The instance address plus exactly one of `amount` / `encryptedInput`.
|
|
300
|
+
* @returns The transaction hash.
|
|
301
|
+
* @throws {@link InvalidArgumentError} when `airdrop` was not created by this factory (`UnknownAirdrop`).
|
|
229
302
|
*/
|
|
230
|
-
|
|
303
|
+
fundAirdrop(args: {
|
|
304
|
+
airdrop: Address;
|
|
305
|
+
} & FundInput & WriteAccountOverride): Promise<Hex>;
|
|
231
306
|
/**
|
|
232
|
-
*
|
|
233
|
-
*
|
|
307
|
+
* Where an ECDSA `create*` from `deployer` with this `(mode, userSalt)` pair
|
|
308
|
+
* would land.
|
|
234
309
|
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* the receipt yourself, or call
|
|
239
|
-
* {@link ConfidentialAirdropFactoryClient.predictAirdropAddress} before mining.
|
|
310
|
+
* Prediction is a pure address oracle — it answers even for a deployer that
|
|
311
|
+
* is not currently allowed to deploy the requested `mode`, so a returned
|
|
312
|
+
* address is not evidence the create will succeed.
|
|
240
313
|
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
|
|
314
|
+
* @param args Prediction inputs; only `mode`, `deployer` and `userSalt` affect the result.
|
|
315
|
+
* @returns The CREATE2 address of the instance.
|
|
316
|
+
*/
|
|
317
|
+
predictEcdsaAirdropAddress(args: PredictArgs<EcdsaAirdropParams>): Promise<Address>;
|
|
318
|
+
/**
|
|
319
|
+
* Where a Merkle `create*` from `deployer` with this `(mode, userSalt)` pair
|
|
320
|
+
* would land.
|
|
244
321
|
*
|
|
245
|
-
* @
|
|
246
|
-
*
|
|
247
|
-
|
|
248
|
-
|
|
322
|
+
* @param args Prediction inputs; only `mode`, `deployer` and `userSalt` affect the result.
|
|
323
|
+
* @returns The CREATE2 address of the instance.
|
|
324
|
+
*/
|
|
325
|
+
predictMerkleAirdropAddress(args: PredictArgs<MerkleAirdropParams>): Promise<Address>;
|
|
326
|
+
/**
|
|
327
|
+
* Init-code hash of the ECDSA proxy the factory would deploy for `mode`.
|
|
328
|
+
*
|
|
329
|
+
* Read it once before a campaign build and again after: the hash tracks the
|
|
330
|
+
* factory's current implementation pointer, so a change between the two
|
|
331
|
+
* reads means an implementation swap landed mid-flight and any address you
|
|
332
|
+
* derived from the first read is stale.
|
|
333
|
+
*
|
|
334
|
+
* @param args The variant params (unused on-chain) and the deployment shell.
|
|
335
|
+
* @returns The `bytes32` init-code hash.
|
|
249
336
|
*/
|
|
250
|
-
|
|
337
|
+
getEcdsaInitCodeHash(args: InitCodeHashArgs<EcdsaAirdropParams>): Promise<Hex>;
|
|
251
338
|
/**
|
|
252
|
-
*
|
|
253
|
-
* from the `ConfidentialAirdropCreated` event in the receipt.
|
|
339
|
+
* Init-code hash of the Merkle proxy the factory would deploy for `mode`.
|
|
254
340
|
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
341
|
+
* @param args The variant params (unused on-chain) and the deployment shell.
|
|
342
|
+
* @returns The `bytes32` init-code hash.
|
|
343
|
+
*/
|
|
344
|
+
getMerkleInitCodeHash(args: InitCodeHashArgs<MerkleAirdropParams>): Promise<Hex>;
|
|
345
|
+
/** How many instances this factory has deployed. Also the upper bound for {@link airdropAt}. */
|
|
346
|
+
airdropCount(): Promise<bigint>;
|
|
347
|
+
/**
|
|
348
|
+
* @param index Zero-based position in deployment order.
|
|
349
|
+
* @returns The instance address.
|
|
350
|
+
* @throws {@link InvalidArgumentError} when `index >= airdropCount()` (`IndexOutOfBounds`).
|
|
351
|
+
*/
|
|
352
|
+
airdropAt(index: bigint): Promise<Address>;
|
|
353
|
+
/**
|
|
354
|
+
* Page through deployed instances in deployment order.
|
|
257
355
|
*
|
|
258
|
-
*
|
|
356
|
+
* The contract clamps to the tail rather than reverting, so an `offset` past
|
|
357
|
+
* the end returns an empty page — page until the result is short, not until
|
|
358
|
+
* it throws.
|
|
259
359
|
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
|
|
264
|
-
|
|
360
|
+
* @param offset Index to start at.
|
|
361
|
+
* @param limit Maximum entries to return.
|
|
362
|
+
* @returns The page, possibly shorter than `limit`.
|
|
363
|
+
*/
|
|
364
|
+
airdrops(offset: bigint, limit: bigint): Promise<readonly Address[]>;
|
|
365
|
+
/**
|
|
366
|
+
* The compliance-manager clone bound to an instance.
|
|
265
367
|
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* `parseEventLogs({ eventName: "ConfidentialAirdropCreated" })`.
|
|
368
|
+
* Doubles as a provenance check: the factory records this mapping only for
|
|
369
|
+
* instances it deployed, so a zero address means the instance is not ours.
|
|
269
370
|
*
|
|
270
|
-
* @
|
|
271
|
-
*
|
|
272
|
-
* params, userSalt, amount, encryptor,
|
|
273
|
-
* });
|
|
371
|
+
* @param airdrop Instance address.
|
|
372
|
+
* @returns The clone address, or the zero address when unknown to this factory.
|
|
274
373
|
*/
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
*
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/**
|
|
374
|
+
complianceManagerOf(airdrop: Address): Promise<Address>;
|
|
375
|
+
/**
|
|
376
|
+
* Redirect where accrued claim-fee ETH withdraws to. Requires
|
|
377
|
+
* `FEE_MANAGER_ROLE`.
|
|
378
|
+
*
|
|
379
|
+
* @throws {@link InvalidArgumentError} when `feeCollector` is the zero address (`ZeroFeeCollector`).
|
|
380
|
+
*/
|
|
381
|
+
setFeeCollector(feeCollector: Address, account?: Account | Address): Promise<Hex>;
|
|
382
|
+
/**
|
|
383
|
+
* Set the per-claim gas fee new instances default to when their creator has
|
|
384
|
+
* no {@link setCustomFee} override. Requires `FEE_MANAGER_ROLE`.
|
|
385
|
+
*
|
|
386
|
+
* @param gasFee Wei, fits `uint96` on-chain.
|
|
387
|
+
*/
|
|
388
|
+
setDefaultGasFee(gasFee: bigint, account?: Account | Address): Promise<Hex>;
|
|
389
|
+
/**
|
|
390
|
+
* Override the default gas fee for one creator. Requires `FEE_MANAGER_ROLE`.
|
|
391
|
+
*
|
|
392
|
+
* @param gasFee Wei, fits `uint96` on-chain.
|
|
393
|
+
*/
|
|
394
|
+
setCustomFee(creator: Address, gasFee: bigint, account?: Account | Address): Promise<Hex>;
|
|
395
|
+
/**
|
|
396
|
+
* Drop a creator's {@link setCustomFee} override, reverting them to
|
|
397
|
+
* {@link defaultGasFee}. Requires `FEE_MANAGER_ROLE`.
|
|
398
|
+
*/
|
|
399
|
+
disableCustomFee(creator: Address, account?: Account | Address): Promise<Hex>;
|
|
400
|
+
/** A creator's fee override, if any — `enabled: false` means {@link defaultGasFee} applies instead. */
|
|
401
|
+
getCustomFee(creator: Address): Promise<CustomFee>;
|
|
402
|
+
/** Current destination for accrued claim-fee ETH withdrawals. */
|
|
302
403
|
feeCollector(): Promise<Address>;
|
|
303
|
-
/** Per-
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
* @
|
|
311
|
-
*/
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
*
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
404
|
+
/** Per-claim gas fee new instances default to absent a {@link setCustomFee} override. */
|
|
405
|
+
defaultGasFee(): Promise<bigint>;
|
|
406
|
+
/**
|
|
407
|
+
* Point future `createEcdsaAirdrop*` calls at a new ECDSA implementation.
|
|
408
|
+
* Requires `IMPL_MANAGER_ROLE`. Does not affect already-deployed instances —
|
|
409
|
+
* clones point at the implementation live when they were created.
|
|
410
|
+
*
|
|
411
|
+
* @throws {@link InvalidArgumentError} when `implementation` is the zero address (`ZeroImplementation`).
|
|
412
|
+
*/
|
|
413
|
+
setEcdsaImplementation(implementation: Address, account?: Account | Address): Promise<Hex>;
|
|
414
|
+
/**
|
|
415
|
+
* Point future `createMerkleAirdrop*` calls at a new Merkle implementation.
|
|
416
|
+
* Requires `IMPL_MANAGER_ROLE`. Does not affect already-deployed instances.
|
|
417
|
+
*
|
|
418
|
+
* @throws {@link InvalidArgumentError} when `implementation` is the zero address (`ZeroImplementation`).
|
|
419
|
+
*/
|
|
420
|
+
setMerkleImplementation(implementation: Address, account?: Account | Address): Promise<Hex>;
|
|
421
|
+
/** The implementation address `createEcdsaAirdrop*` currently clones. */
|
|
422
|
+
ecdsaImplementation(): Promise<Address>;
|
|
423
|
+
/** The implementation address `createMerkleAirdrop*` currently clones. */
|
|
424
|
+
merkleImplementation(): Promise<Address>;
|
|
425
|
+
/**
|
|
426
|
+
* Point future compliance-manager clones at a new implementation. Requires
|
|
427
|
+
* `COMPLIANCE_WIRING_ROLE`. Does not affect already-deployed clones.
|
|
428
|
+
*
|
|
429
|
+
* @throws {@link InvalidArgumentError} when `implementation` is the zero address (`ZeroComplianceManagerImpl`).
|
|
430
|
+
*/
|
|
431
|
+
setComplianceManagerImpl(implementation: Address, account?: Account | Address): Promise<Hex>;
|
|
432
|
+
/**
|
|
433
|
+
* Set the platform-designated compliance delegate every compliance-manager
|
|
434
|
+
* clone wires in. Requires `COMPLIANCE_WIRING_ROLE`.
|
|
435
|
+
*
|
|
436
|
+
* **Ordering:** call this before {@link setDefaultDelegateToCompliance}`(true)`
|
|
437
|
+
* — the contracts' own deploy script does it in this order, and the reverse
|
|
438
|
+
* reverts `ZeroComplianceDelegate` (turning delegation on with no delegate
|
|
439
|
+
* set has nothing to delegate to).
|
|
440
|
+
*
|
|
441
|
+
* @throws {@link InvalidArgumentError} when `delegate` is the zero address (`ZeroComplianceDelegate`).
|
|
442
|
+
*/
|
|
443
|
+
setComplianceDelegate(delegate: Address, account?: Account | Address): Promise<Hex>;
|
|
444
|
+
/**
|
|
445
|
+
* Set whether new instances default to delegating compliance disclosure to
|
|
446
|
+
* {@link complianceDelegate}. Requires `COMPLIANCE_WIRING_ROLE`.
|
|
447
|
+
*
|
|
448
|
+
* **Ordering:** call {@link setComplianceDelegate} first when turning this
|
|
449
|
+
* on — passing `true` while no delegate is set reverts `ZeroComplianceDelegate`.
|
|
450
|
+
*
|
|
451
|
+
* @throws {@link InvalidArgumentError} when `on` is `true` and no delegate is set yet (`ZeroComplianceDelegate`).
|
|
452
|
+
*/
|
|
453
|
+
setDefaultDelegateToCompliance(on: boolean, account?: Account | Address): Promise<Hex>;
|
|
454
|
+
/**
|
|
455
|
+
* Override the default delegate-to-compliance policy for one creator.
|
|
456
|
+
* Requires `COMPLIANCE_WIRING_ROLE`.
|
|
457
|
+
*/
|
|
458
|
+
setCompliancePolicy(creator: Address, delegateToCompliance: boolean, account?: Account | Address): Promise<Hex>;
|
|
459
|
+
/**
|
|
460
|
+
* Drop a creator's {@link setCompliancePolicy} override, reverting them to
|
|
461
|
+
* the factory's default. Requires `COMPLIANCE_WIRING_ROLE`.
|
|
462
|
+
*/
|
|
463
|
+
clearCompliancePolicy(creator: Address, account?: Account | Address): Promise<Hex>;
|
|
464
|
+
/** The compliance-manager implementation new clones currently point at. */
|
|
465
|
+
complianceManagerImpl(): Promise<Address>;
|
|
466
|
+
/** The platform-designated compliance delegate wired into new compliance-manager clones. */
|
|
467
|
+
complianceDelegate(): Promise<Address>;
|
|
468
|
+
/** A creator's delegate-to-compliance override, if any — `overridden: false` means the factory default applies instead. */
|
|
469
|
+
getCompliancePolicy(creator: Address): Promise<CompliancePolicy>;
|
|
470
|
+
/**
|
|
471
|
+
* The delegate-to-compliance policy that actually applies to `creator` —
|
|
472
|
+
* their override if `getCompliancePolicy(creator).overridden`, else the
|
|
473
|
+
* factory default. Prefer this over composing the two reads yourself.
|
|
474
|
+
*/
|
|
475
|
+
effectiveDelegateToCompliance(creator: Address): Promise<boolean>;
|
|
476
|
+
/**
|
|
477
|
+
* Set whether new instances default to permitting `mode: "uups"`. Requires
|
|
478
|
+
* `UPGRADE_MANAGER_ROLE`.
|
|
479
|
+
*/
|
|
480
|
+
setDefaultUpgradeable(allowed: boolean, account?: Account | Address): Promise<Hex>;
|
|
481
|
+
/**
|
|
482
|
+
* Override the default upgradeability policy for one creator. Requires
|
|
483
|
+
* `UPGRADE_MANAGER_ROLE`.
|
|
484
|
+
*/
|
|
485
|
+
setUpgradeabilityPolicy(creator: Address, allowed: boolean, account?: Account | Address): Promise<Hex>;
|
|
486
|
+
/**
|
|
487
|
+
* Drop a creator's {@link setUpgradeabilityPolicy} override, reverting them
|
|
488
|
+
* to the factory default. Requires `UPGRADE_MANAGER_ROLE`.
|
|
489
|
+
*/
|
|
490
|
+
clearUpgradeabilityPolicy(creator: Address, account?: Account | Address): Promise<Hex>;
|
|
491
|
+
/** Whether new instances default to permitting `mode: "uups"` absent a per-creator override. */
|
|
492
|
+
defaultUpgradeable(): Promise<boolean>;
|
|
493
|
+
/** A creator's upgradeability override, if any — `overridden: false` means {@link defaultUpgradeable} applies instead. */
|
|
494
|
+
getUpgradeabilityPolicy(creator: Address): Promise<UpgradeabilityPolicy>;
|
|
495
|
+
/**
|
|
496
|
+
* The upgradeability policy that actually applies to `creator` — this is a
|
|
497
|
+
* plain read of the same value `createEcdsaAirdrop`/`createMerkleAirdrop`
|
|
498
|
+
* consult when validating `mode: "uups"`. This getter does not itself block
|
|
499
|
+
* a create; `preflightCreate` (`./guards.js`) is what reads it and reports
|
|
500
|
+
* an {@link UpgradeabilityNotAllowedError} before the transaction is sent.
|
|
501
|
+
*/
|
|
502
|
+
effectiveUpgradeable(creator: Address): Promise<boolean>;
|
|
503
|
+
/** `bytes32` identifier for the role gating {@link setFeeCollector}, {@link setDefaultGasFee}, {@link setCustomFee} and {@link disableCustomFee}. */
|
|
504
|
+
FEE_MANAGER_ROLE(): Promise<Hex>;
|
|
505
|
+
/** `bytes32` identifier for the role gating {@link setEcdsaImplementation} and {@link setMerkleImplementation}. */
|
|
506
|
+
IMPL_MANAGER_ROLE(): Promise<Hex>;
|
|
507
|
+
/** `bytes32` identifier for the role gating the compliance admin methods. */
|
|
508
|
+
COMPLIANCE_WIRING_ROLE(): Promise<Hex>;
|
|
509
|
+
/** `bytes32` identifier for the role gating the upgradeability admin methods. */
|
|
510
|
+
UPGRADE_MANAGER_ROLE(): Promise<Hex>;
|
|
511
|
+
/**
|
|
512
|
+
* OpenZeppelin's root role (`bytes32(0)`), read from the factory rather than
|
|
513
|
+
* hard-coded. It administers all four roles above.
|
|
514
|
+
*/
|
|
515
|
+
DEFAULT_ADMIN_ROLE(): Promise<Hex>;
|
|
516
|
+
/**
|
|
517
|
+
* Whether `holder` holds `role`.
|
|
518
|
+
*
|
|
519
|
+
* The role subject is called `holder`, not `account`: on the writes below
|
|
520
|
+
* `account` already means "who sends this transaction", and one key cannot
|
|
521
|
+
* be both - an admin granting a role to somebody else is the normal case.
|
|
522
|
+
*
|
|
523
|
+
* @param args.role A `bytes32` from one of the role getters above - not a hand-hashed string.
|
|
524
|
+
*/
|
|
525
|
+
hasRole(args: {
|
|
526
|
+
role: Hex;
|
|
527
|
+
holder: Address;
|
|
528
|
+
}): Promise<boolean>;
|
|
529
|
+
/** The role whose holders may {@link grantRole} and {@link revokeRole} `role` - `DEFAULT_ADMIN_ROLE` for all five factory roles. */
|
|
530
|
+
getRoleAdmin(role: Hex): Promise<Hex>;
|
|
531
|
+
/** How many accounts hold `role`. */
|
|
532
|
+
getRoleMemberCount(role: Hex): Promise<bigint>;
|
|
533
|
+
/**
|
|
534
|
+
* The `index`-th holder of `role`, in `EnumerableSet` order - which is not
|
|
535
|
+
* stable across grants and revokes. Prefer {@link getRoleMembers} unless you
|
|
536
|
+
* genuinely want one entry.
|
|
537
|
+
*/
|
|
538
|
+
getRoleMember(args: {
|
|
539
|
+
role: Hex;
|
|
540
|
+
index: bigint;
|
|
541
|
+
}): Promise<Address>;
|
|
542
|
+
/**
|
|
543
|
+
* Every account currently holding `role`.
|
|
544
|
+
*
|
|
545
|
+
* Run it over the five role getters to check
|
|
546
|
+
* {@link FACTORY_ROLE_CONCENTRATION_NOTE} against the chain you are actually
|
|
547
|
+
* pointed at, rather than taking the note's word for it.
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
* const roles = await Promise.all([
|
|
551
|
+
* factory.DEFAULT_ADMIN_ROLE(),
|
|
552
|
+
* factory.FEE_MANAGER_ROLE(),
|
|
553
|
+
* factory.IMPL_MANAGER_ROLE(),
|
|
554
|
+
* factory.COMPLIANCE_WIRING_ROLE(),
|
|
555
|
+
* factory.UPGRADE_MANAGER_ROLE(),
|
|
556
|
+
* ]);
|
|
557
|
+
* const holders = await Promise.all(roles.map((role) => factory.getRoleMembers(role)));
|
|
558
|
+
* const concentrated = new Set(holders.flat().map((a) => a.toLowerCase())).size === 1;
|
|
559
|
+
*/
|
|
560
|
+
getRoleMembers(role: Hex): Promise<readonly Address[]>;
|
|
561
|
+
/**
|
|
562
|
+
* Grant `role` to `holder`. Requires the role's admin role
|
|
563
|
+
* ({@link getRoleAdmin}).
|
|
564
|
+
*
|
|
565
|
+
* @returns The transaction hash.
|
|
566
|
+
*/
|
|
567
|
+
grantRole(args: {
|
|
568
|
+
role: Hex;
|
|
569
|
+
holder: Address;
|
|
570
|
+
} & WriteAccountOverride): Promise<Hex>;
|
|
571
|
+
/**
|
|
572
|
+
* Revoke `role` from `holder`. Requires the role's admin role.
|
|
573
|
+
*
|
|
574
|
+
* Unlike an airdrop instance, the factory declares no "never empty" floor:
|
|
575
|
+
* revoking the last `DEFAULT_ADMIN_ROLE` member succeeds, and what it
|
|
576
|
+
* freezes is **role administration**, permanently. `DEFAULT_ADMIN_ROLE`
|
|
577
|
+
* administers all four operational roles and itself, so with the set empty
|
|
578
|
+
* no role can ever be granted or revoked again - including putting an admin
|
|
579
|
+
* back. The four operational roles keep working for whoever already holds
|
|
580
|
+
* them: a `FEE_MANAGER_ROLE` holder can still call {@link setDefaultGasFee},
|
|
581
|
+
* an `IMPL_MANAGER_ROLE` holder can still rotate an implementation. The
|
|
582
|
+
* factory therefore keeps running with exactly the role holders it had at
|
|
583
|
+
* that moment, with no way to rotate or remove them. Grant the successor
|
|
584
|
+
* first.
|
|
585
|
+
*
|
|
586
|
+
* @returns The transaction hash.
|
|
587
|
+
*/
|
|
588
|
+
revokeRole(args: {
|
|
589
|
+
role: Hex;
|
|
590
|
+
holder: Address;
|
|
591
|
+
} & WriteAccountOverride): Promise<Hex>;
|
|
592
|
+
/**
|
|
593
|
+
* Give up `role` yourself.
|
|
594
|
+
*
|
|
595
|
+
* The contract's signature is `renounceRole(role, callerConfirmation)` and
|
|
596
|
+
* it reverts `AccessControlBadConfirmation` unless `callerConfirmation` is
|
|
597
|
+
* the sender, so this method takes no holder and fills the confirmation from
|
|
598
|
+
* the resolved sending account. Renouncing for somebody else is not a call
|
|
599
|
+
* that can succeed; use {@link revokeRole} to remove another account's role.
|
|
600
|
+
*
|
|
601
|
+
* The same frozen-role-administration warning as {@link revokeRole} applies,
|
|
602
|
+
* and more sharply - a sole admin renouncing `DEFAULT_ADMIN_ROLE` is not
|
|
603
|
+
* blocked here the way it is on an instance. Read that warning for what
|
|
604
|
+
* actually stops working: role grants and revokes, permanently; not the
|
|
605
|
+
* operational setters, which keep answering to whoever already holds the
|
|
606
|
+
* role that gates them.
|
|
607
|
+
*
|
|
608
|
+
* @returns The transaction hash.
|
|
609
|
+
*/
|
|
610
|
+
renounceRole(args: {
|
|
611
|
+
role: Hex;
|
|
612
|
+
} & WriteAccountOverride): Promise<Hex>;
|
|
356
613
|
}
|
|
357
614
|
/**
|
|
358
615
|
* Create a {@link ConfidentialAirdropFactoryClient}. Mirrors viem's `create*` convention.
|
|
359
616
|
*
|
|
360
617
|
* @example
|
|
361
618
|
* const factory = createConfidentialAirdropFactoryClient({ publicClient, walletClient, encryptor });
|
|
619
|
+
*
|
|
620
|
+
* @alpha
|
|
362
621
|
*/
|
|
363
622
|
export declare function createConfidentialAirdropFactoryClient(config: ConfidentialAirdropFactoryClientConfig): ConfidentialAirdropFactoryClient;
|
|
364
623
|
export {};
|