@tokenops/sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +207 -0
- package/CONTRIBUTING.md +113 -0
- package/LICENSE +32 -0
- package/README.md +677 -0
- package/SECURITY.md +59 -0
- package/dist/chunk-52TC6BF7.js +2755 -0
- package/dist/chunk-56UI7LUR.cjs +516 -0
- package/dist/chunk-5SA2HF2W.cjs +1635 -0
- package/dist/chunk-5SGMJADP.cjs +139 -0
- package/dist/chunk-62DF53UQ.cjs +749 -0
- package/dist/chunk-66IHPTOK.cjs +20 -0
- package/dist/chunk-6ECAHP5O.cjs +1496 -0
- package/dist/chunk-72YGZEQE.js +742 -0
- package/dist/chunk-7VELUOMI.js +35 -0
- package/dist/chunk-BE2AIZ3K.js +23 -0
- package/dist/chunk-CMRETRZO.js +46 -0
- package/dist/chunk-COPFW5Z4.js +82 -0
- package/dist/chunk-CQIPRNS7.cjs +25 -0
- package/dist/chunk-ECT3NL2L.js +124 -0
- package/dist/chunk-FWHYQZ5E.cjs +37 -0
- package/dist/chunk-FYQ2UW4T.js +37 -0
- package/dist/chunk-HGXNRR25.js +105 -0
- package/dist/chunk-HTOMTEA3.cjs +3406 -0
- package/dist/chunk-ITQ7WKVC.cjs +101 -0
- package/dist/chunk-IVE3QEGD.js +478 -0
- package/dist/chunk-JFLEEXKP.js +325 -0
- package/dist/chunk-JFR5J4FL.cjs +128 -0
- package/dist/chunk-K6MFFDBJ.cjs +109 -0
- package/dist/chunk-KWFFIJYX.js +11 -0
- package/dist/chunk-NS44KBV5.cjs +89 -0
- package/dist/chunk-OLDGMKW2.cjs +93 -0
- package/dist/chunk-Q2GP5UDC.js +29 -0
- package/dist/chunk-Q7ARQSUH.cjs +42 -0
- package/dist/chunk-QCA7O2Q5.cjs +49 -0
- package/dist/chunk-QIHZVLIK.js +3388 -0
- package/dist/chunk-SUOG3BQS.cjs +2772 -0
- package/dist/chunk-T5LVV3KY.cjs +44 -0
- package/dist/chunk-UOG4PJL5.js +1488 -0
- package/dist/chunk-VDXVNZCO.cjs +329 -0
- package/dist/chunk-VJKZWYYJ.cjs +32 -0
- package/dist/chunk-WRCUDSUJ.js +96 -0
- package/dist/chunk-XSNLAS5M.js +135 -0
- package/dist/chunk-XXXDQSHE.js +1628 -0
- package/dist/chunk-ZHFLRKFY.js +41 -0
- package/dist/chunk-ZXCOJY2Z.js +87 -0
- package/dist/core/addresses.d.ts +59 -0
- package/dist/core/brands.d.ts +87 -0
- package/dist/core/chains.d.ts +102 -0
- package/dist/core/errors.d.ts +687 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/normalise.d.ts +27 -0
- package/dist/core/preflight.d.ts +25 -0
- package/dist/core/revert-mapper.d.ts +74 -0
- package/dist/core/telemetry.d.ts +50 -0
- package/dist/core/types.d.ts +10 -0
- package/dist/core/version.d.ts +15 -0
- package/dist/core/zama-error-mapper.d.ts +27 -0
- package/dist/fhe/acl.d.ts +73 -0
- package/dist/fhe/erc7984-abi.d.ts +53 -0
- package/dist/fhe/index.cjs +599 -0
- package/dist/fhe/index.d.cts +11 -0
- package/dist/fhe/index.d.ts +11 -0
- package/dist/fhe/index.js +394 -0
- package/dist/fhe/mock-encryptor.d.ts +90 -0
- package/dist/fhe/mock-erc7984.d.ts +134 -0
- package/dist/fhe/operators.d.ts +190 -0
- package/dist/fhe/react/index.cjs +102 -0
- package/dist/fhe/react/index.d.cts +10 -0
- package/dist/fhe/react/index.d.ts +10 -0
- package/dist/fhe/react/index.js +85 -0
- package/dist/fhe/react/use-decrypted-handle.d.ts +102 -0
- package/dist/fhe/scale-ratio.d.ts +168 -0
- package/dist/fhe/sepolia-encryptor-web.d.ts +101 -0
- package/dist/fhe/sepolia-encryptor.d.ts +132 -0
- package/dist/fhe/types.d.ts +62 -0
- package/dist/fhe-airdrop/abis/cloneable.d.ts +781 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +714 -0
- package/dist/fhe-airdrop/abis/index.d.ts +2 -0
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +53 -0
- package/dist/fhe-airdrop/advanced/index.cjs +21 -0
- package/dist/fhe-airdrop/advanced/index.d.cts +13 -0
- package/dist/fhe-airdrop/advanced/index.d.ts +13 -0
- package/dist/fhe-airdrop/advanced/index.js +8 -0
- package/dist/fhe-airdrop/advanced/react/index.cjs +61 -0
- package/dist/fhe-airdrop/advanced/react/index.d.cts +5 -0
- package/dist/fhe-airdrop/advanced/react/index.d.ts +5 -0
- package/dist/fhe-airdrop/advanced/react/index.js +59 -0
- package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +49 -0
- package/dist/fhe-airdrop/airdrop.d.ts +308 -0
- package/dist/fhe-airdrop/encryption.d.ts +109 -0
- package/dist/fhe-airdrop/errors.d.ts +60 -0
- package/dist/fhe-airdrop/factory.d.ts +281 -0
- package/dist/fhe-airdrop/index.cjs +227 -0
- package/dist/fhe-airdrop/index.d.cts +10 -0
- package/dist/fhe-airdrop/index.d.ts +10 -0
- package/dist/fhe-airdrop/index.js +10 -0
- package/dist/fhe-airdrop/react/_shared.d.ts +107 -0
- package/dist/fhe-airdrop/react/index.cjs +638 -0
- package/dist/fhe-airdrop/react/index.d.cts +90 -0
- package/dist/fhe-airdrop/react/index.d.ts +90 -0
- package/dist/fhe-airdrop/react/index.js +430 -0
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +31 -0
- package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +7 -0
- package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +25 -0
- package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +16 -0
- package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +6 -0
- package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +8 -0
- package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +11 -0
- package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +16 -0
- package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +11 -0
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +16 -0
- package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +7 -0
- package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +7 -0
- package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +14 -0
- package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +9 -0
- package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +8 -0
- package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +22 -0
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +50 -0
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +10 -0
- package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -0
- package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +15 -0
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +14 -0
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +14 -0
- package/dist/fhe-airdrop/react/useClaim.d.ts +29 -0
- package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +11 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +33 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +40 -0
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +29 -0
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +31 -0
- package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +14 -0
- package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +16 -0
- package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +11 -0
- package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +17 -0
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +25 -0
- package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +30 -0
- package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +16 -0
- package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +15 -0
- package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +14 -0
- package/dist/fhe-airdrop/react/useSetPaused.d.ts +14 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +31 -0
- package/dist/fhe-airdrop/react/useWithdraw.d.ts +12 -0
- package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +13 -0
- package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +13 -0
- package/dist/fhe-airdrop/types.d.ts +21 -0
- package/dist/fhe-disperse/abis/index.d.ts +2 -0
- package/dist/fhe-disperse/abis/singleton.d.ts +1297 -0
- package/dist/fhe-disperse/abis/wallet.d.ts +111 -0
- package/dist/fhe-disperse/encryption.d.ts +77 -0
- package/dist/fhe-disperse/errors.d.ts +39 -0
- package/dist/fhe-disperse/index.cjs +248 -0
- package/dist/fhe-disperse/index.d.cts +14 -0
- package/dist/fhe-disperse/index.d.ts +14 -0
- package/dist/fhe-disperse/index.js +11 -0
- package/dist/fhe-disperse/react/_shared.d.ts +104 -0
- package/dist/fhe-disperse/react/index.cjs +752 -0
- package/dist/fhe-disperse/react/index.d.cts +82 -0
- package/dist/fhe-disperse/react/index.d.ts +82 -0
- package/dist/fhe-disperse/react/index.js +522 -0
- package/dist/fhe-disperse/react/useAccessEncryptedFeeReserve.d.ts +35 -0
- package/dist/fhe-disperse/react/useApproveTokenOnWallets.d.ts +25 -0
- package/dist/fhe-disperse/react/useBatchDiscloseHandlesToParty.d.ts +16 -0
- package/dist/fhe-disperse/react/useCalculateFee.d.ts +26 -0
- package/dist/fhe-disperse/react/useDeploymentBlockNumber.d.ts +11 -0
- package/dist/fhe-disperse/react/useDisableCustomFee.d.ts +20 -0
- package/dist/fhe-disperse/react/useDiscloseHandleToParty.d.ts +20 -0
- package/dist/fhe-disperse/react/useDisperse.d.ts +28 -0
- package/dist/fhe-disperse/react/useGetBatchLimits.d.ts +12 -0
- package/dist/fhe-disperse/react/useGetFeeConfig.d.ts +15 -0
- package/dist/fhe-disperse/react/useGetFees.d.ts +19 -0
- package/dist/fhe-disperse/react/useGetWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/useGrantRole.d.ts +24 -0
- package/dist/fhe-disperse/react/useHasApprovedSubwallets.d.ts +25 -0
- package/dist/fhe-disperse/react/useHasRole.d.ts +22 -0
- package/dist/fhe-disperse/react/useIsPaused.d.ts +11 -0
- package/dist/fhe-disperse/react/useIsRegistered.d.ts +15 -0
- package/dist/fhe-disperse/react/usePause.d.ts +18 -0
- package/dist/fhe-disperse/react/usePredictWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/usePreflightDisperse.d.ts +37 -0
- package/dist/fhe-disperse/react/useRecoverERC20FromWallets.d.ts +21 -0
- package/dist/fhe-disperse/react/useRecoverFromWallets.d.ts +21 -0
- package/dist/fhe-disperse/react/useRegister.d.ts +40 -0
- package/dist/fhe-disperse/react/useRescueConfidentialTokens.d.ts +21 -0
- package/dist/fhe-disperse/react/useRescueERC20.d.ts +21 -0
- package/dist/fhe-disperse/react/useRevokeRole.d.ts +24 -0
- package/dist/fhe-disperse/react/useRevokeTokenOnWallets.d.ts +24 -0
- package/dist/fhe-disperse/react/useSetCustomFee.d.ts +24 -0
- package/dist/fhe-disperse/react/useSetFeeConfig.d.ts +23 -0
- package/dist/fhe-disperse/react/useSetMaxBatchSizeDirect.d.ts +20 -0
- package/dist/fhe-disperse/react/useSetMaxBatchSizeHolding.d.ts +20 -0
- package/dist/fhe-disperse/react/useSetMaxBatchSizeTokenFee.d.ts +20 -0
- package/dist/fhe-disperse/react/useSingletonBatchDiscloseHandlesToParty.d.ts +13 -0
- package/dist/fhe-disperse/react/useSingletonBatchLimits.d.ts +12 -0
- package/dist/fhe-disperse/react/useSingletonCalculateFee.d.ts +26 -0
- package/dist/fhe-disperse/react/useSingletonDeploymentBlockNumber.d.ts +11 -0
- package/dist/fhe-disperse/react/useSingletonDisableCustomFee.d.ts +21 -0
- package/dist/fhe-disperse/react/useSingletonDiscloseHandleToParty.d.ts +17 -0
- package/dist/fhe-disperse/react/useSingletonFees.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonGrantRole.d.ts +26 -0
- package/dist/fhe-disperse/react/useSingletonHasApprovedSubwallets.d.ts +25 -0
- package/dist/fhe-disperse/react/useSingletonHasRole.d.ts +23 -0
- package/dist/fhe-disperse/react/useSingletonIsPaused.d.ts +11 -0
- package/dist/fhe-disperse/react/useSingletonIsRegistered.d.ts +15 -0
- package/dist/fhe-disperse/react/useSingletonPause.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonPredictWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonRevokeRole.d.ts +26 -0
- package/dist/fhe-disperse/react/useSingletonSetCustomFee.d.ts +25 -0
- package/dist/fhe-disperse/react/useSingletonUnpause.d.ts +18 -0
- package/dist/fhe-disperse/react/useSingletonWalletImplementation.d.ts +12 -0
- package/dist/fhe-disperse/react/useSingletonWallets.d.ts +19 -0
- package/dist/fhe-disperse/react/useSingletonWithdrawGasFee.d.ts +21 -0
- package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +50 -0
- package/dist/fhe-disperse/react/useUnpause.d.ts +17 -0
- package/dist/fhe-disperse/react/useWalletImplementation.d.ts +12 -0
- package/dist/fhe-disperse/react/useWithdrawGasFee.d.ts +26 -0
- package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +70 -0
- package/dist/fhe-disperse/singleton.d.ts +442 -0
- package/dist/fhe-disperse/subtotals.d.ts +14 -0
- package/dist/fhe-disperse/types.d.ts +332 -0
- package/dist/fhe-disperse/validate.d.ts +78 -0
- package/dist/fhe-vesting/abis/factory.d.ts +676 -0
- package/dist/fhe-vesting/abis/index.d.ts +3 -0
- package/dist/fhe-vesting/abis/manager.d.ts +1797 -0
- package/dist/fhe-vesting/advanced/factory-advanced.d.ts +52 -0
- package/dist/fhe-vesting/advanced/index.cjs +21 -0
- package/dist/fhe-vesting/advanced/index.d.cts +12 -0
- package/dist/fhe-vesting/advanced/index.d.ts +12 -0
- package/dist/fhe-vesting/advanced/index.js +8 -0
- package/dist/fhe-vesting/advanced/react/index.cjs +75 -0
- package/dist/fhe-vesting/advanced/react/index.d.cts +5 -0
- package/dist/fhe-vesting/advanced/react/index.d.ts +5 -0
- package/dist/fhe-vesting/advanced/react/index.js +73 -0
- package/dist/fhe-vesting/advanced/react/usePredictManagerAddress.d.ts +41 -0
- package/dist/fhe-vesting/encryption.d.ts +104 -0
- package/dist/fhe-vesting/errors.d.ts +183 -0
- package/dist/fhe-vesting/factory.d.ts +207 -0
- package/dist/fhe-vesting/index.cjs +269 -0
- package/dist/fhe-vesting/index.d.cts +9 -0
- package/dist/fhe-vesting/index.d.ts +9 -0
- package/dist/fhe-vesting/index.js +12 -0
- package/dist/fhe-vesting/manager.d.ts +808 -0
- package/dist/fhe-vesting/react/_shared.d.ts +122 -0
- package/dist/fhe-vesting/react/index.cjs +1054 -0
- package/dist/fhe-vesting/react/index.d.cts +123 -0
- package/dist/fhe-vesting/react/index.d.ts +123 -0
- package/dist/fhe-vesting/react/index.js +771 -0
- package/dist/fhe-vesting/react/useAcceptVestingTransfer.d.ts +12 -0
- package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +14 -0
- package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +15 -0
- package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +14 -0
- package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +26 -0
- package/dist/fhe-vesting/react/useAdminBatchDiscloseToParty.d.ts +16 -0
- package/dist/fhe-vesting/react/useAdminClaim.d.ts +9 -0
- package/dist/fhe-vesting/react/useAdminDiscloseToParty.d.ts +8 -0
- package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetTokenBalance.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +13 -0
- package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +15 -0
- package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +8 -0
- package/dist/fhe-vesting/react/useAllRecipients.d.ts +8 -0
- package/dist/fhe-vesting/react/useAllRecipientsLength.d.ts +6 -0
- package/dist/fhe-vesting/react/useAllRecipientsSliced.d.ts +13 -0
- package/dist/fhe-vesting/react/useBatchCreateVesting.d.ts +24 -0
- package/dist/fhe-vesting/react/useBatchDiscloseHandlesToParty.d.ts +13 -0
- package/dist/fhe-vesting/react/useBatchDiscloseToParty.d.ts +18 -0
- package/dist/fhe-vesting/react/useBatchRevokeVesting.d.ts +12 -0
- package/dist/fhe-vesting/react/useCancelVestingTransfer.d.ts +12 -0
- package/dist/fhe-vesting/react/useClaim.d.ts +19 -0
- package/dist/fhe-vesting/react/useConfidentialVestingFactoryImplementation.d.ts +11 -0
- package/dist/fhe-vesting/react/useCreateManager.d.ts +32 -0
- package/dist/fhe-vesting/react/useCreateManagerAndGetAddress.d.ts +31 -0
- package/dist/fhe-vesting/react/useCreateVesting.d.ts +38 -0
- package/dist/fhe-vesting/react/useDirectVestingTransfer.d.ts +13 -0
- package/dist/fhe-vesting/react/useDisableCustomFee.d.ts +14 -0
- package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +14 -0
- package/dist/fhe-vesting/react/useDiscloseToParty.d.ts +14 -0
- package/dist/fhe-vesting/react/useFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-vesting/react/useFactoryDefaultFeeType.d.ts +11 -0
- package/dist/fhe-vesting/react/useFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useFactoryDefaultTokenFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useFactoryFeeCollector.d.ts +10 -0
- package/dist/fhe-vesting/react/useFactoryInitCodeHash.d.ts +18 -0
- package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +13 -0
- package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +14 -0
- package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +13 -0
- package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +25 -0
- package/dist/fhe-vesting/react/useGrantRole.d.ts +15 -0
- package/dist/fhe-vesting/react/useHasRole.d.ts +14 -0
- package/dist/fhe-vesting/react/useInitiateVestingTransfer.d.ts +12 -0
- package/dist/fhe-vesting/react/useIsRecipient.d.ts +10 -0
- package/dist/fhe-vesting/react/useManagerBatchDiscloseHandlesToParty.d.ts +15 -0
- package/dist/fhe-vesting/react/useManagerDeploymentBlockNumber.d.ts +7 -0
- package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +16 -0
- package/dist/fhe-vesting/react/useManagerFactoryCustomFee.d.ts +17 -0
- package/dist/fhe-vesting/react/useManagerFactoryDefaultGasFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useManagerFactoryDisableCustomFee.d.ts +15 -0
- package/dist/fhe-vesting/react/useManagerFactoryFeeCollector.d.ts +10 -0
- package/dist/fhe-vesting/react/useManagerFactoryInitCodeHash.d.ts +18 -0
- package/dist/fhe-vesting/react/useManagerFactorySetCustomFee.d.ts +19 -0
- package/dist/fhe-vesting/react/useManagerFactorySetDefaultGasFee.d.ts +13 -0
- package/dist/fhe-vesting/react/useManagerFactorySetFeeCollector.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerFee.d.ts +7 -0
- package/dist/fhe-vesting/react/useManagerFeeInfo.d.ts +18 -0
- package/dist/fhe-vesting/react/useManagerFeeType.d.ts +7 -0
- package/dist/fhe-vesting/react/useManagerGrantRole.d.ts +17 -0
- package/dist/fhe-vesting/react/useManagerHasRole.d.ts +15 -0
- package/dist/fhe-vesting/react/useManagerIsPausable.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerIsSplitEnabled.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerMaxBatchSize.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerMaxRevokeBatchSize.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerPause.d.ts +13 -0
- package/dist/fhe-vesting/react/useManagerPaused.d.ts +6 -0
- package/dist/fhe-vesting/react/useManagerRevokeRole.d.ts +17 -0
- package/dist/fhe-vesting/react/useManagerToken.d.ts +11 -0
- package/dist/fhe-vesting/react/useManagerUnpause.d.ts +12 -0
- package/dist/fhe-vesting/react/useManagerWithdrawGasFee.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerWithdrawOtherConfidentialToken.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerWithdrawOtherToken.d.ts +14 -0
- package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +11 -0
- package/dist/fhe-vesting/react/usePartialClaim.d.ts +15 -0
- package/dist/fhe-vesting/react/usePause.d.ts +12 -0
- package/dist/fhe-vesting/react/usePendingVestingTransfer.d.ts +20 -0
- package/dist/fhe-vesting/react/useRecipientVestings.d.ts +11 -0
- package/dist/fhe-vesting/react/useRecipientVestingsLength.d.ts +10 -0
- package/dist/fhe-vesting/react/useRecipientVestingsSliced.d.ts +12 -0
- package/dist/fhe-vesting/react/useRenounceRole.d.ts +16 -0
- package/dist/fhe-vesting/react/useResetGasFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useResetTokenFee.d.ts +10 -0
- package/dist/fhe-vesting/react/useRevokeRole.d.ts +15 -0
- package/dist/fhe-vesting/react/useRevokeVesting.d.ts +15 -0
- package/dist/fhe-vesting/react/useRoleConstants.d.ts +19 -0
- package/dist/fhe-vesting/react/useSetCustomFee.d.ts +18 -0
- package/dist/fhe-vesting/react/useSetDefaultFeeType.d.ts +14 -0
- package/dist/fhe-vesting/react/useSetDefaultGasFee.d.ts +12 -0
- package/dist/fhe-vesting/react/useSetDefaultTokenFee.d.ts +13 -0
- package/dist/fhe-vesting/react/useSetFeeCollector.d.ts +13 -0
- package/dist/fhe-vesting/react/useSetMaxBatchSize.d.ts +12 -0
- package/dist/fhe-vesting/react/useSetMaxRevokeBatchSize.d.ts +12 -0
- package/dist/fhe-vesting/react/useSplitVesting.d.ts +28 -0
- package/dist/fhe-vesting/react/useTransferFeeCollectorRole.d.ts +12 -0
- package/dist/fhe-vesting/react/useUnpause.d.ts +11 -0
- package/dist/fhe-vesting/react/useVestingClaim.d.ts +19 -0
- package/dist/fhe-vesting/react/useVestingInfo.d.ts +25 -0
- package/dist/fhe-vesting/react/useWithdrawAdmin.d.ts +17 -0
- package/dist/fhe-vesting/react/useWithdrawGasFee.d.ts +13 -0
- package/dist/fhe-vesting/react/useWithdrawOtherConfidentialToken.d.ts +13 -0
- package/dist/fhe-vesting/react/useWithdrawOtherToken.d.ts +13 -0
- package/dist/fhe-vesting/react/useWithdrawTokenFee.d.ts +18 -0
- package/dist/fhe-vesting/types.d.ts +72 -0
- package/dist/index.cjs +237 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14 -0
- package/dist/telemetry/console.d.ts +29 -0
- package/dist/telemetry/index.cjs +113 -0
- package/dist/telemetry/index.d.cts +3 -0
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.js +102 -0
- package/dist/telemetry/tokenops.d.ts +15 -0
- package/package.json +316 -0
|
@@ -0,0 +1,3406 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkNS44KBV5_cjs = require('./chunk-NS44KBV5.cjs');
|
|
4
|
+
var chunkQ7ARQSUH_cjs = require('./chunk-Q7ARQSUH.cjs');
|
|
5
|
+
var chunkVDXVNZCO_cjs = require('./chunk-VDXVNZCO.cjs');
|
|
6
|
+
var chunkOLDGMKW2_cjs = require('./chunk-OLDGMKW2.cjs');
|
|
7
|
+
var chunkCQIPRNS7_cjs = require('./chunk-CQIPRNS7.cjs');
|
|
8
|
+
var chunkVJKZWYYJ_cjs = require('./chunk-VJKZWYYJ.cjs');
|
|
9
|
+
var chunk66IHPTOK_cjs = require('./chunk-66IHPTOK.cjs');
|
|
10
|
+
var chunk56UI7LUR_cjs = require('./chunk-56UI7LUR.cjs');
|
|
11
|
+
var viem = require('viem');
|
|
12
|
+
|
|
13
|
+
// src/fhe-disperse/abis/singleton.ts
|
|
14
|
+
var disperseConfidentialAbi = [
|
|
15
|
+
{
|
|
16
|
+
inputs: [
|
|
17
|
+
{
|
|
18
|
+
internalType: "address",
|
|
19
|
+
name: "admin_",
|
|
20
|
+
type: "address"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
internalType: "address",
|
|
24
|
+
name: "feeCollector_",
|
|
25
|
+
type: "address"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
components: [
|
|
29
|
+
{
|
|
30
|
+
internalType: "bool",
|
|
31
|
+
name: "gasFeeEnabled",
|
|
32
|
+
type: "bool"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
internalType: "bool",
|
|
36
|
+
name: "tokenFeeEnabled",
|
|
37
|
+
type: "bool"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
internalType: "uint96",
|
|
41
|
+
name: "defaultGasFee",
|
|
42
|
+
type: "uint96"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
internalType: "uint16",
|
|
46
|
+
name: "defaultTokenFee",
|
|
47
|
+
type: "uint16"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
internalType: "struct IDisperseConfidential.FeeConfig",
|
|
51
|
+
name: "config_",
|
|
52
|
+
type: "tuple"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
internalType: "uint256",
|
|
56
|
+
name: "maxBatchSizeHolding_",
|
|
57
|
+
type: "uint256"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
internalType: "uint256",
|
|
61
|
+
name: "maxBatchSizeDirect_",
|
|
62
|
+
type: "uint256"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
internalType: "uint256",
|
|
66
|
+
name: "maxBatchSizeTokenFee_",
|
|
67
|
+
type: "uint256"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
stateMutability: "nonpayable",
|
|
71
|
+
type: "constructor"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
inputs: [],
|
|
75
|
+
name: "AccessControlBadConfirmation",
|
|
76
|
+
type: "error"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
inputs: [
|
|
80
|
+
{
|
|
81
|
+
internalType: "address",
|
|
82
|
+
name: "account",
|
|
83
|
+
type: "address"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
internalType: "bytes32",
|
|
87
|
+
name: "neededRole",
|
|
88
|
+
type: "bytes32"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
name: "AccessControlUnauthorizedAccount",
|
|
92
|
+
type: "error"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
inputs: [],
|
|
96
|
+
name: "ArrayLengthMismatch",
|
|
97
|
+
type: "error"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
inputs: [
|
|
101
|
+
{
|
|
102
|
+
internalType: "uint256",
|
|
103
|
+
name: "requested",
|
|
104
|
+
type: "uint256"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
internalType: "uint256",
|
|
108
|
+
name: "max",
|
|
109
|
+
type: "uint256"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
name: "BatchTooLarge",
|
|
113
|
+
type: "error"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
inputs: [],
|
|
117
|
+
name: "ContractNotAllowed",
|
|
118
|
+
type: "error"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
inputs: [],
|
|
122
|
+
name: "CustomFeeNotSet",
|
|
123
|
+
type: "error"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
inputs: [],
|
|
127
|
+
name: "EmptyBatch",
|
|
128
|
+
type: "error"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
inputs: [],
|
|
132
|
+
name: "EmptyRecipients",
|
|
133
|
+
type: "error"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
inputs: [],
|
|
137
|
+
name: "EnforcedPause",
|
|
138
|
+
type: "error"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
inputs: [],
|
|
142
|
+
name: "ExpectedPause",
|
|
143
|
+
type: "error"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
inputs: [],
|
|
147
|
+
name: "FailedDeployment",
|
|
148
|
+
type: "error"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
inputs: [],
|
|
152
|
+
name: "HandleNotAllowed",
|
|
153
|
+
type: "error"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
inputs: [
|
|
157
|
+
{
|
|
158
|
+
internalType: "uint256",
|
|
159
|
+
name: "sent",
|
|
160
|
+
type: "uint256"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
internalType: "uint256",
|
|
164
|
+
name: "required",
|
|
165
|
+
type: "uint256"
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
name: "InsufficientAmount",
|
|
169
|
+
type: "error"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
inputs: [
|
|
173
|
+
{
|
|
174
|
+
internalType: "uint256",
|
|
175
|
+
name: "balance",
|
|
176
|
+
type: "uint256"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
internalType: "uint256",
|
|
180
|
+
name: "needed",
|
|
181
|
+
type: "uint256"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
name: "InsufficientBalance",
|
|
185
|
+
type: "error"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
inputs: [],
|
|
189
|
+
name: "InvalidAddress",
|
|
190
|
+
type: "error"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
inputs: [],
|
|
194
|
+
name: "InvalidWalletIndex",
|
|
195
|
+
type: "error"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
inputs: [],
|
|
199
|
+
name: "ReentrancyGuardReentrantCall",
|
|
200
|
+
type: "error"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
inputs: [
|
|
204
|
+
{
|
|
205
|
+
internalType: "address",
|
|
206
|
+
name: "token",
|
|
207
|
+
type: "address"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
name: "SafeERC20FailedOperation",
|
|
211
|
+
type: "error"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
inputs: [
|
|
215
|
+
{
|
|
216
|
+
internalType: "bytes32",
|
|
217
|
+
name: "handle",
|
|
218
|
+
type: "bytes32"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
internalType: "address",
|
|
222
|
+
name: "sender",
|
|
223
|
+
type: "address"
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
name: "SenderNotAllowedToUseHandle",
|
|
227
|
+
type: "error"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
inputs: [
|
|
231
|
+
{
|
|
232
|
+
internalType: "address",
|
|
233
|
+
name: "sender",
|
|
234
|
+
type: "address"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
name: "SenderNotAllowed",
|
|
238
|
+
type: "error"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
inputs: [
|
|
242
|
+
{
|
|
243
|
+
internalType: "uint16",
|
|
244
|
+
name: "fee",
|
|
245
|
+
type: "uint16"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
name: "TokenFeeTooHigh",
|
|
249
|
+
type: "error"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
inputs: [],
|
|
253
|
+
name: "TransferFailed",
|
|
254
|
+
type: "error"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
inputs: [],
|
|
258
|
+
name: "UserAlreadyRegistered",
|
|
259
|
+
type: "error"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
inputs: [],
|
|
263
|
+
name: "UserNotRegistered",
|
|
264
|
+
type: "error"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
inputs: [],
|
|
268
|
+
name: "ZamaProtocolUnsupported",
|
|
269
|
+
type: "error"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
inputs: [],
|
|
273
|
+
name: "ZeroAddressRecipient",
|
|
274
|
+
type: "error"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
anonymous: false,
|
|
278
|
+
inputs: [
|
|
279
|
+
{
|
|
280
|
+
indexed: true,
|
|
281
|
+
internalType: "address",
|
|
282
|
+
name: "token",
|
|
283
|
+
type: "address"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
indexed: true,
|
|
287
|
+
internalType: "address",
|
|
288
|
+
name: "sender",
|
|
289
|
+
type: "address"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
indexed: false,
|
|
293
|
+
internalType: "uint256",
|
|
294
|
+
name: "recipientCount",
|
|
295
|
+
type: "uint256"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
indexed: false,
|
|
299
|
+
internalType: "uint8",
|
|
300
|
+
name: "feeType",
|
|
301
|
+
type: "uint8"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
name: "ConfidentialTokensDispersed",
|
|
305
|
+
type: "event"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
anonymous: false,
|
|
309
|
+
inputs: [
|
|
310
|
+
{
|
|
311
|
+
indexed: true,
|
|
312
|
+
internalType: "address",
|
|
313
|
+
name: "token",
|
|
314
|
+
type: "address"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
indexed: true,
|
|
318
|
+
internalType: "address",
|
|
319
|
+
name: "to",
|
|
320
|
+
type: "address"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
name: "ConfidentialTokensRescued",
|
|
324
|
+
type: "event"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
anonymous: false,
|
|
328
|
+
inputs: [
|
|
329
|
+
{
|
|
330
|
+
indexed: true,
|
|
331
|
+
internalType: "address",
|
|
332
|
+
name: "user",
|
|
333
|
+
type: "address"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
name: "CustomFeeDisabled",
|
|
337
|
+
type: "event"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
anonymous: false,
|
|
341
|
+
inputs: [
|
|
342
|
+
{
|
|
343
|
+
indexed: true,
|
|
344
|
+
internalType: "address",
|
|
345
|
+
name: "user",
|
|
346
|
+
type: "address"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
indexed: false,
|
|
350
|
+
internalType: "uint96",
|
|
351
|
+
name: "gasFee",
|
|
352
|
+
type: "uint96"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
indexed: false,
|
|
356
|
+
internalType: "uint16",
|
|
357
|
+
name: "tokenFee",
|
|
358
|
+
type: "uint16"
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
name: "CustomFeeSet",
|
|
362
|
+
type: "event"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
anonymous: false,
|
|
366
|
+
inputs: [
|
|
367
|
+
{
|
|
368
|
+
indexed: true,
|
|
369
|
+
internalType: "address",
|
|
370
|
+
name: "sender",
|
|
371
|
+
type: "address"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
indexed: false,
|
|
375
|
+
internalType: "address[]",
|
|
376
|
+
name: "recipients",
|
|
377
|
+
type: "address[]"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
indexed: false,
|
|
381
|
+
internalType: "euint64[]",
|
|
382
|
+
name: "requested",
|
|
383
|
+
type: "bytes32[]"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
indexed: false,
|
|
387
|
+
internalType: "euint64[]",
|
|
388
|
+
name: "transferred",
|
|
389
|
+
type: "bytes32[]"
|
|
390
|
+
}
|
|
391
|
+
],
|
|
392
|
+
name: "DirectDistribution",
|
|
393
|
+
type: "event"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
anonymous: false,
|
|
397
|
+
inputs: [
|
|
398
|
+
{
|
|
399
|
+
indexed: true,
|
|
400
|
+
internalType: "address",
|
|
401
|
+
name: "token",
|
|
402
|
+
type: "address"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
indexed: true,
|
|
406
|
+
internalType: "address",
|
|
407
|
+
name: "to",
|
|
408
|
+
type: "address"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
indexed: false,
|
|
412
|
+
internalType: "uint256",
|
|
413
|
+
name: "amount",
|
|
414
|
+
type: "uint256"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
name: "ERC20Rescued",
|
|
418
|
+
type: "event"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
anonymous: false,
|
|
422
|
+
inputs: [
|
|
423
|
+
{
|
|
424
|
+
components: [
|
|
425
|
+
{
|
|
426
|
+
internalType: "bool",
|
|
427
|
+
name: "gasFeeEnabled",
|
|
428
|
+
type: "bool"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
internalType: "bool",
|
|
432
|
+
name: "tokenFeeEnabled",
|
|
433
|
+
type: "bool"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
internalType: "uint96",
|
|
437
|
+
name: "defaultGasFee",
|
|
438
|
+
type: "uint96"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
internalType: "uint16",
|
|
442
|
+
name: "defaultTokenFee",
|
|
443
|
+
type: "uint16"
|
|
444
|
+
}
|
|
445
|
+
],
|
|
446
|
+
indexed: false,
|
|
447
|
+
internalType: "struct IDisperseConfidential.FeeConfig",
|
|
448
|
+
name: "config",
|
|
449
|
+
type: "tuple"
|
|
450
|
+
}
|
|
451
|
+
],
|
|
452
|
+
name: "FeeConfigUpdated",
|
|
453
|
+
type: "event"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
anonymous: false,
|
|
457
|
+
inputs: [
|
|
458
|
+
{
|
|
459
|
+
indexed: true,
|
|
460
|
+
internalType: "address",
|
|
461
|
+
name: "to",
|
|
462
|
+
type: "address"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
indexed: false,
|
|
466
|
+
internalType: "uint256",
|
|
467
|
+
name: "amount",
|
|
468
|
+
type: "uint256"
|
|
469
|
+
}
|
|
470
|
+
],
|
|
471
|
+
name: "GasFeeWithdrawn",
|
|
472
|
+
type: "event"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
anonymous: false,
|
|
476
|
+
inputs: [
|
|
477
|
+
{
|
|
478
|
+
indexed: true,
|
|
479
|
+
internalType: "address",
|
|
480
|
+
name: "discloser",
|
|
481
|
+
type: "address"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
indexed: true,
|
|
485
|
+
internalType: "address",
|
|
486
|
+
name: "party",
|
|
487
|
+
type: "address"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
indexed: false,
|
|
491
|
+
internalType: "euint64[]",
|
|
492
|
+
name: "handles",
|
|
493
|
+
type: "bytes32[]"
|
|
494
|
+
}
|
|
495
|
+
],
|
|
496
|
+
name: "HandlesDisclosedToParty",
|
|
497
|
+
type: "event"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
anonymous: false,
|
|
501
|
+
inputs: [
|
|
502
|
+
{
|
|
503
|
+
indexed: false,
|
|
504
|
+
internalType: "uint256",
|
|
505
|
+
name: "oldSize",
|
|
506
|
+
type: "uint256"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
indexed: false,
|
|
510
|
+
internalType: "uint256",
|
|
511
|
+
name: "newSize",
|
|
512
|
+
type: "uint256"
|
|
513
|
+
}
|
|
514
|
+
],
|
|
515
|
+
name: "MaxBatchSizeDirectUpdated",
|
|
516
|
+
type: "event"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
anonymous: false,
|
|
520
|
+
inputs: [
|
|
521
|
+
{
|
|
522
|
+
indexed: false,
|
|
523
|
+
internalType: "uint256",
|
|
524
|
+
name: "oldSize",
|
|
525
|
+
type: "uint256"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
indexed: false,
|
|
529
|
+
internalType: "uint256",
|
|
530
|
+
name: "newSize",
|
|
531
|
+
type: "uint256"
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
name: "MaxBatchSizeHoldingUpdated",
|
|
535
|
+
type: "event"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
anonymous: false,
|
|
539
|
+
inputs: [
|
|
540
|
+
{
|
|
541
|
+
indexed: false,
|
|
542
|
+
internalType: "uint256",
|
|
543
|
+
name: "oldSize",
|
|
544
|
+
type: "uint256"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
indexed: false,
|
|
548
|
+
internalType: "uint256",
|
|
549
|
+
name: "newSize",
|
|
550
|
+
type: "uint256"
|
|
551
|
+
}
|
|
552
|
+
],
|
|
553
|
+
name: "MaxBatchSizeTokenFeeUpdated",
|
|
554
|
+
type: "event"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
anonymous: false,
|
|
558
|
+
inputs: [
|
|
559
|
+
{
|
|
560
|
+
indexed: false,
|
|
561
|
+
internalType: "address",
|
|
562
|
+
name: "account",
|
|
563
|
+
type: "address"
|
|
564
|
+
}
|
|
565
|
+
],
|
|
566
|
+
name: "Paused",
|
|
567
|
+
type: "event"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
anonymous: false,
|
|
571
|
+
inputs: [
|
|
572
|
+
{
|
|
573
|
+
indexed: true,
|
|
574
|
+
internalType: "bytes32",
|
|
575
|
+
name: "role",
|
|
576
|
+
type: "bytes32"
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
indexed: true,
|
|
580
|
+
internalType: "bytes32",
|
|
581
|
+
name: "previousAdminRole",
|
|
582
|
+
type: "bytes32"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
indexed: true,
|
|
586
|
+
internalType: "bytes32",
|
|
587
|
+
name: "newAdminRole",
|
|
588
|
+
type: "bytes32"
|
|
589
|
+
}
|
|
590
|
+
],
|
|
591
|
+
name: "RoleAdminChanged",
|
|
592
|
+
type: "event"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
anonymous: false,
|
|
596
|
+
inputs: [
|
|
597
|
+
{
|
|
598
|
+
indexed: true,
|
|
599
|
+
internalType: "bytes32",
|
|
600
|
+
name: "role",
|
|
601
|
+
type: "bytes32"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
indexed: true,
|
|
605
|
+
internalType: "address",
|
|
606
|
+
name: "account",
|
|
607
|
+
type: "address"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
indexed: true,
|
|
611
|
+
internalType: "address",
|
|
612
|
+
name: "sender",
|
|
613
|
+
type: "address"
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
name: "RoleGranted",
|
|
617
|
+
type: "event"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
anonymous: false,
|
|
621
|
+
inputs: [
|
|
622
|
+
{
|
|
623
|
+
indexed: true,
|
|
624
|
+
internalType: "bytes32",
|
|
625
|
+
name: "role",
|
|
626
|
+
type: "bytes32"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
indexed: true,
|
|
630
|
+
internalType: "address",
|
|
631
|
+
name: "account",
|
|
632
|
+
type: "address"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
indexed: true,
|
|
636
|
+
internalType: "address",
|
|
637
|
+
name: "sender",
|
|
638
|
+
type: "address"
|
|
639
|
+
}
|
|
640
|
+
],
|
|
641
|
+
name: "RoleRevoked",
|
|
642
|
+
type: "event"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
anonymous: false,
|
|
646
|
+
inputs: [
|
|
647
|
+
{
|
|
648
|
+
indexed: true,
|
|
649
|
+
internalType: "address",
|
|
650
|
+
name: "token",
|
|
651
|
+
type: "address"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
indexed: true,
|
|
655
|
+
internalType: "address",
|
|
656
|
+
name: "to",
|
|
657
|
+
type: "address"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
indexed: false,
|
|
661
|
+
internalType: "euint64",
|
|
662
|
+
name: "amount",
|
|
663
|
+
type: "bytes32"
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
name: "TokenFeeWithdrawn",
|
|
667
|
+
type: "event"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
anonymous: false,
|
|
671
|
+
inputs: [
|
|
672
|
+
{
|
|
673
|
+
indexed: false,
|
|
674
|
+
internalType: "address",
|
|
675
|
+
name: "account",
|
|
676
|
+
type: "address"
|
|
677
|
+
}
|
|
678
|
+
],
|
|
679
|
+
name: "Unpaused",
|
|
680
|
+
type: "event"
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
anonymous: false,
|
|
684
|
+
inputs: [
|
|
685
|
+
{
|
|
686
|
+
indexed: true,
|
|
687
|
+
internalType: "address",
|
|
688
|
+
name: "user",
|
|
689
|
+
type: "address"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
indexed: false,
|
|
693
|
+
internalType: "address",
|
|
694
|
+
name: "wallet0",
|
|
695
|
+
type: "address"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
indexed: false,
|
|
699
|
+
internalType: "address",
|
|
700
|
+
name: "wallet1",
|
|
701
|
+
type: "address"
|
|
702
|
+
}
|
|
703
|
+
],
|
|
704
|
+
name: "UserRegistered",
|
|
705
|
+
type: "event"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
anonymous: false,
|
|
709
|
+
inputs: [
|
|
710
|
+
{
|
|
711
|
+
indexed: true,
|
|
712
|
+
internalType: "address",
|
|
713
|
+
name: "sender",
|
|
714
|
+
type: "address"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
indexed: false,
|
|
718
|
+
internalType: "address",
|
|
719
|
+
name: "wallet",
|
|
720
|
+
type: "address"
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
indexed: false,
|
|
724
|
+
internalType: "address[]",
|
|
725
|
+
name: "recipients",
|
|
726
|
+
type: "address[]"
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
indexed: false,
|
|
730
|
+
internalType: "euint64[]",
|
|
731
|
+
name: "requested",
|
|
732
|
+
type: "bytes32[]"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
indexed: false,
|
|
736
|
+
internalType: "euint64[]",
|
|
737
|
+
name: "transferred",
|
|
738
|
+
type: "bytes32[]"
|
|
739
|
+
}
|
|
740
|
+
],
|
|
741
|
+
name: "WalletDistribution",
|
|
742
|
+
type: "event"
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
inputs: [],
|
|
746
|
+
name: "BASIS_POINTS",
|
|
747
|
+
outputs: [
|
|
748
|
+
{
|
|
749
|
+
internalType: "uint256",
|
|
750
|
+
name: "",
|
|
751
|
+
type: "uint256"
|
|
752
|
+
}
|
|
753
|
+
],
|
|
754
|
+
stateMutability: "view",
|
|
755
|
+
type: "function"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
inputs: [],
|
|
759
|
+
name: "DEFAULT_ADMIN_ROLE",
|
|
760
|
+
outputs: [
|
|
761
|
+
{
|
|
762
|
+
internalType: "bytes32",
|
|
763
|
+
name: "",
|
|
764
|
+
type: "bytes32"
|
|
765
|
+
}
|
|
766
|
+
],
|
|
767
|
+
stateMutability: "view",
|
|
768
|
+
type: "function"
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
inputs: [],
|
|
772
|
+
name: "DEPLOYMENT_BLOCK_NUMBER",
|
|
773
|
+
outputs: [
|
|
774
|
+
{
|
|
775
|
+
internalType: "uint256",
|
|
776
|
+
name: "",
|
|
777
|
+
type: "uint256"
|
|
778
|
+
}
|
|
779
|
+
],
|
|
780
|
+
stateMutability: "view",
|
|
781
|
+
type: "function"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
inputs: [],
|
|
785
|
+
name: "FEE_COLLECTOR_ROLE",
|
|
786
|
+
outputs: [
|
|
787
|
+
{
|
|
788
|
+
internalType: "bytes32",
|
|
789
|
+
name: "",
|
|
790
|
+
type: "bytes32"
|
|
791
|
+
}
|
|
792
|
+
],
|
|
793
|
+
stateMutability: "view",
|
|
794
|
+
type: "function"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
inputs: [],
|
|
798
|
+
name: "FEE_MANAGER_ROLE",
|
|
799
|
+
outputs: [
|
|
800
|
+
{
|
|
801
|
+
internalType: "bytes32",
|
|
802
|
+
name: "",
|
|
803
|
+
type: "bytes32"
|
|
804
|
+
}
|
|
805
|
+
],
|
|
806
|
+
stateMutability: "view",
|
|
807
|
+
type: "function"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
inputs: [],
|
|
811
|
+
name: "FEE_TYPE_GAS",
|
|
812
|
+
outputs: [
|
|
813
|
+
{
|
|
814
|
+
internalType: "uint8",
|
|
815
|
+
name: "",
|
|
816
|
+
type: "uint8"
|
|
817
|
+
}
|
|
818
|
+
],
|
|
819
|
+
stateMutability: "view",
|
|
820
|
+
type: "function"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
inputs: [],
|
|
824
|
+
name: "FEE_TYPE_GAS_DIRECT",
|
|
825
|
+
outputs: [
|
|
826
|
+
{
|
|
827
|
+
internalType: "uint8",
|
|
828
|
+
name: "",
|
|
829
|
+
type: "uint8"
|
|
830
|
+
}
|
|
831
|
+
],
|
|
832
|
+
stateMutability: "view",
|
|
833
|
+
type: "function"
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
inputs: [],
|
|
837
|
+
name: "FEE_TYPE_TOKEN",
|
|
838
|
+
outputs: [
|
|
839
|
+
{
|
|
840
|
+
internalType: "uint8",
|
|
841
|
+
name: "",
|
|
842
|
+
type: "uint8"
|
|
843
|
+
}
|
|
844
|
+
],
|
|
845
|
+
stateMutability: "view",
|
|
846
|
+
type: "function"
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
inputs: [],
|
|
850
|
+
name: "PAUSER_ROLE",
|
|
851
|
+
outputs: [
|
|
852
|
+
{
|
|
853
|
+
internalType: "bytes32",
|
|
854
|
+
name: "",
|
|
855
|
+
type: "bytes32"
|
|
856
|
+
}
|
|
857
|
+
],
|
|
858
|
+
stateMutability: "view",
|
|
859
|
+
type: "function"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
inputs: [],
|
|
863
|
+
name: "WALLET_IMPLEMENTATION",
|
|
864
|
+
outputs: [
|
|
865
|
+
{
|
|
866
|
+
internalType: "address",
|
|
867
|
+
name: "",
|
|
868
|
+
type: "address"
|
|
869
|
+
}
|
|
870
|
+
],
|
|
871
|
+
stateMutability: "view",
|
|
872
|
+
type: "function"
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
inputs: [],
|
|
876
|
+
name: "WITHDRAWER_ROLE",
|
|
877
|
+
outputs: [
|
|
878
|
+
{
|
|
879
|
+
internalType: "bytes32",
|
|
880
|
+
name: "",
|
|
881
|
+
type: "bytes32"
|
|
882
|
+
}
|
|
883
|
+
],
|
|
884
|
+
stateMutability: "view",
|
|
885
|
+
type: "function"
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
inputs: [
|
|
889
|
+
{
|
|
890
|
+
internalType: "address",
|
|
891
|
+
name: "token",
|
|
892
|
+
type: "address"
|
|
893
|
+
}
|
|
894
|
+
],
|
|
895
|
+
name: "accessEncryptedFeeReserve",
|
|
896
|
+
outputs: [
|
|
897
|
+
{
|
|
898
|
+
internalType: "euint64",
|
|
899
|
+
name: "reserve",
|
|
900
|
+
type: "bytes32"
|
|
901
|
+
}
|
|
902
|
+
],
|
|
903
|
+
stateMutability: "nonpayable",
|
|
904
|
+
type: "function"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
inputs: [
|
|
908
|
+
{
|
|
909
|
+
internalType: "address",
|
|
910
|
+
name: "token",
|
|
911
|
+
type: "address"
|
|
912
|
+
}
|
|
913
|
+
],
|
|
914
|
+
name: "approveUserWalletsForToken",
|
|
915
|
+
outputs: [],
|
|
916
|
+
stateMutability: "nonpayable",
|
|
917
|
+
type: "function"
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
inputs: [
|
|
921
|
+
{
|
|
922
|
+
internalType: "euint64[]",
|
|
923
|
+
name: "handles",
|
|
924
|
+
type: "bytes32[]"
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
internalType: "address",
|
|
928
|
+
name: "party",
|
|
929
|
+
type: "address"
|
|
930
|
+
}
|
|
931
|
+
],
|
|
932
|
+
name: "batchDiscloseHandlesToParty",
|
|
933
|
+
outputs: [],
|
|
934
|
+
stateMutability: "nonpayable",
|
|
935
|
+
type: "function"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
inputs: [],
|
|
939
|
+
name: "confidentialProtocolId",
|
|
940
|
+
outputs: [
|
|
941
|
+
{
|
|
942
|
+
internalType: "uint256",
|
|
943
|
+
name: "",
|
|
944
|
+
type: "uint256"
|
|
945
|
+
}
|
|
946
|
+
],
|
|
947
|
+
stateMutability: "view",
|
|
948
|
+
type: "function"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
inputs: [
|
|
952
|
+
{
|
|
953
|
+
internalType: "address",
|
|
954
|
+
name: "user",
|
|
955
|
+
type: "address"
|
|
956
|
+
}
|
|
957
|
+
],
|
|
958
|
+
name: "disableCustomFee",
|
|
959
|
+
outputs: [],
|
|
960
|
+
stateMutability: "nonpayable",
|
|
961
|
+
type: "function"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
inputs: [
|
|
965
|
+
{
|
|
966
|
+
internalType: "euint64",
|
|
967
|
+
name: "handle",
|
|
968
|
+
type: "bytes32"
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
internalType: "address",
|
|
972
|
+
name: "party",
|
|
973
|
+
type: "address"
|
|
974
|
+
}
|
|
975
|
+
],
|
|
976
|
+
name: "discloseHandleToParty",
|
|
977
|
+
outputs: [],
|
|
978
|
+
stateMutability: "nonpayable",
|
|
979
|
+
type: "function"
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
inputs: [
|
|
983
|
+
{
|
|
984
|
+
internalType: "address",
|
|
985
|
+
name: "token",
|
|
986
|
+
type: "address"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
internalType: "address[]",
|
|
990
|
+
name: "recipients",
|
|
991
|
+
type: "address[]"
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
internalType: "externalEuint64[]",
|
|
995
|
+
name: "encryptedAmounts",
|
|
996
|
+
type: "bytes32[]"
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
internalType: "bytes",
|
|
1000
|
+
name: "inputProof",
|
|
1001
|
+
type: "bytes"
|
|
1002
|
+
}
|
|
1003
|
+
],
|
|
1004
|
+
name: "disperseConfidentialTokenDirect",
|
|
1005
|
+
outputs: [],
|
|
1006
|
+
stateMutability: "payable",
|
|
1007
|
+
type: "function"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
inputs: [
|
|
1011
|
+
{
|
|
1012
|
+
internalType: "address",
|
|
1013
|
+
name: "token",
|
|
1014
|
+
type: "address"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
internalType: "address[]",
|
|
1018
|
+
name: "recipients",
|
|
1019
|
+
type: "address[]"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
internalType: "externalEuint64[]",
|
|
1023
|
+
name: "encryptedAmounts",
|
|
1024
|
+
type: "bytes32[]"
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
internalType: "externalEuint64[2]",
|
|
1028
|
+
name: "encryptedSubtotals",
|
|
1029
|
+
type: "bytes32[2]"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
internalType: "bytes",
|
|
1033
|
+
name: "inputProof",
|
|
1034
|
+
type: "bytes"
|
|
1035
|
+
}
|
|
1036
|
+
],
|
|
1037
|
+
name: "disperseConfidentialTokens",
|
|
1038
|
+
outputs: [],
|
|
1039
|
+
stateMutability: "payable",
|
|
1040
|
+
type: "function"
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
inputs: [
|
|
1044
|
+
{
|
|
1045
|
+
internalType: "address",
|
|
1046
|
+
name: "token",
|
|
1047
|
+
type: "address"
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
internalType: "address[]",
|
|
1051
|
+
name: "recipients",
|
|
1052
|
+
type: "address[]"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
internalType: "externalEuint64[]",
|
|
1056
|
+
name: "encryptedAmounts",
|
|
1057
|
+
type: "bytes32[]"
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
internalType: "externalEuint64[2]",
|
|
1061
|
+
name: "encryptedSubtotals",
|
|
1062
|
+
type: "bytes32[2]"
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
internalType: "bytes",
|
|
1066
|
+
name: "inputProof",
|
|
1067
|
+
type: "bytes"
|
|
1068
|
+
}
|
|
1069
|
+
],
|
|
1070
|
+
name: "disperseConfidentialTokensWithTokenFee",
|
|
1071
|
+
outputs: [],
|
|
1072
|
+
stateMutability: "nonpayable",
|
|
1073
|
+
type: "function"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
inputs: [],
|
|
1077
|
+
name: "feeConfig",
|
|
1078
|
+
outputs: [
|
|
1079
|
+
{
|
|
1080
|
+
internalType: "bool",
|
|
1081
|
+
name: "gasFeeEnabled",
|
|
1082
|
+
type: "bool"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
internalType: "bool",
|
|
1086
|
+
name: "tokenFeeEnabled",
|
|
1087
|
+
type: "bool"
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
internalType: "uint96",
|
|
1091
|
+
name: "defaultGasFee",
|
|
1092
|
+
type: "uint96"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
internalType: "uint16",
|
|
1096
|
+
name: "defaultTokenFee",
|
|
1097
|
+
type: "uint16"
|
|
1098
|
+
}
|
|
1099
|
+
],
|
|
1100
|
+
stateMutability: "view",
|
|
1101
|
+
type: "function"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
inputs: [
|
|
1105
|
+
{
|
|
1106
|
+
internalType: "address",
|
|
1107
|
+
name: "user",
|
|
1108
|
+
type: "address"
|
|
1109
|
+
}
|
|
1110
|
+
],
|
|
1111
|
+
name: "getCustomFee",
|
|
1112
|
+
outputs: [
|
|
1113
|
+
{
|
|
1114
|
+
internalType: "bool",
|
|
1115
|
+
name: "enabled",
|
|
1116
|
+
type: "bool"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
internalType: "uint96",
|
|
1120
|
+
name: "gasFee",
|
|
1121
|
+
type: "uint96"
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
internalType: "uint16",
|
|
1125
|
+
name: "tokenFee",
|
|
1126
|
+
type: "uint16"
|
|
1127
|
+
}
|
|
1128
|
+
],
|
|
1129
|
+
stateMutability: "view",
|
|
1130
|
+
type: "function"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
inputs: [
|
|
1134
|
+
{
|
|
1135
|
+
internalType: "address",
|
|
1136
|
+
name: "user",
|
|
1137
|
+
type: "address"
|
|
1138
|
+
}
|
|
1139
|
+
],
|
|
1140
|
+
name: "getFeeAmounts",
|
|
1141
|
+
outputs: [
|
|
1142
|
+
{
|
|
1143
|
+
internalType: "bool",
|
|
1144
|
+
name: "isCustomFee",
|
|
1145
|
+
type: "bool"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
internalType: "uint96",
|
|
1149
|
+
name: "gasFee",
|
|
1150
|
+
type: "uint96"
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
internalType: "uint16",
|
|
1154
|
+
name: "tokenFee",
|
|
1155
|
+
type: "uint16"
|
|
1156
|
+
}
|
|
1157
|
+
],
|
|
1158
|
+
stateMutability: "view",
|
|
1159
|
+
type: "function"
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
inputs: [
|
|
1163
|
+
{
|
|
1164
|
+
internalType: "address",
|
|
1165
|
+
name: "user",
|
|
1166
|
+
type: "address"
|
|
1167
|
+
}
|
|
1168
|
+
],
|
|
1169
|
+
name: "getGasFee",
|
|
1170
|
+
outputs: [
|
|
1171
|
+
{
|
|
1172
|
+
internalType: "uint96",
|
|
1173
|
+
name: "",
|
|
1174
|
+
type: "uint96"
|
|
1175
|
+
}
|
|
1176
|
+
],
|
|
1177
|
+
stateMutability: "view",
|
|
1178
|
+
type: "function"
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
inputs: [
|
|
1182
|
+
{
|
|
1183
|
+
internalType: "bytes32",
|
|
1184
|
+
name: "role",
|
|
1185
|
+
type: "bytes32"
|
|
1186
|
+
}
|
|
1187
|
+
],
|
|
1188
|
+
name: "getRoleAdmin",
|
|
1189
|
+
outputs: [
|
|
1190
|
+
{
|
|
1191
|
+
internalType: "bytes32",
|
|
1192
|
+
name: "",
|
|
1193
|
+
type: "bytes32"
|
|
1194
|
+
}
|
|
1195
|
+
],
|
|
1196
|
+
stateMutability: "view",
|
|
1197
|
+
type: "function"
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
inputs: [
|
|
1201
|
+
{
|
|
1202
|
+
internalType: "address",
|
|
1203
|
+
name: "user",
|
|
1204
|
+
type: "address"
|
|
1205
|
+
}
|
|
1206
|
+
],
|
|
1207
|
+
name: "getTokenFee",
|
|
1208
|
+
outputs: [
|
|
1209
|
+
{
|
|
1210
|
+
internalType: "uint16",
|
|
1211
|
+
name: "",
|
|
1212
|
+
type: "uint16"
|
|
1213
|
+
}
|
|
1214
|
+
],
|
|
1215
|
+
stateMutability: "view",
|
|
1216
|
+
type: "function"
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
inputs: [
|
|
1220
|
+
{
|
|
1221
|
+
internalType: "address",
|
|
1222
|
+
name: "user",
|
|
1223
|
+
type: "address"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
internalType: "uint256",
|
|
1227
|
+
name: "index",
|
|
1228
|
+
type: "uint256"
|
|
1229
|
+
}
|
|
1230
|
+
],
|
|
1231
|
+
name: "getUserWallet",
|
|
1232
|
+
outputs: [
|
|
1233
|
+
{
|
|
1234
|
+
internalType: "address",
|
|
1235
|
+
name: "",
|
|
1236
|
+
type: "address"
|
|
1237
|
+
}
|
|
1238
|
+
],
|
|
1239
|
+
stateMutability: "view",
|
|
1240
|
+
type: "function"
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
inputs: [
|
|
1244
|
+
{
|
|
1245
|
+
internalType: "bytes32",
|
|
1246
|
+
name: "role",
|
|
1247
|
+
type: "bytes32"
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
internalType: "address",
|
|
1251
|
+
name: "account",
|
|
1252
|
+
type: "address"
|
|
1253
|
+
}
|
|
1254
|
+
],
|
|
1255
|
+
name: "grantRole",
|
|
1256
|
+
outputs: [],
|
|
1257
|
+
stateMutability: "nonpayable",
|
|
1258
|
+
type: "function"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
inputs: [
|
|
1262
|
+
{
|
|
1263
|
+
internalType: "address",
|
|
1264
|
+
name: "user",
|
|
1265
|
+
type: "address"
|
|
1266
|
+
}
|
|
1267
|
+
],
|
|
1268
|
+
name: "hasCustomFee",
|
|
1269
|
+
outputs: [
|
|
1270
|
+
{
|
|
1271
|
+
internalType: "bool",
|
|
1272
|
+
name: "",
|
|
1273
|
+
type: "bool"
|
|
1274
|
+
}
|
|
1275
|
+
],
|
|
1276
|
+
stateMutability: "view",
|
|
1277
|
+
type: "function"
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
inputs: [
|
|
1281
|
+
{
|
|
1282
|
+
internalType: "bytes32",
|
|
1283
|
+
name: "role",
|
|
1284
|
+
type: "bytes32"
|
|
1285
|
+
},
|
|
1286
|
+
{
|
|
1287
|
+
internalType: "address",
|
|
1288
|
+
name: "account",
|
|
1289
|
+
type: "address"
|
|
1290
|
+
}
|
|
1291
|
+
],
|
|
1292
|
+
name: "hasRole",
|
|
1293
|
+
outputs: [
|
|
1294
|
+
{
|
|
1295
|
+
internalType: "bool",
|
|
1296
|
+
name: "",
|
|
1297
|
+
type: "bool"
|
|
1298
|
+
}
|
|
1299
|
+
],
|
|
1300
|
+
stateMutability: "view",
|
|
1301
|
+
type: "function"
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
inputs: [
|
|
1305
|
+
{
|
|
1306
|
+
internalType: "address",
|
|
1307
|
+
name: "user",
|
|
1308
|
+
type: "address"
|
|
1309
|
+
}
|
|
1310
|
+
],
|
|
1311
|
+
name: "isRegistered",
|
|
1312
|
+
outputs: [
|
|
1313
|
+
{
|
|
1314
|
+
internalType: "bool",
|
|
1315
|
+
name: "",
|
|
1316
|
+
type: "bool"
|
|
1317
|
+
}
|
|
1318
|
+
],
|
|
1319
|
+
stateMutability: "view",
|
|
1320
|
+
type: "function"
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
inputs: [],
|
|
1324
|
+
name: "maxBatchSizeDirect",
|
|
1325
|
+
outputs: [
|
|
1326
|
+
{
|
|
1327
|
+
internalType: "uint256",
|
|
1328
|
+
name: "",
|
|
1329
|
+
type: "uint256"
|
|
1330
|
+
}
|
|
1331
|
+
],
|
|
1332
|
+
stateMutability: "view",
|
|
1333
|
+
type: "function"
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
inputs: [],
|
|
1337
|
+
name: "maxBatchSizeHolding",
|
|
1338
|
+
outputs: [
|
|
1339
|
+
{
|
|
1340
|
+
internalType: "uint256",
|
|
1341
|
+
name: "",
|
|
1342
|
+
type: "uint256"
|
|
1343
|
+
}
|
|
1344
|
+
],
|
|
1345
|
+
stateMutability: "view",
|
|
1346
|
+
type: "function"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
inputs: [],
|
|
1350
|
+
name: "maxBatchSizeTokenFee",
|
|
1351
|
+
outputs: [
|
|
1352
|
+
{
|
|
1353
|
+
internalType: "uint256",
|
|
1354
|
+
name: "",
|
|
1355
|
+
type: "uint256"
|
|
1356
|
+
}
|
|
1357
|
+
],
|
|
1358
|
+
stateMutability: "view",
|
|
1359
|
+
type: "function"
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
inputs: [],
|
|
1363
|
+
name: "pause",
|
|
1364
|
+
outputs: [],
|
|
1365
|
+
stateMutability: "nonpayable",
|
|
1366
|
+
type: "function"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
inputs: [],
|
|
1370
|
+
name: "paused",
|
|
1371
|
+
outputs: [
|
|
1372
|
+
{
|
|
1373
|
+
internalType: "bool",
|
|
1374
|
+
name: "",
|
|
1375
|
+
type: "bool"
|
|
1376
|
+
}
|
|
1377
|
+
],
|
|
1378
|
+
stateMutability: "view",
|
|
1379
|
+
type: "function"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
inputs: [
|
|
1383
|
+
{
|
|
1384
|
+
internalType: "address",
|
|
1385
|
+
name: "token",
|
|
1386
|
+
type: "address"
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
internalType: "address",
|
|
1390
|
+
name: "to",
|
|
1391
|
+
type: "address"
|
|
1392
|
+
}
|
|
1393
|
+
],
|
|
1394
|
+
name: "recoverERC20FromWallets",
|
|
1395
|
+
outputs: [],
|
|
1396
|
+
stateMutability: "nonpayable",
|
|
1397
|
+
type: "function"
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
inputs: [
|
|
1401
|
+
{
|
|
1402
|
+
internalType: "address",
|
|
1403
|
+
name: "token",
|
|
1404
|
+
type: "address"
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
internalType: "address",
|
|
1408
|
+
name: "to",
|
|
1409
|
+
type: "address"
|
|
1410
|
+
}
|
|
1411
|
+
],
|
|
1412
|
+
name: "recoverFromWallets",
|
|
1413
|
+
outputs: [],
|
|
1414
|
+
stateMutability: "nonpayable",
|
|
1415
|
+
type: "function"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
inputs: [
|
|
1419
|
+
{
|
|
1420
|
+
internalType: "address",
|
|
1421
|
+
name: "token",
|
|
1422
|
+
type: "address"
|
|
1423
|
+
}
|
|
1424
|
+
],
|
|
1425
|
+
name: "register",
|
|
1426
|
+
outputs: [],
|
|
1427
|
+
stateMutability: "nonpayable",
|
|
1428
|
+
type: "function"
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
inputs: [
|
|
1432
|
+
{
|
|
1433
|
+
internalType: "bytes32",
|
|
1434
|
+
name: "role",
|
|
1435
|
+
type: "bytes32"
|
|
1436
|
+
},
|
|
1437
|
+
{
|
|
1438
|
+
internalType: "address",
|
|
1439
|
+
name: "callerConfirmation",
|
|
1440
|
+
type: "address"
|
|
1441
|
+
}
|
|
1442
|
+
],
|
|
1443
|
+
name: "renounceRole",
|
|
1444
|
+
outputs: [],
|
|
1445
|
+
stateMutability: "nonpayable",
|
|
1446
|
+
type: "function"
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
inputs: [
|
|
1450
|
+
{
|
|
1451
|
+
internalType: "address",
|
|
1452
|
+
name: "token",
|
|
1453
|
+
type: "address"
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
internalType: "address",
|
|
1457
|
+
name: "to",
|
|
1458
|
+
type: "address"
|
|
1459
|
+
}
|
|
1460
|
+
],
|
|
1461
|
+
name: "rescueConfidentialTokens",
|
|
1462
|
+
outputs: [],
|
|
1463
|
+
stateMutability: "nonpayable",
|
|
1464
|
+
type: "function"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
inputs: [
|
|
1468
|
+
{
|
|
1469
|
+
internalType: "address",
|
|
1470
|
+
name: "token",
|
|
1471
|
+
type: "address"
|
|
1472
|
+
},
|
|
1473
|
+
{
|
|
1474
|
+
internalType: "address",
|
|
1475
|
+
name: "to",
|
|
1476
|
+
type: "address"
|
|
1477
|
+
}
|
|
1478
|
+
],
|
|
1479
|
+
name: "rescueERC20",
|
|
1480
|
+
outputs: [],
|
|
1481
|
+
stateMutability: "nonpayable",
|
|
1482
|
+
type: "function"
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
inputs: [
|
|
1486
|
+
{
|
|
1487
|
+
internalType: "bytes32",
|
|
1488
|
+
name: "role",
|
|
1489
|
+
type: "bytes32"
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
internalType: "address",
|
|
1493
|
+
name: "account",
|
|
1494
|
+
type: "address"
|
|
1495
|
+
}
|
|
1496
|
+
],
|
|
1497
|
+
name: "revokeRole",
|
|
1498
|
+
outputs: [],
|
|
1499
|
+
stateMutability: "nonpayable",
|
|
1500
|
+
type: "function"
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
inputs: [
|
|
1504
|
+
{
|
|
1505
|
+
internalType: "address",
|
|
1506
|
+
name: "token",
|
|
1507
|
+
type: "address"
|
|
1508
|
+
}
|
|
1509
|
+
],
|
|
1510
|
+
name: "revokeUserWalletsForToken",
|
|
1511
|
+
outputs: [],
|
|
1512
|
+
stateMutability: "nonpayable",
|
|
1513
|
+
type: "function"
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
inputs: [
|
|
1517
|
+
{
|
|
1518
|
+
internalType: "address",
|
|
1519
|
+
name: "user",
|
|
1520
|
+
type: "address"
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
internalType: "uint96",
|
|
1524
|
+
name: "gasFee",
|
|
1525
|
+
type: "uint96"
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
internalType: "uint16",
|
|
1529
|
+
name: "tokenFee",
|
|
1530
|
+
type: "uint16"
|
|
1531
|
+
}
|
|
1532
|
+
],
|
|
1533
|
+
name: "setCustomFee",
|
|
1534
|
+
outputs: [],
|
|
1535
|
+
stateMutability: "nonpayable",
|
|
1536
|
+
type: "function"
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
inputs: [
|
|
1540
|
+
{
|
|
1541
|
+
components: [
|
|
1542
|
+
{
|
|
1543
|
+
internalType: "bool",
|
|
1544
|
+
name: "gasFeeEnabled",
|
|
1545
|
+
type: "bool"
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
internalType: "bool",
|
|
1549
|
+
name: "tokenFeeEnabled",
|
|
1550
|
+
type: "bool"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
internalType: "uint96",
|
|
1554
|
+
name: "defaultGasFee",
|
|
1555
|
+
type: "uint96"
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
internalType: "uint16",
|
|
1559
|
+
name: "defaultTokenFee",
|
|
1560
|
+
type: "uint16"
|
|
1561
|
+
}
|
|
1562
|
+
],
|
|
1563
|
+
internalType: "struct IDisperseConfidential.FeeConfig",
|
|
1564
|
+
name: "config",
|
|
1565
|
+
type: "tuple"
|
|
1566
|
+
}
|
|
1567
|
+
],
|
|
1568
|
+
name: "setFeeConfig",
|
|
1569
|
+
outputs: [],
|
|
1570
|
+
stateMutability: "nonpayable",
|
|
1571
|
+
type: "function"
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
inputs: [
|
|
1575
|
+
{
|
|
1576
|
+
internalType: "uint256",
|
|
1577
|
+
name: "size",
|
|
1578
|
+
type: "uint256"
|
|
1579
|
+
}
|
|
1580
|
+
],
|
|
1581
|
+
name: "setMaxBatchSizeDirect",
|
|
1582
|
+
outputs: [],
|
|
1583
|
+
stateMutability: "nonpayable",
|
|
1584
|
+
type: "function"
|
|
1585
|
+
},
|
|
1586
|
+
{
|
|
1587
|
+
inputs: [
|
|
1588
|
+
{
|
|
1589
|
+
internalType: "uint256",
|
|
1590
|
+
name: "size",
|
|
1591
|
+
type: "uint256"
|
|
1592
|
+
}
|
|
1593
|
+
],
|
|
1594
|
+
name: "setMaxBatchSizeHolding",
|
|
1595
|
+
outputs: [],
|
|
1596
|
+
stateMutability: "nonpayable",
|
|
1597
|
+
type: "function"
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
inputs: [
|
|
1601
|
+
{
|
|
1602
|
+
internalType: "uint256",
|
|
1603
|
+
name: "size",
|
|
1604
|
+
type: "uint256"
|
|
1605
|
+
}
|
|
1606
|
+
],
|
|
1607
|
+
name: "setMaxBatchSizeTokenFee",
|
|
1608
|
+
outputs: [],
|
|
1609
|
+
stateMutability: "nonpayable",
|
|
1610
|
+
type: "function"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
inputs: [
|
|
1614
|
+
{
|
|
1615
|
+
internalType: "bytes4",
|
|
1616
|
+
name: "interfaceId",
|
|
1617
|
+
type: "bytes4"
|
|
1618
|
+
}
|
|
1619
|
+
],
|
|
1620
|
+
name: "supportsInterface",
|
|
1621
|
+
outputs: [
|
|
1622
|
+
{
|
|
1623
|
+
internalType: "bool",
|
|
1624
|
+
name: "",
|
|
1625
|
+
type: "bool"
|
|
1626
|
+
}
|
|
1627
|
+
],
|
|
1628
|
+
stateMutability: "view",
|
|
1629
|
+
type: "function"
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
inputs: [],
|
|
1633
|
+
name: "unpause",
|
|
1634
|
+
outputs: [],
|
|
1635
|
+
stateMutability: "nonpayable",
|
|
1636
|
+
type: "function"
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
inputs: [
|
|
1640
|
+
{
|
|
1641
|
+
internalType: "address",
|
|
1642
|
+
name: "to",
|
|
1643
|
+
type: "address"
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
internalType: "uint256",
|
|
1647
|
+
name: "amount",
|
|
1648
|
+
type: "uint256"
|
|
1649
|
+
}
|
|
1650
|
+
],
|
|
1651
|
+
name: "withdrawGasFee",
|
|
1652
|
+
outputs: [],
|
|
1653
|
+
stateMutability: "nonpayable",
|
|
1654
|
+
type: "function"
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
inputs: [
|
|
1658
|
+
{
|
|
1659
|
+
internalType: "address",
|
|
1660
|
+
name: "token",
|
|
1661
|
+
type: "address"
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
internalType: "address",
|
|
1665
|
+
name: "to",
|
|
1666
|
+
type: "address"
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
internalType: "externalEuint64",
|
|
1670
|
+
name: "encryptedAmount",
|
|
1671
|
+
type: "bytes32"
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
internalType: "bytes",
|
|
1675
|
+
name: "inputProof",
|
|
1676
|
+
type: "bytes"
|
|
1677
|
+
}
|
|
1678
|
+
],
|
|
1679
|
+
name: "withdrawTokenFee",
|
|
1680
|
+
outputs: [],
|
|
1681
|
+
stateMutability: "nonpayable",
|
|
1682
|
+
type: "function"
|
|
1683
|
+
}
|
|
1684
|
+
];
|
|
1685
|
+
function resolveEncryptor(source) {
|
|
1686
|
+
if (source === void 0) return void 0;
|
|
1687
|
+
return typeof source === "function" ? source() : source;
|
|
1688
|
+
}
|
|
1689
|
+
var MAX_UINT64 = (1n << 64n) - 1n;
|
|
1690
|
+
function assertUint64(value, label) {
|
|
1691
|
+
if (value < 0n || value > MAX_UINT64) {
|
|
1692
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1693
|
+
method: "encryptUint64",
|
|
1694
|
+
argument: label,
|
|
1695
|
+
reason: "exceeds uint64 range (0..2^64-1)",
|
|
1696
|
+
value
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
async function encryptUint64({
|
|
1701
|
+
encryptor,
|
|
1702
|
+
contractAddress,
|
|
1703
|
+
userAddress,
|
|
1704
|
+
value
|
|
1705
|
+
}) {
|
|
1706
|
+
assertUint64(value, "value");
|
|
1707
|
+
const { handles, inputProof } = await encryptor.encrypt({
|
|
1708
|
+
values: [{ value, type: "euint64" }],
|
|
1709
|
+
contractAddress,
|
|
1710
|
+
userAddress
|
|
1711
|
+
});
|
|
1712
|
+
if (handles.length !== 1) {
|
|
1713
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1714
|
+
method: "encryptUint64",
|
|
1715
|
+
argument: "handles",
|
|
1716
|
+
reason: `expected 1 handle, got ${handles.length}`,
|
|
1717
|
+
value: handles.length
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
return {
|
|
1721
|
+
handle: chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(handles[0])),
|
|
1722
|
+
inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
|
|
1723
|
+
};
|
|
1724
|
+
}
|
|
1725
|
+
async function encryptUint64Batch({
|
|
1726
|
+
encryptor,
|
|
1727
|
+
contractAddress,
|
|
1728
|
+
userAddress,
|
|
1729
|
+
values
|
|
1730
|
+
}) {
|
|
1731
|
+
if (values.length === 0) {
|
|
1732
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1733
|
+
method: "encryptUint64Batch",
|
|
1734
|
+
argument: "values",
|
|
1735
|
+
reason: "must be non-empty"
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
values.forEach((v, i) => assertUint64(v, `values[${i}]`));
|
|
1739
|
+
const { handles, inputProof } = await encryptor.encrypt({
|
|
1740
|
+
values: values.map((value) => ({ value, type: "euint64" })),
|
|
1741
|
+
contractAddress,
|
|
1742
|
+
userAddress
|
|
1743
|
+
});
|
|
1744
|
+
if (handles.length !== values.length) {
|
|
1745
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1746
|
+
method: "encryptUint64Batch",
|
|
1747
|
+
argument: "handles",
|
|
1748
|
+
reason: `expected ${values.length} handles, got ${handles.length}`,
|
|
1749
|
+
value: handles.length
|
|
1750
|
+
});
|
|
1751
|
+
}
|
|
1752
|
+
return {
|
|
1753
|
+
handles: handles.map((h) => chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(h))),
|
|
1754
|
+
inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
// src/fhe-disperse/errors.ts
|
|
1759
|
+
var NotRegisteredError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
|
|
1760
|
+
name = "NotRegisteredError";
|
|
1761
|
+
constructor(args) {
|
|
1762
|
+
super(
|
|
1763
|
+
`${args.method}: ${args.user} has not registered with the disperse singleton. Call \`register(token)\` first.`,
|
|
1764
|
+
{
|
|
1765
|
+
code: "TOKENOPS_NOT_REGISTERED",
|
|
1766
|
+
cause: args.cause,
|
|
1767
|
+
context: {
|
|
1768
|
+
method: args.method,
|
|
1769
|
+
contractAddress: args.contractAddress,
|
|
1770
|
+
user: args.user
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
);
|
|
1774
|
+
}
|
|
1775
|
+
};
|
|
1776
|
+
var AlreadyRegisteredError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
|
|
1777
|
+
name = "AlreadyRegisteredError";
|
|
1778
|
+
constructor(args) {
|
|
1779
|
+
super(
|
|
1780
|
+
`${args.method}: ${args.user} is already registered. Use \`approveUserWalletsForToken\` to whitelist additional tokens.`,
|
|
1781
|
+
{
|
|
1782
|
+
code: "TOKENOPS_ALREADY_REGISTERED",
|
|
1783
|
+
cause: args.cause,
|
|
1784
|
+
context: {
|
|
1785
|
+
method: args.method,
|
|
1786
|
+
contractAddress: args.contractAddress,
|
|
1787
|
+
user: args.user
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
);
|
|
1791
|
+
}
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
// src/fhe-disperse/subtotals.ts
|
|
1795
|
+
function computeSubtotals(amounts) {
|
|
1796
|
+
const count = amounts.length;
|
|
1797
|
+
const baseSize = Math.floor(count / 2);
|
|
1798
|
+
const remainder = count % 2;
|
|
1799
|
+
const group0Size = baseSize + remainder;
|
|
1800
|
+
let group0 = 0n;
|
|
1801
|
+
let group1 = 0n;
|
|
1802
|
+
for (let i = 0; i < group0Size; i++) group0 += amounts[i];
|
|
1803
|
+
for (let i = group0Size; i < count; i++) group1 += amounts[i];
|
|
1804
|
+
return { group0, group1 };
|
|
1805
|
+
}
|
|
1806
|
+
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
1807
|
+
var MAX_UINT642 = (1n << 64n) - 1n;
|
|
1808
|
+
function validateDisperseInputs(args) {
|
|
1809
|
+
const { recipients, amounts, mode, batchLimit, method, contractAddress } = args;
|
|
1810
|
+
const errors = [];
|
|
1811
|
+
if (recipients.length === 0) {
|
|
1812
|
+
errors.push(
|
|
1813
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1814
|
+
method,
|
|
1815
|
+
argument: "recipients",
|
|
1816
|
+
reason: "must be non-empty"
|
|
1817
|
+
})
|
|
1818
|
+
);
|
|
1819
|
+
}
|
|
1820
|
+
if (amounts.length !== recipients.length) {
|
|
1821
|
+
errors.push(
|
|
1822
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1823
|
+
method,
|
|
1824
|
+
argument: "amounts",
|
|
1825
|
+
reason: `length mismatch: recipients.length (${recipients.length}) !== amounts.length (${amounts.length})`
|
|
1826
|
+
})
|
|
1827
|
+
);
|
|
1828
|
+
}
|
|
1829
|
+
recipients.forEach((r, i) => {
|
|
1830
|
+
if (!viem.isAddress(r, { strict: true })) {
|
|
1831
|
+
errors.push(
|
|
1832
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1833
|
+
method,
|
|
1834
|
+
argument: `recipients[${i}]`,
|
|
1835
|
+
reason: "must be a valid EIP-55 checksummed address",
|
|
1836
|
+
value: r
|
|
1837
|
+
})
|
|
1838
|
+
);
|
|
1839
|
+
return;
|
|
1840
|
+
}
|
|
1841
|
+
if (r === ZERO_ADDRESS) {
|
|
1842
|
+
errors.push(
|
|
1843
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1844
|
+
method,
|
|
1845
|
+
argument: `recipients[${i}]`,
|
|
1846
|
+
reason: "zero address",
|
|
1847
|
+
value: r
|
|
1848
|
+
})
|
|
1849
|
+
);
|
|
1850
|
+
}
|
|
1851
|
+
});
|
|
1852
|
+
amounts.forEach((v, i) => {
|
|
1853
|
+
if (v < 0n || v > MAX_UINT642) {
|
|
1854
|
+
errors.push(
|
|
1855
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1856
|
+
method,
|
|
1857
|
+
argument: `amounts[${i}]`,
|
|
1858
|
+
reason: "exceeds uint64 range (0..2^64-1)"
|
|
1859
|
+
})
|
|
1860
|
+
);
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
const perAmountOk = errors.every((e) => !e.context.argument?.toString().startsWith("amounts["));
|
|
1864
|
+
const lengthsOk = recipients.length > 0 && amounts.length === recipients.length;
|
|
1865
|
+
if (mode !== "direct" && perAmountOk && lengthsOk) {
|
|
1866
|
+
const { group0, group1 } = computeSubtotals([...amounts]);
|
|
1867
|
+
if (group0 > MAX_UINT642) {
|
|
1868
|
+
errors.push(
|
|
1869
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1870
|
+
method,
|
|
1871
|
+
argument: "amounts",
|
|
1872
|
+
reason: "wallet-mode subtotal exceeds uint64 range"
|
|
1873
|
+
})
|
|
1874
|
+
);
|
|
1875
|
+
}
|
|
1876
|
+
if (group1 > MAX_UINT642) {
|
|
1877
|
+
errors.push(
|
|
1878
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1879
|
+
method,
|
|
1880
|
+
argument: "amounts",
|
|
1881
|
+
reason: "wallet-mode subtotal exceeds uint64 range"
|
|
1882
|
+
})
|
|
1883
|
+
);
|
|
1884
|
+
}
|
|
1885
|
+
if (group0 <= MAX_UINT642 && group1 <= MAX_UINT642 && group0 + group1 > MAX_UINT642) {
|
|
1886
|
+
errors.push(
|
|
1887
|
+
new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1888
|
+
method,
|
|
1889
|
+
argument: "amounts",
|
|
1890
|
+
reason: "wallet-mode subtotals sum exceeds uint64 range (would silently zero on-chain)"
|
|
1891
|
+
})
|
|
1892
|
+
);
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
if (batchLimit > 0n && BigInt(recipients.length) > batchLimit) {
|
|
1896
|
+
errors.push(
|
|
1897
|
+
new chunk56UI7LUR_cjs.BatchTooLargeError({
|
|
1898
|
+
method,
|
|
1899
|
+
contractAddress,
|
|
1900
|
+
requested: recipients.length,
|
|
1901
|
+
max: batchLimit
|
|
1902
|
+
})
|
|
1903
|
+
);
|
|
1904
|
+
}
|
|
1905
|
+
return errors;
|
|
1906
|
+
}
|
|
1907
|
+
function assertChecksumAddress(value, argument, method) {
|
|
1908
|
+
if (value === void 0) return;
|
|
1909
|
+
if (!viem.isAddress(value, { strict: true })) {
|
|
1910
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1911
|
+
method,
|
|
1912
|
+
argument,
|
|
1913
|
+
reason: "must be a valid EIP-55 checksummed address \u2014 use viem's getAddress(addr) to fix the checksum",
|
|
1914
|
+
value
|
|
1915
|
+
});
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
function assertNonZeroChecksumAddress(value, argument, method) {
|
|
1919
|
+
if (value === void 0) return;
|
|
1920
|
+
assertChecksumAddress(value, argument, method);
|
|
1921
|
+
if (value === ZERO_ADDRESS) {
|
|
1922
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1923
|
+
method,
|
|
1924
|
+
argument,
|
|
1925
|
+
reason: "must not be the zero address",
|
|
1926
|
+
value
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
function batchLimitForMode(mode, limits) {
|
|
1931
|
+
if (mode === "direct") return limits.direct;
|
|
1932
|
+
if (mode === "wallet-token-fee") return limits.tokenFee;
|
|
1933
|
+
return limits.holding;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
// src/fhe-disperse/types.ts
|
|
1937
|
+
var DisperseSubwalletNotFoundError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
|
|
1938
|
+
name = "DisperseSubwalletNotFoundError";
|
|
1939
|
+
constructor(txHash, singletonAddress) {
|
|
1940
|
+
super(
|
|
1941
|
+
`register: no UserRegistered event from singleton ${singletonAddress} in tx ${txHash} \u2014 the registration may have reverted silently.`,
|
|
1942
|
+
{
|
|
1943
|
+
code: "TOKENOPS_RECEIPT_EVENT_NOT_FOUND",
|
|
1944
|
+
context: { txHash, singletonAddress }
|
|
1945
|
+
}
|
|
1946
|
+
);
|
|
1947
|
+
}
|
|
1948
|
+
};
|
|
1949
|
+
var DisperseEncryptedReserveNotGrantedError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
|
|
1950
|
+
name = "DisperseEncryptedReserveNotGrantedError";
|
|
1951
|
+
constructor(txHash, callerAddress) {
|
|
1952
|
+
super(
|
|
1953
|
+
`getEncryptedFeeReserve: no ACL Allowed event granting ${callerAddress} access to the fee reserve handle was found in tx ${txHash}. The fee reserve for this token may be uninitialized (no fees have accrued yet).`,
|
|
1954
|
+
{
|
|
1955
|
+
code: "TOKENOPS_RECEIPT_EVENT_NOT_FOUND",
|
|
1956
|
+
context: { txHash, callerAddress }
|
|
1957
|
+
}
|
|
1958
|
+
);
|
|
1959
|
+
}
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
// src/fhe-disperse/singleton.ts
|
|
1963
|
+
var disperseProductMapper = (name, _args, ctx) => {
|
|
1964
|
+
const user = ctx.productContext?.["user"] ?? ZERO_ADDRESS2;
|
|
1965
|
+
switch (name) {
|
|
1966
|
+
case "UserAlreadyRegistered":
|
|
1967
|
+
return new AlreadyRegisteredError({ ...ctx, user });
|
|
1968
|
+
case "UserNotRegistered":
|
|
1969
|
+
return new NotRegisteredError({ ...ctx, user });
|
|
1970
|
+
case "ContractNotAllowed":
|
|
1971
|
+
return new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
1972
|
+
method: ctx.method,
|
|
1973
|
+
argument: "handle",
|
|
1974
|
+
reason: "the handle's origin contract did not grant this singleton persistent ACL on the handle. ERC-7984 `transferred` handles are scoped to the token contract \u2014 disclose them through the token, not through `DisperseConfidential`."
|
|
1975
|
+
});
|
|
1976
|
+
default:
|
|
1977
|
+
return void 0;
|
|
1978
|
+
}
|
|
1979
|
+
};
|
|
1980
|
+
var ZERO_ADDRESS2 = "0x0000000000000000000000000000000000000000";
|
|
1981
|
+
var ERC7984_IS_OPERATOR_ABI = [
|
|
1982
|
+
{
|
|
1983
|
+
inputs: [
|
|
1984
|
+
{ name: "holder", type: "address" },
|
|
1985
|
+
{ name: "spender", type: "address" }
|
|
1986
|
+
],
|
|
1987
|
+
name: "isOperator",
|
|
1988
|
+
outputs: [{ name: "", type: "bool" }],
|
|
1989
|
+
stateMutability: "view",
|
|
1990
|
+
type: "function"
|
|
1991
|
+
}
|
|
1992
|
+
];
|
|
1993
|
+
function predictErc1167Address(implementation, salt, deployer) {
|
|
1994
|
+
const initCode = `0x3d602d80600a3d3981f3363d3d373d3d3d363d73${implementation.slice(2)}5af43d82803e903d91602b57fd5bf3`;
|
|
1995
|
+
return viem.getCreate2Address({
|
|
1996
|
+
from: deployer,
|
|
1997
|
+
salt,
|
|
1998
|
+
bytecodeHash: viem.keccak256(initCode)
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
2001
|
+
var ConfidentialDisperseClient = class {
|
|
2002
|
+
publicClient;
|
|
2003
|
+
walletClient;
|
|
2004
|
+
address;
|
|
2005
|
+
encryptor;
|
|
2006
|
+
#aclAddressOverride;
|
|
2007
|
+
#telemetry;
|
|
2008
|
+
#cachedAclAddress;
|
|
2009
|
+
constructor(config) {
|
|
2010
|
+
this.publicClient = config.publicClient;
|
|
2011
|
+
this.walletClient = config.walletClient;
|
|
2012
|
+
this.encryptor = config.encryptor;
|
|
2013
|
+
this.#telemetry = config.telemetry;
|
|
2014
|
+
const chainId = config.chainId ?? config.publicClient.chain?.id;
|
|
2015
|
+
const addressOverride = config.address ? chunkCQIPRNS7_cjs.normaliseAddress(config.address) : void 0;
|
|
2016
|
+
const resolved = addressOverride ?? (chainId === void 0 ? void 0 : chunkOLDGMKW2_cjs.getFheDisperseSingletonAddress(chainId));
|
|
2017
|
+
if (!resolved) {
|
|
2018
|
+
throw new chunk56UI7LUR_cjs.DeploymentAddressUnavailableError({
|
|
2019
|
+
reason: chainId === void 0 ? "chain-id-missing" : "registry-not-deployed",
|
|
2020
|
+
product: "fheDisperse",
|
|
2021
|
+
contract: "disperseConfidentialSingleton",
|
|
2022
|
+
chainId,
|
|
2023
|
+
clientLabel: "ConfidentialDisperseClient"
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
this.address = resolved;
|
|
2027
|
+
this.#aclAddressOverride = config.aclAddress;
|
|
2028
|
+
this.#telemetry?.event("fhe-disperse.client.init", {
|
|
2029
|
+
surface: "singleton",
|
|
2030
|
+
chainId: chainId ?? null,
|
|
2031
|
+
hasWallet: !!this.walletClient,
|
|
2032
|
+
aclResolved: !!config.aclAddress || chainId !== void 0 && !!chunkQ7ARQSUH_cjs.getFhevmAclAddress(chainId),
|
|
2033
|
+
sdkVersion: chunkVDXVNZCO_cjs.SDK_VERSION
|
|
2034
|
+
});
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* The FHEVM ACL contract address used by encrypted-view methods to parse
|
|
2038
|
+
* `ACL.Allowed` events. Resolved lazily on first access; throws
|
|
2039
|
+
* `DeploymentAddressUnavailableError` if no override was passed and the
|
|
2040
|
+
* SDK does not have an ACL deployed for the connected chain.
|
|
2041
|
+
*/
|
|
2042
|
+
get aclAddress() {
|
|
2043
|
+
if (this.#cachedAclAddress) return this.#cachedAclAddress;
|
|
2044
|
+
this.#cachedAclAddress = this.#aclAddressOverride ?? chunkQ7ARQSUH_cjs.requireFhevmAclAddress(this.publicClient.chain?.id, "ConfidentialDisperseClient");
|
|
2045
|
+
return this.#cachedAclAddress;
|
|
2046
|
+
}
|
|
2047
|
+
// ============================================================
|
|
2048
|
+
// READ METHODS
|
|
2049
|
+
// ============================================================
|
|
2050
|
+
/**
|
|
2051
|
+
* Check whether a user has registered their wallet pair via `register(token)`.
|
|
2052
|
+
*/
|
|
2053
|
+
async isRegistered(user) {
|
|
2054
|
+
assertChecksumAddress(user, "user", "isRegistered");
|
|
2055
|
+
return this.#read("isRegistered", [user]);
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* Return the on-chain wallet pair for a registered user, or `null` if not registered.
|
|
2059
|
+
*
|
|
2060
|
+
* Both wallet addresses are fetched in parallel via `getUserWallet(user, 0|1)`.
|
|
2061
|
+
* For unregistered users, call {@link predictWallets} to get the deterministic
|
|
2062
|
+
* addresses they would get after registration.
|
|
2063
|
+
*/
|
|
2064
|
+
async getWallets(user) {
|
|
2065
|
+
assertChecksumAddress(user, "user", "getWallets");
|
|
2066
|
+
const registered = await this.isRegistered(user);
|
|
2067
|
+
if (!registered) return null;
|
|
2068
|
+
const [wallet0, wallet1] = await Promise.all([
|
|
2069
|
+
this.#read("getUserWallet", [user, 0n]),
|
|
2070
|
+
this.#read("getUserWallet", [user, 1n])
|
|
2071
|
+
]);
|
|
2072
|
+
return [wallet0, wallet1];
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* Deterministically predict the wallet addresses a user would get after
|
|
2076
|
+
* calling `register()`, even before registration.
|
|
2077
|
+
*
|
|
2078
|
+
* Reads `WALLET_IMPLEMENTATION()` once from chain, then applies the same
|
|
2079
|
+
* `keccak256(abi.encodePacked(user, uint256(0|1)))` salt scheme used in the
|
|
2080
|
+
* contract's `_registerWallets` function.
|
|
2081
|
+
*
|
|
2082
|
+
* Note: `Clones.predictDeterministicAddress(impl, salt)` without an explicit
|
|
2083
|
+
* deployer uses `address(this)` (the singleton) as the deployer — mirrored here.
|
|
2084
|
+
*/
|
|
2085
|
+
async predictWallets(user) {
|
|
2086
|
+
assertChecksumAddress(user, "user", "predictWallets");
|
|
2087
|
+
const impl = await this.#read("WALLET_IMPLEMENTATION");
|
|
2088
|
+
const salt0 = viem.keccak256(viem.encodePacked(["address", "uint256"], [user, 0n]));
|
|
2089
|
+
const salt1 = viem.keccak256(viem.encodePacked(["address", "uint256"], [user, 1n]));
|
|
2090
|
+
const w0 = predictErc1167Address(impl, salt0, this.address);
|
|
2091
|
+
const w1 = predictErc1167Address(impl, salt1, this.address);
|
|
2092
|
+
return [w0, w1];
|
|
2093
|
+
}
|
|
2094
|
+
/**
|
|
2095
|
+
* Return consolidated fee information for a user in a single helper.
|
|
2096
|
+
*
|
|
2097
|
+
* Combines `getFeeAmounts(user)` (per-user resolved fees) and `feeConfig()`
|
|
2098
|
+
* (global toggles) in two parallel RPC calls. UI code calls this to render
|
|
2099
|
+
* the fee panel before the user submits.
|
|
2100
|
+
*/
|
|
2101
|
+
async getFees(user) {
|
|
2102
|
+
assertChecksumAddress(user, "user", "getFees");
|
|
2103
|
+
const [feeAmounts, cfg] = await Promise.all([
|
|
2104
|
+
this.#read("getFeeAmounts", [user]),
|
|
2105
|
+
this.#read("feeConfig")
|
|
2106
|
+
]);
|
|
2107
|
+
const [isCustomFee, gasFee, tokenFee] = feeAmounts;
|
|
2108
|
+
const [gasFeeEnabled, tokenFeeEnabled] = cfg;
|
|
2109
|
+
return {
|
|
2110
|
+
isCustom: isCustomFee,
|
|
2111
|
+
gasFeeWei: gasFee,
|
|
2112
|
+
tokenFeeBps: tokenFee,
|
|
2113
|
+
gasFeeEnabled,
|
|
2114
|
+
tokenFeeEnabled
|
|
2115
|
+
};
|
|
2116
|
+
}
|
|
2117
|
+
/**
|
|
2118
|
+
* Read the raw per-user fee override stored on-chain, BEFORE the global
|
|
2119
|
+
* toggles are applied. Returns `{ enabled: false, gasFeeWei: 0n,
|
|
2120
|
+
* tokenFeeBps: 0 }` when no override exists for `user`.
|
|
2121
|
+
*
|
|
2122
|
+
* Use this — not {@link getFees} — when you need to distinguish "no
|
|
2123
|
+
* override set" from "override set but globally disabled". The resolved
|
|
2124
|
+
* shape is in {@link getFees}.
|
|
2125
|
+
*/
|
|
2126
|
+
async getCustomFee(user) {
|
|
2127
|
+
assertChecksumAddress(user, "user", "getCustomFee");
|
|
2128
|
+
const [enabled, gasFeeWei, tokenFeeBps] = await this.#read(
|
|
2129
|
+
"getCustomFee",
|
|
2130
|
+
[user]
|
|
2131
|
+
);
|
|
2132
|
+
return { enabled, gasFeeWei, tokenFeeBps };
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Return the on-chain global fee configuration.
|
|
2136
|
+
*
|
|
2137
|
+
* Round-trips against {@link setFeeConfig} — pass the result back unchanged
|
|
2138
|
+
* to update one toggle without re-stating the others. Note that ABI outputs
|
|
2139
|
+
* are positional, not named — viem decodes the tuple as an array.
|
|
2140
|
+
*/
|
|
2141
|
+
async getFeeConfig() {
|
|
2142
|
+
const [gasFeeEnabled, tokenFeeEnabled, defaultGasFee, defaultTokenFee] = await this.#read("feeConfig");
|
|
2143
|
+
return { gasFeeEnabled, tokenFeeEnabled, defaultGasFee, defaultTokenFee };
|
|
2144
|
+
}
|
|
2145
|
+
/**
|
|
2146
|
+
* Return batch size limits for all three disperse modes.
|
|
2147
|
+
* `0n` means no limit is configured.
|
|
2148
|
+
*/
|
|
2149
|
+
async getBatchLimits() {
|
|
2150
|
+
const [holding, direct, tokenFee] = await Promise.all([
|
|
2151
|
+
this.#read("maxBatchSizeHolding"),
|
|
2152
|
+
this.#read("maxBatchSizeDirect"),
|
|
2153
|
+
this.#read("maxBatchSizeTokenFee")
|
|
2154
|
+
]);
|
|
2155
|
+
return { holding, direct, tokenFee };
|
|
2156
|
+
}
|
|
2157
|
+
/**
|
|
2158
|
+
* Calculate the fee for a specific disperse call without writing to chain.
|
|
2159
|
+
*
|
|
2160
|
+
* Reads live fee data via `getFeeAmounts(user)` and computes:
|
|
2161
|
+
* - `"wallet"` / `"direct"`: `ethValue = recipients * gasFeeWei`, no token fee.
|
|
2162
|
+
* - `"wallet-token-fee"`: `ethValue = 0n`, `tokenFeeAmount = totalTokens * tokenFeeBps / 10000n`.
|
|
2163
|
+
*
|
|
2164
|
+
* **For `"wallet-token-fee"` mode**, the on-chain fee base is the
|
|
2165
|
+
* post-cap subtotal sum (`subtotal0 + subtotal1`), not `sum(amounts[])`.
|
|
2166
|
+
* The two differ only when the caller has independently constructed subtotals
|
|
2167
|
+
* that don't match `sum(amounts)` — pass `totalTokens === subtotal0 +
|
|
2168
|
+
* subtotal1` for the result to match the on-chain computation. Both this
|
|
2169
|
+
* SDK and the contract round the BPS multiplication down (floor division).
|
|
2170
|
+
*
|
|
2171
|
+
* @throws {TokenOpsSdkError} if mode is `"wallet-token-fee"` and `totalTokens` is not provided.
|
|
2172
|
+
*/
|
|
2173
|
+
async calculateFee(args) {
|
|
2174
|
+
const fees = await this.getFees(args.user);
|
|
2175
|
+
if (args.mode === "wallet-token-fee") {
|
|
2176
|
+
if (args.totalTokens === void 0) {
|
|
2177
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
2178
|
+
method: "calculateFee",
|
|
2179
|
+
argument: "totalTokens",
|
|
2180
|
+
reason: "is required for wallet-token-fee mode"
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
const tokenFeeAmount = args.totalTokens * BigInt(fees.tokenFeeBps) / 10000n;
|
|
2184
|
+
return { ethValue: 0n, tokenFeeAmount };
|
|
2185
|
+
}
|
|
2186
|
+
return { ethValue: BigInt(args.recipients) * fees.gasFeeWei };
|
|
2187
|
+
}
|
|
2188
|
+
/**
|
|
2189
|
+
* Check whether a user's registered subwallets have approved the singleton
|
|
2190
|
+
* as an ERC-7984 operator for the given token.
|
|
2191
|
+
*
|
|
2192
|
+
* Calls `isOperator(wallet, singleton)` on the token contract for each wallet.
|
|
2193
|
+
* Both wallets must return `true` for wallet-mode disperses to work.
|
|
2194
|
+
*
|
|
2195
|
+
* Note: this requires the user to already be registered. For unregistered
|
|
2196
|
+
* users, call {@link predictWallets} first and check predicted addresses.
|
|
2197
|
+
*/
|
|
2198
|
+
async hasApprovedSubwallets(args) {
|
|
2199
|
+
assertChecksumAddress(args.user, "user", "hasApprovedSubwallets");
|
|
2200
|
+
assertChecksumAddress(args.token, "token", "hasApprovedSubwallets");
|
|
2201
|
+
const wallets = await this.getWallets(args.user);
|
|
2202
|
+
if (!wallets) {
|
|
2203
|
+
return { wallet0: false, wallet1: false, both: false };
|
|
2204
|
+
}
|
|
2205
|
+
const [w0, w1] = wallets;
|
|
2206
|
+
const [ok0, ok1] = await Promise.all([
|
|
2207
|
+
this.publicClient.readContract({
|
|
2208
|
+
address: args.token,
|
|
2209
|
+
abi: ERC7984_IS_OPERATOR_ABI,
|
|
2210
|
+
functionName: "isOperator",
|
|
2211
|
+
args: [w0, this.address]
|
|
2212
|
+
}),
|
|
2213
|
+
this.publicClient.readContract({
|
|
2214
|
+
address: args.token,
|
|
2215
|
+
abi: ERC7984_IS_OPERATOR_ABI,
|
|
2216
|
+
functionName: "isOperator",
|
|
2217
|
+
args: [w1, this.address]
|
|
2218
|
+
})
|
|
2219
|
+
]);
|
|
2220
|
+
return { wallet0: ok0, wallet1: ok1, both: ok0 && ok1 };
|
|
2221
|
+
}
|
|
2222
|
+
// ============================================================
|
|
2223
|
+
// PRE-FLIGHT HELPER
|
|
2224
|
+
// ============================================================
|
|
2225
|
+
/**
|
|
2226
|
+
* Comprehensive pre-flight report. One call gives a UI everything it needs
|
|
2227
|
+
* to render a "ready to disperse" checklist.
|
|
2228
|
+
*
|
|
2229
|
+
* Internally composes:
|
|
2230
|
+
* - `isRegistered` + `getWallets` / `predictWallets`
|
|
2231
|
+
* - `hasApprovedSubwallets` (wallet modes) or `isOperator(sender, singleton)` (direct mode)
|
|
2232
|
+
* - `calculateFee` / `getBatchLimits`
|
|
2233
|
+
* - Structural recipient + amount validation
|
|
2234
|
+
*/
|
|
2235
|
+
async preflightDisperse(args) {
|
|
2236
|
+
const { user, token, recipients, amounts, mode } = args;
|
|
2237
|
+
assertChecksumAddress(user, "user", "preflightDisperse");
|
|
2238
|
+
assertChecksumAddress(token, "token", "preflightDisperse");
|
|
2239
|
+
const [isUserRegistered, predictedWallets, batchLimits, callerBalance, isPaused] = await Promise.all([
|
|
2240
|
+
this.isRegistered(user),
|
|
2241
|
+
this.predictWallets(user),
|
|
2242
|
+
this.getBatchLimits(),
|
|
2243
|
+
this.publicClient.getBalance({ address: user }),
|
|
2244
|
+
this.paused()
|
|
2245
|
+
]);
|
|
2246
|
+
const wallets = isUserRegistered ? await this.getWallets(user) : null;
|
|
2247
|
+
let hasApprovedSubwallets = {
|
|
2248
|
+
wallet0: false,
|
|
2249
|
+
wallet1: false,
|
|
2250
|
+
both: false
|
|
2251
|
+
};
|
|
2252
|
+
let hasApprovedSingleton = null;
|
|
2253
|
+
if (mode === "direct") {
|
|
2254
|
+
hasApprovedSingleton = await this.publicClient.readContract({
|
|
2255
|
+
address: token,
|
|
2256
|
+
abi: ERC7984_IS_OPERATOR_ABI,
|
|
2257
|
+
functionName: "isOperator",
|
|
2258
|
+
args: [user, this.address]
|
|
2259
|
+
});
|
|
2260
|
+
} else {
|
|
2261
|
+
if (isUserRegistered) {
|
|
2262
|
+
hasApprovedSubwallets = await this.hasApprovedSubwallets({ user, token });
|
|
2263
|
+
} else if (predictedWallets) {
|
|
2264
|
+
const [ok0, ok1] = await Promise.all([
|
|
2265
|
+
this.publicClient.readContract({
|
|
2266
|
+
address: token,
|
|
2267
|
+
abi: ERC7984_IS_OPERATOR_ABI,
|
|
2268
|
+
functionName: "isOperator",
|
|
2269
|
+
args: [predictedWallets[0], this.address]
|
|
2270
|
+
}),
|
|
2271
|
+
this.publicClient.readContract({
|
|
2272
|
+
address: token,
|
|
2273
|
+
abi: ERC7984_IS_OPERATOR_ABI,
|
|
2274
|
+
functionName: "isOperator",
|
|
2275
|
+
args: [predictedWallets[1], this.address]
|
|
2276
|
+
})
|
|
2277
|
+
]);
|
|
2278
|
+
hasApprovedSubwallets = { wallet0: ok0, wallet1: ok1, both: ok0 && ok1 };
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
const totalTokens = amounts.reduce((a, b) => a + b, 0n);
|
|
2282
|
+
const fee = await this.calculateFee({
|
|
2283
|
+
user,
|
|
2284
|
+
mode,
|
|
2285
|
+
recipients: recipients.length,
|
|
2286
|
+
totalTokens: mode === "wallet-token-fee" ? totalTokens : void 0
|
|
2287
|
+
});
|
|
2288
|
+
const limit = batchLimitForMode(mode, batchLimits);
|
|
2289
|
+
const batchOk = limit === 0n || BigInt(recipients.length) <= limit;
|
|
2290
|
+
const recipientChecks = recipients.map((addr) => {
|
|
2291
|
+
if (addr === "0x0000000000000000000000000000000000000000") {
|
|
2292
|
+
return { address: addr, ok: false, reason: "Zero address" };
|
|
2293
|
+
}
|
|
2294
|
+
return { address: addr, ok: true };
|
|
2295
|
+
});
|
|
2296
|
+
const amountsOk = amounts.length === recipients.length && amounts.length > 0;
|
|
2297
|
+
const allAmountsInUint64 = amountsOk && amounts.every((v) => v >= 0n && v < 1n << 64n);
|
|
2298
|
+
let subtotals;
|
|
2299
|
+
if (mode !== "direct" && allAmountsInUint64) {
|
|
2300
|
+
subtotals = computeSubtotals([...amounts]);
|
|
2301
|
+
}
|
|
2302
|
+
const blockers = [];
|
|
2303
|
+
const blockerErrors = [];
|
|
2304
|
+
const deterministicErrors = validateDisperseInputs({
|
|
2305
|
+
recipients,
|
|
2306
|
+
amounts,
|
|
2307
|
+
mode,
|
|
2308
|
+
batchLimit: limit,
|
|
2309
|
+
method: "preflightDisperse",
|
|
2310
|
+
contractAddress: this.address
|
|
2311
|
+
});
|
|
2312
|
+
for (const err of deterministicErrors) {
|
|
2313
|
+
blockerErrors.push(err);
|
|
2314
|
+
blockers.push(err.message);
|
|
2315
|
+
}
|
|
2316
|
+
if (mode !== "direct" && !isUserRegistered) {
|
|
2317
|
+
blockers.push("User is not registered");
|
|
2318
|
+
blockerErrors.push(
|
|
2319
|
+
new NotRegisteredError({
|
|
2320
|
+
method: "preflightDisperse",
|
|
2321
|
+
contractAddress: this.address,
|
|
2322
|
+
user: args.user
|
|
2323
|
+
})
|
|
2324
|
+
);
|
|
2325
|
+
} else if (mode === "wallet" || mode === "wallet-token-fee") {
|
|
2326
|
+
if (!hasApprovedSubwallets.both)
|
|
2327
|
+
blockers.push(
|
|
2328
|
+
`Wallets not fully approved for token \u2014 wallet0: ${hasApprovedSubwallets.wallet0}, wallet1: ${hasApprovedSubwallets.wallet1}`
|
|
2329
|
+
);
|
|
2330
|
+
}
|
|
2331
|
+
if (mode === "direct" && hasApprovedSingleton === false) {
|
|
2332
|
+
blockers.push("Sender has not approved the singleton as operator on the token");
|
|
2333
|
+
}
|
|
2334
|
+
if (isPaused) {
|
|
2335
|
+
blockers.push("Singleton is paused");
|
|
2336
|
+
blockerErrors.push(
|
|
2337
|
+
new chunk56UI7LUR_cjs.PausedError({ method: "preflightDisperse", contractAddress: this.address })
|
|
2338
|
+
);
|
|
2339
|
+
}
|
|
2340
|
+
if (callerBalance < fee.ethValue) {
|
|
2341
|
+
blockerErrors.push(
|
|
2342
|
+
new chunk56UI7LUR_cjs.InsufficientFeeError({
|
|
2343
|
+
method: "preflightDisperse",
|
|
2344
|
+
contractAddress: this.address,
|
|
2345
|
+
feeKind: "gas",
|
|
2346
|
+
required: fee.ethValue,
|
|
2347
|
+
provided: callerBalance
|
|
2348
|
+
})
|
|
2349
|
+
);
|
|
2350
|
+
blockers.push(
|
|
2351
|
+
`User ETH balance (${callerBalance.toString()} wei) is below the required gas fee (${fee.ethValue.toString()} wei)`
|
|
2352
|
+
);
|
|
2353
|
+
}
|
|
2354
|
+
return {
|
|
2355
|
+
isUserRegistered,
|
|
2356
|
+
wallets,
|
|
2357
|
+
predictedWallets,
|
|
2358
|
+
hasApprovedSubwallets,
|
|
2359
|
+
hasApprovedSingleton,
|
|
2360
|
+
feeEth: fee.ethValue,
|
|
2361
|
+
feeTokenAmount: fee.tokenFeeAmount,
|
|
2362
|
+
batchLimit: limit,
|
|
2363
|
+
batchOk,
|
|
2364
|
+
recipientChecks,
|
|
2365
|
+
amountsOk,
|
|
2366
|
+
subtotals,
|
|
2367
|
+
ready: blockers.length === 0,
|
|
2368
|
+
blockers,
|
|
2369
|
+
blockerErrors
|
|
2370
|
+
};
|
|
2371
|
+
}
|
|
2372
|
+
// ============================================================
|
|
2373
|
+
// WRITE METHODS
|
|
2374
|
+
// ============================================================
|
|
2375
|
+
/**
|
|
2376
|
+
* Register the caller's dedicated wallet pair for wallet-mode disperses.
|
|
2377
|
+
*
|
|
2378
|
+
* Deploys two deterministic ERC-1167 wallet clones and approves them for `token`.
|
|
2379
|
+
* Can only be called once per user — subsequent calls revert with `UserAlreadyRegistered`.
|
|
2380
|
+
*
|
|
2381
|
+
* @returns `{ hash, wallets }` — `wallets` is parsed from the `UserRegistered` event.
|
|
2382
|
+
* @throws {DisperseSubwalletNotFoundError} if no `UserRegistered` event matching the singleton is found.
|
|
2383
|
+
*/
|
|
2384
|
+
async register(args) {
|
|
2385
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-disperse.singleton.register", async () => {
|
|
2386
|
+
assertChecksumAddress(args.token, "token", "register");
|
|
2387
|
+
const wallet = this.#requireWallet("register");
|
|
2388
|
+
const account = this.#resolveAccount(wallet, args.account, "register");
|
|
2389
|
+
const userAddress = accountAddress(account);
|
|
2390
|
+
await this.#preflightWrite("register", "register", [args.token], account, {
|
|
2391
|
+
user: userAddress
|
|
2392
|
+
});
|
|
2393
|
+
let hash;
|
|
2394
|
+
try {
|
|
2395
|
+
hash = await wallet.writeContract({
|
|
2396
|
+
address: this.address,
|
|
2397
|
+
abi: disperseConfidentialAbi,
|
|
2398
|
+
functionName: "register",
|
|
2399
|
+
args: [args.token],
|
|
2400
|
+
account,
|
|
2401
|
+
chain: wallet.chain
|
|
2402
|
+
});
|
|
2403
|
+
} catch (err) {
|
|
2404
|
+
throw this.#mapRevert("register", err, { user: userAddress }, userAddress);
|
|
2405
|
+
}
|
|
2406
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
2407
|
+
const events = viem.parseEventLogs({
|
|
2408
|
+
abi: disperseConfidentialAbi,
|
|
2409
|
+
eventName: "UserRegistered",
|
|
2410
|
+
logs: receipt.logs
|
|
2411
|
+
});
|
|
2412
|
+
const ours = events.filter((ev2) => ev2.address.toLowerCase() === this.address.toLowerCase());
|
|
2413
|
+
if (ours.length === 0) {
|
|
2414
|
+
throw new DisperseSubwalletNotFoundError(hash, this.address);
|
|
2415
|
+
}
|
|
2416
|
+
const ev = ours[0];
|
|
2417
|
+
return { hash, wallets: [ev.args.wallet0, ev.args.wallet1] };
|
|
2418
|
+
});
|
|
2419
|
+
}
|
|
2420
|
+
/**
|
|
2421
|
+
* Approve the caller's existing registered wallets as ERC-7984 operators for `token`.
|
|
2422
|
+
*
|
|
2423
|
+
* Required for wallet-mode disperses when using a token different from the one
|
|
2424
|
+
* passed at registration time.
|
|
2425
|
+
*/
|
|
2426
|
+
async approveTokenOnWallets(args) {
|
|
2427
|
+
assertChecksumAddress(args.token, "token", "approveTokenOnWallets");
|
|
2428
|
+
const user = this.#userAddressFromOverride(args.account, "approveTokenOnWallets");
|
|
2429
|
+
return this.#write("approveUserWalletsForToken", [args.token], args.account, { user });
|
|
2430
|
+
}
|
|
2431
|
+
/**
|
|
2432
|
+
* Revoke the operator approval on `token` for the caller's wallets.
|
|
2433
|
+
*
|
|
2434
|
+
* The user can re-approve later via `approveTokenOnWallets`.
|
|
2435
|
+
*/
|
|
2436
|
+
async revokeTokenOnWallets(args) {
|
|
2437
|
+
assertChecksumAddress(args.token, "token", "revokeTokenOnWallets");
|
|
2438
|
+
const user = this.#userAddressFromOverride(args.account, "revokeTokenOnWallets");
|
|
2439
|
+
return this.#write("revokeUserWalletsForToken", [args.token], args.account, { user });
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Recover all residual confidential tokens from the caller's wallets to `to`.
|
|
2443
|
+
*
|
|
2444
|
+
* Use after a wallet-mode disperse where the subtotals were inflated and tokens
|
|
2445
|
+
* remain locked in the wallets. Returns the bare tx hash (not a wrapped result
|
|
2446
|
+
* object) — unlike `disperse()`, this method does not surface any additional
|
|
2447
|
+
* receipt-derived data.
|
|
2448
|
+
*/
|
|
2449
|
+
async recoverFromWallets(args) {
|
|
2450
|
+
assertChecksumAddress(args.token, "token", "recoverFromWallets");
|
|
2451
|
+
assertNonZeroChecksumAddress(args.to, "to", "recoverFromWallets");
|
|
2452
|
+
const user = this.#userAddressFromOverride(args.account, "recoverFromWallets");
|
|
2453
|
+
return this.#write("recoverFromWallets", [args.token, args.to], args.account, { user });
|
|
2454
|
+
}
|
|
2455
|
+
/**
|
|
2456
|
+
* Recover ERC-20 tokens accidentally sent to the caller's wallets. Returns the
|
|
2457
|
+
* bare tx hash.
|
|
2458
|
+
*/
|
|
2459
|
+
async recoverERC20FromWallets(args) {
|
|
2460
|
+
assertChecksumAddress(args.token, "token", "recoverERC20FromWallets");
|
|
2461
|
+
assertNonZeroChecksumAddress(args.to, "to", "recoverERC20FromWallets");
|
|
2462
|
+
const user = this.#userAddressFromOverride(args.account, "recoverERC20FromWallets");
|
|
2463
|
+
return this.#write("recoverERC20FromWallets", [args.token, args.to], args.account, { user });
|
|
2464
|
+
}
|
|
2465
|
+
/**
|
|
2466
|
+
* Disperse confidential tokens to multiple recipients.
|
|
2467
|
+
*
|
|
2468
|
+
* SDK responsibilities:
|
|
2469
|
+
* 1. Validates input deterministically (lengths, zero addresses, per-amount
|
|
2470
|
+
* uint64 bounds, wallet-mode subtotal overflow, batch-limit for the
|
|
2471
|
+
* selected mode) — using the same {@link validateDisperseInputs} helper
|
|
2472
|
+
* `preflightDisperse` uses, so an oversized or malformed batch is rejected
|
|
2473
|
+
* before any FHE encryption time is spent.
|
|
2474
|
+
* 2. For wallet modes: computes group subtotals using the contract's exact split rule.
|
|
2475
|
+
* 3. Encrypts amounts + subtotals in a single batch call (one input proof).
|
|
2476
|
+
* 4. Computes `msg.value` for gas-fee modes; `0` for token-fee mode.
|
|
2477
|
+
* 5. Dispatches to the correct contract function based on `mode`.
|
|
2478
|
+
*
|
|
2479
|
+
* @throws {TokenOpsSdkError} on input validation failure (first deterministic error).
|
|
2480
|
+
* @throws {TokenOpsSdkError} if no encryptor is available at call time.
|
|
2481
|
+
*/
|
|
2482
|
+
async disperse(args) {
|
|
2483
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-disperse.singleton.disperse", async () => {
|
|
2484
|
+
const { token, mode, recipients, amounts } = args;
|
|
2485
|
+
assertChecksumAddress(token, "token", "disperse");
|
|
2486
|
+
const wallet = this.#requireWallet("disperse");
|
|
2487
|
+
const account = this.#resolveAccount(wallet, args.account, "disperse");
|
|
2488
|
+
const enc = resolveEncryptor(this.encryptor);
|
|
2489
|
+
if (!enc) {
|
|
2490
|
+
throw new chunk56UI7LUR_cjs.MissingEncryptorError("disperse", {
|
|
2491
|
+
hint: "Pass `encryptor` to the call or the client config."
|
|
2492
|
+
});
|
|
2493
|
+
}
|
|
2494
|
+
const batchLimits = await this.getBatchLimits();
|
|
2495
|
+
const errors = validateDisperseInputs({
|
|
2496
|
+
recipients,
|
|
2497
|
+
amounts,
|
|
2498
|
+
mode,
|
|
2499
|
+
batchLimit: batchLimitForMode(mode, batchLimits),
|
|
2500
|
+
method: "disperse",
|
|
2501
|
+
contractAddress: this.address
|
|
2502
|
+
});
|
|
2503
|
+
if (errors[0]) throw errors[0];
|
|
2504
|
+
const userAddr = accountAddress(account);
|
|
2505
|
+
if (mode === "direct") {
|
|
2506
|
+
return this.#disperseDirect({
|
|
2507
|
+
token,
|
|
2508
|
+
recipients,
|
|
2509
|
+
amounts,
|
|
2510
|
+
account,
|
|
2511
|
+
wallet,
|
|
2512
|
+
userAddr,
|
|
2513
|
+
enc,
|
|
2514
|
+
gasFeeOverride: args.gasFeeOverride
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
return this.#disperseWallet({
|
|
2518
|
+
token,
|
|
2519
|
+
mode,
|
|
2520
|
+
recipients,
|
|
2521
|
+
amounts,
|
|
2522
|
+
account,
|
|
2523
|
+
wallet,
|
|
2524
|
+
userAddr,
|
|
2525
|
+
enc,
|
|
2526
|
+
gasFeeOverride: args.gasFeeOverride
|
|
2527
|
+
});
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
// ============================================================
|
|
2531
|
+
// ENCRYPTED FEE RESERVE (ADMIN / FEE_COLLECTOR)
|
|
2532
|
+
// ============================================================
|
|
2533
|
+
/**
|
|
2534
|
+
* **This is a write transaction, not a free view. It costs gas.**
|
|
2535
|
+
*
|
|
2536
|
+
* Grant the caller persistent FHE ACL on the encrypted token fee reserve and
|
|
2537
|
+
* return the handle. The handle is extracted from the receipt's ACL `Allowed`
|
|
2538
|
+
* event — using `simulateContract` here would return a divergent handle that
|
|
2539
|
+
* breaks user-decrypt downstream (Pitfall #1).
|
|
2540
|
+
*
|
|
2541
|
+
* If no fees have accrued for `token`, the contract does not emit an ACL event
|
|
2542
|
+
* and this method throws {@link DisperseEncryptedReserveNotGrantedError}.
|
|
2543
|
+
* Check `FHE.isInitialized` off-chain: a zero-hash handle means the reserve
|
|
2544
|
+
* is uninitialised.
|
|
2545
|
+
*
|
|
2546
|
+
* Requires FEE_COLLECTOR_ROLE or DEFAULT_ADMIN_ROLE.
|
|
2547
|
+
*
|
|
2548
|
+
* @throws {DisperseEncryptedReserveNotGrantedError} when no ACL event is found
|
|
2549
|
+
* (i.e., reserve is uninitialised — no fees have accrued).
|
|
2550
|
+
*/
|
|
2551
|
+
async getEncryptedFeeReserve(args) {
|
|
2552
|
+
assertChecksumAddress(args.token, "token", "getEncryptedFeeReserve");
|
|
2553
|
+
const wallet = this.#requireWallet("getEncryptedFeeReserve");
|
|
2554
|
+
const account = this.#resolveAccount(wallet, args.account, "getEncryptedFeeReserve");
|
|
2555
|
+
await this.#preflightWrite(
|
|
2556
|
+
"getEncryptedFeeReserve",
|
|
2557
|
+
"accessEncryptedFeeReserve",
|
|
2558
|
+
[args.token],
|
|
2559
|
+
account,
|
|
2560
|
+
{ user: accountAddress(account) }
|
|
2561
|
+
);
|
|
2562
|
+
let hash;
|
|
2563
|
+
try {
|
|
2564
|
+
hash = await wallet.writeContract({
|
|
2565
|
+
address: this.address,
|
|
2566
|
+
abi: disperseConfidentialAbi,
|
|
2567
|
+
functionName: "accessEncryptedFeeReserve",
|
|
2568
|
+
args: [args.token],
|
|
2569
|
+
account,
|
|
2570
|
+
chain: wallet.chain
|
|
2571
|
+
});
|
|
2572
|
+
} catch (err) {
|
|
2573
|
+
throw this.#mapRevert(
|
|
2574
|
+
"getEncryptedFeeReserve",
|
|
2575
|
+
err,
|
|
2576
|
+
{ user: accountAddress(account) },
|
|
2577
|
+
accountAddress(account)
|
|
2578
|
+
);
|
|
2579
|
+
}
|
|
2580
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
2581
|
+
const callerAddress = accountAddress(account).toLowerCase();
|
|
2582
|
+
const aclLogs = receipt.logs.filter(
|
|
2583
|
+
(log) => log.address.toLowerCase() === this.aclAddress.toLowerCase()
|
|
2584
|
+
);
|
|
2585
|
+
const events = viem.parseEventLogs({ abi: [chunkQ7ARQSUH_cjs.ACL_ALLOWED_EVENT], logs: aclLogs });
|
|
2586
|
+
const granted = events.filter(
|
|
2587
|
+
(ev) => ev.args.account.toLowerCase() === callerAddress && ev.args.caller.toLowerCase() === this.address.toLowerCase()
|
|
2588
|
+
);
|
|
2589
|
+
if (granted.length === 0) {
|
|
2590
|
+
throw new DisperseEncryptedReserveNotGrantedError(hash, accountAddress(account));
|
|
2591
|
+
}
|
|
2592
|
+
if (granted.length > 1) {
|
|
2593
|
+
throw new chunk56UI7LUR_cjs.ReceiptEventAmbiguousError({
|
|
2594
|
+
method: "getEncryptedFeeReserve",
|
|
2595
|
+
eventName: "Allowed",
|
|
2596
|
+
contractAddress: this.aclAddress,
|
|
2597
|
+
count: granted.length,
|
|
2598
|
+
txHash: hash
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
const handle = granted[0].args.handle;
|
|
2602
|
+
return { handle, hash };
|
|
2603
|
+
}
|
|
2604
|
+
// ============================================================
|
|
2605
|
+
// DISCLOSURE METHODS
|
|
2606
|
+
// ============================================================
|
|
2607
|
+
/**
|
|
2608
|
+
* Grant `party` persistent FHE ACL on a single `handle`.
|
|
2609
|
+
*
|
|
2610
|
+
* Caller must already hold ACL on `handle`. FHEVM ACL is append-only — the
|
|
2611
|
+
* grant cannot be revoked.
|
|
2612
|
+
*
|
|
2613
|
+
* @returns `{ hash, discloser, party, disclosedHandles }`. The non-`hash`
|
|
2614
|
+
* fields are parsed from the `HandlesDisclosedToParty` event when present;
|
|
2615
|
+
* if the event is absent (anomalous), they fall back to the call's inputs.
|
|
2616
|
+
*/
|
|
2617
|
+
async discloseHandleToParty(args) {
|
|
2618
|
+
assertChecksumAddress(args.party, "party", "discloseHandleToParty");
|
|
2619
|
+
const wallet = this.#requireWallet("discloseHandleToParty");
|
|
2620
|
+
const acct = this.#resolveAccount(wallet, args.account, "discloseHandleToParty");
|
|
2621
|
+
const hash = await this.#write(
|
|
2622
|
+
"discloseHandleToParty",
|
|
2623
|
+
[args.handle, args.party],
|
|
2624
|
+
args.account
|
|
2625
|
+
);
|
|
2626
|
+
return this.#parseDisclosure(hash, accountAddress(acct), args.party, [args.handle]);
|
|
2627
|
+
}
|
|
2628
|
+
/**
|
|
2629
|
+
* Batch variant — atomically grant `party` persistent ACL on all `handles`.
|
|
2630
|
+
* Reverts on the first handle that fails caller-ACL or contract-ACL checks.
|
|
2631
|
+
*/
|
|
2632
|
+
async batchDiscloseHandlesToParty(args) {
|
|
2633
|
+
assertChecksumAddress(args.party, "party", "batchDiscloseHandlesToParty");
|
|
2634
|
+
const wallet = this.#requireWallet("batchDiscloseHandlesToParty");
|
|
2635
|
+
const acct = this.#resolveAccount(wallet, args.account, "batchDiscloseHandlesToParty");
|
|
2636
|
+
const hash = await this.#write(
|
|
2637
|
+
"batchDiscloseHandlesToParty",
|
|
2638
|
+
[args.handles, args.party],
|
|
2639
|
+
args.account
|
|
2640
|
+
);
|
|
2641
|
+
return this.#parseDisclosure(hash, accountAddress(acct), args.party, args.handles);
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* Parse a `HandlesDisclosedToParty` event from a disclosure receipt. If the
|
|
2645
|
+
* event is missing (which would indicate a contract or parser anomaly),
|
|
2646
|
+
* fall back to the inputs the caller passed — the tx already succeeded.
|
|
2647
|
+
*/
|
|
2648
|
+
async #parseDisclosure(hash, fallbackDiscloser, fallbackParty, fallbackHandles) {
|
|
2649
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
2650
|
+
const events = viem.parseEventLogs({
|
|
2651
|
+
abi: disperseConfidentialAbi,
|
|
2652
|
+
eventName: "HandlesDisclosedToParty",
|
|
2653
|
+
logs: receipt.logs.filter((log) => log.address.toLowerCase() === this.address.toLowerCase())
|
|
2654
|
+
});
|
|
2655
|
+
const ev = events[0];
|
|
2656
|
+
if (!ev) {
|
|
2657
|
+
return {
|
|
2658
|
+
hash,
|
|
2659
|
+
discloser: fallbackDiscloser,
|
|
2660
|
+
party: fallbackParty,
|
|
2661
|
+
disclosedHandles: [...fallbackHandles]
|
|
2662
|
+
};
|
|
2663
|
+
}
|
|
2664
|
+
return {
|
|
2665
|
+
hash,
|
|
2666
|
+
discloser: ev.args.discloser,
|
|
2667
|
+
party: ev.args.party,
|
|
2668
|
+
disclosedHandles: [...ev.args.handles]
|
|
2669
|
+
};
|
|
2670
|
+
}
|
|
2671
|
+
// ============================================================
|
|
2672
|
+
// ADMIN / FEE-MANAGER / FEE-COLLECTOR WRITES
|
|
2673
|
+
// ============================================================
|
|
2674
|
+
/**
|
|
2675
|
+
* Pause all disperse operations. Requires PAUSER_ROLE.
|
|
2676
|
+
* @returns Transaction hash.
|
|
2677
|
+
*/
|
|
2678
|
+
async pause(account) {
|
|
2679
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-disperse.singleton.pause", async () => {
|
|
2680
|
+
return this.#write("pause", [], account);
|
|
2681
|
+
});
|
|
2682
|
+
}
|
|
2683
|
+
/**
|
|
2684
|
+
* Unpause the singleton. Requires PAUSER_ROLE.
|
|
2685
|
+
* @returns Transaction hash.
|
|
2686
|
+
*/
|
|
2687
|
+
async unpause(account) {
|
|
2688
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-disperse.singleton.unpause", async () => {
|
|
2689
|
+
return this.#write("unpause", [], account);
|
|
2690
|
+
});
|
|
2691
|
+
}
|
|
2692
|
+
/**
|
|
2693
|
+
* Update the global fee configuration: enable/disable gas and token fees, set defaults.
|
|
2694
|
+
* Requires FEE_MANAGER_ROLE.
|
|
2695
|
+
* @returns Transaction hash.
|
|
2696
|
+
*/
|
|
2697
|
+
async setFeeConfig(config, account) {
|
|
2698
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-disperse.singleton.setFeeConfig", async () => {
|
|
2699
|
+
return this.#write(
|
|
2700
|
+
"setFeeConfig",
|
|
2701
|
+
[
|
|
2702
|
+
{
|
|
2703
|
+
gasFeeEnabled: config.gasFeeEnabled,
|
|
2704
|
+
tokenFeeEnabled: config.tokenFeeEnabled,
|
|
2705
|
+
defaultGasFee: config.defaultGasFee,
|
|
2706
|
+
defaultTokenFee: config.defaultTokenFee
|
|
2707
|
+
}
|
|
2708
|
+
],
|
|
2709
|
+
account
|
|
2710
|
+
);
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
/**
|
|
2714
|
+
* Set a per-user fee override (gas fee in wei, token fee in BPS).
|
|
2715
|
+
* Requires FEE_MANAGER_ROLE.
|
|
2716
|
+
* @returns Transaction hash.
|
|
2717
|
+
*/
|
|
2718
|
+
async setCustomFee(user, gasFee, tokenFee, account) {
|
|
2719
|
+
assertChecksumAddress(user, "user", "setCustomFee");
|
|
2720
|
+
return this.#write("setCustomFee", [user, gasFee, tokenFee], account);
|
|
2721
|
+
}
|
|
2722
|
+
/**
|
|
2723
|
+
* Remove a per-user fee override, falling back to the global defaults.
|
|
2724
|
+
* Requires FEE_MANAGER_ROLE. Throws `CustomFeeNotSet` if no override exists.
|
|
2725
|
+
* @returns Transaction hash.
|
|
2726
|
+
*/
|
|
2727
|
+
async disableCustomFee(user, account) {
|
|
2728
|
+
assertChecksumAddress(user, "user", "disableCustomFee");
|
|
2729
|
+
return this.#write("disableCustomFee", [user], account, { user });
|
|
2730
|
+
}
|
|
2731
|
+
/**
|
|
2732
|
+
* Set the maximum batch size for `"wallet"` mode disperses. `0n` = no limit.
|
|
2733
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
2734
|
+
* @returns Transaction hash.
|
|
2735
|
+
*/
|
|
2736
|
+
async setMaxBatchSizeHolding(size, account) {
|
|
2737
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(
|
|
2738
|
+
this.#telemetry,
|
|
2739
|
+
"fhe-disperse.singleton.setMaxBatchSizeHolding",
|
|
2740
|
+
async () => {
|
|
2741
|
+
return this.#write("setMaxBatchSizeHolding", [size], account);
|
|
2742
|
+
}
|
|
2743
|
+
);
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Set the maximum batch size for `"direct"` mode disperses. `0n` = no limit.
|
|
2747
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
2748
|
+
* @returns Transaction hash.
|
|
2749
|
+
*/
|
|
2750
|
+
async setMaxBatchSizeDirect(size, account) {
|
|
2751
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(
|
|
2752
|
+
this.#telemetry,
|
|
2753
|
+
"fhe-disperse.singleton.setMaxBatchSizeDirect",
|
|
2754
|
+
async () => {
|
|
2755
|
+
return this.#write("setMaxBatchSizeDirect", [size], account);
|
|
2756
|
+
}
|
|
2757
|
+
);
|
|
2758
|
+
}
|
|
2759
|
+
/**
|
|
2760
|
+
* Set the maximum batch size for `"wallet-token-fee"` mode disperses. `0n` = no limit.
|
|
2761
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
2762
|
+
* @returns Transaction hash.
|
|
2763
|
+
*/
|
|
2764
|
+
async setMaxBatchSizeTokenFee(size, account) {
|
|
2765
|
+
return chunkVJKZWYYJ_cjs.withTelemetry(
|
|
2766
|
+
this.#telemetry,
|
|
2767
|
+
"fhe-disperse.singleton.setMaxBatchSizeTokenFee",
|
|
2768
|
+
async () => {
|
|
2769
|
+
return this.#write("setMaxBatchSizeTokenFee", [size], account);
|
|
2770
|
+
}
|
|
2771
|
+
);
|
|
2772
|
+
}
|
|
2773
|
+
/**
|
|
2774
|
+
* Withdraw `amount` wei of accumulated ETH gas fees to `to`. The amount is
|
|
2775
|
+
* not capped on-chain — callers MUST pass an explicit amount. There is no
|
|
2776
|
+
* "drain full balance" sentinel: passing `0n` succeeds with no ETH movement.
|
|
2777
|
+
* Read the singleton's ETH balance with `publicClient.getBalance(singleton)`
|
|
2778
|
+
* to drain.
|
|
2779
|
+
*
|
|
2780
|
+
* Requires FEE_COLLECTOR_ROLE.
|
|
2781
|
+
* @returns Transaction hash.
|
|
2782
|
+
*/
|
|
2783
|
+
async withdrawGasFee(to, amount, account) {
|
|
2784
|
+
assertNonZeroChecksumAddress(to, "to", "withdrawGasFee");
|
|
2785
|
+
return this.#write("withdrawGasFee", [to, amount], account);
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Withdraw accumulated encrypted token fees.
|
|
2789
|
+
*
|
|
2790
|
+
* The amount is encrypted by the caller — pass plaintext `amount` and an
|
|
2791
|
+
* encryptor, or pass `encryptedInput` directly. The contract caps the
|
|
2792
|
+
* withdrawal at the available reserve via `FHE.min`.
|
|
2793
|
+
*
|
|
2794
|
+
* Returns the tx hash plus the **transferred** handle parsed from the
|
|
2795
|
+
* `TokenFeeWithdrawn` event. Decrypt the handle via Zama's `userDecrypt`
|
|
2796
|
+
* to view the actual amount moved (which can be less than requested when
|
|
2797
|
+
* the reserve was smaller than the request). The caller is granted
|
|
2798
|
+
* persistent ACL on this handle by the contract.
|
|
2799
|
+
*
|
|
2800
|
+
* **`encryptedInput` is bound to (this singleton, this caller).** Zama's
|
|
2801
|
+
* KMSVerifier rejects proofs whose `contractAddress` or `userAddress`
|
|
2802
|
+
* don't match the executing tx. If you pre-encrypt on a different chain's
|
|
2803
|
+
* singleton, or for a different caller, the on-chain submission will
|
|
2804
|
+
* revert with a generic verification failure. The plaintext `amount`
|
|
2805
|
+
* path is safer when the caller / chain isn't fixed yet.
|
|
2806
|
+
*/
|
|
2807
|
+
async withdrawTokenFee(args) {
|
|
2808
|
+
assertChecksumAddress(args.token, "token", "withdrawTokenFee");
|
|
2809
|
+
assertNonZeroChecksumAddress(args.to, "to", "withdrawTokenFee");
|
|
2810
|
+
const wallet = this.#requireWallet("withdrawTokenFee");
|
|
2811
|
+
const account = this.#resolveAccount(wallet, args.account, "withdrawTokenFee");
|
|
2812
|
+
const encrypted = await this.#encryptSingle(
|
|
2813
|
+
args.amount,
|
|
2814
|
+
args.encryptor,
|
|
2815
|
+
args.encryptedInput,
|
|
2816
|
+
account,
|
|
2817
|
+
"withdrawTokenFee"
|
|
2818
|
+
);
|
|
2819
|
+
await this.#preflightWrite(
|
|
2820
|
+
"withdrawTokenFee",
|
|
2821
|
+
"withdrawTokenFee",
|
|
2822
|
+
[args.token, args.to, encrypted.handle, encrypted.inputProof],
|
|
2823
|
+
account
|
|
2824
|
+
);
|
|
2825
|
+
let hash;
|
|
2826
|
+
try {
|
|
2827
|
+
hash = await wallet.writeContract({
|
|
2828
|
+
address: this.address,
|
|
2829
|
+
abi: disperseConfidentialAbi,
|
|
2830
|
+
functionName: "withdrawTokenFee",
|
|
2831
|
+
args: [args.token, args.to, encrypted.handle, encrypted.inputProof],
|
|
2832
|
+
account,
|
|
2833
|
+
chain: wallet.chain
|
|
2834
|
+
});
|
|
2835
|
+
} catch (err) {
|
|
2836
|
+
throw this.#mapRevert("withdrawTokenFee", err, void 0, accountAddress(account));
|
|
2837
|
+
}
|
|
2838
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
2839
|
+
const events = viem.parseEventLogs({
|
|
2840
|
+
abi: disperseConfidentialAbi,
|
|
2841
|
+
eventName: "TokenFeeWithdrawn",
|
|
2842
|
+
logs: receipt.logs.filter((log) => log.address.toLowerCase() === this.address.toLowerCase())
|
|
2843
|
+
});
|
|
2844
|
+
const transferredHandle = events[0]?.args.amount;
|
|
2845
|
+
return { hash, transferredHandle };
|
|
2846
|
+
}
|
|
2847
|
+
/**
|
|
2848
|
+
* Rescue accidentally-sent ERC-7984 confidential tokens from the singleton.
|
|
2849
|
+
* Requires WITHDRAWER_ROLE.
|
|
2850
|
+
* @returns Transaction hash.
|
|
2851
|
+
*/
|
|
2852
|
+
async rescueConfidentialTokens(token, to, account) {
|
|
2853
|
+
assertChecksumAddress(token, "token", "rescueConfidentialTokens");
|
|
2854
|
+
assertNonZeroChecksumAddress(to, "to", "rescueConfidentialTokens");
|
|
2855
|
+
return this.#write("rescueConfidentialTokens", [token, to], account);
|
|
2856
|
+
}
|
|
2857
|
+
/**
|
|
2858
|
+
* Rescue accidentally-sent ERC-20 tokens from the singleton.
|
|
2859
|
+
* Requires WITHDRAWER_ROLE.
|
|
2860
|
+
* @returns Transaction hash.
|
|
2861
|
+
*/
|
|
2862
|
+
async rescueERC20(token, to, account) {
|
|
2863
|
+
assertChecksumAddress(token, "token", "rescueERC20");
|
|
2864
|
+
assertNonZeroChecksumAddress(to, "to", "rescueERC20");
|
|
2865
|
+
return this.#write("rescueERC20", [token, to], account);
|
|
2866
|
+
}
|
|
2867
|
+
// ============================================================
|
|
2868
|
+
// ROLE MANAGEMENT
|
|
2869
|
+
// ============================================================
|
|
2870
|
+
/**
|
|
2871
|
+
* Check whether `address` holds `role` on the singleton.
|
|
2872
|
+
* @example
|
|
2873
|
+
* const isAdmin = await client.hasRole("0x0000...0000", account.address);
|
|
2874
|
+
*/
|
|
2875
|
+
async hasRole(role, address) {
|
|
2876
|
+
assertChecksumAddress(address, "address", "hasRole");
|
|
2877
|
+
return this.#read("hasRole", [role, address]);
|
|
2878
|
+
}
|
|
2879
|
+
/**
|
|
2880
|
+
* Grant `role` to `accountTarget`. Requires DEFAULT_ADMIN_ROLE.
|
|
2881
|
+
* @returns Transaction hash.
|
|
2882
|
+
*/
|
|
2883
|
+
async grantRole(role, accountTarget, account) {
|
|
2884
|
+
assertChecksumAddress(accountTarget, "accountTarget", "grantRole");
|
|
2885
|
+
return this.#write("grantRole", [role, accountTarget], account);
|
|
2886
|
+
}
|
|
2887
|
+
/**
|
|
2888
|
+
* Revoke `role` from `accountTarget`. Requires DEFAULT_ADMIN_ROLE.
|
|
2889
|
+
* @returns Transaction hash.
|
|
2890
|
+
*/
|
|
2891
|
+
async revokeRole(role, accountTarget, account) {
|
|
2892
|
+
assertChecksumAddress(accountTarget, "accountTarget", "revokeRole");
|
|
2893
|
+
return this.#write("revokeRole", [role, accountTarget], account);
|
|
2894
|
+
}
|
|
2895
|
+
/**
|
|
2896
|
+
* Voluntarily relinquish `role` from the caller. The contract enforces
|
|
2897
|
+
* `callerConfirmation === msg.sender` (OZ AccessControl) as a guard against
|
|
2898
|
+
* accidental renunciation via a wrapper contract — pass the connected
|
|
2899
|
+
* wallet's address here.
|
|
2900
|
+
*
|
|
2901
|
+
* Use to permanently drop privileges from a fee-collector / withdrawer /
|
|
2902
|
+
* pauser without needing an admin's `revokeRole`. Cannot be undone.
|
|
2903
|
+
*
|
|
2904
|
+
* @returns Transaction hash.
|
|
2905
|
+
*/
|
|
2906
|
+
async renounceRole(role, callerConfirmation, account) {
|
|
2907
|
+
assertChecksumAddress(callerConfirmation, "callerConfirmation", "renounceRole");
|
|
2908
|
+
return this.#write("renounceRole", [role, callerConfirmation], account);
|
|
2909
|
+
}
|
|
2910
|
+
// ============================================================
|
|
2911
|
+
// STATE READS
|
|
2912
|
+
// ============================================================
|
|
2913
|
+
/** Whether the singleton is currently paused. */
|
|
2914
|
+
async paused() {
|
|
2915
|
+
return this.#read("paused");
|
|
2916
|
+
}
|
|
2917
|
+
/** Block number at which the singleton was deployed. */
|
|
2918
|
+
async deploymentBlockNumber() {
|
|
2919
|
+
return this.#read("DEPLOYMENT_BLOCK_NUMBER");
|
|
2920
|
+
}
|
|
2921
|
+
/** The ERC-1167 `WALLET_IMPLEMENTATION` address used by `Clones.cloneDeterministic`. */
|
|
2922
|
+
async walletImplementation() {
|
|
2923
|
+
return this.#read("WALLET_IMPLEMENTATION");
|
|
2924
|
+
}
|
|
2925
|
+
// ============================================================
|
|
2926
|
+
// INTERNAL HELPERS
|
|
2927
|
+
// ============================================================
|
|
2928
|
+
async #disperseDirect(args) {
|
|
2929
|
+
const { token, recipients, amounts, account, wallet, userAddr, enc, gasFeeOverride } = args;
|
|
2930
|
+
let encrypted;
|
|
2931
|
+
try {
|
|
2932
|
+
encrypted = await encryptUint64Batch({
|
|
2933
|
+
encryptor: enc,
|
|
2934
|
+
contractAddress: this.address,
|
|
2935
|
+
userAddress: userAddr,
|
|
2936
|
+
values: amounts
|
|
2937
|
+
});
|
|
2938
|
+
} catch (err) {
|
|
2939
|
+
throw chunkNS44KBV5_cjs.mapZamaError(err, { method: "disperse[direct]", operation: "encrypt" });
|
|
2940
|
+
}
|
|
2941
|
+
let ethValue = gasFeeOverride;
|
|
2942
|
+
if (ethValue === void 0) {
|
|
2943
|
+
const fees = await this.getFees(userAddr);
|
|
2944
|
+
ethValue = BigInt(recipients.length) * fees.gasFeeWei;
|
|
2945
|
+
}
|
|
2946
|
+
await this.#preflightWrite(
|
|
2947
|
+
"disperse[direct]",
|
|
2948
|
+
"disperseConfidentialTokenDirect",
|
|
2949
|
+
[token, recipients, encrypted.handles, encrypted.inputProof],
|
|
2950
|
+
account,
|
|
2951
|
+
{ user: userAddr },
|
|
2952
|
+
ethValue
|
|
2953
|
+
);
|
|
2954
|
+
let hash;
|
|
2955
|
+
try {
|
|
2956
|
+
hash = await wallet.writeContract({
|
|
2957
|
+
address: this.address,
|
|
2958
|
+
abi: disperseConfidentialAbi,
|
|
2959
|
+
functionName: "disperseConfidentialTokenDirect",
|
|
2960
|
+
args: [token, recipients, encrypted.handles, encrypted.inputProof],
|
|
2961
|
+
account,
|
|
2962
|
+
chain: wallet.chain,
|
|
2963
|
+
value: ethValue
|
|
2964
|
+
});
|
|
2965
|
+
} catch (err) {
|
|
2966
|
+
throw this.#mapRevert("disperse[direct]", err, { user: userAddr }, userAddr);
|
|
2967
|
+
}
|
|
2968
|
+
const distributions = await this.#parseDirectDistributions(hash);
|
|
2969
|
+
return { hash, distributions };
|
|
2970
|
+
}
|
|
2971
|
+
async #disperseWallet(args) {
|
|
2972
|
+
const { token, mode, recipients, amounts, account, wallet, userAddr, enc, gasFeeOverride } = args;
|
|
2973
|
+
const count = amounts.length;
|
|
2974
|
+
const { group0, group1 } = computeSubtotals(amounts);
|
|
2975
|
+
const allValues = [...amounts, group0, group1];
|
|
2976
|
+
let encrypted;
|
|
2977
|
+
try {
|
|
2978
|
+
encrypted = await encryptUint64Batch({
|
|
2979
|
+
encryptor: enc,
|
|
2980
|
+
contractAddress: this.address,
|
|
2981
|
+
userAddress: userAddr,
|
|
2982
|
+
values: allValues
|
|
2983
|
+
});
|
|
2984
|
+
} catch (err) {
|
|
2985
|
+
throw chunkNS44KBV5_cjs.mapZamaError(err, { method: `disperse[${mode}]`, operation: "encrypt" });
|
|
2986
|
+
}
|
|
2987
|
+
const amountHandles = encrypted.handles.slice(0, count);
|
|
2988
|
+
const subtotal0Handle = encrypted.handles[count];
|
|
2989
|
+
const subtotal1Handle = encrypted.handles[count + 1];
|
|
2990
|
+
if (mode === "wallet-token-fee") {
|
|
2991
|
+
const writeArgs = [
|
|
2992
|
+
token,
|
|
2993
|
+
recipients,
|
|
2994
|
+
amountHandles,
|
|
2995
|
+
[subtotal0Handle, subtotal1Handle],
|
|
2996
|
+
encrypted.inputProof
|
|
2997
|
+
];
|
|
2998
|
+
await this.#preflightWrite(
|
|
2999
|
+
"disperse[wallet-token-fee]",
|
|
3000
|
+
"disperseConfidentialTokensWithTokenFee",
|
|
3001
|
+
writeArgs,
|
|
3002
|
+
account,
|
|
3003
|
+
{ user: userAddr }
|
|
3004
|
+
);
|
|
3005
|
+
let hash2;
|
|
3006
|
+
try {
|
|
3007
|
+
hash2 = await wallet.writeContract({
|
|
3008
|
+
address: this.address,
|
|
3009
|
+
abi: disperseConfidentialAbi,
|
|
3010
|
+
functionName: "disperseConfidentialTokensWithTokenFee",
|
|
3011
|
+
args: writeArgs,
|
|
3012
|
+
account,
|
|
3013
|
+
chain: wallet.chain
|
|
3014
|
+
});
|
|
3015
|
+
} catch (err) {
|
|
3016
|
+
throw this.#mapRevert("disperse[wallet-token-fee]", err, { user: userAddr }, userAddr);
|
|
3017
|
+
}
|
|
3018
|
+
const distributions2 = await this.#parseWalletDistributions(hash2);
|
|
3019
|
+
return { hash: hash2, distributions: distributions2 };
|
|
3020
|
+
}
|
|
3021
|
+
let ethValue = gasFeeOverride;
|
|
3022
|
+
if (ethValue === void 0) {
|
|
3023
|
+
const fees = await this.getFees(userAddr);
|
|
3024
|
+
ethValue = BigInt(count) * fees.gasFeeWei;
|
|
3025
|
+
}
|
|
3026
|
+
const walletWriteArgs = [
|
|
3027
|
+
token,
|
|
3028
|
+
recipients,
|
|
3029
|
+
amountHandles,
|
|
3030
|
+
[subtotal0Handle, subtotal1Handle],
|
|
3031
|
+
encrypted.inputProof
|
|
3032
|
+
];
|
|
3033
|
+
await this.#preflightWrite(
|
|
3034
|
+
"disperse[wallet]",
|
|
3035
|
+
"disperseConfidentialTokens",
|
|
3036
|
+
walletWriteArgs,
|
|
3037
|
+
account,
|
|
3038
|
+
{ user: userAddr },
|
|
3039
|
+
ethValue
|
|
3040
|
+
);
|
|
3041
|
+
let hash;
|
|
3042
|
+
try {
|
|
3043
|
+
hash = await wallet.writeContract({
|
|
3044
|
+
address: this.address,
|
|
3045
|
+
abi: disperseConfidentialAbi,
|
|
3046
|
+
functionName: "disperseConfidentialTokens",
|
|
3047
|
+
args: walletWriteArgs,
|
|
3048
|
+
account,
|
|
3049
|
+
chain: wallet.chain,
|
|
3050
|
+
value: ethValue
|
|
3051
|
+
});
|
|
3052
|
+
} catch (err) {
|
|
3053
|
+
throw this.#mapRevert("disperse[wallet]", err, { user: userAddr }, userAddr);
|
|
3054
|
+
}
|
|
3055
|
+
const distributions = await this.#parseWalletDistributions(hash);
|
|
3056
|
+
return { hash, distributions };
|
|
3057
|
+
}
|
|
3058
|
+
/**
|
|
3059
|
+
* Parse the `DirectDistribution` event from a `disperseConfidentialTokenDirect`
|
|
3060
|
+
* receipt. Filters logs by the singleton's own address to avoid picking up
|
|
3061
|
+
* unrelated events from re-entrancy / hook contracts. Returns at most one
|
|
3062
|
+
* row (the contract emits exactly one `DirectDistribution` per direct call)
|
|
3063
|
+
* but tolerates zero gracefully.
|
|
3064
|
+
*/
|
|
3065
|
+
async #parseDirectDistributions(hash) {
|
|
3066
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
3067
|
+
const ours = receipt.logs.filter(
|
|
3068
|
+
(log) => log.address.toLowerCase() === this.address.toLowerCase()
|
|
3069
|
+
);
|
|
3070
|
+
const events = viem.parseEventLogs({
|
|
3071
|
+
abi: disperseConfidentialAbi,
|
|
3072
|
+
eventName: "DirectDistribution",
|
|
3073
|
+
logs: ours
|
|
3074
|
+
});
|
|
3075
|
+
return events.map((ev) => ({
|
|
3076
|
+
recipients: [...ev.args.recipients],
|
|
3077
|
+
requested: [...ev.args.requested],
|
|
3078
|
+
transferred: [...ev.args.transferred]
|
|
3079
|
+
}));
|
|
3080
|
+
}
|
|
3081
|
+
/**
|
|
3082
|
+
* Parse `WalletDistribution` events from a wallet-mode disperse receipt.
|
|
3083
|
+
* The contract emits one event per non-empty sub-wallet group — so up to
|
|
3084
|
+
* two rows for a `disperse(...)` call. Filtered by singleton address.
|
|
3085
|
+
*/
|
|
3086
|
+
async #parseWalletDistributions(hash) {
|
|
3087
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
3088
|
+
const ours = receipt.logs.filter(
|
|
3089
|
+
(log) => log.address.toLowerCase() === this.address.toLowerCase()
|
|
3090
|
+
);
|
|
3091
|
+
const events = viem.parseEventLogs({
|
|
3092
|
+
abi: disperseConfidentialAbi,
|
|
3093
|
+
eventName: "WalletDistribution",
|
|
3094
|
+
logs: ours
|
|
3095
|
+
});
|
|
3096
|
+
return events.map((ev) => ({
|
|
3097
|
+
wallet: ev.args.wallet,
|
|
3098
|
+
recipients: [...ev.args.recipients],
|
|
3099
|
+
requested: [...ev.args.requested],
|
|
3100
|
+
transferred: [...ev.args.transferred]
|
|
3101
|
+
}));
|
|
3102
|
+
}
|
|
3103
|
+
/**
|
|
3104
|
+
* Resolve the encrypted-amount payload for a single-amount write. Enforces
|
|
3105
|
+
* **exactly one** of `amount` / `encryptedInput` so callers cannot silently
|
|
3106
|
+
* mix a stale plaintext with a pre-encrypted handle.
|
|
3107
|
+
*/
|
|
3108
|
+
async #encryptSingle(amount, encryptor, preEncrypted, account, method) {
|
|
3109
|
+
const hasAmount = amount !== void 0;
|
|
3110
|
+
const hasInput = preEncrypted !== void 0;
|
|
3111
|
+
if (hasAmount && hasInput) {
|
|
3112
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
3113
|
+
method,
|
|
3114
|
+
argument: "amount/encryptedInput",
|
|
3115
|
+
reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got both"
|
|
3116
|
+
});
|
|
3117
|
+
}
|
|
3118
|
+
if (!hasAmount && !hasInput) {
|
|
3119
|
+
throw new chunk56UI7LUR_cjs.InvalidArgumentError({
|
|
3120
|
+
method,
|
|
3121
|
+
argument: "amount/encryptedInput",
|
|
3122
|
+
reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got neither"
|
|
3123
|
+
});
|
|
3124
|
+
}
|
|
3125
|
+
if (hasInput) return preEncrypted;
|
|
3126
|
+
const enc = encryptor ?? resolveEncryptor(this.encryptor);
|
|
3127
|
+
if (!enc) {
|
|
3128
|
+
throw new chunk56UI7LUR_cjs.MissingEncryptorError("encryptSingle", {
|
|
3129
|
+
hint: "Pass `encryptor` to the call or the client config (eager or lazy factory)."
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3132
|
+
try {
|
|
3133
|
+
return await encryptUint64({
|
|
3134
|
+
encryptor: enc,
|
|
3135
|
+
contractAddress: this.address,
|
|
3136
|
+
userAddress: accountAddress(account),
|
|
3137
|
+
value: amount
|
|
3138
|
+
});
|
|
3139
|
+
} catch (err) {
|
|
3140
|
+
throw chunkNS44KBV5_cjs.mapZamaError(err, { method: "encryptSingle", operation: "encrypt" });
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
#requireWallet(method) {
|
|
3144
|
+
if (!this.walletClient) {
|
|
3145
|
+
throw new chunk56UI7LUR_cjs.MissingWalletClientError(method);
|
|
3146
|
+
}
|
|
3147
|
+
return this.walletClient;
|
|
3148
|
+
}
|
|
3149
|
+
#resolveAccount(wallet, override, method) {
|
|
3150
|
+
const acct = override ?? wallet.account;
|
|
3151
|
+
if (!acct) {
|
|
3152
|
+
throw new chunk56UI7LUR_cjs.MissingAccountError(method);
|
|
3153
|
+
}
|
|
3154
|
+
return acct;
|
|
3155
|
+
}
|
|
3156
|
+
/**
|
|
3157
|
+
* Resolve the caller's address for productContext.user without doing the
|
|
3158
|
+
* full `writeContract` prep. Required by the sub-wallet helpers so that
|
|
3159
|
+
* any typed revert (e.g. `UserNotRegistered`) carries the actual caller
|
|
3160
|
+
* in `error.context.user`, not the zero-address default the product
|
|
3161
|
+
* mapper falls back to.
|
|
3162
|
+
*/
|
|
3163
|
+
#userAddressFromOverride(override, method) {
|
|
3164
|
+
const wallet = this.#requireWallet(method);
|
|
3165
|
+
return accountAddress(this.#resolveAccount(wallet, override, method));
|
|
3166
|
+
}
|
|
3167
|
+
async #write(functionName, args, account, productContext) {
|
|
3168
|
+
const wallet = this.#requireWallet(functionName);
|
|
3169
|
+
const acct = this.#resolveAccount(wallet, account, functionName);
|
|
3170
|
+
await this.#preflightWrite(functionName, functionName, args, acct, productContext);
|
|
3171
|
+
try {
|
|
3172
|
+
return await wallet.writeContract({
|
|
3173
|
+
address: this.address,
|
|
3174
|
+
abi: disperseConfidentialAbi,
|
|
3175
|
+
functionName,
|
|
3176
|
+
args,
|
|
3177
|
+
account: acct,
|
|
3178
|
+
chain: wallet.chain
|
|
3179
|
+
});
|
|
3180
|
+
} catch (err) {
|
|
3181
|
+
throw this.#mapRevert(functionName, err, productContext, accountAddress(acct));
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
/**
|
|
3185
|
+
* Pre-flight a write via `simulateContract` purely to surface typed reverts.
|
|
3186
|
+
*
|
|
3187
|
+
* The simulate's *return value* is discarded — FHE writes still need
|
|
3188
|
+
* `writeContract` + receipt parsing because simulated FHE op handles diverge
|
|
3189
|
+
* from the executed-tx handles (Pitfall #1). The only purpose of the
|
|
3190
|
+
* simulate call here is to let viem decode any revert against the ABI and
|
|
3191
|
+
* produce a `ContractFunctionRevertedError` frame the revert-mapper can
|
|
3192
|
+
* classify (e.g. `AccessControlUnauthorizedAccount` → `AccessDeniedError`).
|
|
3193
|
+
*/
|
|
3194
|
+
async #preflightWrite(method, functionName, args, account, productContext, value) {
|
|
3195
|
+
try {
|
|
3196
|
+
await this.publicClient.simulateContract({
|
|
3197
|
+
address: this.address,
|
|
3198
|
+
abi: disperseConfidentialAbi,
|
|
3199
|
+
functionName,
|
|
3200
|
+
args,
|
|
3201
|
+
account,
|
|
3202
|
+
...value !== void 0 ? { value } : {}
|
|
3203
|
+
});
|
|
3204
|
+
} catch (err) {
|
|
3205
|
+
if (chunkVDXVNZCO_cjs.isContractRevert(err)) {
|
|
3206
|
+
throw this.#mapRevert(method, err, productContext, accountAddress(account));
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
#mapRevert(method, err, productContext, account) {
|
|
3211
|
+
return chunkVDXVNZCO_cjs.mapContractRevert(err, {
|
|
3212
|
+
method,
|
|
3213
|
+
contractAddress: this.address,
|
|
3214
|
+
abi: disperseConfidentialAbi,
|
|
3215
|
+
productMapper: disperseProductMapper,
|
|
3216
|
+
productContext,
|
|
3217
|
+
account
|
|
3218
|
+
});
|
|
3219
|
+
}
|
|
3220
|
+
async #read(functionName, args = []) {
|
|
3221
|
+
const result = await this.publicClient.readContract({
|
|
3222
|
+
address: this.address,
|
|
3223
|
+
abi: disperseConfidentialAbi,
|
|
3224
|
+
functionName,
|
|
3225
|
+
args
|
|
3226
|
+
});
|
|
3227
|
+
return result;
|
|
3228
|
+
}
|
|
3229
|
+
};
|
|
3230
|
+
function createConfidentialDisperseClient(config) {
|
|
3231
|
+
return new ConfidentialDisperseClient(config);
|
|
3232
|
+
}
|
|
3233
|
+
function accountAddress(account) {
|
|
3234
|
+
return typeof account === "string" ? account : account.address;
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
// src/fhe-disperse/abis/wallet.ts
|
|
3238
|
+
var disperseWalletAbi = [
|
|
3239
|
+
{
|
|
3240
|
+
inputs: [],
|
|
3241
|
+
stateMutability: "nonpayable",
|
|
3242
|
+
type: "constructor"
|
|
3243
|
+
},
|
|
3244
|
+
{
|
|
3245
|
+
inputs: [],
|
|
3246
|
+
name: "InvalidAddress",
|
|
3247
|
+
type: "error"
|
|
3248
|
+
},
|
|
3249
|
+
{
|
|
3250
|
+
inputs: [],
|
|
3251
|
+
name: "InvalidInitialization",
|
|
3252
|
+
type: "error"
|
|
3253
|
+
},
|
|
3254
|
+
{
|
|
3255
|
+
inputs: [],
|
|
3256
|
+
name: "NotController",
|
|
3257
|
+
type: "error"
|
|
3258
|
+
},
|
|
3259
|
+
{
|
|
3260
|
+
inputs: [],
|
|
3261
|
+
name: "NotInitializing",
|
|
3262
|
+
type: "error"
|
|
3263
|
+
},
|
|
3264
|
+
{
|
|
3265
|
+
inputs: [
|
|
3266
|
+
{
|
|
3267
|
+
internalType: "address",
|
|
3268
|
+
name: "token",
|
|
3269
|
+
type: "address"
|
|
3270
|
+
}
|
|
3271
|
+
],
|
|
3272
|
+
name: "SafeERC20FailedOperation",
|
|
3273
|
+
type: "error"
|
|
3274
|
+
},
|
|
3275
|
+
{
|
|
3276
|
+
inputs: [],
|
|
3277
|
+
name: "ZamaProtocolUnsupported",
|
|
3278
|
+
type: "error"
|
|
3279
|
+
},
|
|
3280
|
+
{
|
|
3281
|
+
anonymous: false,
|
|
3282
|
+
inputs: [
|
|
3283
|
+
{
|
|
3284
|
+
indexed: false,
|
|
3285
|
+
internalType: "uint64",
|
|
3286
|
+
name: "version",
|
|
3287
|
+
type: "uint64"
|
|
3288
|
+
}
|
|
3289
|
+
],
|
|
3290
|
+
name: "Initialized",
|
|
3291
|
+
type: "event"
|
|
3292
|
+
},
|
|
3293
|
+
{
|
|
3294
|
+
inputs: [
|
|
3295
|
+
{
|
|
3296
|
+
internalType: "address",
|
|
3297
|
+
name: "token",
|
|
3298
|
+
type: "address"
|
|
3299
|
+
}
|
|
3300
|
+
],
|
|
3301
|
+
name: "approveToken",
|
|
3302
|
+
outputs: [],
|
|
3303
|
+
stateMutability: "nonpayable",
|
|
3304
|
+
type: "function"
|
|
3305
|
+
},
|
|
3306
|
+
{
|
|
3307
|
+
inputs: [],
|
|
3308
|
+
name: "controller",
|
|
3309
|
+
outputs: [
|
|
3310
|
+
{
|
|
3311
|
+
internalType: "address",
|
|
3312
|
+
name: "",
|
|
3313
|
+
type: "address"
|
|
3314
|
+
}
|
|
3315
|
+
],
|
|
3316
|
+
stateMutability: "view",
|
|
3317
|
+
type: "function"
|
|
3318
|
+
},
|
|
3319
|
+
{
|
|
3320
|
+
inputs: [
|
|
3321
|
+
{
|
|
3322
|
+
internalType: "address",
|
|
3323
|
+
name: "controller_",
|
|
3324
|
+
type: "address"
|
|
3325
|
+
}
|
|
3326
|
+
],
|
|
3327
|
+
name: "initialize",
|
|
3328
|
+
outputs: [],
|
|
3329
|
+
stateMutability: "nonpayable",
|
|
3330
|
+
type: "function"
|
|
3331
|
+
},
|
|
3332
|
+
{
|
|
3333
|
+
inputs: [
|
|
3334
|
+
{
|
|
3335
|
+
internalType: "address",
|
|
3336
|
+
name: "token",
|
|
3337
|
+
type: "address"
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
internalType: "address",
|
|
3341
|
+
name: "to",
|
|
3342
|
+
type: "address"
|
|
3343
|
+
}
|
|
3344
|
+
],
|
|
3345
|
+
name: "recoverConfidentialToken",
|
|
3346
|
+
outputs: [],
|
|
3347
|
+
stateMutability: "nonpayable",
|
|
3348
|
+
type: "function"
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
inputs: [
|
|
3352
|
+
{
|
|
3353
|
+
internalType: "address",
|
|
3354
|
+
name: "token",
|
|
3355
|
+
type: "address"
|
|
3356
|
+
},
|
|
3357
|
+
{
|
|
3358
|
+
internalType: "address",
|
|
3359
|
+
name: "to",
|
|
3360
|
+
type: "address"
|
|
3361
|
+
}
|
|
3362
|
+
],
|
|
3363
|
+
name: "recoverERC20",
|
|
3364
|
+
outputs: [],
|
|
3365
|
+
stateMutability: "nonpayable",
|
|
3366
|
+
type: "function"
|
|
3367
|
+
},
|
|
3368
|
+
{
|
|
3369
|
+
inputs: [
|
|
3370
|
+
{
|
|
3371
|
+
internalType: "address",
|
|
3372
|
+
name: "token",
|
|
3373
|
+
type: "address"
|
|
3374
|
+
}
|
|
3375
|
+
],
|
|
3376
|
+
name: "revokeToken",
|
|
3377
|
+
outputs: [],
|
|
3378
|
+
stateMutability: "nonpayable",
|
|
3379
|
+
type: "function"
|
|
3380
|
+
}
|
|
3381
|
+
];
|
|
3382
|
+
|
|
3383
|
+
// src/fhe-disperse/index.ts
|
|
3384
|
+
var FEE_COLLECTOR_ROLE = "0x2dca0f5ce7e75a4b43fe2b0d6f5d0b7a2bf92ecf89f8f0aa17b8308b67038821";
|
|
3385
|
+
var FEE_MANAGER_ROLE = "0x6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c";
|
|
3386
|
+
var PAUSER_ROLE = "0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a";
|
|
3387
|
+
var WITHDRAWER_ROLE = "0x10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e4";
|
|
3388
|
+
var DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
3389
|
+
|
|
3390
|
+
exports.AlreadyRegisteredError = AlreadyRegisteredError;
|
|
3391
|
+
exports.ConfidentialDisperseClient = ConfidentialDisperseClient;
|
|
3392
|
+
exports.DEFAULT_ADMIN_ROLE = DEFAULT_ADMIN_ROLE;
|
|
3393
|
+
exports.DisperseEncryptedReserveNotGrantedError = DisperseEncryptedReserveNotGrantedError;
|
|
3394
|
+
exports.DisperseSubwalletNotFoundError = DisperseSubwalletNotFoundError;
|
|
3395
|
+
exports.FEE_COLLECTOR_ROLE = FEE_COLLECTOR_ROLE;
|
|
3396
|
+
exports.FEE_MANAGER_ROLE = FEE_MANAGER_ROLE;
|
|
3397
|
+
exports.NotRegisteredError = NotRegisteredError;
|
|
3398
|
+
exports.PAUSER_ROLE = PAUSER_ROLE;
|
|
3399
|
+
exports.WITHDRAWER_ROLE = WITHDRAWER_ROLE;
|
|
3400
|
+
exports.computeSubtotals = computeSubtotals;
|
|
3401
|
+
exports.createConfidentialDisperseClient = createConfidentialDisperseClient;
|
|
3402
|
+
exports.disperseConfidentialAbi = disperseConfidentialAbi;
|
|
3403
|
+
exports.disperseWalletAbi = disperseWalletAbi;
|
|
3404
|
+
exports.encryptUint64 = encryptUint64;
|
|
3405
|
+
exports.encryptUint64Batch = encryptUint64Batch;
|
|
3406
|
+
exports.resolveEncryptor = resolveEncryptor;
|