import { ethers, InterfaceAbi, ContractRunner, TransactionReceipt, BigNumberish, BytesLike, SignatureLike } from 'ethers'; export { ApproveWalletLinkInput, ApproveWalletLinkResult, CreateWalletLinkChallengeInput, DEFAULT_HAZBASE_API_ENDPOINT, GetActivityInput, GetActivityResult, GetBalanceInput, GetBalanceResult, GetOwnerOperationStatusInput, GetOwnerOperationStatusResult, GetTokenInfoInput, GetTokenInfoResult, GetTransferStatusInput, GetTransferStatusResult, GetX402HazbaseWalletPaymentStatusInput, HazbaseWalletApiError, HazbaseWalletApiErrorBody, HazbaseWalletClient, HazbaseWalletClientOptions, ListTokensInput, ListTokensResult, OwnerOperationCall, PayX402WithHazbaseWalletInput, PrepareOwnerOperationInput, PrepareOwnerOperationResult, PrepareTransferInput, PrepareTransferResult, SubmitOwnerOperationInput, SubmitOwnerOperationResult, SubmitTransferInput, SubmitTransferResult, VerifyWalletLinkInput, VerifyWalletLinkResult, VerifyWalletLinkSessionInput, VerifyWalletLinkSessionResult, WalletActivityItem, WalletLinkChallengeResult, WalletTokenBalance, WalletTokenSummary, X402HazbaseWalletPaymentResult, X402PaymentActivityDetails, createHazbaseWalletClient } from './wallet.mjs'; export { ConsumeWalletAddressOptions, ConsumeWalletOperationResultOptions, CreateX402WalletUrlOptions, HAZBASE_WALLET_ADDRESS_REQUEST, HAZBASE_WALLET_ADDRESS_RESPONSE, HAZBASE_WALLET_LINK_REQUEST, HAZBASE_WALLET_LINK_RESPONSE, HAZBASE_WALLET_OPERATION_ACK, HAZBASE_WALLET_OPERATION_ERROR, HAZBASE_WALLET_OPERATION_REQUEST, HAZBASE_WALLET_OPERATION_RESULT, HAZBASE_X402_BRIDGE_DETECTED, HAZBASE_X402_BRIDGE_ERROR, HAZBASE_X402_BRIDGE_PAYMENT, HAZBASE_X402_BRIDGE_REQUEST, HAZBASE_X402_BRIDGE_VERSION, HazbaseRuntimeLike, HazbaseX402ContentEnvelope, InstallHazbaseWalletContentBridgeOptions, PostX402BridgeRequestOptions, PublishX402RequestOptions, RequestWalletAddressOptions, RequestWalletAddressResult, RequestWalletLinkOptions, RequestWalletLinkResult, RequestWalletOperationOptions, RequestWalletOperationResult, SaveX402HandoffOptions, WalletAddressPwaUrlOptions, WalletLinkHandoff, WalletLinkProofFragment, WalletLinkPwaUrlOptions, WalletOperationHandoff, WalletOperationPwaUrlOptions, WalletOperationRequest, WalletOperationResultFragment, consumeAndVerifyWalletLinkFromFragment, consumeWalletAddressFromFragment, consumeWalletLinkProofFromFragment, consumeWalletOperationResultFromFragment, createHazbaseRequestId, createWalletAddressPwaUrl, createWalletAddressReturnUrl, createWalletLinkPwaUrl, createWalletLinkReturnUrl, createWalletOperationPwaUrl, createWalletOperationReturnUrl, createX402WalletUrl, installHazbaseWalletContentBridge, normalizeEvmAddress, postX402BridgeRequest, publishX402Request, readWalletLinkHandoffFromUrl, readWalletOperationHandoffFromUrl, readX402EnvelopeFromPage, removeX402UrlParams, requestWalletAddress, requestWalletLink, requestWalletOperation, saveX402Handoff, setX402RequestScript, shortenAddress, verifyWalletLinkProof, verifyWalletLinkSession } from './extension.mjs'; export { OptionId, RankedChoiceIrvConfig, SingleChoiceConfig, TallyConfig, TallyInput, TallyOption, TallyOutcome, TallyResult, TallyRound, VOTING_CONTRACT_METHOD_IDS, VOTING_METHOD_IDS, VotingMethodId, VotingTallyError, VotingTallyErrorCode, WeightedBallot, hashBallotSet, hashTallyConfig, hashWeightedBallot, tallyVotes, validateTallyInput } from './voting.mjs'; export { A as ApprovalCallOptions, B as BENEFICIARY_ASSIGNMENT_TYPES, a as BeneficiaryAssignment, C as CreatePooledEscrowArgs, D as DeployPooledEscrowOptions, b as DeployPooledEscrowResult, P as PooledEscrowRecord, c as PooledEscrowStatus, d as PooledTokenEscrowHelper, e as PooledTokenEscrowHelperOptions, f as PreparedContractCall } from './PooledTokenEscrowHelper-DpQirIx4.mjs'; interface BuilderInit { address: string; abi: ethers.InterfaceAbi; chainId: number; signer: ethers.JsonRpcSigner; } interface RelayerCfg { accessToken: string; } declare class ContractBuilder { private readonly address; private readonly abi; private readonly chainId; private readonly signer; private relayer?; private _chainIdOk?; private constructor(); /** * Verify the signer's live chain matches init.chainId before signing. The meta-tx * (relayer) path uses chainId for the EIP-712 forwarder domain, and a mismatch * would produce a signature valid on a different chain than the caller intended. * Memoized so it runs at most once per builder. */ private assertChainId; static create(init: BuilderInit): ContractBuilder; withRelayer(cfg: RelayerCfg): ContractBuilder; build(): any; private invoke; } interface DeployViaFactoryOptions { contractType: string; implABI: InterfaceAbi; initArgs: readonly unknown[]; signer: ethers.Signer; factory?: string; implOwner?: string; initFn?: string; version?: number; } type Address$f = string; type Bytes32$a = string; /** Deploy-time arguments mapped to AgreementManager.initialize(...) */ interface DeployArgs$e { /** DEFAULT_ADMIN_ROLE holder */ admin: Address$f; /** ERC-2771 trusted forwarders (can be empty) */ trustedForwarders?: readonly Address$f[]; } /** Result of deployment via factory (uses `res.address`) */ interface DeployResult$g { /** Proxy address */ address: Address$f; /** Deployment/initialize receipt */ receipt: TransactionReceipt; /** Connected helper */ helper: AgreementManagerHelper; } /** Offer status enum — MUST match Solidity order */ declare enum OfferStatus { None = 0, Offered = 1, Accepted = 2, Rejected = 3, Cancelled = 4 } /** Dispute status enum — MUST match Solidity order */ declare enum DisputeStatus { None = 0, Raised = 1, Acknowledged = 2, Resolved = 3, Rejected = 4 } /** Canonical on-chain Offer struct (see .sol) */ interface OfferStruct { issuer: Address$f; investor: Address$f; tokenAddress: Address$f; partition: Bytes32$a; tokenId: bigint; classId: bigint; nonceId: bigint; amount: bigint; documentHash: Bytes32$a; documentURI: string; expiry: bigint; nonce: bigint; delegatedTo: Address$f; issuerSig: string; status: OfferStatus; } /** Minimal dispute struct (see .sol) */ interface DisputeStruct { claimant: Address$f; offerId: Bytes32$a; evidenceURI: string; status: DisputeStatus; createdAt: bigint; } /** Arguments for creating an offer (issuer-signed) */ interface OfferArgs { /** Intended counterparty (investor) */ investor: Address$f; /** Asset address (address(0) for escrowless) */ tokenAddress: Address$f; /** ERC-1400 partition (0x00…00 for others) */ partition: Bytes32$a; /** ERC721/1155 id (0 for fungibles) */ tokenId: BigNumberish; /** Amount/units for ERC20/1400/1155/3475 (1 for ERC721) */ amount: BigNumberish; /** ERC-3475 class id (0 for others) */ classId: BigNumberish; /** ERC-3475 nonce id (0 for others) */ nonceId: BigNumberish; /** Off-chain document hash (bytes32) */ documentHash: Bytes32$a; /** Off-chain document URI (string) */ documentURI: string; /** Expiry (unix seconds, ≥ now) */ expiry: BigNumberish; /** Issuer-scoped nonce (must be unused) */ nonce: BigNumberish; /** EIP-712 signature by the issuer over the fields above */ issuerSig: BytesLike; /** Optional delegated executor; if set, only this address can call acceptOffer */ delegatedTo?: Address$f; } interface OptionalArgs$g { abi?: InterfaceAbi; } declare class AgreementManagerHelper { readonly address: Address$f; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$g | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new AgreementManager proxy and return a connected helper. * Purpose: Initialize a two-step offer manager with optional escrow and meta-tx. * @param args `{ admin, trustedForwarders }` forwarded to `initialize`. * @param signer Deployer signer. * @param opts Optional factory options (salt, factory address, gas settings). * @returns `{ address, receipt, helper }` for immediate use. */ static deploy(args: DeployArgs$e, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing AgreementManager at `address`. * Purpose: Bind helper to a deployed proxy for calls and transactions. * @param address Target contract address. * @param runner Signer or provider context. * @returns Connected helper instance. */ static attach(address: Address$f, runner: ContractRunner, ops?: OptionalArgs$g): AgreementManagerHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap wallet/provider without re-attaching. * @param runner New signer or provider. * @returns New helper instance pointing to the same contract. */ connect(runner: ContractRunner): AgreementManagerHelper; /** Create an offer and (optionally) escrow assets into the contract. * Purpose: Persist an issuer-signed offer; escrow occurs if `tokenAddress != 0x0`. * @param a Offer arguments (see `OfferArgs`). * @returns `{ offerId, receipt }` where `offerId` is the deterministic id used on-chain. * * Notes: * - Issuer is `msg.sender` of this transaction and MUST match the signer of `issuerSig`. * - When `tokenAddress == 0x0` (escrowless), all of {tokenId, amount, classId, nonceId} MUST be zero. * - Reverts on expired offers, used nonce, bad signature, or duplicate `offerId`. * * Solidity: * function offer( * address investor, address tokenAddress, bytes32 partition, * uint256 tokenId, uint256 amount, uint256 classId, uint256 nonceId, * bytes32 documentHash, string documentURI, * uint256 expiry, uint256 nonce, * bytes issuerSig, address delegatedTo * ) external; */ offer(a: OfferArgs): Promise<{ offerId: Bytes32$a; receipt: TransactionReceipt; }>; /** Cancel an offered (non-expired) offer; issuer only. * Purpose: Return escrow to issuer and remove the offer. * @param offerId Target offer id. * @returns Transaction receipt upon inclusion. * * Solidity: function cancelOffer(bytes32 offerId) external; */ cancelOffer(offerId: Bytes32$a): Promise; /** Accept an offered (non-expired) offer as investor or delegated market. * Purpose: Transfer escrow to investor and finalize agreement. * @param offerId Target offer id. * @param investorSig Investor EIP-712 signature over the same Offer struct. * @returns Transaction receipt upon inclusion. * * Solidity: function acceptOffer(bytes32 offerId, bytes investorSig) external; */ acceptOffer(offerId: Bytes32$a, investorSig: BytesLike): Promise; /** Reject an offered (non-expired) offer; investor only. * Purpose: Return escrow to issuer and delete the offer. * @param offerId Target offer id. * @returns Transaction receipt upon inclusion. * * Solidity: function rejectOffer(bytes32 offerId) external; */ rejectOffer(offerId: Bytes32$a): Promise; /** Raise a dispute record (no fund movement). * Purpose: Persist a dispute with an evidence pointer. * @param offerId Optional related offer id (0x0 if none). * @param evidenceURI IPFS/HTTPS evidence. * @returns `{ disputeId, receipt }` (id is keccak(sender, now, offerId, evidenceURI)). * * Solidity: function raiseDispute(bytes32 offerId, string evidenceURI) external; */ raiseDispute(offerId: Bytes32$a, evidenceURI: string): Promise<{ disputeId: Bytes32$a; receipt: TransactionReceipt; }>; /** Set dispute status (GUARDIAN_ROLE). * Purpose: Administrative status transition (no fund movement). * @param id Dispute id. * @param newStatus One of Acknowledged/Resolved/Rejected. * @returns Transaction receipt upon inclusion. * * Solidity: function setDisputeStatus(bytes32 id, DisputeStatus newStatus) external; */ setDisputeStatus(id: Bytes32$a, newStatus: DisputeStatus): Promise; /** Get a stored Offer by id. */ getOffer(id: Bytes32$a): Promise; /** Read a stored Dispute by id. */ getDispute(id: Bytes32$a): Promise; /** Next nonce value expected to be unused for an issuer. */ nextNonce(issuer: Address$f): Promise; /** Used-nonce check (public mapping). */ usedNonces(issuer: Address$f, nonce: BigNumberish): Promise; /** Current nonce counter (public mapping; equals `nextNonce`). */ currentNonce(issuer: Address$f): Promise; /** Settlement flag (true after successful acceptance). */ isSettled(id: Bytes32$a): Promise; /** Contract type string ("AgreementManager"). */ contractType(): Promise; /** Contract semantic version ("1"). */ contractVersion(): Promise; /** ERC-2771 meta-tx forwarder check. */ isTrustedForwarder(fwd: Address$f): Promise; /** ERC-165 support check. */ supportsInterface(iid: BytesLike): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). */ unpause(): Promise; /** Compute deterministic `offerId` exactly as the contract does (keccak256(abi.encode(...))). * Purpose: Pre-compute ids client-side and reconcile with events/storage. * @param x Minimal fields needed for id derivation. `issuer` is msg.sender at `offer(...)`. * @returns 32-byte id (hex string). */ static computeOfferId(x: { issuer: Address$f; investor: Address$f; tokenAddress: Address$f; partition: Bytes32$a; tokenId: BigNumberish; amount: BigNumberish; classId: BigNumberish; nonceId: BigNumberish; documentHash: Bytes32$a; documentURI: string; expiry: BigNumberish; nonce: BigNumberish; }): Bytes32$a; /** Build the EIP-712 digest used by both issuer and investor for a given offer. * Purpose: Pre-validate signatures or generate them off-chain. * @param chainId EVM chain id. * @param verifyingContract AgreementManager address (this.address). * @param offer Full typed payload (same layout for issuer & investor). * @returns 32-byte digest to be signed / recovered. */ static buildOfferDigest(chainId: number, verifyingContract: Address$f, offer: { issuer: Address$f; investor: Address$f; tokenAddress: Address$f; partition: Bytes32$a; tokenId: BigNumberish; amount: BigNumberish; classId: BigNumberish; nonceId: BigNumberish; documentHash: Bytes32$a; documentURI: string; expiry: BigNumberish; nonce: BigNumberish; }): Bytes32$a; /** Sign an Offer (issuer or investor). * Purpose: Helper for tests/tools to produce correct EIP-712 signatures. * @param signer Ethers signer used to sign typed data (must equal `offer.issuer` or `offer.investor`). * @param chainId EVM chain id. * @param offer Offer payload (fields as in `OFFER_TYPES.Offer`). * @returns Hex signature (0x…). */ static signOffer(signer: ethers.Signer, chainId: number, verifyingContract: Address$f, offer: { issuer: Address$f; investor: Address$f; tokenAddress: Address$f; partition: Bytes32$a; tokenId: BigNumberish; amount: BigNumberish; classId: BigNumberish; nonceId: BigNumberish; documentHash: Bytes32$a; documentURI: string; expiry: BigNumberish; nonce: BigNumberish; }): Promise; /** Recover signer from a provided signature over an offer payload. */ static recoverOfferSigner(chainId: number, verifyingContract: Address$f, offer: { issuer: Address$f; investor: Address$f; tokenAddress: Address$f; partition: Bytes32$a; tokenId: BigNumberish; amount: BigNumberish; classId: BigNumberish; nonceId: BigNumberish; documentHash: Bytes32$a; documentURI: string; expiry: BigNumberish; nonce: BigNumberish; }, sig: SignatureLike): Address$f; /** Query `OfferCreated(offerId, issuer, investor)` events. */ queryOfferCreated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `OfferCancelled(offerId)` events. */ queryOfferCancelled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `OfferSettled(...)` events. */ queryOfferSettled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `OfferRejected(offerId)` events. */ queryOfferRejected(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `OfferCleanedUp(offerId)` events. */ queryOfferCleanedUp(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `DisputeRaised(disputeId, offerId, claimant, evidenceURI)` events. */ queryDisputeRaised(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `DisputeStatusChanged(disputeId, newStatus)` events. */ queryDisputeStatusChanged(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$e = string; type Bytes32$9 = string; /** Deploy-time arguments (forwarded to initialize). */ interface DeployArgs$d { /** Base URI (e.g., "ipfs://.../") used by tokenURI when no per-id URI set. */ baseURI: string; /** DEFAULT_ADMIN_ROLE holder (timelock recommended). */ admin: Address$e; /** ERC-2771 trusted forwarders (can be empty). */ trustedForwarders?: readonly Address$e[]; /** Default royalty receiver (ERC-2981). */ royaltyReceiver: Address$e; /** Default royalty fee in basis points (0..10000). */ royaltyFeeBps: number; } /** Result of deployment via factory (uses `res.address`). */ interface DeployResult$f { /** Proxy address of the deployed instance. */ address: Address$e; /** Deployment/initialize transaction receipt. */ receipt: TransactionReceipt; /** Connected helper bound to the new proxy. */ helper: PrivilegeNFTHelper; } /** Voucher struct for lazy minting (must match Solidity field order & types). */ interface MintVoucher$2 { /** Token id to mint. */ id: bigint | number; /** Per-id metadata URI (empty string to fallback to baseURI). */ uri: string; /** Voting tier factor (0..255) used by Votes module. */ tier: number; /** Unix seconds when this NFT expires (used for sweep/redeem checks). */ expiresAt: bigint | number; /** Unix seconds (inclusive) until which the voucher is valid. */ validUntil: bigint | number; /** Issuer-chosen unique nonce (anti-replay). */ nonce: bigint | number; /** Signer address (must hold MINTER_ROLE). */ issuer: Address$e; /** Recipient; if zero, contract uses _msgSender(). */ to: Address$e; } interface OptionalArgs$f { abi?: InterfaceAbi; } declare class PrivilegeNFTHelper { readonly address: Address$e; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$f | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new PrivilegeNFT proxy and return a connected helper. * Purpose: Initialize an ERC-721 collection with royalties, voting tiers, EIP-712, and meta-tx. * @param args `{ baseURI, admin, trustedForwarders, royaltyReceiver, royaltyFeeBps }` forwarded to `initialize`. * @param signer Deployer signer. * @param opts Optional factory options (salt, factory address, gas). * @returns `{ address, receipt, helper }` for immediate use. */ static deploy(args: DeployArgs$d, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing PrivilegeNFT at `address`. * Purpose: Bind helper to a deployed proxy for calls/transactions. * @param address Target contract address. * @param runner Signer or provider context. * @returns Connected helper instance. */ static attach(address: Address$e, runner: ContractRunner, ops?: OptionalArgs$f): PrivilegeNFTHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap wallet/provider without re-attaching. * @param runner New signer or provider. * @returns New helper targeting the same address. */ connect(runner: ContractRunner): PrivilegeNFTHelper; /** Set default royalty parameters (ERC-2981). * Purpose: Configure marketplace royalty distribution. * @param receiver Royalty receiver address. * @param feeBps Fee in basis points (0..10000). * @returns Transaction receipt upon inclusion. */ setDefaultRoyalty(receiver: Address$e, feeBps: number): Promise; /** Delete default royalty parameters (ERC-2981). * Purpose: Remove royalty info; per-token settings, if any, remain. * @returns Transaction receipt upon inclusion. */ deleteDefaultRoyalty(): Promise; /** Set voting tier for a token id **before** mint. * Purpose: Adjust per-id voting weight factor (0..255). * @param id Token id to assign a tier to. * @param newTier Tier value (0..255); reverts if already minted. * @returns Transaction receipt upon inclusion. */ setTier(id: bigint | number, newTier: number): Promise; /** Configure (or clear) the whitelist registry. * Purpose: When set, transfers require both sender and recipient to be whitelisted. * @param registry Whitelist contract address (0x0 to disable). * @returns Transaction receipt upon inclusion. */ setWhitelist(registry: Address$e): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). * Purpose: Emergency stop for mints/transfers/redeems. * @returns Transaction receipt upon inclusion. */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). * Purpose: Resume operations after pause. * @returns Transaction receipt upon inclusion. */ unpause(): Promise; /** Mint directly (MINTER_ROLE). * Purpose: Create a token id and set its metadata & reward type. * @param to Recipient address. * @param id Token id to mint. * @param uri Per-id metadata URI (empty string to use baseURI). * @param tier Voting tier factor (0..255). * @param exp Expiry timestamp (unix seconds). * @param rType Arbitrary reward type flag to associate with `id`. * @returns Transaction receipt upon inclusion. */ mint(to: Address$e, id: bigint | number, uri: string, tier: number, exp: bigint | number, rType: bigint | number): Promise; /** Redeem an EIP-712 MintVoucher (lazy mint) (MINTER signature required). * Purpose: Gas-efficient distribution; issuer signs off-chain, user (or relayer) submits on-chain. * @param voucher MintVoucher payload (fields must match Solidity struct). * @param sig EIP-712 signature by `voucher.issuer`. * @param rType Reward type to associate with `voucher.id`. * @returns Transaction receipt upon inclusion. */ redeemVoucher(voucher: MintVoucher$2, sig: BytesLike, rType: bigint | number): Promise; /** Redeem (burn) a token for rewards. * Purpose: Holder burns token `id`; downstream system credits the off-chain reward. * @param from Holder (must be caller or approved operator). * @param id Token id to redeem (burn). * @returns Transaction receipt upon inclusion. */ redeem(from: Address$e, id: bigint | number): Promise; /** Permit-for-all (EIP-712) — gasless operator approval. * Purpose: Approve or revoke `operator` for all of `owner`’s NFTs using a signature. * @param owner Token owner (signer of `v,r,s`). * @param operator Operator to approve/revoke. * @param approved `true` to grant; `false` to revoke. * @param deadline Signature expiry (unix seconds). * @param vrs Signature parts `{ v, r, s }`. * @returns Transaction receipt upon inclusion. */ permitForAll(owner: Address$e, operator: Address$e, approved: boolean, deadline: bigint | number, vrs: { v: number; r: BytesLike; s: BytesLike; }): Promise; /** Sweep: burn **expired** token owned by the caller. * Purpose: Self-cleanup for expired NFTs. Reverts if not expired. * @param id Token id to check and burn if expired. * @returns Transaction receipt upon inclusion. */ sweepExpired(id: bigint | number): Promise; /** Admin sweep: burn **expired** token owned by `from` (MINTER_ROLE). * Purpose: Operational cleanup for expired NFTs. * @param from Address whose expired token will be burned. * @param id Token id to check and burn if expired. * @returns Transaction receipt upon inclusion. */ sweepExpiredFrom(from: Address$e, id: bigint | number): Promise; /** setApprovalForAll — standard ERC-721 operator approval. * Purpose: Approve or revoke `operator` for all tokens. * @param operator Operator address. * @param approved `true` to approve; `false` to revoke. * @returns Transaction receipt upon inclusion. */ setApprovalForAll(operator: Address$e, approved: boolean): Promise; /** approve — approve an operator for a single token. * Purpose: Allow `to` to transfer `tokenId`. * @param to Approved operator. * @param tokenId Token id to approve. * @returns Transaction receipt upon inclusion. */ approve(to: Address$e, tokenId: bigint | number): Promise; /** safeTransferFrom — standard ERC-721 transfer (with receiver check). * Purpose: Move `tokenId` from `from` to `to`. * @param from Current owner. * @param to Recipient. * @param tokenId Token id to transfer. * @param data Optional bytes data forwarded to receiver hook. * @returns Transaction receipt upon inclusion. */ safeTransferFrom(from: Address$e, to: Address$e, tokenId: bigint | number, data?: BytesLike): Promise; /** Contract type string (for factory/registry UIs). */ contractType(): Promise; /** Contract semantic version string. */ contractVersion(): Promise; /** Base URI currently stored in the contract (collection URI). */ contractURI(): Promise; /** tokenURI for a specific token id. */ tokenURI(id: bigint | number): Promise; /** Current total supply (number of existing tokens). */ totalSupply(): Promise; /** Cumulative minted tokens so far (may include burned). */ totalMinted(): Promise; /** Max supply cap for the whole collection (0 = unlimited). */ maxSupply(): Promise; /** Arbitrary reward type associated to a token id. */ rewardTypeOf(id: bigint | number): Promise; /** Voting tier for a token id (0..255). */ tierOf(id: bigint | number): Promise; /** Expiry timestamp for a token id (unix seconds). */ expiresAtOf(id: bigint | number): Promise; /** Current whitelist registry address (0x0 if disabled). */ whitelist(): Promise; /** Owner of token id. */ ownerOf(id: bigint | number): Promise; /** ERC-2771 meta-tx forwarder check. */ isTrustedForwarder(fwd: Address$e): Promise; /** Soulbound flag (true blocks non-mint/non-burn transfers between EOAs). */ soulbound(): Promise; /** ERC165 support check. */ supportsInterface(iid: BytesLike): Promise; /** Compute the exact EIP-712 digest used by `redeemVoucher` for a given domain and voucher. * Purpose: Pre-validate signatures or generate them off-chain. * @param chainId EVM chain id. * @param voucher `MintVoucher` payload. * @returns 32-byte digest to be signed by `voucher.issuer`. */ computeVoucherDigest(chainId: number, voucher: MintVoucher$2): Bytes32$9; /** Sign a MintVoucher (wallet must match `voucher.issuer`). * Purpose: Helper for tests or distribution tooling to produce signatures. * @param signer Ethers signer used to sign typed data (must be `voucher.issuer`). * @param chainId EVM chain id. * @param voucher `MintVoucher` payload to sign. * @returns Hex signature suitable for `redeemVoucher`. */ signVoucher(signer: ethers.Signer, chainId: number, voucher: MintVoucher$2): Promise; /** Query `MetadataUpdate(id)` events. */ queryMetadataUpdate(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `RewardRedeemed(user,id)` events. */ queryRewardRedeemed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query ERC-721 `Transfer` events. */ queryTransfer(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query ERC-721 `Approval` events. */ queryApproval(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query ERC-721 `ApprovalForAll` events. */ queryApprovalForAll(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$d = string; type Bytes32$8 = string; /** Deploy-time arguments (forwarded to initialize) */ interface DeployArgs$c { /** Base URI used by ERC1155 (e.g., "ipfs://.../{id}.json") */ baseURI: string; /** DEFAULT_ADMIN_ROLE holder (also receives MINTER/PAUSER/etc via RolesCommon) */ admin: Address$d; /** ERC-2771 trusted forwarders (can be empty) */ trustedForwarders?: readonly Address$d[]; /** Default royalty receiver (ERC-2981) */ royaltyReceiver: Address$d; /** Default royalty fee in basis points (0..10000) */ royaltyFeeBps: number; } /** Result of deployment via factory (use `res.address`) */ interface DeployResult$e { address: Address$d; receipt: TransactionReceipt; helper: PrivilegeEditionHelper; } /** Voucher struct for lazy minting (must match Solidity field order & types) */ interface MintVoucher$1 { /** Token id to mint */ id: bigint | number; /** Amount to mint (per ERC1155 semantics) */ amount: bigint | number; /** Per-id metadata URI (overrides baseURI when non-empty) */ uri: string; /** Voting tier factor (0..255) used by VotesUpgradeable */ tier: number; /** Unix seconds when this edition expires (transfer/burn handling on-chain) */ expiresAt: bigint | number; /** Unix seconds (inclusive) until which the voucher is valid */ validUntil: bigint | number; /** Issuer-chosen unique nonce (anti-replay, tracked on chain) */ nonce: bigint | number; /** Signer address (must hold MINTER_ROLE) */ issuer: Address$d; /** Recipient; if zero, contract will use _msgSender() */ to: Address$d; } interface OptionalArgs$e { abi?: InterfaceAbi; } declare class PrivilegeEditionHelper { readonly address: Address$d; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$e | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new PrivilegeEdition proxy and return a connected helper. * Purpose: Initialize an ERC-1155 collection with royalties, EIP-712, meta-tx, and votes. * @param args `{ baseURI, admin, trustedForwarders, royaltyReceiver, royaltyFeeBps }` forwarded to `initialize`. * @param signer Deployer signer. * @param opts Optional factory options (salt, factory address, gas). * @returns `{ address, receipt, helper }` for immediate use. */ static deploy(args: DeployArgs$c, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing PrivilegeEdition at `address`. * Purpose: Bind helper to a deployed proxy for calls/transactions. * @param address Target contract address. * @param runner Signer or provider context. * @returns Connected helper instance. */ static attach(address: Address$d, runner: ContractRunner, ops?: OptionalArgs$e): PrivilegeEditionHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap wallet/provider without re-attaching. * @param runner New signer or provider. * @returns New helper targeting the same address. */ connect(runner: ContractRunner): PrivilegeEditionHelper; /** Set default royalty parameters (ERC-2981). * Purpose: Configure marketplace royalty distribution. * @param receiver Royalty receiver address. * @param feeBps Fee in basis points (0..10000). * @returns Transaction receipt upon inclusion. */ setDefaultRoyalty(receiver: Address$d, feeBps: number): Promise; /** Delete default royalty parameters (ERC-2981). * Purpose: Remove royalty info; per-id settings, if any, remain. * @returns Transaction receipt upon inclusion. */ deleteDefaultRoyalty(): Promise; /** Lock (cap) total supply for a given id. * Purpose: Enforce maximum mintable units; 0 means unlocked/unlimited before locking. * @param id Token id to cap. * @param cap Maximum supply to allow (must be ≥ current minted). * @returns Transaction receipt upon inclusion. */ lockSupply(id: bigint | number, cap: bigint | number): Promise; /** Set voting tier for an id before any mint has occurred. * Purpose: Adjust per-id voting weight factor (0..255). * @param id Token id. * @param newTier Tier value (0..255); reverts if already minted. * @returns Transaction receipt upon inclusion. */ setTier(id: bigint | number, newTier: number): Promise; /** Configure (or clear) the whitelist registry. * Purpose: When set, transfers require both sender and recipient to be whitelisted. * @param registry Whitelist contract address (0x0 to disable). * @returns Transaction receipt upon inclusion. */ setWhitelist(registry: Address$d): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). * Purpose: Emergency stop for mints/transfers/redeems. * @returns Transaction receipt upon inclusion. */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). * Purpose: Resume operations after pause. * @returns Transaction receipt upon inclusion. */ unpause(): Promise; /** Mint directly (MINTER_ROLE). * Purpose: Create/mint an edition and set its metadata & reward type. * @param to Recipient address. * @param id Token id to mint. * @param amt Amount to mint. * @param uri Per-id metadata URI (empty string to use baseURI). * @param tier Voting tier factor (0..255). * @param exp Expiry timestamp (unix seconds). * @param rType Arbitrary reward type flag to associate with `id`. * @returns Transaction receipt upon inclusion. */ mint(to: Address$d, id: bigint | number, amt: bigint | number, uri: string, tier: number, exp: bigint | number, rType: bigint | number): Promise; /** Redeem an EIP-712 MintVoucher (lazy mint) (MINTER signature required). * Purpose: Gas-efficient distribution; issuer signs off-chain, user (or relayer) submits on-chain. * @param voucher MintVoucher payload (fields must match Solidity struct). * @param sig EIP-712 signature by `voucher.issuer`. * @param rType Reward type to associate with `voucher.id`. * @returns Transaction receipt upon inclusion. */ redeemVoucher(voucher: MintVoucher$1, sig: BytesLike, rType: bigint | number): Promise; /** Redeem (burn) tokens for rewards. * Purpose: Holder burns `amount` of `id`; downstream system credits the off-chain reward. * @param from Token holder (must be caller or approved operator). * @param id Token id to redeem. * @param amount Amount to burn. * @returns Transaction receipt upon inclusion. */ redeem(from: Address$d, id: bigint | number, amount: bigint | number): Promise; /** Batch version of `redeem`. * Purpose: Burn multiple ids in a single transaction. * @param from Token holder (caller or approved). * @param ids Token ids to burn (array). * @param amounts Amounts per id (same length as `ids`). * @returns Transaction receipt upon inclusion. */ batchRedeem(from: Address$d, ids: readonly (bigint | number)[], amounts: readonly (bigint | number)[]): Promise; /** Permit-for-all (EIP-712) — gasless operator approval. * Purpose: Approve or revoke `operator` for all of `owner`’s editions using a signature. * @param owner Token owner (signer of `v,r,s`). * @param operator Operator to approve/revoke. * @param approved `true` to grant; `false` to revoke. * @param deadline Signature expiry (unix seconds). * @param vrs Signature parts `{ v, r, s }`. * @returns Transaction receipt upon inclusion. */ permitForAll(owner: Address$d, operator: Address$d, approved: boolean, deadline: bigint | number, vrs: { v: number; r: BytesLike; s: BytesLike; }): Promise; /** Burn all **expired** balances of the caller for a set of ids. * Purpose: Self-sweep; reverts if nothing is expired. * @param ids Token ids to check and burn if expired. * @returns Transaction receipt upon inclusion. */ sweepExpired(ids: readonly (bigint | number)[]): Promise; /** Admin sweep: burn **expired** balances of `from` for a set of ids (MINTER_ROLE). * Purpose: Operational cleanup for expired editions. * @param from Address whose expired balances will be burned. * @param ids Token ids to check and burn if expired. * @returns Transaction receipt upon inclusion. */ sweepExpiredFrom(from: Address$d, ids: readonly (bigint | number)[]): Promise; /** Contract type string (for factory/registry UIs). */ contractType(): Promise; /** Contract semantic version string. */ contractVersion(): Promise; /** Base URI currently stored in ERC1155. */ contractURI(): Promise; /** Per-id token URI (falls back to base when empty). */ uri(id: bigint | number): Promise; /** Total supply for a given id (minted − burned). */ totalSupply(id: bigint | number): Promise; /** Cumulative minted amount for id. */ totalMinted(id: bigint | number): Promise; /** Max supply cap for id (0 = unlocked/unlimited). */ maxSupply(id: bigint | number): Promise; /** Arbitrary reward type associated to id. */ rewardTypeOf(id: bigint | number): Promise; /** Current whitelist registry address (0x0 if disabled). */ whitelist(): Promise; /** ERC-2771 meta-tx forwarder check. */ isTrustedForwarder(fwd: Address$d): Promise; /** Soulbound flag (true blocks non-mint/non-burn transfers between EOAs). */ soulbound(): Promise; /** ERC165 support check. */ supportsInterface(iid: BytesLike): Promise; /** Compute the exact EIP-712 digest used by `redeemVoucher` for a given domain and voucher. * Purpose: Pre-validate signatures or generate them off-chain. * @param chainId EVM chain id. * @param voucher `MintVoucher` payload. * @returns 32-byte digest to be signed by `voucher.issuer`. */ computeVoucherDigest(chainId: number, voucher: MintVoucher$1): Bytes32$8; /** Sign a MintVoucher (wallet must match `voucher.issuer`). * Purpose: Helper for tests or distribution tooling to produce signatures. * @param signer Ethers signer used to sign typed data (must be `voucher.issuer`). * @param chainId EVM chain id. * @param voucher `MintVoucher` payload to sign. * @returns Hex signature suitable for `redeemVoucher`. */ signVoucher(signer: ethers.Signer, chainId: number, voucher: MintVoucher$1): Promise; /** Query `MetadataUpdate(id)` events. */ queryMetadataUpdate(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `RewardRedeemed(user,id,amount)` events. */ queryRewardRedeemed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query ERC1155 `TransferSingle` events. */ queryTransferSingle(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query ERC1155 `TransferBatch` events. */ queryTransferBatch(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query ERC1155 `ApprovalForAll` events. */ queryApprovalForAll(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } /** ERC-3475 key/value metadata entry. */ interface Values { key: string; value: string; } /** Deploy-time args — mirrors `initialize(admin, forwarders)` */ interface DeployArgs$b { /** DEFAULT_ADMIN_ROLE holder (also granted MINTER_ROLE) */ admin: string; /** ERC-2771 trusted forwarders (can be empty) */ trustedForwarders?: readonly string[]; } /** Result of deployment via factory. (use `res.address`, not `res.proxy`) */ interface DeployResult$d { /** Proxy address of the newly created instance */ address: string; /** Deployment + initialize tx receipt */ receipt: TransactionReceipt; /** Connected helper */ helper: BondTokenHelper; } /** EIP-712 PermitForAll payload (mirrors Solidity PERMIT_TYPEHASH). */ interface PermitForAllStruct { owner: string; operator: string; approved: boolean; nonce: bigint; deadline: bigint; } interface OptionalArgs$d { abi?: InterfaceAbi; } /** Signature parts used by `payCouponWithPermit`-like flows (if needed). */ interface SigParts { v: number; r: BytesLike; s: BytesLike; } declare class BondTokenHelper { readonly address: string; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$d | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new BondToken proxy and return a connected helper. * Purpose: Initialize an ERC-3475 Class/Nonce bond token with snapshots, whitelist, and EIP-712 permit. * @param args `{ admin, trustedForwarders }` for `initialize`. * @param signer Signer used to deploy and call the initializer. * @param opts Optional factory options (salt, factory address, gas). * @returns `{ address, receipt, helper }` for immediate use. */ static deploy(args: DeployArgs$b, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing BondToken at `address`. * Purpose: Bind a helper to an already deployed instance. * @param address Target contract address. * @param runner Signer or provider for calls/txs. * @returns Connected helper instance. */ static attach(address: string, runner: ContractRunner, ops?: OptionalArgs$d): BondTokenHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap wallet/provider without re-attaching. * @param runner New signer or provider. * @returns New helper instance sharing the same address. */ connect(runner: ContractRunner): BondTokenHelper; /** Create a new class with metadata (MINTER_ROLE). * @param classId Class identifier. * @param data Array of `{ key, value }` metadata entries. * @returns Transaction receipt. Emits `ClassCreated(classId)`. */ createClass(classId: BigNumberish, data: Values[]): Promise; /** Create a new nonce under an existing class (MINTER_ROLE). * @param classId Class identifier (must exist). * @param nonceId Nonce identifier (must be unused). * @param data Array of `{ key, value }` metadata entries. * @returns Transaction receipt. Emits `NonceCreated(classId, nonceId)`. */ createNonce(classId: BigNumberish, nonceId: BigNumberish, data: Values[]): Promise; /** Toggle class transferability (MINTER_ROLE). * @param classId Class identifier. * @param ok `true` to allow transfers; `false` to lock. * @returns Transaction receipt. Emits `ClassTransferableSet(classId, ok)`. */ setClassTransferable(classId: BigNumberish, ok: boolean): Promise; /** Configure an external whitelist registry (MINTER_ROLE). * @param registry Whitelist contract address (0x0 to disable checks). * @returns Transaction receipt upon inclusion. */ setWhitelist(registry: string): Promise; /** Mint bond units to `to` for (classId, nonceId) (MINTER_ROLE, whenNotPaused). * @param to Recipient address. * @param classId Class identifier. * @param nonceId Nonce identifier. * @param amount Units to mint. * @returns Transaction receipt. Emits `Transfer(0x0, to, ...)`. */ issue(to: string, classId: BigNumberish, nonceId: BigNumberish, amount: BigNumberish): Promise; /** Transfer bond units from caller to `to` (whenNotPaused). * @param to Recipient address. * @param classId Class identifier. * @param nonceId Nonce identifier. * @param amount Units to transfer. * @returns Transaction receipt. Emits `Transfer(from, to, ...)`. */ transfer(to: string, classId: BigNumberish, nonceId: BigNumberish, amount: BigNumberish): Promise; /** Operator transfer with approval (or MINTER_ROLE) (whenNotPaused). * @param from Token owner (must approve caller via `setApprovalForAll` or caller has MINTER_ROLE). * @param to Recipient address. * @param classId Class identifier. * @param nonceId Nonce identifier. * @param amount Units to transfer. * @returns Transaction receipt. Emits `Transfer(from, to, ...)`. */ operatorTransferFrom(from: string, to: string, classId: BigNumberish, nonceId: BigNumberish, amount: BigNumberish): Promise; /** Redeem (burn) from caller (whenNotPaused). * @param classId Class identifier. * @param nonceId Nonce identifier. * @param amount Units to redeem. * @returns Transaction receipt. Emits `Redeemed(msg.sender, ...)`. */ redeem(classId: BigNumberish, nonceId: BigNumberish, amount: BigNumberish): Promise; /** Burn from an arbitrary holder (MINTER_ROLE, whenNotPaused). * @param from Address to burn from. * @param classId Class identifier. * @param nonceId Nonce identifier. * @param amount Units to burn. * @returns Transaction receipt. Emits `Redeemed(from, ...)`. */ burn(from: string, classId: BigNumberish, nonceId: BigNumberish, amount: BigNumberish): Promise; /** Approve or revoke an operator for all of caller’s positions. * @param operator Operator address to set. * @param approved `true` to approve; `false` to revoke. * @returns Transaction receipt upon inclusion. */ setApprovalForAll(operator: string, approved: boolean): Promise; /** Check operator approval for `owner`. * @param owner Token owner address. * @param operator Operator address to check. * @returns `true` iff operator is approved for all. */ isApprovedForAll(owner: string, operator: string): Promise; /** Read current EIP-712 permit nonce for `owner`. * @param owner Address whose nonce to read. * @returns Current nonce value. */ nonces(owner: string): Promise; /** Submit an on-chain PermitForAll (gasless approval) using a signature. * @param owner Owner address (signer on the signature). * @param operator Operator to approve or revoke. * @param approved `true` to approve; `false` to revoke. * @param deadline UNIX seconds; signature is invalid after this moment. * @param vrs Signature parts `{ v, r, s }`. * @returns Transaction receipt upon inclusion. */ permitForAll(owner: string, operator: string, approved: boolean, deadline: BigNumberish, vrs: SigParts): Promise; /** Produce an EIP-712 signature for PermitForAll (off-chain). * @param signer Signer to produce the signature (must match `owner`). * @param payload `{ owner, operator, approved, deadline }` (nonce is fetched externally). * @param chainId Chain id for the EIP-712 domain. * @param verifyingContract Address of the BondToken contract. * @param currentNonce Current nonce for `owner` (from `nonces(owner)`). * @returns Hex signature string suitable for `permitForAll`. */ signPermitForAll(signer: ethers.Signer, payload: Omit, chainId: number, verifyingContract: string, currentNonce: bigint): Promise; /** Create a new snapshot id (MINTER_ROLE). * Purpose: Finalize “dirty” balances/supply and increment `_snapId`. * @returns `{ id, receipt }` where `id` is parsed from the `Snapshot(id)` event. */ snapshot(): Promise<{ id: bigint | null; receipt: TransactionReceipt; }>; /** Historical balance at snapshot `id`. * @param holder Account address. * @param classId Class identifier. * @param nonceId Nonce identifier. * @param id Snapshot id (≥ 1; id=1 is the bootstrap baseline). * @returns Balance recorded at that snapshot. */ balanceOfAt(holder: string, classId: BigNumberish, nonceId: BigNumberish, id: BigNumberish): Promise; /** Historical total supply at snapshot `id`. * @param classId Class identifier. * @param nonceId Nonce identifier. * @param id Snapshot id. * @returns Total supply recorded at that snapshot. */ totalSupplyAt(classId: BigNumberish, nonceId: BigNumberish, id: BigNumberish): Promise; /** Current balance for (classId, nonceId). */ balanceOf(owner: string, classId: BigNumberish, nonceId: BigNumberish): Promise; /** Current total supply for (classId, nonceId). */ totalSupply(classId: BigNumberish, nonceId: BigNumberish): Promise; /** Class transferability flag (public mapping). */ classTransferable(classId: BigNumberish): Promise; /** Return all class metadata pairs. */ classData(classId: BigNumberish): Promise; /** Return all nonce metadata pairs. */ nonceData(classId: BigNumberish, nonceId: BigNumberish): Promise; /** Indexed class metadata accessor (key,value). */ classDataAt(classId: BigNumberish, index: BigNumberish): Promise<{ key: string; value: string; }>; /** ERC-165 interface support. */ supportsInterface(iid: BytesLike): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). */ unpause(): Promise; /** Query `ClassCreated(classId)` events. */ queryClassCreated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `NonceCreated(classId, nonceId)` events. */ queryNonceCreated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Transfer(from,to,classId,nonceId,amount)` events. */ queryTransfer(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Redeemed(from,classId,nonceId,amount)` events. */ queryRedeemed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `ClassTransferableSet(classId,allowed)` events. */ queryClassTransferableSet(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Snapshot(id)` events. */ querySnapshot(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$c = string; type Bytes32$7 = string; /** Deploy-time args — mirrors `initialize(admin, forwarders)` */ interface DeployArgs$a { /** DEFAULT_ADMIN_ROLE holder */ admin: Address$c; /** ERC-2771 trusted forwarders */ trustedForwarders?: readonly Address$c[]; } /** Result of deployment via factory (use `res.address`) */ interface DeployResult$c { /** Proxy address */ address: Address$c; /** Deployment/initialize tx receipt */ receipt: TransactionReceipt; /** Connected helper */ helper: DebtManagerHelper; } /** Enum mirror of `TrancheStatus` in Solidity */ declare enum TrancheStatus { PENDING = 0, ACTIVE = 1, CALLED = 2, PUT_NOTICE = 3, DEFAULTED = 4, MATURED = 5 } /** Argument bag for `createTranche` */ interface CreateTrancheArgs { /** ERC-3475 snapshot-capable debt token */ token: Address$c; /** ERC-3475 class id */ classId: BigNumberish; /** ERC-3475 nonce id */ nonceId: BigNumberish; /** Principal ERC20 address (also used for call/put/maturity redemptions) */ principalToken: Address$c; /** Principal per 1 debt unit (scaled to principal token decimals) */ principalPerUnit: BigNumberish; /** Coupon ERC20 address (may be same as principalToken) */ couponToken: Address$c; /** Maturity timestamp (unix seconds, must be > now at creation) */ maturity: BigNumberish; /** Call price (bps, e.g., 10000 = 100%) */ callPriceBps: BigNumberish; /** Put price (bps) */ putPriceBps: BigNumberish; /** Call notice period (seconds) */ callNoticeSec: BigNumberish; /** Put notice period (seconds) */ putNoticeSec: BigNumberish; } /** Tranche info returned by `trancheInfo` */ interface TrancheInfo { token: Address$c; classId: bigint; nonceId: bigint; principalToken: Address$c; principalPerUnit: bigint; couponToken: Address$c; maturity: bigint; status: TrancheStatus; callPriceBps: number; putPriceBps: number; } interface OptionalArgs$c { abi?: InterfaceAbi; } /** Coupon metadata (no snapshot fields; see notes) */ interface CouponMeta { /** Coupon due timestamp (unix) */ payDate: bigint; /** Informational rate (bps) */ rateBps: bigint; /** Whether this epoch was paid by issuer */ paid: boolean; /** Total amount provisioned by issuer for this epoch */ totalPaid: bigint; /** Total amount claimed so far by holders */ claimed: bigint; } declare class DebtManagerHelper { readonly address: Address$c; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$c | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new DebtManager proxy and return a connected helper. * Purpose: Initialize a snapshot-based bond/debt lifecycle manager. * @param args Deploy/initialize arguments (admin, forwarders). * @param signer Ethers signer to send deployment & initializer tx. * @param opts Optional factory options (salt, factory address, etc.). * @returns `{ address, receipt, helper }` for immediate use. */ static deploy(args: DeployArgs$a, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing DebtManager at `address`. * Purpose: Bind helper to a deployed proxy/implementation for calls/txs. * @param address Target contract address. * @param runner Signer or provider for execution context. * @returns Connected helper instance. */ static attach(address: Address$c, runner: ContractRunner, ops?: OptionalArgs$c): DebtManagerHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap wallet/provider without re-attaching. * @param runner New signer or provider. * @returns New helper targeting the same address. */ connect(runner: ContractRunner): DebtManagerHelper; /** Create a new tranche (class/nonce) and register it as PENDING. * Purpose: Set base tokens & economics before adding coupon schedule. * @param a Tranche creation arguments (see `CreateTrancheArgs`). * @returns Transaction receipt; use `tranchesLength()-1` to get index, * or listen for `TrancheCreated(idx, maturity)`. */ createTranche(a: CreateTrancheArgs): Promise; /** Append a coupon epoch (strictly increasing by payDate). * Purpose: Build the schedule; first append moves PENDING → ACTIVE. * @param idx Tranche index. * @param payDate Coupon due timestamp (unix seconds). * @param rateBps Informational coupon rate in bps. * @returns Transaction receipt on success. Emits `CouponScheduleAdded`. */ addCouponSchedule(idx: BigNumberish, payDate: BigNumberish, rateBps: BigNumberish): Promise; /** Provision coupon funds and take a snapshot for an epoch. * Purpose: Record snapshot & per-unit payout, enabling holder claims. * @param idx Tranche index. * @param epoch Coupon epoch index. * @param totalAmount Total ERC20 amount to distribute this epoch. * @returns Transaction receipt. Emits `CouponPaid`. */ payCoupon(idx: BigNumberish, epoch: number, totalAmount: BigNumberish): Promise; /** Pay coupon using EIP-2612 `permit` on coupon token. * Purpose: Fund coupon in a single tx with gasless token approval. * @param idx Tranche index. * @param epoch Coupon epoch index. * @param totalAmount Total ERC20 amount to distribute this epoch. * @param deadline Permit deadline. * @param sig Signature parts `{ v, r, s }`. * @returns Transaction receipt. Emits `CouponPaid`. */ payCouponWithPermit(idx: BigNumberish, epoch: number, totalAmount: BigNumberish, deadline: BigNumberish, sig: { v: number; r: BytesLike; s: BytesLike; }): Promise; /** Notify CALL (issuer side). After notice period, holders can execute call. * Purpose: Move ACTIVE → CALLED, start call notice countdown. * @param idx Tranche index. * @returns Transaction receipt. Emits `CallNotified`. */ notifyCall(idx: BigNumberish): Promise; /** Deposit principal into tranche pool (issuer funding). * Purpose: Top up `principalPool`; required before payouts/redemptions. * @param idx Tranche index. * @param amount Principal token amount to deposit. * @returns Transaction receipt. Emits `PrincipalFunded`. */ depositPrincipal(idx: BigNumberish, amount: BigNumberish): Promise; /** Notify that debt token total supply changed externally. * Purpose: Recompute `requiredPrincipal` = principalPerUnit × totalSupply * delta since last cache; keeps funding requirements consistent. * @param idx Tranche index. * @returns Transaction receipt. Emits `SupplyAdjusted`. */ notifySupplyChange(idx: BigNumberish): Promise; /** Check & flag default if next unpaid coupon exceeded grace. * Purpose: Set status → DEFAULTED when due + grace < now and unpaid. * @param idx Tranche index. * @returns Transaction receipt; emits `Defaulted` if default flagged. */ checkDefault(idx: BigNumberish): Promise; /** Close tranche at/after maturity (issuer sweep). * Purpose: Mark MATURED and sweep remaining funds to `to` (after grace), * or enforce all coupons claimed if within grace. * @param idx Tranche index. * @param to Sweep recipient (non-zero). * @returns Transaction receipt. Emits `TrancheClosed`. */ closeTranche(idx: BigNumberish, to: Address$c): Promise; /** Claim coupon for an epoch based on snapshot balance. * Purpose: Receiver gets `balanceOfAt * perUnit` for epoch snapshot. * @param idx Tranche index. * @param epoch Coupon epoch index. * @returns Transaction receipt. Emits `CouponClaimed`. */ claimCoupon(idx: BigNumberish, epoch: number): Promise; /** Execute CALL after issuer notice period. * Purpose: Burn `amount` units and receive call price × principal. * @param idx Tranche index. * @param amount Units to call (burn). * @returns Transaction receipt. Emits `Called`. */ executeCall(idx: BigNumberish, amount: BigNumberish): Promise; /** File a PUT notice (requires current positive balance). * Purpose: Start put notice countdown for the caller. * @param idx Tranche index. * @returns Transaction receipt. Emits `PutNotified`. */ givePutNotice(idx: BigNumberish): Promise; /** Execute PUT after notice period. * Purpose: Burn `amount` units and receive put price × principal. * @param idx Tranche index. * @param amount Units to put (burn). * @returns Transaction receipt. Emits `PutExecuted`. */ exercisePut(idx: BigNumberish, amount: BigNumberish): Promise; /** Redeem principal at/after maturity (ACTIVE or PUT_NOTICE). * Purpose: Burn `amount` units and receive `principalPerUnit * amount`. * @param idx Tranche index. * @param amount Units to redeem (burn). * @returns Transaction receipt. Emits `PrincipalRedeemed`. */ redeemAtMaturity(idx: BigNumberish, amount: BigNumberish): Promise; /** Number of tranches created. * Purpose: Utility to enumerate tranche indices. * @returns `uint256` length of internal tranches array. */ tranchesLength(): Promise; /** Read key tranche metadata (see `TrancheInfo`). * Purpose: Fetch static economics & addresses for UI/services. * @param idx Tranche index. * @returns Strongly-typed tranche info object. */ trancheInfo(idx: BigNumberish): Promise; /** Number of coupon epochs on a tranche. * Purpose: Iterate coupon schedule for display or reconciliation. * @param idx Tranche index. * @returns Count of coupon epochs (`uint256` → number). */ couponCount(idx: BigNumberish): Promise; /** Return coupon epoch metadata (no snapshot/perUnit in this view). * Purpose: Show coupon calendar and payout progress. * @param idx Tranche index. * @param ep Coupon epoch index. * @returns `CouponMeta` object with payDate/rate/paid/totalPaid/claimed. */ couponMeta(idx: BigNumberish, ep: number): Promise; /** Public convenience: whether `owner` claimed coupon `ep` for tranche `idx`. * Purpose: Wallet UI: hide claim button when already claimed. * @param idx Tranche index. * @param ep Coupon epoch index. * @param owner Holder address to check. * @returns True iff already claimed. */ isClaimed(idx: BigNumberish, ep: number, owner: Address$c): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). * Purpose: Emergency stop to halt coupon/put/call/redemptions. * @returns Transaction receipt upon inclusion. */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). * Purpose: Resume operations after an emergency. * @returns Transaction receipt upon inclusion. */ unpause(): Promise; /** Query `TrancheCreated(idx,maturity)` events. */ queryTrancheCreated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CouponScheduleAdded(idx,epoch,payDate,rateBps)` events. */ queryCouponScheduleAdded(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CouponPaid(idx,epoch,totalAmount)` events. */ queryCouponPaid(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CouponClaimed(idx,epoch,holder,amount)` events. */ queryCouponClaimed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CallNotified(idx)` events. */ queryCallNotified(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Called(idx,holder,amount,pay)` events. */ queryCalled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `PutNotified(idx,holder)` events. */ queryPutNotified(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `PutExecuted(idx,holder,amount)` events. */ queryPutExecuted(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Defaulted(idx,missedEpoch)` events. */ queryDefaulted(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `PrincipalRedeemed(idx,holder,amount)` events. */ queryPrincipalRedeemed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `TrancheClosed(idx,to)` events. */ queryTrancheClosed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `PrincipalFunded(idx,amount)` events. */ queryPrincipalFunded(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `SupplyAdjusted(idx,dUnits,dPrincipal)` events. */ querySupplyAdjusted(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** (Legacy) Build a leaf = keccak256(abi.encodePacked(index, holder, amount)) * Note: Current `DebtManager` uses snapshot-based coupon distribution, * not Merkle-based claims. Kept for backwards-compatible tooling. */ static buildLeaf(index: number, holder: Address$c, amount: bigint): Bytes32$7; } type Address$b = string; type Bytes32$6 = string; /** Deploy-time arguments mapped to `initialize(admin, splitter, bps, forwarders)` */ interface DeployArgs$9 { /** DEFAULT_ADMIN_ROLE holder */ admin: Address$b; /** Fee receiver router (Splitter) */ splitter: Address$b; /** Protocol fee in bps (≤ 1000 = 10%) */ bps: number; /** ERC-2771 trusted forwarders (can be empty) */ trustedForwarders?: readonly Address$b[]; } /** Result of deployment via factory (uses `res.address`) */ interface DeployResult$b { address: Address$b; receipt: TransactionReceipt; helper: MarketManagerHelper; } declare enum AssetKind { ERC20 = 0, ERC721 = 1, ERC1155 = 2, BOND = 3 } interface Asset { /** ERC20/721/1155/BOND selector */ kind: AssetKind; /** Asset token contract address */ token: Address$b | string; /** For ERC721: tokenId, for ERC1155: id, for BOND: classId, for ERC20: 0 */ id: BigNumberish; /** For BOND only: nonceId, else 0 */ nonceId: BigNumberish; /** Per-unit “ticket size”: amount of the asset delivered per 1 unit purchase */ amount: BigNumberish; } /** EIP-2612-like permit data used when paying with ERC20 */ interface PermitData { /** Suggested: price * qty (spender = MarketManager) */ value: BigNumberish; /** Permit deadline (unix seconds) */ deadline: BigNumberish; /** ECDSA signature parts */ v: number; r: BytesLike; s: BytesLike; } /** Fixed-price, on-chain ask listing */ interface Ask { seller: Address$b | string; asset: Asset; /** Price per 1 unit (token decimals or wei for ETH) */ price: bigint; /** Address(0)=ETH, else ERC20 address */ paymentToken: Address$b | string; /** Remaining units available */ quantity: bigint; /** Per-wallet cap (0 = unlimited) */ maxPerWallet: number; /** Start time (unix seconds) */ startTime: bigint; /** End time (0 = open-ended) */ endTime: bigint; /** Optional royalty receiver (if royaltyBps > 0) */ royaltyReceiver: Address$b | string; /** Royalty in bps (0..10000) */ royaltyBps: number; /** Optional AgreementManager (delegated settlement) */ agreement: Address$b | string; /** Offer id at AgreementManager (required if agreement != 0) */ offerId: Bytes32$6; } /** Off-chain EIP-712 signed voucher (lazy listing) */ interface Voucher { asset: Asset; price: BigNumberish; paymentToken: Address$b; quantity: BigNumberish; maxPerWallet: BigNumberish; startTime: BigNumberish; endTime: BigNumberish; royaltyReceiver: Address$b; royaltyBps: number; salt: BigNumberish; seller: Address$b; } interface OptionalArgs$b { abi?: InterfaceAbi; } declare class MarketManagerHelper { readonly address: Address$b; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$b | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new MarketManager proxy and return a connected helper. * Purpose: Initialize market with fee router and protocol bps. * @param args See `DeployArgs` — forwarded to `initialize(...)`. * @param signer Signer used to deploy and initialize the proxy. * @param opts Optional factory options (salt, factory, gas). * @returns `{ address, receipt, helper }` for immediate use. */ static deploy(args: DeployArgs$9, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing MarketManager at `address`. * Purpose: Bind helper to a deployed proxy for calls/transactions. * @param address Target contract address. * @param runner Signer or provider context. * @returns Connected helper instance. */ static attach(address: Address$b, runner: ContractRunner, ops?: OptionalArgs$b): MarketManagerHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap wallet/provider without re-attaching. * @param runner New signer or provider. * @returns New helper targeting the same address. */ connect(runner: ContractRunner): MarketManagerHelper; /** Update protocol fee and fee router (ADMIN_ROLE). * Purpose: Change `feeBps` and set Splitter to receive fees. * @param bps New fee bps (≤ 1000). * @param to New Splitter address (non-zero). * @returns Transaction receipt upon inclusion. */ setFee(bps: number, to: Address$b): Promise; /** Allow or disallow a payment token (ADMIN_ROLE). * Purpose: Configure which ERC20s are acceptable as `paymentToken`. * @param token ERC20 address (address(0) == ETH). * @param allowed True to allow, false to disallow. * @returns Transaction receipt upon inclusion. */ setPaymentToken(token: Address$b, allowed: boolean): Promise; /** Configure (or clear) KYC registry (ADMIN_ROLE). * Purpose: When set, buyers must be whitelisted. * @param registry Whitelist contract address. * @returns Transaction receipt upon inclusion. */ setWhitelist(registry: Address$b): Promise; /** Create a fixed-price listing. * Purpose: Escrow assets and register an `Ask` unless delegated via AgreementManager. * @param asset Asset descriptor. * @param price Price per 1 unit (token decimals or wei). * @param paymentToken Address(0)=ETH, else ERC20 (must be allowed if non-zero). * @param quantity Units to list (must be > 0). * @param maxPerWallet Per-wallet cap (0 = unlimited). * @param startTime Start timestamp (0 ⇒ now). * @param endTime End timestamp (0 = open-ended, must be > now). * @param royaltyReceiver Receiver for royalties (required when `royaltyBps > 0`). * @param royaltyBps Royalty in bps (0..10000); `feeBps + royaltyBps ≤ 10000`. * @param agreement AgreementManager address (0x0 for direct escrow). * @param offerId Offer id at AgreementManager (required if `agreement != 0`). * @returns `{ askId, receipt }` where `askId` is parsed from `AskCreated`. */ createAsk(asset: Asset, price: bigint, paymentToken: string, quantity: bigint, params?: { maxPerWallet?: number; startTime?: number; endTime?: number; royaltyReceiver?: string; royaltyBps?: number; agreement?: string; offerId?: string; }): Promise<{ askId: bigint; receipt: ethers.TransactionReceipt; }>; /** Cancel an ask (seller only). * Purpose: Remove an active listing and release escrow if any. * @param askId Ask id to cancel. * @returns Transaction receipt upon inclusion. */ cancelAsk(askId: BigNumberish): Promise; /** Buy from an ask; auto-selects call with/without permit/investorSig. * Purpose: Transfer assets seller→buyer and route payment with fee/royalty. * @param askId Ask id to fill. * @param qty Units to buy (≤ ask.quantity). * @param opts Optional settings: * - `permit`: ERC20 permit for gasless allowance set. * - `investorSig`: required when `ask.agreement != 0`. * - `value`: override ETH value; by default computed as price * qty for ETH asks. * @returns `{ receipt, totals? }` where `totals` is parsed from `AskFilled` when available. */ fillAsk(askId: BigNumberish, qty: BigNumberish, opts?: { permit?: PermitData; investorSig?: BytesLike; value?: bigint; }): Promise<{ receipt: TransactionReceipt; totals?: { totalPaid: bigint; fee: bigint; royalty: bigint; net: bigint; }; }>; /** Redeem an EIP-712 `Voucher` (lazy listing). * Purpose: Seller-signed order; buyer (or relayer) executes on-chain. * @param v Voucher payload (must match Solidity struct layout). * @param qty Units to buy (supports partial fills up to `v.quantity`). * @param sig EIP-712 signature by `v.seller`. * @param opts Optional settings: * - `permit`: ERC20 permit for gasless allowance. * - `value`: override ETH value; by default computed as v.price * qty for ETH. * @returns `{ receipt, totals? }` with `VoucherFilled` amounts if emitted. */ fillVoucher(v: Voucher, qty: BigNumberish, sig: BytesLike, opts?: { permit?: PermitData; value?: bigint; }): Promise<{ receipt: TransactionReceipt; totals?: { totalPaid: bigint; fee: bigint; royalty: bigint; net: bigint; }; }>; /** Compute the exact EIP-712 digest used by the contract for a voucher. * Purpose: Pre-validate signatures or generate them off-chain. * @param chainId EVM chain id. * @param voucher `Voucher` payload. * @returns 32-byte digest to be signed by `voucher.seller`. */ computeVoucherDigest(chainId: number, voucher: Voucher): Bytes32$6; /** Sign a voucher with a signer (wallet must be `voucher.seller`). * Purpose: Helper for tests and distribution tooling. * @param signer Ethers signer used to sign typed data. * @param chainId EVM chain id. * @param voucher `Voucher` payload. * @returns Hex signature suitable for `fillVoucher`. */ signVoucher(signer: ethers.Signer, chainId: number, voucher: Voucher): Promise; /** Flush pending ERC20 fee to Splitter (nonReentrant, whenNotPaused). * Purpose: Route accrued protocol fees; accrues to `pendingFee` on failure. * @param token ERC20 token address to flush (indexed in events). * @param maxAmount Max amount to flush (0 = all pending). * @returns Transaction receipt upon inclusion. */ flushFees(token: Address$b, maxAmount: BigNumberish): Promise; /** Flush pending native fee to Splitter (nonReentrant, whenNotPaused). * Purpose: Route accrued protocol fees in ETH; accrues to `pendingNative` on failure. * @param maxAmount Max amount to flush (0 = all pending). * @returns Transaction receipt upon inclusion. */ flushNative(maxAmount: BigNumberish): Promise; /** Number of asks created (use indices `[0, asksLength)` for enumeration). */ asksLength(): Promise; /** Read ask by id (full struct). */ ask(id: BigNumberish): Promise; /** How many units of a voucher digest have been filled. */ voucherFilled(digest: Bytes32$6): Promise; /** Protocol fee bps (public variable). */ feeBps(): Promise; /** Current Splitter address (public variable). */ splitter(): Promise; /** Current KYC whitelist registry (0x0 if unset). */ kyc(): Promise; /** Whether an ERC20 is allowed as a payment token (address(0) denotes ETH). */ isPaymentTokenAllowed(token: Address$b): Promise; /** Pending ERC20 protocol fee for a given token. */ pendingFee(token: Address$b): Promise; /** Pending native (ETH) protocol fee. */ pendingNative(): Promise; /** ERC165 support check (via AccessControlUpgradeable). */ supportsInterface(iid: BytesLike): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). */ unpause(): Promise; /** Query `AskCreated(askId, seller, asset, qty, price, payToken)` events. */ queryAskCreated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `AskCancelled(askId)` events. */ queryAskCancelled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `AskFilled(askId, buyer, qty, totalPaid, fee, royalty, net)` events. */ queryAskFilled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `VoucherFilled(h, buyer, qty, totalPaid, fee, royalty, net)` events. */ queryVoucherFilled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `FeePending(token, amount)` events. */ queryFeePending(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `FeeFlushed(token, amount)` events. */ queryFeeFlushed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Build an ERC-20 asset descriptor. */ static assetERC20(token: Address$b, amountPerUnit: bigint): Asset; /** Build an ERC-721 asset descriptor. */ static assetERC721(token: Address$b, tokenId: bigint): Asset; /** Build an ERC-1155 asset descriptor. */ static assetERC1155(token: Address$b, id: bigint, amountPerUnit: bigint): Asset; /** Build a BOND asset descriptor (ERC-3475-like). */ static assetBond(token: Address$b, classId: bigint, nonceId: bigint, unitsPerTicket: bigint): Asset; } type Address$a = string; type Bytes32$5 = string; /** Deploy-time arguments mapped to WhitelistUpgradeable.initialize(...) */ interface DeployArgs$8 { /** DEFAULT_ADMIN_ROLE holder */ admin: Address$a; /** Initial Merkle root for ZK verification (bytes32 hex string) */ initialRoot: Bytes32$5; /** Groth16-style verifier contract address (implements verifyProof) */ verifier: Address$a; /** ERC-2771 trusted forwarders */ trustedForwarders?: readonly Address$a[]; } /** Result of deployment via factory (uses res.address, not res.proxy) */ interface DeployResult$a { /** Proxy address */ address: Address$a; /** Deployment/initialize transaction receipt */ receipt: TransactionReceipt; /** Connected helper */ helper: WhitelistHelper; } interface OptionalArgs$a { abi?: InterfaceAbi; } /** KYC trust level mirror (must match .sol enum order) */ declare enum KYCLevel { None = 0, Basic = 1, ZK = 2 } /** zkSNARK proof tuple shapes (Groth16) */ type ProofA = readonly [string, string]; type ProofB = readonly [[string, string], [string, string]]; type ProofC = readonly [string, string]; /** Public signals: [mode, root, nullifier, addr160, reserved5, reserved6] */ type PubSignals = readonly [ bigint, bigint, bigint, bigint, bigint, bigint ]; declare class WhitelistHelper { readonly address: Address$a; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$a | undefined; static KYCLevel: typeof KYCLevel; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new WhitelistUpgradeable proxy and return a connected helper. * Purpose: Initialize a KYC/allowlist registry with admin- and ZK-managed entries. * @param args See DeployArgs — forwarded to initialize(admin, root, verifier, forwarders). * @param signer Ethers signer used for deployment. * @param opts Optional factory opts (salt, factory address, gas settings). * @returns { address, receipt, helper } for immediate use. */ static deploy(args: DeployArgs$8, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing WhitelistUpgradeable at `address`. * Purpose: Create a helper bound to a deployed proxy. * @param address Target contract address. * @param runner Signer or provider to perform calls/txs. * @returns Connected helper instance. */ static attach(address: Address$a, runner: ContractRunner, ops?: OptionalArgs$a): WhitelistHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap execution context (e.g., change wallet) without re-attaching. * @param runner New signer or provider. * @returns New helper instance sharing the same address. */ connect(runner: ContractRunner): WhitelistHelper; /** Add one address as `Basic` (onlyRole(ADMIN_ROLE)). * @param user Address to set as Basic. * @returns Transaction receipt upon inclusion. * * Solidity: function add(address user) external; */ addBasic(user: Address$a): Promise; /** Remove one address (set to `None`) (onlyRole(ADMIN_ROLE)). * @param user Address to remove from the list. * @returns Transaction receipt upon inclusion. * * Solidity: function remove(address user) external; */ removeBasic(user: Address$a): Promise; /** Batch add addresses as `Basic` (onlyRole(ADMIN_ROLE)). * @param users Array of addresses to set as Basic. * @returns Transaction receipt upon inclusion. * * Solidity: function addBatch(address[] calldata u) external; */ addBasicBatch(users: readonly Address$a[]): Promise; /** Batch remove addresses (set to `None`) (onlyRole(ADMIN_ROLE)). * @param users Array of addresses to remove. * @returns Transaction receipt upon inclusion. * * Solidity: function removeBatch(address[] calldata u) external; */ removeBasicBatch(users: readonly Address$a[]): Promise; /** Add an address as `ZK` by verifying a Groth16 proof (onlyRole(VERIFIER_ROLE)). * Purpose: Trust-minimized allowlisting against the current Merkle root. * @param to Address to mark as ZK upon successful verification. * @param a Groth16 proof `a` (uint256[2]). * @param b Groth16 proof `b` (uint256[2][2]). * @param c Groth16 proof `c` (uint256[2]). * @param pubSignals Public signals (uint256[6]): * [0]=mode(0=KYC), [1]=root, [2]=nullifier, [3]=uint160(to), [4],[5]=reserved. * @returns `{ nullifier, receipt }`. Emits `ZKAdded(to)` on success. * * Solidity: * function addWithVerify( * address to, * uint[2] calldata a, * uint[2][2] calldata b, * uint[2] calldata c, * uint[6] calldata pubSignals * ) external whenNotPaused onlyRole(VERIFIER_ROLE); */ addZK(to: Address$a, a: ProofA, b: ProofB, c: ProofC, pubSignals: PubSignals): Promise<{ nullifier: Bytes32$5; receipt: TransactionReceipt; }>; /** Update the active Merkle root (onlyRole(VERIFIER_ROLE)). * Purpose: Rotate the cohort root used for zk verification. * @param newRoot New bytes32 root. * @returns Transaction receipt upon inclusion. * * Solidity: function setRoot(bytes32 newRoot) external; */ setRoot(newRoot: Bytes32$5): Promise; /** Replace the Groth16 verifier contract (onlyRole(ADMIN_ROLE)). * Purpose: Swap verifier implementation if needed. * @param v New verifier contract address. * @returns Transaction receipt upon inclusion. * * Solidity: function setVerifier(address v) external; */ setVerifier(v: Address$a): Promise; /** Pause state-changing entrypoints (onlyRole(PAUSER_ROLE)). * Purpose: Emergency stop for add/remove/root updates. * @returns Transaction receipt upon inclusion. * * Solidity: function pause() external; */ pause(): Promise; /** Unpause state-changing entrypoints (onlyRole(PAUSER_ROLE)). * Purpose: Resume operations after pause. * @returns Transaction receipt upon inclusion. * * Solidity: function unpause() external; */ unpause(): Promise; /** True if a user is whitelisted at any level (`Basic` or `ZK`). * @param user Address to check. * @returns Boolean result. * * Solidity: function isWhitelisted(address user) external view returns (bool); */ isWhitelisted(user: Address$a): Promise; /** Get the KYC level for a user. * @param user Address to query. * @returns KYCLevel enum value (0=None, 1=Basic, 2=ZK). * * Solidity: function kycLevel(address user) external view returns (KYCLevel); */ kycLevel(user: Address$a): Promise; /** Check if a nullifier hash has already been consumed. * @param nullifier Bytes32 nullifier hash. * @returns True if used (replay protected), false otherwise. * * Solidity: function usedNullifier(bytes32 nf) external view returns (bool); */ usedNullifier(nullifier: Bytes32$5): Promise; /** Current Merkle root used for zk verification. * @returns Bytes32 hex string (0x…). * * Solidity: bytes32 public currentRoot; */ currentRoot(): Promise; /** Current verifier contract address. * @returns Address of the verifier. * * Solidity: IVerifier public verifier; */ verifier(): Promise; /** ERC-2771: true if `forwarder` is a trusted meta-tx forwarder. * @param fwd Forwarder address to check. * @returns Boolean result. */ isTrustedForwarder(fwd: Address$a): Promise; /** Read VERIFIER_ROLE selector. */ VERIFIER_ROLE(): Promise; /** Grant a role (bytes32) to an account (DEFAULT_ADMIN_ROLE required). * @param role Role id (bytes32). * @param account Target account. * @returns Transaction receipt upon inclusion. */ grantRole(role: BytesLike, account: Address$a): Promise; /** Revoke a role (bytes32) from an account (DEFAULT_ADMIN_ROLE required). * @param role Role id (bytes32). * @param account Target account. * @returns Transaction receipt upon inclusion. */ revokeRole(role: BytesLike, account: Address$a): Promise; /** Renounce a role (bytes32) for the connected signer. * @param role Role id (bytes32). * @param account Must match the connected signer. * @returns Transaction receipt upon inclusion. */ renounceRole(role: BytesLike, account: Address$a): Promise; /** Check if `account` holds `role`. * @param role Role id (bytes32). * @param account Address to check. * @returns True if the account has the role. */ hasRole(role: BytesLike, account: Address$a): Promise; /** Query `WhitelistUpdated(user, level)` events. */ queryWhitelistUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `BatchWhitelistUpdated(count, level)` events. */ queryBatchWhitelistUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `RootUpdated(oldRoot, newRoot)` events. */ queryRootUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `VerifierSet(oldVerifier, newVerifier)` events. */ queryVerifierSet(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `ZKAdded(user)` events. */ queryZKAdded(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$9 = string; type Bytes32$4 = string; /** Deploy-time arguments mapped to FlexibleToken.initialize(...) */ interface DeployArgs$7 { /** ERC-20 name */ name: string; /** ERC-20 symbol */ symbol: string; /** Recipient of initial supply (also granted MINTER_ROLE) */ treasury: Address$9; /** Initial mint amount sent to `treasury` (cap-checked). RAW smallest unit * (like mint()): use ethers.parseUnits("100", decimals) for human amounts. */ initialSupply: BigNumberish; /** Supply cap (0 ⇒ unlimited). RAW smallest unit (see `initialSupply`). */ cap: BigNumberish; /** ERC-20 decimals (0..18) */ decimals: number; /** true ⇒ transferable, false ⇒ soul-bound (non-transferable) */ transferable: boolean; /** DEFAULT_ADMIN_ROLE holder (timelock recommended) */ admin: Address$9; /** ERC-2771 trusted forwarders */ forwarders?: readonly Address$9[]; } /** Result of deployment via factory (uses `res.address`) */ interface DeployResult$9 { address: Address$9; receipt: TransactionReceipt; helper: FlexibleTokenHelper; } /** Struct used by `redeemVoucher` (EIP-712) */ interface MintVoucher { /** Address that signed and must hold MINTER_ROLE */ issuer: Address$9; /** Recipient; if zero, contract uses _msgSender() */ to: Address$9; /** Mint amount */ amount: BigNumberish; /** Redemption deadline (unix seconds; inclusive) */ validUntil: BigNumberish; /** Arbitrary nonce to avoid collisions */ nonce: BigNumberish; } interface OptionalArgs$9 { abi?: InterfaceAbi; } type AmountLike = PromiseLike & { /** Returns raw bigint (smallest unit). */ raw(): Promise; /** Returns human-readable string using token decimals. */ format(): Promise; }; declare class FlexibleTokenHelper { readonly address: Address$9; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$9 | undefined; private _decimals?; private _symbol?; private _metaInit?; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); private amountOf; /** Deploy a new FlexibleToken proxy and return a connected helper. * Purpose: Initialize a configurable ERC20Votes token with optional cap and soul-bound behavior. * @param args See DeployArgs — forwarded to `initialize(...)` on-chain. * @param signer Ethers signer used for deployment and initializer call. * @param opts Optional factory options (salt, factory address, etc.). * @returns { address, receipt, helper } for immediate use. */ static deploy(args: DeployArgs$7, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing FlexibleToken at `address`. * Purpose: Create a helper bound to a deployed proxy or implementation. * @param address Target contract address. * @param runner Signer or provider to perform calls/txs. * @returns Connected helper instance. */ static attach(address: Address$9, runner: ContractRunner, ops?: OptionalArgs$9): FlexibleTokenHelper; /** Return a new helper bound to a different signer/runner. * Purpose: Swap execution context (e.g., change wallet) without re-attaching. * @param runner New signer or provider. * @returns New helper instance sharing the same address. */ connect(runner: ContractRunner): FlexibleTokenHelper; /** Mint tokens to `to` (MINTER_ROLE required, whenNotPaused). * Purpose: Increase supply within cap (if non-zero). * @param to Recipient address. * @param amount Mint amount (wei units of token). * @returns Transaction receipt upon inclusion. */ mint(to: Address$9, amount: BigNumberish): Promise; /** Batch mint to multiple recipients (MINTER_ROLE, whenNotPaused). * Purpose: Gas-efficient distribution; checks aggregated cap if set. * @param to Array of recipient addresses. * @param amounts Array of mint amounts per recipient (same length as `to`). * @returns Transaction receipt upon inclusion. */ batchMint(to: readonly Address$9[], amounts: readonly BigNumberish[]): Promise; transfer(to: string, amount: BigNumberish): Promise; approve(spender: string, amount: BigNumberish): Promise; /** Burn tokens from `from` (MINTER_ROLE required, whenNotPaused). * Purpose: Decrease supply from a specific holder. * @param from Address whose balance is reduced. * @param amount Burn amount. * @returns Transaction receipt upon inclusion. */ burn(from: Address$9, amount: BigNumberish): Promise; /** Batch burn from multiple holders (MINTER_ROLE, whenNotPaused). * Purpose: Gas-efficient reduction across many addresses. * @param from Array of holder addresses. * @param amounts Array of burn amounts (same length as `from`). * @returns Transaction receipt upon inclusion. */ batchBurn(from: readonly Address$9[], amounts: readonly BigNumberish[]): Promise; /** Redeem an off-chain signed MintVoucher (nonReentrant, whenNotPaused). * Purpose: Authorized airdrop/mint flow without granting MINTER_ROLE to relayer. * @param voucher The MintVoucher payload (issuer, to, amount, validUntil, nonce). * @param sig EIP-712 signature from `voucher.issuer` (who must hold MINTER_ROLE). * @returns `{ amount, receipt, digest }` where `amount` is minted amount returned by the contract, * and `digest` is the EIP-712 hash for record-keeping. * * Notes: * - Contract computes `digest = _hashTypedDataV4(keccak256(abi.encode(...)))` and verifies the signer. * - If `voucher.to == 0x0`, recipient becomes `_msgSender()` (ERC-2771-aware). * - Emits `VoucherRedeemed(digest, to, amount)`. */ redeemVoucher(voucher: MintVoucher, sig: BytesLike): Promise<{ amount: bigint; digest: Bytes32$4; receipt: TransactionReceipt; }>; /** Compute the EIP-712 digest for a MintVoucher exactly as the contract does. * Purpose: Pre-validate signatures or generate them off-chain. * @param chainId Chain id for the EIP-712 domain. * @param name Token name used by EIP-712 domain (usually `await name()`). * @param voucher The voucher payload to hash. * @returns 32-byte digest to be signed / compared on-chain. */ computeVoucherDigest(chainId: number, name: string, voucher: MintVoucher): Bytes32$4; /** Sign a MintVoucher with a signer (wallet must match `voucher.issuer`). * Purpose: Helper for tests/off-chain distribution tools. * @param signer Ethers signer used to sign typed data. * @param chainId Chain id for the EIP-712 domain. * @param name Token name for domain (usually `await name()`). * @param voucher Voucher payload. * @returns Signature bytes ready for `redeemVoucher`. */ signVoucher(signer: ethers.Signer, chainId: number, name: string, voucher: MintVoucher): Promise; /** Update the cap; 0 means unlimited (ADMIN_ROLE). * Purpose: Change maximum total supply limit. * @param newCap New cap value (0 ⇒ unlimited). * @returns Transaction receipt upon inclusion. */ setCap(newCap: BigNumberish): Promise; /** Configure/replace the whitelist registry (GUARDIAN_ROLE). * Purpose: Enforce allow-listing on sender & recipient for transfers when set. * @param registry Whitelist contract address (0x0 to disable). * @returns Transaction receipt upon inclusion. */ setWhitelist(registry: Address$9): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). * Purpose: Emergency stop for mint/burn/transfer. * @returns Transaction receipt upon inclusion. */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). * Purpose: Resume operations after pause. * @returns Transaction receipt upon inclusion. */ unpause(): Promise; /** Delegate voting power to `delegatee`. * Purpose: Assign the caller’s voting power to another address. * @param delegatee Address to receive voting power. * @returns Transaction receipt upon inclusion. */ delegate(delegatee: Address$9): Promise; /** Delegate by signature (gasless). * Purpose: Off-chain signed delegation usable by a relayer. * @returns Transaction receipt upon inclusion. */ delegateBySig(delegatee: Address$9, nonce: BigNumberish, expiry: BigNumberish, v: number, r: BytesLike, s: BytesLike): Promise; /** Current delegate for `account`. */ delegates(account: Address$9): Promise; /** Current votes for `account` (latest checkpoint). */ getVotes(account: Address$9): AmountLike; /** Past votes for `account` at `blockNumber`. */ getPastVotes(account: Address$9, blockNumber: BigNumberish): AmountLike; /** Past total supply at `blockNumber` (for quorum calculations). */ getPastTotalSupply(blockNumber: BigNumberish): AmountLike; /** ERC20 Permit (EIP-2612) approval with signature. * Purpose: Approve `spender` for `value` without on-chain tx by owner. * @returns Transaction receipt upon inclusion. */ permit(owner: Address$9, spender: Address$9, value: BigNumberish, deadline: BigNumberish, v: number, r: BytesLike, s: BytesLike): Promise; /** Current nonce for `owner` (required for permit). */ nonces(owner: Address$9): Promise; /** Lazily loads and memoizes token metadata (decimals/symbol). */ private ensureMeta; format(amountRaw: bigint | string): Promise; /** Parses a human-readable amount (e.g., "1.5") to a raw on-chain integer. */ parse(amountHuman: string | number): Promise; /** Max total supply; 0 means unlimited. */ cap(): AmountLike; /** Soul-bound mode flag; false disables normal transfers. */ transferable(): Promise; /** Whitelist registry address (0x0 if disabled). */ whitelist(): Promise; /** Redeemed status for a voucher digest (replay protection). */ redeemed(digest: Bytes32$4): Promise; /** ERC-2771: true if `forwarder` is a trusted meta-tx forwarder. */ isTrustedForwarder(forwarder: Address$9): Promise; /** ERC-20 name. */ name(): Promise; /** ERC-20 symbol. */ symbol(): Promise; /** ERC-20 decimals. */ decimals(): Promise; /** Total token supply. */ totalSupply(): AmountLike; /** Balance of `account`. */ balanceOf(account: string): AmountLike; /** Allowance from `owner` to `spender`. */ allowance(owner: Address$9, spender: Address$9): AmountLike; /** Query `CapChanged(oldCap,newCap)` events within a block range. */ queryCapChanged(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `WhitelistConfigured(whitelist)` events. */ queryWhitelistConfigured(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `VoucherRedeemed(digest,to,amount)` events. */ queryVoucherRedeemed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$8 = string; type Bytes32$3 = string; /** Deploy-time arguments mapped to GenericGovernor.initialize(...) */ interface DeployArgs$6 { /** Admin with DEFAULT_ADMIN_ROLE (and Governor admin) */ admin: Address$8; /** Governor name (used for EIP-712 domain separator) */ name: string; /** IVotes-compliant token (e.g., ERC20Votes) */ token: Address$8; /** TimelockController (upgradeable) used by this Governor */ timelock: Address$8; /** IWeightStrategy implementation for vote weights/quorum/threshold */ strategyAddr: Address$8; /** ERC-2771 trusted forwarders (can be empty) */ trustedForwarders?: readonly Address$8[]; } /** Deploy result (uses `res.address`, not `res.proxy`) */ interface DeployResult$8 { address: Address$8; receipt: TransactionReceipt; helper: GenericGovernorHelper; } /** Extended propose() arguments (matches the custom .sol overload) */ interface ProposalArgs { proposer: Address$8; targets: readonly Address$8[]; values: readonly (bigint | number)[]; calldatas: readonly BytesLike[]; description: string; /** UNIX seconds (0 ⇒ start immediately) */ startTs: bigint | number; /** UNIX seconds (must be > startTs, ≤ startTs + 60 days) */ endTs: bigint | number; } /** Tuple returned by `getProposalDetails(id)` */ interface ProposalDetails { proposer: Address$8; targets: Address$8[]; values: bigint[]; calldatas: string[]; start: bigint; end: bigint; description: string; } interface OptionalArgs$8 { abi?: InterfaceAbi; } /** Enum mirror of `Origin` in .sol (proposalOrigin mapping) */ declare enum Origin { Standalone = 0, Meta = 1 } declare class GenericGovernorHelper { readonly address: Address$8; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$8 | undefined; static SupportType: { readonly Against: 0; readonly For: 1; readonly Abstain: 2; }; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new Governor proxy and return a connected helper. */ static deploy(args: DeployArgs$6, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing Governor proxy at `address`. */ static attach(address: Address$8, runner: ContractRunner, ops?: OptionalArgs$8): GenericGovernorHelper; /** Return a new helper bound to a different signer/runner. */ connect(runner: ContractRunner): GenericGovernorHelper; /** Create a proposal with explicit voting window (extended overload). * @returns Proposal id (deterministic; computed via on-chain `hashProposal`) * * Solidity: * function propose( * address proposer, * address[] targets, * uint256[] values, * bytes[] calldatas, * string description, * uint64 startTs, * uint64 endTs * ) public returns (uint256 id); */ propose(p: ProposalArgs): Promise; /** Mirror a proposal from a parent (Meta) into this child (requires META_ROLE). * @returns The shared id (reverts on mismatch as per .sol) * * Solidity: * function proposeChild( * uint256 sharedId, * address proposer, * address[] targets, * uint256[] values, * bytes[] calldatas, * string description, * uint64 startTs, * uint64 endTs * ) external onlyRole(META_ROLE) returns (uint256); */ proposeChild(sharedId: bigint | number, p: ProposalArgs): Promise; /** Queue the proposal into the Timelock (GovernorTimelockControl). * @returns ETA (if emitted via ProposalQueued) * * Solidity: * function queue(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) * external returns (uint256 proposalId); */ queue(proposalId: bigint | number): Promise; /** Execute the queued proposal (Timelock calls the targets). * * Solidity: * function execute(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) * external payable returns (uint256 proposalId); */ execute(proposalId: bigint | number): Promise; /** Cancel a pending/active proposal (if allowed by rules/timelock). * * Solidity: * function cancel(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) * external returns (uint256 proposalId); */ cancel(proposalId: bigint | number): Promise; /** Cast a simple vote (0=Against, 1=For, 2=Abstain). */ castVote(proposalId: bigint | number, support: 0 | 1 | 2): Promise; /** Cast a vote with a reason (stored on-chain). */ castVoteWithReason(proposalId: bigint | number, support: 0 | 1 | 2, reason: string): Promise; /** Optional: cast vote with params (GovernorCountingSimple supports this overload). */ castVoteWithReasonAndParams(proposalId: bigint | number, support: 0 | 1 | 2, reason: string, params: BytesLike): Promise; /** Change default weight strategy (onlyGovernance). Emits `DefaultStrategySet`. */ updateStrategy(id4: BytesLike, newAddr: Address$8): Promise; /** Current default weight strategy address. */ defaultStrategy(): Promise; /** Read back extended proposal details stored on-chain. */ getProposalDetails(id: bigint | number): Promise; /** Tally for/against and total supply at snapshot (helper view). */ tally(id: bigint | number): Promise<{ yesVotes: bigint; noVotes: bigint; supply: bigint; }>; /** Custom start timestamp for proposal id. */ getStartTime(id: bigint | number): Promise; /** Custom end timestamp for proposal id. */ getEndTime(id: bigint | number): Promise; /** Governor state (honors timestamp window via .sol override). */ state(id: bigint | number): Promise; /** Whether this proposal needs timelock queuing. */ proposalNeedsQueuing(id: bigint | number): Promise; /** Quorum at a given block (strategy-based). */ quorum(blockNumber: bigint | number): Promise; /** Proposal threshold from GovernorSettings (could be strategy-based upstream). */ proposalThreshold(): Promise; /** Origin of the proposal (Standalone or Meta). */ proposalOrigin(id: bigint | number): Promise; /** Underlying IVotes token address. */ token(): Promise; /** Timelock controller address. */ timelock(): Promise; /** Update an ERC-2771 trusted forwarder (ADMIN_ROLE only). */ updateForwarder(forwarder: Address$8, trust: boolean): Promise; /** ERC-165 interface support (aggregated across parents). */ supportsInterface(iid: BytesLike): Promise; /** Read META_ROLE value (public constant in .sol). */ META_ROLE(): Promise; /** Read ADMIN_ROLE value (public constant exposed by RolesCommon). */ ADMIN_ROLE(): Promise; /** Grant a role (bytes32) to an account (DEFAULT_ADMIN_ROLE required). */ grantRole(role: BytesLike, account: Address$8): Promise; /** Revoke a role (bytes32) from an account (DEFAULT_ADMIN_ROLE required). */ revokeRole(role: BytesLike, account: Address$8): Promise; /** Renounce a role for the connected signer. */ renounceRole(role: BytesLike, account: Address$8): Promise; /** Check if `account` holds `role`. */ hasRole(role: BytesLike, account: Address$8): Promise; /** Compute OZ Governor descriptionHash = keccak256(utf8(description)). */ static descriptionHash(description: string): Bytes32$3; /** On-chain pure id computation (matches Governor’s hasher). */ hashProposal(args: { targets: readonly Address$8[]; values: readonly (bigint | number)[]; calldatas: readonly BytesLike[]; description: string; }): Promise; /** Query `ProposalCreated` events. */ queryProposalCreated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `ProposalQueued` events. */ queryProposalQueued(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `ProposalExecuted` events. */ queryProposalExecuted(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `VoteCast` events. */ queryVoteCast(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `DefaultStrategySet(id,address)` events. */ queryDefaultStrategySet(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$7 = string; interface DeployArgs$5 { /** DEFAULT_ADMIN_ROLE holder for MetaGovernor */ admin: Address$7; /** Governor name (string used in EIP-712 domain) */ name: string; /** Economic child governor address (must implement IGovernorBasic) */ econ: Address$7; /** Social child governor address (must implement IGovernorBasic) */ soc: Address$7; /** TimelockController address used by MetaGovernor */ timelock: Address$7; /** ERC-2771 trusted forwarder list */ trustedForwarders?: readonly Address$7[]; } interface DeployResult$7 { /** Proxy address (use `res.address` from deployViaFactory) */ address: Address$7; /** Deployment/initialize tx receipt */ receipt: TransactionReceipt; /** Connected helper */ helper: MetaGovernorHelper; } interface OptionalArgs$7 { abi?: InterfaceAbi; } interface Factors { eco: number; soc: number; } interface QuorumRule { eco: number; soc: number; } interface SuperRule { yesBp: number; turnoutBp: number; } declare const ProposalType: { readonly Economic: 0; readonly Social: 1; readonly Mixed: 2; readonly Emergency: 3; }; type ProposalTypeKey = keyof typeof ProposalType; declare class MetaGovernorHelper { readonly address: Address$7; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$7 | undefined; static ProposalType: { readonly Economic: 0; readonly Social: 1; readonly Mixed: 2; readonly Emergency: 3; }; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new MetaGovernor proxy and return a connected helper. */ static deploy(args: DeployArgs$5, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing MetaGovernor at `address`. */ static attach(address: Address$7, runner: ContractRunner, ops?: OptionalArgs$7): MetaGovernorHelper; /** Return a new helper bound to a different signer/runner. */ connect(runner: ContractRunner): MetaGovernorHelper; /** Create a proposal on BOTH child governors with a shared id. * @param p Proposal type (affects combination/quorum/super rules). * @param targets Call targets. * @param values ETH amounts (wei) per call. * @param calldatas Encoded calldata per call. * @param desc Human-readable description. * @param startTs Voting start timestamp (unix seconds). * @param endTs Voting end timestamp (unix seconds). * @returns The shared proposal id (same as `hashProposal(...)`). * * On-chain checks: * - `startTs < endTs` and `endTs > block.timestamp`. * - `targets.length == values.length == calldatas.length`. * * Solidity: * function propose( * ProposalType p, * address[] targets, * uint256[] values, * bytes[] calldatas, * string desc, * uint64 startTs, * uint64 endTs * ) external returns (uint256 id); */ propose(p: ProposalTypeKey | number, targets: readonly Address$7[], values: readonly (bigint | number)[], calldatas: readonly ethers.BytesLike[], desc: string, startTs: bigint | number, endTs: bigint | number): Promise; /** Finalize after BOTH children are `Succeeded` and combined rules pass. */ finalize(id: bigint | number): Promise; /** Governor state (MetaGovernor’s view). */ state(id: bigint | number): Promise; /** Whether proposals require queuing (timelock). */ proposalNeedsQueuing(id: bigint | number): Promise; /** Voting delay placeholder (meta uses children windows). */ votingDelay(): Promise; /** Voting period placeholder (meta uses children windows). */ votingPeriod(): Promise; /** Proposal threshold passthrough (from Governor base). */ proposalThreshold(): Promise; /** Read addresses configured on meta. */ econ(): Promise; soc(): Promise; /** Timelock controller address (inherited getter). */ timelock(): Promise; /** Base combination factors for a proposal type (bp each for eco/soc YES/NO). */ baseFactorsOf(p: ProposalTypeKey | number): Promise; /** Child turnout quorum (bp of each child total supply). */ quorumRuleOf(p: ProposalTypeKey | number): Promise; /** Super-majority rule: YES-share threshold and combined turnout threshold. */ superRuleOf(p: ProposalTypeKey | number): Promise; /** Economic child voting power at `timepoint`. */ getEconVotes(account: Address$7, timepoint: bigint | number): Promise; /** Social child voting power at `timepoint`. */ getSocVotes(account: Address$7, timepoint: bigint | number): Promise; /** Add/remove a trusted ERC-2771 forwarder. Requires DEFAULT_ADMIN_ROLE. */ updateForwarder(forwarder: Address$7, trust: boolean): Promise; /** ERC165 interface support (aggregated across parents). */ supportsInterface(iid: string): Promise; /** On-chain, pure proposal id computation (matches MetaGovernor.sol). */ hashProposal(args: { targets: readonly Address$7[]; values: readonly (bigint | number)[]; calldatas: readonly ethers.BytesLike[]; description: string; }): Promise; /** Query `Finalized(id, yes, no, sender)` events. */ queryFinalized(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$6 = string; type Bytes32$2 = string; /** Constructor/initializer arguments (mirrors `.initialize`) */ interface DeployArgs$4 { /** Initial minimum delay in seconds */ minDelay: BigNumberish; /** Accounts granted PROPOSER_ROLE and CANCELLER_ROLE */ proposers: readonly Address$6[]; /** Accounts granted EXECUTOR_ROLE (use address(0) to open) */ executors: readonly Address$6[]; /** Optional admin granted TIMELOCK_ADMIN_ROLE */ admin: Address$6; } /** Result of deployment via factory. */ interface DeployResult$6 { /** Proxy address (use `res.address`) */ address: Address$6; /** Deployment/initialize receipt */ receipt: TransactionReceipt; /** Connected helper */ helper: TimelockControllerHelper; } interface OptionalArgs$6 { abi?: InterfaceAbi; } /** Operation state enum (must match OZ `OperationState`). */ declare enum OperationState { Unset = 0, Waiting = 1, Ready = 2, Done = 3 } declare class TimelockControllerHelper { readonly address: Address$6; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$6 | undefined; /** Internal constructor; use `attach` or `deploy`. */ private constructor(); /** Deploy a new TimelockController proxy and return a connected helper. */ static deploy(args: DeployArgs$4, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing TimelockController at `address`. */ static attach(address: Address$6, runner: ContractRunner, ops?: OptionalArgs$6): TimelockControllerHelper; /** Return a new helper bound to a different signer/runner. */ connect(runner: ContractRunner): TimelockControllerHelper; /** Schedule a single operation. * @param target Contract to call * @param value ETH to forward (from timelock balance) * @param data Calldata (4-byte selector + encoded args) * @param predecessor Optional dependency op id (or ZERO_BYTES32) * @param salt User-chosen salt for uniqueness * @param delay Delay in seconds (≥ current minDelay) * @returns Receipt * * Solidity: * function schedule(address target, uint256 value, bytes data, * bytes32 predecessor, bytes32 salt, uint256 delay) external; */ schedule(target: Address$6, value: BigNumberish, data: BytesLike, predecessor: BytesLike | undefined, salt: BytesLike, delay: BigNumberish): Promise; /** Schedule a batch of operations. * Arrays must have equal length; each index is a separate call under one operation id. * * Solidity: * function scheduleBatch(address[] targets, uint256[] values, bytes[] datas, * bytes32 predecessor, bytes32 salt, uint256 delay) external; */ scheduleBatch(targets: readonly Address$6[], values: readonly BigNumberish[], datas: readonly BytesLike[], predecessor: BytesLike | undefined, salt: BytesLike, delay: BigNumberish): Promise; /** Execute a single operation (must be READY). * * Solidity: * function execute(address target, uint256 value, bytes data, * bytes32 predecessor, bytes32 salt) external payable; */ execute(target: Address$6, value: BigNumberish, data: BytesLike, predecessor: BytesLike | undefined, salt: BytesLike): Promise; /** Execute a batch operation (must be READY). * * Solidity: * function executeBatch(address[] targets, uint256[] values, bytes[] datas, * bytes32 predecessor, bytes32 salt) external payable; */ executeBatch(targets: readonly Address$6[], values: readonly BigNumberish[], datas: readonly BytesLike[], predecessor: BytesLike | undefined, salt: BytesLike): Promise; /** Cancel a scheduled (pending/waiting) operation. * * Solidity: * function cancel(bytes32 id) external; */ cancel(id: BytesLike): Promise; /** Read the current minimum delay. */ minDelay(): Promise; /** Schedule a self-call to update the minimum delay via the timelock. * This is the canonical way to change delay (only the timelock can call `updateDelay`). * * @param newDelay New delay in seconds * @param salt Unique salt * @param delay Delay to wait before execution (≥ current minDelay) * @param predecessor Optional dependency id (default ZERO_BYTES32) * @returns The operation id (hash) and the schedule receipt */ scheduleUpdateDelay(params: { newDelay: BigNumberish; salt: BytesLike; delay: BigNumberish; predecessor?: BytesLike; }): Promise<{ id: Bytes32$2; receipt: TransactionReceipt; }>; /** Hash for a single operation (pure on-chain function). */ hashOperation(target: Address$6, value: BigNumberish, data: BytesLike, predecessor: BytesLike, salt: BytesLike): Promise; /** Hash for a batch operation (pure on-chain function). */ hashOperationBatch(targets: readonly Address$6[], values: readonly BigNumberish[], datas: readonly BytesLike[], predecessor: BytesLike, salt: BytesLike): Promise; /** Operation timestamp (0 if unset or executed). */ timestamp(id: BytesLike): Promise; /** Operation finite state (Unset / Waiting / Ready / Done). */ operationState(id: BytesLike): Promise; /** True if operation exists (any state except Unset). */ isOperation(id: BytesLike): Promise; /** True if operation is pending (registered but not ready). */ isOperationPending(id: BytesLike): Promise; /** True if operation is ready (delay elapsed, not done). */ isOperationReady(id: BytesLike): Promise; /** True if operation is executed (done). */ isOperationDone(id: BytesLike): Promise; /** Read role ids (bytes32) from the contract. */ TIMELOCK_ADMIN_ROLE(): Promise; PROPOSER_ROLE(): Promise; EXECUTOR_ROLE(): Promise; CANCELLER_ROLE(): Promise; /** Grant a role (bytes32) to an account (DEFAULT_ADMIN_ROLE required). */ grantRole(role: BytesLike, account: Address$6): Promise; /** Revoke a role (bytes32) from an account (DEFAULT_ADMIN_ROLE required). */ revokeRole(role: BytesLike, account: Address$6): Promise; /** Renounce a role (bytes32) for the connected signer. */ renounceRole(role: BytesLike, account: Address$6): Promise; /** Check if `account` holds `role`. */ hasRole(role: BytesLike, account: Address$6): Promise; /** ERC165 support check (useful for interface probing). */ supportsInterface(iid: BytesLike): Promise; /** Query `CallScheduled(id,index,target,value,data,predecessor,delay)` events. */ queryCallScheduled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CallExecuted(id,index,target,value,data)` events. */ queryCallExecuted(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Cancelled(id)` events. */ queryCancelled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `MinDelayChange(old,new)` events. */ queryMinDelayChange(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$5 = string; interface DeployArgs$3 { /** DEFAULT_ADMIN_ROLE holder */ admin: Address$5; /** ERC20 reward token address */ rewardToken: Address$5; /** Emission duration per deposit cycle (seconds) */ duration: number; /** Stake cooldown (seconds; 0 disables) */ cooldownSecs: number; /** Deposit fee in BPS for ERC20/1155 (0..500) */ depositFeeBps: number; /** Fee recipient (ZeroAddress ⇒ burn) */ feeTreasury: Address$5; /** Initially allowed staking assets (arrowlist) */ initialArrowlist: readonly Address$5[]; /** ERC-2771 trusted forwarders */ forwarders?: readonly Address$5[]; } interface DeployResult$5 { /** Proxy address (deployViaFactory returns `.address`) */ address: Address$5; /** Deployment + initialize tx receipt */ receipt: TransactionReceipt; /** Connected helper */ helper: StakingHelper; } interface ActionParams { /** Destination contract (must be rewardToken or arrowlisted token) */ target: Address$5; /** ETH value forwarded with the call */ value: bigint; /** Calldata (must include a 4-byte selector at head) */ data: ethers.BytesLike; /** Delay (seconds) from now until first execution */ delay: bigint; /** If true, the action will be rescheduled repeatedly */ recurring: boolean; /** Interval (seconds) for recurring actions (required if recurring) */ interval: bigint; } interface Position { shares: bigint; rewardDebt: bigint; } interface OptionalArgs$5 { abi?: InterfaceAbi; } declare class StakingHelper { readonly address: Address$5; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$5 | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new staking proxy and return a connected helper. */ static deploy(args: DeployArgs$3, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing staking proxy at `address`. */ static attach(address: Address$5, runner: ContractRunner, ops?: OptionalArgs$5): StakingHelper; /** Return a new helper bound to a different signer/runner. */ connect(runner: ContractRunner): StakingHelper; /** Fund rewards and (re)start emission. Requires ADMIN_ROLE. * * Solidity: * function deposit(uint256 amount) * external onlyRole(ADMIN_ROLE) nonReentrant whenNotPaused updatePool; */ deposit(amount: bigint): Promise; /** Withdraw leftover rewards after the emission window ended. Requires ADMIN_ROLE. * * Solidity: * function withdraw(address to) * external nonReentrant whenNotPaused onlyRole(ADMIN_ROLE); */ withdraw(to: Address$5): Promise; /** Set stake cooldown seconds (0 disables). Requires ADMIN_ROLE. */ setCooldown(seconds: number | bigint): Promise; /** Set rounding precision (≤ 18) for payout rounding. Requires ADMIN_ROLE. */ setRewardPrecision(p: number): Promise; /** Configure deposit fee (0..500 bps) and fee recipient (ZeroAddress ⇒ burn). Requires ADMIN_ROLE. */ setDepositFee(bps: number, treasury?: Address$5): Promise; /** Allow or disallow a token for staking (arrowlist). Requires ADMIN_ROLE. */ setArrowlist(token: Address$5, allowed: boolean): Promise; /** Set (or clear) the whitelist registry. Requires MINTER_ROLE. */ setWhitelist(registry: Address$5): Promise; /** Stake ERC20 tokens (token must be arrowlisted). Requires whitelist if registry is set. * Caller must `approve(pool, amount)` on the ERC20 beforehand. * * Solidity: * function stakeERC20(address token, uint256 amount) * external onlyWhitelisted nonReentrant updatePool; */ stakeERC20(token: Address$5, amount: bigint): Promise; /** Unstake ERC20 tokens. * * Solidity: * function unstakeERC20(address token, uint256 amount) * external nonReentrant updatePool; */ unstakeERC20(token: Address$5, amount: bigint): Promise; /** Stake one ERC721 token (collection must be arrowlisted). Requires whitelist if registry is set. */ stakeERC721(token: Address$5, tokenId: bigint): Promise; /** Unstake one ERC721 token. */ unstakeERC721(token: Address$5, tokenId: bigint): Promise; /** Stake ERC1155 units (collection must be arrowlisted). Requires whitelist if registry is set. */ stakeERC1155(token: Address$5, id: bigint, amount: bigint): Promise; /** Unstake ERC1155 units. */ unstakeERC1155(token: Address$5, id: bigint, amount: bigint): Promise; /** Claim accrued reward for a given (token,id) position of the caller. Requires whitelist if registry is set. * * Solidity: * function claim(address token, uint256 id) * external onlyWhitelisted nonReentrant updatePool; */ claim(token: Address$5, id: bigint): Promise; /** Schedule a call to `target` with `value` and `data`. Returns the action id extracted from the event. */ scheduleAction(p: ActionParams): Promise<{ id: bigint; receipt: TransactionReceipt; }>; /** Execute a scheduled action when due; returns the `success` flag if found in events. */ executeAction(id: bigint): Promise<{ success: boolean | null; receipt: TransactionReceipt; }>; /** Compute rounded pending reward for a user position (applies `rewardPrecision`). */ pendingReward(token: Address$5, id: bigint, user: Address$5): Promise; /** Compute raw (unrounded) pending reward for a user position. */ pendingRawReward(token: Address$5, id: bigint, user: Address$5): Promise; /** Read stored position (shares, rewardDebt). */ position(token: Address$5, id: bigint, user: Address$5): Promise; /** Number of scheduled actions stored on-chain. */ actionsLength(): Promise; rewardToken(): Promise; whitelist(): Promise; rewardRate(): Promise; finishAt(): Promise; reservedReward(): Promise; rewardsDuration(): Promise; rewardPrecision(): Promise; totalShares(): Promise; accRewardPerShare(): Promise; lastUpdate(): Promise; cooldownSecs(): Promise; depositFeeBps(): Promise; feeTreasury(): Promise; isArrowed(token: Address$5): Promise; lastStakeAt(user: Address$5): Promise; /** Pause state-changing entrypoints. Requires PAUSER_ROLE. */ pause(): Promise; /** Unpause state-changing entrypoints. Requires PAUSER_ROLE. */ unpause(): Promise; /** Query `Staked(user, token, id, amount)` events. */ queryStaked(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Unstaked(user, token, id, amount)` events. */ queryUnstaked(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `RewardClaimed(user, amount)` events. */ queryRewardClaimed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `ActionScheduled(id, target, selector, executeAfter, recurring)` events. */ queryActionScheduled(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `ActionExecuted(id, target, success)` events. */ queryActionExecuted(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CooldownUpdated(_secs)` events. */ queryCooldownUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `DepositFeeUpdated(_bps, _treasury)` events. */ queryDepositFeeUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `TokenArrowed(token, allowed)` events. */ queryTokenArrowed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } /** Canonical bytes32 hex string (0x + 64 hex chars). */ type Address$4 = string; type Bytes32$1 = string; /** Result of deployment via factory. */ interface DeployResult$4 { address: Address$4; receipt: ethers.TransactionReceipt; helper: KpiRegistryHelper; } /** Solidity `struct Meta` mirrored in TS (see KpiRegistry.sol). */ interface KpiMeta { projectId: Bytes32$1; label: string; decimals: number; compareMask: number; threshold: bigint; commitment: boolean; } /** Solidity `struct MetricUpdate` in MultiTrustCredential (used by pushKpiValue). */ interface MetricUpdate { metricId: Bytes32$1; newValue: bigint; leafFull: ethers.BytesLike; deadline: bigint; } interface OptionalArgs$4 { abi?: InterfaceAbi; } declare const CompareMask$1: { readonly NONE: 0; readonly GTE: 1; readonly LTE: 2; readonly EQ: 4; readonly RANGE: 3; readonly FLOOR_EQ: 5; readonly CEIL_EQ: 6; readonly ALL: 7; }; type CompareMaskKey$1 = keyof typeof CompareMask$1; declare class KpiRegistryHelper { readonly address: string; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$4 | undefined; /** Internal constructor; use `attach` or `deploy`. */ private constructor(); /** Attach an existing KpiRegistry at `address`. */ static attach(address: Address$4, runner: ContractRunner, ops?: OptionalArgs$4): KpiRegistryHelper; /** Return a new helper with a different signer/runner. */ connect(runner: ContractRunner): KpiRegistryHelper; /** Deploy a new KpiRegistry proxy via your factory helper. * - The underlying implementation will be initialized with: * initialize(admin, mtcAddress, trustedForwarders) * - `trustedForwarders` is the ERC-2771 trusted forwarders list. */ static deploy({ admin, mtcAddress, trustedForwarders, }: { admin: string; mtcAddress: string; trustedForwarders: readonly string[]; }, signer: ethers.Signer, opts?: Partial>): Promise; /** Register a KPI under a project and mirror registration in MTC. * @param projectId Project id (bytes32). Accepts bytes32/number/bigint/string. * - If string and not hex, will be encoded to bytes32 (UTF-8 padded). * @param label Human-readable label used in deterministic metricId. * @param roleName Bytes32 role name enforced by MTC for write permission. * - Pass a bytes32 hex (0x…) or ASCII which will be encoded to bytes32. * @param decimals Number of decimals for numeric KPIs (uint8 > 0). * @param compare Allowed comparisons (bit mask). You can pass: * - a key of CompareMask (e.g., 'GTE', 'RANGE', 'ALL'), or * - a numeric mask (0-7). * @param threshold Threshold for numeric evaluation (ignored if `commitment` is true). * @param commitment If true, treated as commitment/hash KPI (no numeric comparison). * @returns Transaction receipt. Emits `MetricRegistered`. * * Solidity: * function registerKpi( * bytes32 projectId, * string label, * bytes32 roleName, * uint8 decimals, * uint8 compareMask, * uint256 threshold, * bool commitment * ) external returns (bytes32 metricId); */ registerKpi(projectId: Bytes32$1 | bigint | number | string, label: string, roleName: Bytes32$1 | string, decimals: number, compare: CompareMaskKey$1 | number, threshold: bigint, commitment: boolean): Promise; /** Push a KPI value into MTC and record an epoch timestamp internally. * - Caller must have ORACLE_ROLE on KpiRegistry/MTC side (as configured). * - For numeric KPIs (commitment=false), a `MetricPassed` event is emitted * when the new value satisfies the compareMask threshold. * @param tokenId Credential token id in MTC (often cast from holder address). * @param update MetricUpdate struct: * { metricId, newValue, leafFull, deadline } * @returns Transaction receipt. Emits `MetricUpdated` (+ optionally `MetricPassed`). * * Solidity: * function pushKpiValue(uint256 tokenId, MetricUpdate calldata upd) external; */ pushKpiValue(tokenId: bigint | number, update: MetricUpdate | { metricId: Bytes32$1 | bigint | number | string; newValue: bigint; leafFull: ethers.BytesLike; deadline: bigint; }): Promise; /** Pause state-changing entrypoints; requires PAUSER_ROLE. */ pause(): Promise; /** Unpause state-changing entrypoints; requires PAUSER_ROLE. */ unpause(): Promise; /** Fetch KPI meta by metricId. */ kpiMeta(metricId: Bytes32$1 | bigint | number | string): Promise; /** Latest epoch timestamp for a KPI (0 if none). */ latestTimestamp(metricId: Bytes32$1 | bigint | number | string): Promise; /** List all KPI ids registered under a project. */ listProjectKpis(projectId: Bytes32$1 | bigint | number | string): Promise; /** Attached MultiTrustCredential address recorded by the registry. */ mtcAddress(): Promise; /** True if `account` holds `roleName` on the registry. */ hasRole(roleName: Bytes32$1 | string, account: Address$4): Promise; /** Registry admin role bytes32. */ adminRole(): Promise; /** Registry oracle role bytes32. */ oracleRole(): Promise; /** Query `MetricRegistered` events. */ queryMetricRegistered(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `MetricUpdated` events. */ queryMetricUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `MetricPassed` events. */ queryMetricPassed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; } type Address$3 = string; type Bytes32 = string; /** Deploy-time arguments mapped to MultiTrustCredential.initialize(...) */ interface DeployArgs$2 { admin: Address$3; trustedForwarders?: readonly Address$3[]; } /** Result of deployment via factory. */ interface DeployResult$3 { address: Address$3; receipt: TransactionReceipt; helper: MultiTrustCredentialHelper; } /** Struct mirrors (see .sol) */ interface MetricInputStruct { /** bytes32 metric id */ metricId: Bytes32 | string; /** uint32 value (use number ≤ 2^32-1 or bigint) */ value: number | bigint; /** uint256 anchor root stored on-chain (maps to Metric.leafFull) */ anchorRoot?: bigint; /** @deprecated Use anchorRoot. */ leafFull?: bigint; /** tokenURI for new token (empty string allowed) */ uri?: string; /** expire date time for metric */ expiresAt?: bigint; } interface MintItemStruct { to: Address$3; metricId: Bytes32 | string; value: number | bigint; anchorRoot?: bigint; /** @deprecated Use anchorRoot. */ leafFull?: bigint; uri?: string; expiresAt?: bigint; } interface MetricUpdateStruct { metricId: Bytes32 | string; newValue: number | bigint; anchorRoot?: bigint; /** @deprecated Use anchorRoot. */ leafFull?: bigint; expiresAt?: bigint; } interface UpdateItemStruct { tokenId: bigint; metricId: Bytes32 | string; newValue: number | bigint; anchorRoot?: bigint; /** @deprecated Use anchorRoot. */ leafFull?: bigint; expiresAt?: bigint; } interface OptionalArgs$3 { abi?: InterfaceAbi; } interface ProofRoleGrant { roleName: Bytes32 | string; account: Address$3; } interface ProofReadinessIssue { code: 'verifier_not_set' | 'missing_role' | 'kpi_registry_mtc_mismatch' | 'kpi_registry_missing_admin_role' | 'kpi_registry_missing_writer_role'; message: string; roleName?: Bytes32; account?: Address$3; } interface ProofReadiness { ready: boolean; verifier: Address$3; issues: ProofReadinessIssue[]; } interface IntegratedProofReadiness extends ProofReadiness { kpiRegistry?: Address$3; kpiRegistryMtc?: Address$3; } declare const CompareMask: { readonly GT: 1; readonly LT: 2; readonly EQ: 4; readonly NONE: 0; readonly NEQ: 3; readonly GTE: 5; readonly LTE: 6; readonly ALL: 7; }; type CompareMaskKey = keyof typeof CompareMask; declare class MultiTrustCredentialHelper { readonly address: Address$3; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$3 | undefined; static CompareMask: { readonly GT: 1; readonly LT: 2; readonly EQ: 4; readonly NONE: 0; readonly NEQ: 3; readonly GTE: 5; readonly LTE: 6; readonly ALL: 7; }; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new MTC proxy via your factory helper. * - Initializes with: `initialize(admin, verifier, forwarders)`. */ static deploy(args: DeployArgs$2, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach an existing MTC at `address`. */ static attach(address: Address$3, runner: ContractRunner, ops?: OptionalArgs$3): MultiTrustCredentialHelper; /** Return a new helper bound to a different runner/signer. */ connect(runner: ContractRunner): MultiTrustCredentialHelper; /** Register a new metric type. * @param id Metric id (bytes32). * @param label Human-readable label. * @param roleName Writer role (bytes32) required for mint/update. * @param commitment If true, commitment/hash semantics for value. * @param mask Allowed compare ops (0..7). Use `CompareMask` keys or numeric. * @returns Transaction receipt. Emits `MetricRegistered`. * * Solidity: * function registerMetric(bytes32 id, string label, bytes32 roleName, bool commitment, uint8 mask) * external onlyRole(ADMIN_ROLE); */ registerMetric(id: Bytes32 | string, label: string, roleName: Bytes32 | string, commitment: boolean, mask: CompareMaskKey | number): Promise; /** Update compare mask for a metric (writer role required). * @param id Metric id. * @param mask New mask (0..7). * @returns Transaction receipt. * * Solidity: * function setCompareMask(bytes32 id, uint8 mask) external whenNotPaused; */ setCompareMask(id: Bytes32 | string, mask: CompareMaskKey | number): Promise; /** Mint credential (if absent) and set a metric in one call. * @param to Token owner address (tokenId = uint160(to)). * @param input MetricInputStruct. * @returns Transaction receipt. Emits `MetricUpdated`. * * Solidity: * function mint(address to, MetricInput calldata data) * external whenNotPaused nonReentrant; */ mint(to: Address$3, input: MetricInputStruct): Promise; /** Batch mint and/or write metrics. * @param arr Array of MintItemStruct. * @returns Transaction receipt. Emits `MetricUpdated` per item. * * Solidity: * function mintBatch(MintItem[] calldata arr) * external whenNotPaused nonReentrant; */ mintBatch(arr: MintItemStruct[]): Promise; /** Update a metric for an existing token. * @param tokenId Token id (uint256). * @param upd MetricUpdateStruct. * @returns Transaction receipt. Emits `MetricUpdated`. * * Solidity: * function updateMetric(uint256 tokenId, MetricUpdate calldata upd) * external whenNotPaused nonReentrant; */ updateMetric(tokenId: bigint, upd: MetricUpdateStruct): Promise; /** Batch update metrics. * @param arr Array of UpdateItemStruct. * @returns Transaction receipt. Emits `MetricUpdated` per item. * * Solidity: * function updateMetricBatch(UpdateItem[] calldata arr) * external whenNotPaused nonReentrant; */ updateMetricBatch(arr: UpdateItemStruct[]): Promise; updateVerifier(_verifier?: Address$3): Promise; getProofReadiness(requiredGrants?: readonly ProofRoleGrant[]): Promise; assertProofReadiness(requiredGrants?: readonly ProofRoleGrant[]): Promise; getIntegratedProofReadiness({ kpiRegistry, requiredGrants, requiredKpiWriterRoles, }?: { kpiRegistry?: Address$3 | KpiRegistryHelper; requiredGrants?: readonly ProofRoleGrant[]; requiredKpiWriterRoles?: readonly (Bytes32 | string)[]; }): Promise; assertIntegratedProofReadiness(args?: { kpiRegistry?: Address$3 | KpiRegistryHelper; requiredGrants?: readonly ProofRoleGrant[]; requiredKpiWriterRoles?: readonly (Bytes32 | string)[]; }): Promise; configureProofFlow({ verifier, roleGrants, }: { verifier?: Address$3; roleGrants?: readonly ProofRoleGrant[]; }): Promise<{ verifierReceipt?: TransactionReceipt; roleReceipts: TransactionReceipt[]; readiness: ProofReadiness; }>; /** Verify a zk proof against stored metric / mask rules. * @returns bool (true if verifier returns true and on-chain checks pass). * * Solidity: * function proveMetric( * uint256 tokenId, * bytes32 metricId, * uint256[2] calldata a, * uint256[2][2] calldata b, * uint256[2] calldata c, * uint256[6] calldata pubSignals * ) external view whenNotPaused returns (bool); */ proveMetric(tokenId: bigint, metricId: Bytes32 | string, a: readonly [string, string], b: readonly [[string, string], [string, string]], c: readonly [string, string], pubSignals: readonly [bigint, bigint, bigint, bigint, bigint, bigint]): Promise; proveGroupMetric(tokenId: bigint, metricId: Bytes32 | string, a: readonly [string, string], b: readonly [[string, string], [string, string]], c: readonly [string, string], pubSignals: readonly [bigint, bigint, bigint, bigint, bigint, bigint]): Promise; /** Predicate type helpers (keccak256("...") / bytes32). */ static PredicateType: { readonly ALLOWLIST: Bytes32; readonly RANGE: Bytes32; readonly DELTA: Bytes32; }; /** Convert a predicate label or bytes32 into the on-chain predicateType (bytes32 keccak). */ static toPredicateType(v: Bytes32 | string): Bytes32; /** Enable/disable a predicate for a metric (ADMIN_ROLE required). */ setPredicateAllowed(metricId: Bytes32 | string, predicateType: Bytes32 | string, allowed: boolean): Promise; /** Set predicate verification profile (ADMIN_ROLE required). */ setPredicateProfile(metricId: Bytes32 | string, predicateType: Bytes32 | string, predVerifier: Address$3, signalsLen: number, anchorIndex: number, addrIndex: number, epochIndex: number, epochCheck: boolean, requireMaskZero: boolean): Promise; /** Set predicate epoch/version (ADMIN_ROLE required). */ setPredicateEpoch(metricId: Bytes32 | string, predicateType: Bytes32 | string, epoch: bigint): Promise; /** Prove an arbitrary predicate (ZKEx). Proof must be Groth16-style (a,b,c). */ provePredicate(tokenId: bigint, metricId: Bytes32 | string, predicateType: Bytes32 | string, proof: { a: readonly [string, string]; b: readonly [[string, string], [string, string]]; c: readonly [string, string]; }, publicSignals: readonly bigint[]): Promise; /** Slash (reduce) a numeric metric for an offender (SLASHER_ROLE required). * @param offender Address to slash (tokenId = uint160(offender)). * @param metricId Metric type id. * @param penalty Amount to subtract (uint32 > 0). * @returns Transaction receipt. Emits `Slash`. * * Solidity: * function slash(address offender, bytes32 metricId, uint32 penalty) * external onlyRole(SLASHER_ROLE); */ slash(offender: Address$3, metricId: Bytes32 | string, penalty: number | bigint): Promise; /** Pause state-changing entrypoints (PAUSER_ROLE). */ pause(): Promise; /** Unpause state-changing entrypoints (PAUSER_ROLE). */ unpause(): Promise; /** Read writer role (bytes32) for a metric id. */ metricRoleOf(metricId: Bytes32 | string): Promise; /** Read human-readable label for a metric id. */ metricLabelOf(metricId: Bytes32 | string): Promise; /** True if the metric is marked as commitment-only. */ isCommitment(metricId: Bytes32 | string): Promise; /** Compare mask (0..7) for a metric id. */ compareMaskOf(metricId: Bytes32 | string): Promise; /** Current zk verifier address (public variable). */ verifier(): Promise; /** Query `MetricRegistered(id,label,role,mask)` events. */ queryMetricRegistered(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `MetricUpdated(tokenId,metricId,newValue,leafFull)` events. */ queryMetricUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Slash(tokenId,metricId,penalty)` events. */ querySlash(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `VerifierSet(verifier)` events (emitted on initialize). */ queryVerifierSet(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Grant a role (bytes32) to an account. Requires DEFAULT_ADMIN_ROLE. */ grantRole(role: Bytes32 | string, account: Address$3): Promise; /** Revoke a role (bytes32) from an account. Requires DEFAULT_ADMIN_ROLE. */ revokeRole(role: Bytes32 | string, account: Address$3): Promise; /** Renounce a role (bytes32) for the connected signer (self). */ renounceRole(role: Bytes32 | string, account: Address$3): Promise; /** Check if `account` holds `role`. */ hasRole(role: Bytes32 | string, account: Address$3): Promise; /** Deterministic tokenId convention used on-chain: uint256(uint160(owner)). */ static tokenIdFor(owner: Address$3): bigint; } type Address$2 = string; /** Result of deployment via factory. */ interface DeployResult$2 { address: Address$2; receipt: TransactionReceipt; helper: EmergencyPauseManagerHelper; } /** Deploy-time arguments mapped to EmergencyPauseManager.initialize(...) */ interface DeployArgs$1 { admin: Address$2; forwarders: readonly Address$2[]; } interface OptionalArgs$2 { abi?: InterfaceAbi; } declare class EmergencyPauseManagerHelper { readonly address: Address$2; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$2 | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new EmergencyPauseManager proxy via your factory helper. * - Initializes with: `initialize(admin, forwarders)`. */ static deploy({ admin, forwarders }: DeployArgs$1, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach an existing EmergencyPauseManager at `address`. */ static attach(address: Address$2, runner: ContractRunner, ops?: OptionalArgs$2): EmergencyPauseManagerHelper; /** Return a new helper bound to a different runner/signer. */ connect(runner: ContractRunner): EmergencyPauseManagerHelper; /** Register a new Pausable-compatible target contract. * @param target Target contract address implementing `pause()` / `unpause()`. * @returns Transaction receipt. Emits `TargetRegistered(target)`. * * Requirements (on-chain): * - Caller must have `PAUSER_ROLE`. * - `target` must be a contract and **not** this manager itself. * - The registry length must be `< MAX_TARGETS`. * * Solidity: * function registerPausable(address target) external onlyRole(PAUSER_ROLE); */ registerPausable(target: Address$2): Promise; /** Remove a previously registered target. * @param target Address to remove. * @returns Transaction receipt. Emits `TargetRemoved(target)`. * * Requirements (on-chain): * - Caller must have `PAUSER_ROLE`. * - Target must exist in the set. * * Solidity: * function removePausable(address target) external onlyRole(PAUSER_ROLE); */ removePausable(target: Address$2): Promise; /** Return the full list of registered targets. * @returns address[] Array of target addresses (current snapshot). * * Solidity: * function getTargets() external view returns(address[] memory); */ getTargets(): Promise; /** Batch-call `pause()` on all registered targets. * - Emits `PausedAll(msg.sender)` after attempting all targets. * - For each target failure, emits `PauseFailed(target)`; the batch continues. * @returns Transaction receipt. * * Requirements (on-chain): * - Caller must have `GUARDIAN_ROLE`. * * Solidity: * function pauseAll() external onlyRole(GUARDIAN_ROLE); */ pauseAll(): Promise; /** Batch-call `unpause()` on all registered targets. * - Emits `UnpausedAll(msg.sender)` after attempting all targets. * - For each target failure, emits `UnpauseFailed(target)`; the batch continues. * @returns Transaction receipt. * * Requirements (on-chain): * - Caller must have `GOVERNOR_ROLE`. * * Solidity: * function unpauseAll() external onlyRole(GOVERNOR_ROLE); */ unpauseAll(): Promise; /** Check if **all** targets currently report `paused() == true`. * - Internally uses `staticcall` to each target’s `paused()`; returns `false` if any call fails. * @returns boolean * * Solidity: * function checkAllPaused() external view returns (bool); */ checkAllPaused(): Promise; /** Read `MAX_TARGETS` constant from the contract, if exposed as public. */ maxTargets(): Promise; /** Query `TargetRegistered(target)` events. */ queryTargetRegistered(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `TargetRemoved(target)` events. */ queryTargetRemoved(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `PausedAll(pauser)` events. */ queryPausedAll(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `UnpausedAll(pauser)` events. */ queryUnpausedAll(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `PauseFailed(target)` events. */ queryPauseFailed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `UnpauseFailed(target)` events. */ queryUnpauseFailed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Grant a role (bytes32) to an account. Requires `DEFAULT_ADMIN_ROLE`. */ grantRole(role: string, account: Address$2): Promise; /** Revoke a role (bytes32) from an account. Requires `DEFAULT_ADMIN_ROLE`. */ revokeRole(role: string, account: Address$2): Promise; /** Renounce a role (bytes32) for the connected signer (self). */ renounceRole(role: string, account: Address$2): Promise; /** Check if `account` holds `role`. */ hasRole(role: string, account: Address$2): Promise; } /** Canonical 20-byte address string. */ type Address$1 = string; /** Result of deployment via factory. */ interface DeployResult$1 { address: Address$1; receipt: TransactionReceipt; helper: ReservePoolHelper; } /** Deploy-time arguments mapped to ReservePool.initialize(...) */ interface DeployArgs { admin: Address$1; router: Address$1; protocolToken: Address$1; forwarders: readonly Address$1[]; } interface OptionalArgs$1 { abi?: InterfaceAbi; } declare class ReservePoolHelper { readonly address: Address$1; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs$1 | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Attach an existing ReservePool at `address`. */ static attach(address: Address$1, runner: ContractRunner, ops?: OptionalArgs$1): ReservePoolHelper; /** Return a new helper bound to a different signer/runner. */ connect(runner: ContractRunner): ReservePoolHelper; /** Deploy a new ReservePool proxy via your factory helper. * - The underlying implementation will be initialized with: * initialize(admin, router, protocolToken, forwarders) */ static deploy(args: DeployArgs, signer: ethers.Signer, opts?: Partial>): Promise; /** Fund the **liquidity** bucket for `token` by `amount`. * - Native ETH is intentionally rejected because buy-back flow remains ERC20-only. * - If ERC20, performs `approveIfNeeded(token, this.address, amount)` and calls `fundLiquidity`. * @returns Transaction receipt. Emits `LiquidityFunded`. */ fundLiquidity(token: Address$1, amount: bigint): Promise; /** Fund the **compensation** bucket for `token` by `amount`. * - If `token == 0x0`, sends native ETH with `value = amount`. * - If ERC20, performs `approveIfNeeded(token, this.address, amount)` and calls `fundCompensation`. * @returns Transaction receipt. Emits `CompensationFunded`. */ fundCompensation(token: Address$1, amount: bigint): Promise; /** Execute a **forced buy-back** from `tokenIn` to `protocolToken` via router. * - Deducts `amountIn` from the liquidity bucket and swaps along `path`. * - Enforces cooldown: `block.timestamp - lastBuyBackAt[tokenIn] >= buyBackCooldown`. * - Path **must** start with `tokenIn` and end with `protocolToken`. * - Emits `BuyBackExecuted`. * @returns amountOut received (protocolToken). * * Solidity: * function triggerBuyBack( * address tokenIn, * uint256 amountIn, * uint256 minAmountOut, * address[] calldata path * ) external returns (uint256 amountOut) */ triggerBuyBack(tokenIn: Address$1, amountIn: bigint, minAmountOut: bigint, path: readonly Address$1[]): Promise; /** Pay compensation from the **compensation** bucket. Emits `CompensationPaid`. */ payCompensation(token: Address$1, to: Address$1, amount: bigint): Promise; /** Sweep between buckets for `token`. * - If `toCompensation = true`: moves from liquidity → compensation. * - If `toCompensation = false`: moves from compensation → liquidity. * Emits `Sweep`. */ sweep(token: Address$1, amount: bigint, toCompensation: boolean): Promise; /** Update the global buy-back cooldown. Only GUARDIAN_ROLE. Emits `BuyBackCooldownUpdated`. */ setBuyBackCooldown(newCooldownSeconds: bigint): Promise; /** Pause state-changing entrypoints. Only PAUSER_ROLE. */ pause(): Promise; /** Unpause state-changing entrypoints. Only PAUSER_ROLE. */ unpause(): Promise; /** Read the liquidity bucket for `token`. */ liquidityOf(token: Address$1): Promise; /** Read the compensation bucket for `token`. */ compensationOf(token: Address$1): Promise; /** Last buy-back timestamp (per tokenIn). */ lastBuyBackAt(tokenIn: Address$1): Promise; /** Global buy-back cooldown (seconds). */ buyBackCooldown(): Promise; /** AMM router address used by the pool. */ router(): Promise; /** Protocol token address (buy-back target; must be `path[path.length-1]`). */ protocolToken(): Promise; /** Query `LiquidityFunded` events. */ queryLiquidityFunded(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CompensationFunded` events. */ queryCompensationFunded(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `BuyBackExecuted` events. */ queryBuyBackExecuted(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `CompensationPaid` events. */ queryCompensationPaid(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `Sweep` events. */ querySweep(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `BuyBackCooldownUpdated` events. */ queryBuyBackCooldownUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Ensure allowance from `owner` (current signer) to `spender` ≥ `amount`. * - If insufficient, sends a single `approve(spender, MAX_UINT)` to minimize future approvals. * - No-op when `token == 0x0` (ETH) — approvals are for ERC-20 only. */ private approveIfNeeded; } /** Canonical 20-byte address string. */ type Address = string; declare const ReserveBucket: { readonly DIRECT: 0; readonly COMPENSATION: 1; readonly LIQUIDITY: 2; }; type ReserveBucketValue = typeof ReserveBucket[keyof typeof ReserveBucket]; type ReserveBucketInput = ReserveBucketValue | 'direct' | 'compensation' | 'liquidity'; type RoutedAssetKind = 'erc20' | 'native'; interface RouteLintIssue { code: 'routes_length' | 'route_dest' | 'route_bps' | 'route_bucket' | 'routes_sum' | 'native_liquidity'; message: string; index?: number; } interface RouteLintResult { ok: boolean; assetKind: RoutedAssetKind; totalBps: number; issues: RouteLintIssue[]; } /** Route struct mirror: destination, share, and optional ReservePool bucket target. */ interface Route { dest: string; bps: number; reserveBucket: ReserveBucketInput; } /** Result of deployment via factory. */ interface DeployResult { address: string; receipt: TransactionReceipt; helper: SplitterHelper; } interface OptionalArgs { abi?: InterfaceAbi; } declare class SplitterHelper { readonly address: string; readonly contract: ethers.Contract; readonly runner: ContractRunner; readonly ops: OptionalArgs | undefined; /** Internal constructor; prefer `attach` or `deploy`. */ private constructor(); /** Deploy a new Splitter proxy via your factory helper. * - Initializes with: `initialize(admin, routes, forwarders)`. * - `routes` must be 1..10 entries and sum of `bps` must be exactly 10,000. * - `reserveBucket` must be explicit for each route. */ static deploy({ admin, routes, trustedForwarders, }: { admin: string; routes: readonly Route[]; trustedForwarders?: readonly string[]; }, signer: ethers.Signer, opts?: Partial>): Promise; /** Attach to an existing Splitter at `address`. */ static attach(address: Address, runner: ContractRunner, ops?: OptionalArgs): SplitterHelper; /** Return a new helper bound to a different runner/signer. */ connect(runner: ContractRunner): SplitterHelper; /** Route ERC-20 `amount` according to current `routes`. * @note The Splitter **pulls** tokens using `safeTransferFrom(msg.sender, this, amount)`. * Therefore, the caller must first approve the Splitter address on the token: * `await erc20.approve(splitter.address, amount)`. * @returns Transaction receipt. Emits `FeeSplit(totalReceived, token, false)`. * * Solidity: * function routeERC20(IERC20 token, uint256 amount) external nonReentrant; */ routeERC20(token: string, amount: bigint): Promise; /** Route native ETH (msg.value) according to current `routes`. * @param amount Amount of native ETH to route (wei). Will be sent as `value`. * @returns Transaction receipt. Emits `FeeSplit(msg.value, address(0), true)`. * * Solidity: * function routeNative() external payable nonReentrant; */ routeNative(amount: bigint): Promise; /** Update route set (governance). Requires `GOVERNOR_ROLE` on-chain. * - Contract enforces: 1..10 items, `bps` in [1, 10_000], and sum == 10_000. * - Remainder/dust is always assigned to index 0 during distribution. * @returns Transaction receipt. Emits `RoutesUpdated`. * * Solidity: * function setRoutes(Route[] calldata _routes) external onlyRole(GOVERNOR_ROLE); */ setRoutes(routes: readonly Route[]): Promise; /** Fetch current routes (best-effort by probing indices 0..9). * - Splitter stores `Route[] public routes;` but does not expose `.length`. * - Contract limits size to 10, so we probe up to 10 and stop on first revert. * @returns Array of `{ dest, bps }` in on-chain order. */ getRoutes(): Promise; /** Read pending native (wei) for `addr` accrued from failed deliveries. */ pendingOf(addr: string): Promise; /** Claim caller’s pending native. Emits `PendingClaimed(msg.sender, amount)`. */ claimPendingNative(): Promise; /** Sweep `amount` from `dest`’s pending native to the same `dest` (governance). * - Requires `GOVERNOR_ROLE` on-chain. * @returns Transaction receipt. Emits `PendingClaimed(dest, amount)`. * * Solidity: * function sweepPendingNative(address dest, uint256 amount) * external onlyRole(GOVERNOR_ROLE) nonReentrant; */ sweepPendingNative(dest: string, amount: bigint): Promise; /** Pause state-changing entrypoints. Requires `PAUSER_ROLE` on-chain. */ pause(): Promise; /** Unpause state-changing entrypoints. Requires `PAUSER_ROLE` on-chain. */ unpause(): Promise; /** Query `FeeSplit(total, asset, nativePath)` events. */ queryFeeSplit(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `RoutesUpdated()` events. */ queryRoutesUpdated(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `NativePending(dest, amount)` events (native delivery fallback). */ queryNativePending(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; /** Query `PendingClaimed(dest, amount)` events. */ queryPendingClaimed(from?: number | string, to?: number | string): Promise<(ethers.Log | ethers.EventLog)[]>; static normalizeReserveBucket(bucket: ReserveBucketInput): ReserveBucketValue; static normalizeRoutes(routes: readonly Route[]): { dest: string; bps: number; reserveBucket: ReserveBucketValue; }[]; static lintRoutes(routes: readonly Route[], assetKind?: RoutedAssetKind): RouteLintResult; static assertAssetCompatibleRoutes(routes: readonly Route[], assetKind?: RoutedAssetKind): void; /** Validate routes: 1..10 entries, each `bps` in [1, 10000], sum == 10000, no zero dest. */ static assertRoutes(routes: readonly Route[]): void; } export { AgreementManagerHelper, BondTokenHelper, ContractBuilder, DebtManagerHelper, EmergencyPauseManagerHelper, FlexibleTokenHelper, GenericGovernorHelper, MarketManagerHelper, MetaGovernorHelper, MultiTrustCredentialHelper, PrivilegeEditionHelper, PrivilegeNFTHelper, ReservePoolHelper, SplitterHelper, StakingHelper, TimelockControllerHelper, WhitelistHelper };