import { Addressable, BigNumberish, BytesLike, ParamType, Typed } from "ethers"; //#region src/main/chains.d.ts declare const chains: { readonly 1: { readonly name: "mainnet"; readonly prefix: "eth"; }; readonly 10: { readonly name: "optimism"; readonly prefix: "oeth"; }; readonly 100: { readonly name: "gnosis"; readonly prefix: "gno"; }; readonly 1101: { readonly name: "zkevm"; readonly prefix: "zkevm"; }; readonly 11155111: { readonly name: "sepolia"; readonly prefix: "sep"; }; readonly 137: { readonly name: "polygon"; readonly prefix: "matic"; }; readonly 146: { readonly name: "sonic"; readonly prefix: "sonic"; }; readonly 42161: { readonly name: "arbitrumOne"; readonly prefix: "arb1"; }; readonly 42220: { readonly name: "celo"; readonly prefix: "celo"; }; readonly 43114: { readonly name: "avalanche"; readonly prefix: "avax"; }; readonly 56: { readonly name: "bsc"; readonly prefix: "bnb"; }; readonly 130: { readonly name: "unichain"; readonly prefix: "unichain"; }; readonly 480: { readonly name: "worldchain"; readonly prefix: "worldchain"; }; readonly 5000: { readonly name: "mantle"; readonly prefix: "mantle"; }; readonly 57073: { readonly name: "ink"; readonly prefix: "ink"; }; readonly 60808: { readonly name: "bob"; readonly prefix: "bob"; }; readonly 747474: { readonly name: "katana"; readonly prefix: "katana"; }; readonly 80094: { readonly name: "berachain"; readonly prefix: "berachain"; }; readonly 8453: { readonly name: "base"; readonly prefix: "base"; }; readonly 84532: { readonly name: "baseSepolia"; readonly prefix: "basesep"; }; readonly 999: { readonly name: "hyperevm"; readonly prefix: "hyperevm"; }; readonly 14: { readonly name: "flare"; readonly prefix: "flr"; }; readonly 534352: { readonly name: "scroll"; readonly prefix: "scr"; }; readonly 9745: { readonly name: "plasma"; readonly prefix: "plasma"; }; readonly 4326: { readonly name: "megaeth"; readonly prefix: "megaeth"; }; }; //#endregion //#region src/main/types.d.ts type ChainId = keyof typeof chains; declare enum ExecutionOptions { None = 0, Send = 1, DelegateCall = 2, Both = 3, } declare enum Clearance { None = 0, Target = 1, Function = 2, } declare enum ParameterType { None = 0, Static = 1, Dynamic = 2, Tuple = 3, Array = 4, Calldata = 5, AbiEncoded = 6, } declare enum Operator { Pass = 0, And = 1, Or = 2, Matches = 5, ArrayEvery = 7, EqualToAvatar = 15, EqualTo = 16, // paramType: Static / Dynamic / Tuple / Array GreaterThan = 17, // paramType: Static LessThan = 18, // paramType: Static SignedIntGreaterThan = 19, // paramType: Static SignedIntLessThan = 20, // paramType: Static Bitmask = 21, // paramType: Static / Dynamic Custom = 22, // paramType: Static / Dynamic / Tuple / Array WithinAllowance = 28, // paramType: Static EtherWithinAllowance = 29, // paramType: None CallWithinAllowance = 30, } declare enum Status { Ok = 0, /** Role not allowed to delegate call to target address */ DelegateCallNotAllowed = 1, /** Role not allowed to call target address */ TargetAddressNotAllowed = 2, /** Role not allowed to call this function on target address */ FunctionNotAllowed = 3, /** Role not allowed to send to target address */ SendNotAllowed = 4, /** Or condition not met */ OrViolation = 5, /** Nor condition not met */ NorViolation = 6, /** Parameter value is not equal to allowed */ ParameterNotAllowed = 7, /** Parameter value less than allowed */ ParameterLessThanAllowed = 8, /** Parameter value greater than maximum allowed by role */ ParameterGreaterThanAllowed = 9, /** Parameter value does not match */ ParameterNotAMatch = 10, /** Array elements do not meet allowed criteria for every element */ NotEveryArrayElementPasses = 11, /** Array elements do not meet allowed criteria for at least one element */ NoArrayElementPasses = 12, /** Parameter value not a subset of allowed */ ParameterNotSubsetOfAllowed = 13, /** Bitmask exceeded value length */ BitmaskOverflow = 14, /** Bitmask not an allowed value */ BitmaskNotAllowed = 15, CustomConditionViolation = 16, AllowanceExceeded = 17, CallAllowanceExceeded = 18, EtherAllowanceExceeded = 19, } interface Role { key: `0x${string}`; members: `0x${string}`[]; targets: Target[]; annotations: Annotation[]; lastUpdate: number; } interface Target { address: `0x${string}`; clearance: Clearance; executionOptions: ExecutionOptions; functions: Function[]; } interface Function { selector: `0x${string}`; executionOptions: ExecutionOptions; wildcarded: boolean; condition?: Condition; } interface Condition { paramType: ParameterType; operator: Operator; compValue?: `0x${string}`; children?: readonly Condition[]; } interface Allowance { key: `0x${string}`; refill: bigint; maxRefill: bigint; period: bigint; balance: bigint; timestamp: bigint; } interface Annotation { /** The URI serves as ID for the annotation. An http get request will be made to fetch the targeted permissions. */ uri: string; /** The OpenAPI schema that describes the API endpoint at uri. */ schema: string; } interface RolesModifier { address: `0x${string}`; owner: `0x${string}`; avatar: `0x${string}`; target: `0x${string}`; roles: Role[]; allowances: Allowance[]; multiSendAddresses: `0x${string}`[]; } //#endregion //#region src/main/target/authoring/types.d.ts type ConditionFunction = (abiType: ParamType, _?: T) => Condition; type PrimitiveValue = BigNumberish | BytesLike | string | boolean; type PrimitiveScoping = T | ConditionFunction; type ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never; type ArrayScoping = readonly Awaited>[] | ConditionFunction>[]>; type RequireAtLeastOne = { [K in keyof T]-?: Required> & Partial>> }[keyof T]; type PrimitiveOnly = Exclude | Addressable>; type MapToScoping = PrimitiveOnly extends PrimitiveValue ? PrimitiveScoping> : PrimitiveOnly extends unknown[] ? ArrayScoping> : PrimitiveOnly extends { [key: string]: any; } ? StructScoping> : never; type StructScoping = RequireAtLeastOne<{ [Key in keyof Struct]?: MapToScoping }> | ConditionFunction; /** * A scoping is one of the following: * - a primitive or array value – will be used for an equality check * - an object – will be used as a matching pattern * - a condition function */ type Scoping = T extends PrimitiveValue ? PrimitiveScoping : T extends any[] ? ArrayScoping : T extends { [key: string]: any; } ? StructScoping : unknown; type TupleScopings = { [Index in keyof Params]?: MapToScoping }; //#endregion //#region src/main/target/authoring/c/allowance.d.ts /** * Meters the parameter against an allowance. * * @param allowanceKey The allowance's key, as a label or already encoded */ declare const withinAllowance: (allowanceKey: string) => ConditionFunction; //#endregion //#region src/main/target/authoring/c/array.d.ts /** * Passes if every element of the array matches the given condition. * @param elementScoping The condition on the array elements */ declare const every: >, T extends any[]>(elementScoping: S) => ConditionFunction; //#endregion //#region src/main/target/authoring/c/branching.d.ts type ScopingBranches = [Scoping, Scoping, ...Scoping[]]; /** * Passes if any of the branch conditions are true. * @param branches conditions to be evaluated */ declare const or: , T>(...branches: Branches) => ConditionFunction; /** * Passes if all of the branch conditions are true. * @param branches conditions to be evaluated */ declare const and: , T>(...branches: Branches) => ConditionFunction; //#endregion //#region src/main/target/authoring/c/comparison.d.ts /** * Asserts that the value from calldata is equal to the given value * @param value The reference value to encode */ declare const eq: (value: any) => ConditionFunction; /** * Asserts that the value from calldata is equal to the avatar address configured on the Roles mod */ declare const avatar: ConditionFunction; /** * Asserts that the value from calldata is greater than the given value * @param value The reference value to encode */ declare const gt: (value: BigNumberish) => ConditionFunction; /** * Asserts that the value from calldata is greater than or equal to the given value * @param value The reference value to encode */ declare const gte: (value: BigNumberish) => ConditionFunction; /** * Asserts that the value from calldata is greater than the given value * @param value The reference value to encode */ declare const lt: (value: BigNumberish) => ConditionFunction; /** * Asserts that the value from calldata is less than or equal to the given value * @param value The reference value to encode */ declare const lte: (value: BigNumberish) => ConditionFunction; /** * Asserts that the bits selected by the mask at the given bytes offset equal the given value */ declare const bitmask: ({ shift, mask, value }: Bitmask) => ConditionFunction; interface Bitmask { /** Offset in bytes at which to apply the mask, defaults to `0` */ shift?: number; /** The 15 bytes bitmask, each `1` means the bit at that position will be compared against the comparison value bit at the same position */ mask: BytesLike; /** The 15 bytes comparison value, defines the expected value (`0` or `1`) for the bit at that position */ value: BytesLike; } //#endregion //#region src/main/permission/types.d.ts interface ExecutionFlags { send?: boolean; delegatecall?: boolean; } type TargetPermission = { targetAddress: `0x${string}`; } & ExecutionFlags; type FunctionPermission = ({ selector: `0x${string}`; } | { signature: string; }) & { targetAddress: `0x${string}`; condition?: Condition | ConditionFunction; } & ExecutionFlags; type FunctionPermissionCoerced = { selector: `0x${string}`; targetAddress: `0x${string}`; condition?: Condition; } & ExecutionFlags; type Permission = TargetPermission | FunctionPermission; type PermissionCoerced = TargetPermission | FunctionPermissionCoerced; type PermissionSet = Permission[] & { annotation?: Annotation; }; //#endregion //#region src/main/permission/coercePermission.d.ts declare const coercePermission:

(permission: P) => P extends FunctionPermission ? FunctionPermissionCoerced : TargetPermission; //#endregion //#region src/main/permission/processPermissions.d.ts /** * Processes permissions returning the resulting list of allowed targets. Merges permission entries addressing the same function and performs sanity checks. * @param permissions to process * @returns The resulting list of allowed targets */ declare const processPermissions: (input: readonly (Permission | PermissionSet)[]) => { targets: Target[]; annotations: Annotation[]; }; //#endregion //#region src/main/permission/reconstructPermissions.d.ts declare const reconstructPermissions: (targets: readonly Target[]) => PermissionCoerced[]; //#endregion //#region src/main/permission/id.d.ts declare const targetId: (permission: PermissionCoerced) => string; declare const permissionId: (permission: PermissionCoerced) => string; //#endregion //#region src/main/permission/validatePresets.d.ts /** * Filters and validates permission presets, returning two sets: * 1. Confirmed presets that are fully included onchain * 2. Remaining permissions that are not covered by any preset. */ declare function validatePresets({ targets, presets }: { targets: readonly Target[]; presets: readonly (T | null)[]; }): { presets: T[]; permissions: PermissionCoerced[]; }; //#endregion //#region src/main/target/authoring/c/matches.d.ts type AbiType = string | ParamType; /** * Matches a tuple or array against a structure of conditions. * * Throws if the type is not a tuple or array. Throws if the structure of conditions is incompatible with the type. * @param scoping The conditions on the tuple or array elements */ declare const matches: | StructScoping>(scoping: S) => (abiType: ParamType) => Condition; type CalldataMatches = { /** * Matches the parameters part of EVM call data against a structure of conditions. * * Skips over the first 4 bytes (function selector) and matches the ABI encoded parameters against the structure of conditions. * Optionally, also checks the function selector. * * @param scoping The conditions structure over the decoded parameters * @param abiTypes The parameter types defining how to decode bytes * @param selector If set, checks that the 4 bytes function selector matches the given value **/ >(scopings: S, abiTypes: readonly AbiType[], options?: { selector?: `0x${string}`; etherWithinAllowance?: string; callWithinAllowance?: string; }): (abiType?: ParamType) => Condition; /** * Matches EVM call data against a reference function permission. * * The 4 bytes function selector is checked against the function permission selector. * Also, function permission condition is evaluated on the call data. * * @param functionPermission The reference function permission **/ (functionPermission: FunctionPermission): (abiType?: ParamType) => Condition; }; declare const calldataMatches: CalldataMatches; /** * Matches standard ABI encoded bytes against a structure of conditions. * * @param scoping The conditions structure over the decoded parameters * @param abiTypes The parameter types defining how to decode bytes **/ declare const abiEncodedMatches: >(scopings: S, abiTypes: AbiType[]) => (abiType?: ParamType) => { paramType: ParameterType; operator: Operator; children: Condition[]; }; /** * Maps a scoping (shortcut notation or condition function) to a condition. * @param scoping The scoping to map. * @param abiType The abi type of the parameter the scoping applies to. * @returns */ //#endregion //#region src/main/target/authoring/c/custom.d.ts /** * Asserts that the value is scope represents an ERC721 token ID owned by the avatar. * Assumes that the call target is the ERC721 contract. */ declare const avatarIsOwnerOfErc721: ConditionFunction; //#endregion //#region src/main/target/authoring/c/pass.d.ts /** * Allows any value to pass */ declare const pass: (abiType: ParamType) => { paramType: ParameterType; operator: Operator; children: readonly Condition[] | undefined; }; declare namespace index_d_exports { export { abiEncodedMatches, and, avatar, avatarIsOwnerOfErc721, bitmask, calldataMatches, eq, every, gt, gte, lt, lte, matches, or, pass, withinAllowance }; } //#endregion //#region src/main/target/authoring/forAll.d.ts type UntargetedFunctionPermission = ({ selector: `0x${string}`; } | { signature: string; }) & { condition?: Condition | ConditionFunction; } & ExecutionFlags; type UntargetedPermission = ExecutionFlags | UntargetedFunctionPermission; declare const forAll: (targetAddresses: readonly `0x${string}`[], allow: UntargetedPermission | UntargetedPermission[]) => Permission[]; //#endregion //#region src/main/condition/readingIntegrity.d.ts declare const READING_INTEGRITY_DOCS = "https://docs.roles.gnosisguild.org/general/nested-calldata"; interface ReadingIntegrityOptions { /** * Acknowledgements of conditions that have been checked and are known to be * safe (see READING_INTEGRITY_DOCS), as `ReadingIntegrityError` reports * them in `acknowledgement`. These pass the check. */ acknowledged?: readonly string[]; } /** * The function a condition is set on. An acknowledgement made for it covers * that condition on that function of that contract only, as the contract * receiving the nested call may differ elsewhere. */ interface ReadingIntegrityScope { targetAddress: string; selector: string; } /** * Thrown by `checkReadingIntegrity`. `conditionHash` identifies the function * condition (normalized). `acknowledgement` is what to pass in `acknowledged` * once it has been checked. */ declare class ReadingIntegrityError extends Error { readonly conditionHash: string; readonly acknowledgement: string; constructor(reason: string, hash: string, acknowledgement: string); } /** * Rejects conditions that Roles v2 may read differently from the contract * receiving the call: * * - Conditions on calldata nested in a `bytes` parameter (`calldataMatches` or * `abiEncodedMatches` below the top level). * - A `bitmask` on a `bytes` value that expects the last bytes it checks to * be zero. * * Conditions acknowledged in `options.acknowledged` pass. With a `scope`, an * acknowledgement covers the condition on that function only; without one, * on any function. * * @param condition The root condition of a function. */ declare const checkReadingIntegrity: (condition: Condition, options?: ReadingIntegrityOptions & { scope?: ReadingIntegrityScope; }) => void; //#endregion //#region src/main/target/integrity.d.ts /** * Checks that targets are well-formed and their conditions valid. * * @param options.acknowledged acknowledgements of conditions checked to be * safe despite a `ReadingIntegrityError` (see `checkReadingIntegrity`). Each * covers one condition on one function of one target. */ declare const targetIntegrity: (targets: Target[], options?: ReadingIntegrityOptions) => void; //#endregion //#region src/main/condition/conditionId.d.ts declare function conditionHash(condition: Condition): string; /** * A canonical string id: two conditions get the same id exactly when they are * the same tree. Field order, extra fields, missing `children`/`compValue` and * the hex case of `compValue` make no difference. */ declare function conditionId(condition: Condition): string; /** * The key normalizeCondition sorts And/Or branches by. It is not an id: the * compValues are concatenated without lengths, so different conditions can * share a key (break ties with conditionId). It stays as it is because the * order it gives decides the normalized tree, and so the condition addresses * of roles already applied on chain. */ /** * Calculates the create2 storage address of the condition. */ declare const conditionAddress: (condition: Condition) => string; //#endregion //#region src/main/condition/flattenCondition.d.ts interface ConditionFlat { parent: number; paramType: ParameterType; operator: Operator; compValue?: string; } /** * Flattens a condition with nested children conditions into a breadth-first, flat array of conditions with parent index references. */ declare const flattenCondition: (root: Condition) => ConditionFlat[]; //#endregion //#region src/main/condition/normalize/index.d.ts /** * Normalizes a condition by transforming its structure without altering its semantics. * The goal is to minimize tree size and produce a canonical (normal) form, so that * semantically equivalent conditions are structurally identical. * * This normalization enables efficient condition equality checks and supports globally * deduplicated storage. In particular, the Roles contract stores conditions as bytecode * at addresses derived from hashing the condition data — so structurally consistent * representations help avoid redundant storage. */ declare function normalizeCondition(condition: Condition): Condition; //#endregion //#region src/main/abi.d.ts declare const rolesAbi: readonly [{ readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "_owner"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "_avatar"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "_target"; readonly type: "address"; }]; readonly stateMutability: "nonpayable"; readonly type: "constructor"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "AlreadyDisabledModule"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "AlreadyEnabledModule"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "ArraysDifferentLength"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "CalldataOutOfBounds"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "enum PermissionChecker.Status"; readonly name: "status"; readonly type: "uint8"; }, { readonly internalType: "bytes32"; readonly name: "info"; readonly type: "bytes32"; }]; readonly name: "ConditionViolation"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "FunctionSignatureTooShort"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly name: "HashAlreadyConsumed"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "InvalidInitialization"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "InvalidModule"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "InvalidPageSize"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "MalformedMultiEntrypoint"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "ModuleTransactionFailed"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "NoMembership"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "sender"; readonly type: "address"; }]; readonly name: "NotAuthorized"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "NotInitializing"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "owner"; readonly type: "address"; }]; readonly name: "OwnableInvalidOwner"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "account"; readonly type: "address"; }]; readonly name: "OwnableUnauthorizedAccount"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "SetupModulesAlreadyCalled"; readonly type: "error"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }, { readonly indexed: false; readonly internalType: "enum ExecutionOptions"; readonly name: "options"; readonly type: "uint8"; }]; readonly name: "AllowFunction"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "enum ExecutionOptions"; readonly name: "options"; readonly type: "uint8"; }]; readonly name: "AllowTarget"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "bytes32[]"; readonly name: "roleKeys"; readonly type: "bytes32[]"; }, { readonly indexed: false; readonly internalType: "bool[]"; readonly name: "memberOf"; readonly type: "bool[]"; }]; readonly name: "AssignRoles"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "previousAvatar"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "newAvatar"; readonly type: "address"; }]; readonly name: "AvatarSet"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "allowanceKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "uint128"; readonly name: "consumed"; readonly type: "uint128"; }, { readonly indexed: false; readonly internalType: "uint128"; readonly name: "newBalance"; readonly type: "uint128"; }]; readonly name: "ConsumeAllowance"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "DisabledModule"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "EnabledModule"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "ExecutionFromModuleFailure"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "ExecutionFromModuleSuccess"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly name: "HashExecuted"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly name: "HashInvalidated"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "uint64"; readonly name: "version"; readonly type: "uint64"; }]; readonly name: "Initialized"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "previousOwner"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "newOwner"; readonly type: "address"; }]; readonly name: "OwnershipTransferred"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }]; readonly name: "RevokeFunction"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }]; readonly name: "RevokeTarget"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "initiator"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "owner"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "avatar"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "target"; readonly type: "address"; }]; readonly name: "RolesModSetup"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }, { readonly components: readonly [{ readonly internalType: "uint8"; readonly name: "parent"; readonly type: "uint8"; }, { readonly internalType: "enum ParameterType"; readonly name: "paramType"; readonly type: "uint8"; }, { readonly internalType: "enum Operator"; readonly name: "operator"; readonly type: "uint8"; }, { readonly internalType: "bytes"; readonly name: "compValue"; readonly type: "bytes"; }]; readonly indexed: false; readonly internalType: "struct ConditionFlat[]"; readonly name: "conditions"; readonly type: "tuple[]"; }, { readonly indexed: false; readonly internalType: "enum ExecutionOptions"; readonly name: "options"; readonly type: "uint8"; }]; readonly name: "ScopeFunction"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }]; readonly name: "ScopeTarget"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "bytes32"; readonly name: "allowanceKey"; readonly type: "bytes32"; }, { readonly indexed: false; readonly internalType: "uint128"; readonly name: "balance"; readonly type: "uint128"; }, { readonly indexed: false; readonly internalType: "uint128"; readonly name: "maxRefill"; readonly type: "uint128"; }, { readonly indexed: false; readonly internalType: "uint128"; readonly name: "refill"; readonly type: "uint128"; }, { readonly indexed: false; readonly internalType: "uint64"; readonly name: "period"; readonly type: "uint64"; }, { readonly indexed: false; readonly internalType: "uint64"; readonly name: "timestamp"; readonly type: "uint64"; }]; readonly name: "SetAllowance"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "bytes32"; readonly name: "defaultRoleKey"; readonly type: "bytes32"; }]; readonly name: "SetDefaultRole"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: false; readonly internalType: "address"; readonly name: "to"; readonly type: "address"; }, { readonly indexed: false; readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }, { readonly indexed: false; readonly internalType: "contract ITransactionUnwrapper"; readonly name: "adapter"; readonly type: "address"; }]; readonly name: "SetUnwrapAdapter"; readonly type: "event"; }, { readonly anonymous: false; readonly inputs: readonly [{ readonly indexed: true; readonly internalType: "address"; readonly name: "previousTarget"; readonly type: "address"; }, { readonly indexed: true; readonly internalType: "address"; readonly name: "newTarget"; readonly type: "address"; }]; readonly name: "TargetSet"; readonly type: "event"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }, { readonly internalType: "enum ExecutionOptions"; readonly name: "options"; readonly type: "uint8"; }]; readonly name: "allowFunction"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly internalType: "enum ExecutionOptions"; readonly name: "options"; readonly type: "uint8"; }]; readonly name: "allowTarget"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly name: "allowances"; readonly outputs: readonly [{ readonly internalType: "uint128"; readonly name: "refill"; readonly type: "uint128"; }, { readonly internalType: "uint128"; readonly name: "maxRefill"; readonly type: "uint128"; }, { readonly internalType: "uint64"; readonly name: "period"; readonly type: "uint64"; }, { readonly internalType: "uint128"; readonly name: "balance"; readonly type: "uint128"; }, { readonly internalType: "uint64"; readonly name: "timestamp"; readonly type: "uint64"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }, { readonly internalType: "bytes32[]"; readonly name: "roleKeys"; readonly type: "bytes32[]"; }, { readonly internalType: "bool[]"; readonly name: "memberOf"; readonly type: "bool[]"; }]; readonly name: "assignRoles"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "avatar"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }, { readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly name: "consumed"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: ""; readonly type: "bool"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly name: "defaultRoles"; readonly outputs: readonly [{ readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "prevModule"; readonly type: "address"; }, { readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "disableModule"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }]; readonly name: "enableModule"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "to"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }, { readonly internalType: "bytes"; readonly name: "data"; readonly type: "bytes"; }, { readonly internalType: "enum Enum.Operation"; readonly name: "operation"; readonly type: "uint8"; }]; readonly name: "execTransactionFromModule"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: "success"; readonly type: "bool"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "to"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }, { readonly internalType: "bytes"; readonly name: "data"; readonly type: "bytes"; }, { readonly internalType: "enum Enum.Operation"; readonly name: "operation"; readonly type: "uint8"; }]; readonly name: "execTransactionFromModuleReturnData"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: "success"; readonly type: "bool"; }, { readonly internalType: "bytes"; readonly name: "returnData"; readonly type: "bytes"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "to"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }, { readonly internalType: "bytes"; readonly name: "data"; readonly type: "bytes"; }, { readonly internalType: "enum Enum.Operation"; readonly name: "operation"; readonly type: "uint8"; }, { readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "bool"; readonly name: "shouldRevert"; readonly type: "bool"; }]; readonly name: "execTransactionWithRole"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: "success"; readonly type: "bool"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "to"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "value"; readonly type: "uint256"; }, { readonly internalType: "bytes"; readonly name: "data"; readonly type: "bytes"; }, { readonly internalType: "enum Enum.Operation"; readonly name: "operation"; readonly type: "uint8"; }, { readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "bool"; readonly name: "shouldRevert"; readonly type: "bool"; }]; readonly name: "execTransactionWithRoleReturnData"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: "success"; readonly type: "bool"; }, { readonly internalType: "bytes"; readonly name: "returnData"; readonly type: "bytes"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "start"; readonly type: "address"; }, { readonly internalType: "uint256"; readonly name: "pageSize"; readonly type: "uint256"; }]; readonly name: "getModulesPaginated"; readonly outputs: readonly [{ readonly internalType: "address[]"; readonly name: "array"; readonly type: "address[]"; }, { readonly internalType: "address"; readonly name: "next"; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "hash"; readonly type: "bytes32"; }]; readonly name: "invalidate"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "_module"; readonly type: "address"; }]; readonly name: "isModuleEnabled"; readonly outputs: readonly [{ readonly internalType: "bool"; readonly name: ""; readonly type: "bool"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes"; readonly name: "data"; readonly type: "bytes"; }, { readonly internalType: "bytes32"; readonly name: "salt"; readonly type: "bytes32"; }]; readonly name: "moduleTxHash"; readonly outputs: readonly [{ readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "owner"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "renounceOwnership"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }]; readonly name: "revokeFunction"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }]; readonly name: "revokeTarget"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }, { readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }, { readonly components: readonly [{ readonly internalType: "uint8"; readonly name: "parent"; readonly type: "uint8"; }, { readonly internalType: "enum ParameterType"; readonly name: "paramType"; readonly type: "uint8"; }, { readonly internalType: "enum Operator"; readonly name: "operator"; readonly type: "uint8"; }, { readonly internalType: "bytes"; readonly name: "compValue"; readonly type: "bytes"; }]; readonly internalType: "struct ConditionFlat[]"; readonly name: "conditions"; readonly type: "tuple[]"; }, { readonly internalType: "enum ExecutionOptions"; readonly name: "options"; readonly type: "uint8"; }]; readonly name: "scopeFunction"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }, { readonly internalType: "address"; readonly name: "targetAddress"; readonly type: "address"; }]; readonly name: "scopeTarget"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: "key"; readonly type: "bytes32"; }, { readonly internalType: "uint128"; readonly name: "balance"; readonly type: "uint128"; }, { readonly internalType: "uint128"; readonly name: "maxRefill"; readonly type: "uint128"; }, { readonly internalType: "uint128"; readonly name: "refill"; readonly type: "uint128"; }, { readonly internalType: "uint64"; readonly name: "period"; readonly type: "uint64"; }, { readonly internalType: "uint64"; readonly name: "timestamp"; readonly type: "uint64"; }]; readonly name: "setAllowance"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "_avatar"; readonly type: "address"; }]; readonly name: "setAvatar"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "module"; readonly type: "address"; }, { readonly internalType: "bytes32"; readonly name: "roleKey"; readonly type: "bytes32"; }]; readonly name: "setDefaultRole"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "_target"; readonly type: "address"; }]; readonly name: "setTarget"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "to"; readonly type: "address"; }, { readonly internalType: "bytes4"; readonly name: "selector"; readonly type: "bytes4"; }, { readonly internalType: "contract ITransactionUnwrapper"; readonly name: "adapter"; readonly type: "address"; }]; readonly name: "setTransactionUnwrapper"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes"; readonly name: "initParams"; readonly type: "bytes"; }]; readonly name: "setUp"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly []; readonly name: "target"; readonly outputs: readonly [{ readonly internalType: "address"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "address"; readonly name: "newOwner"; readonly type: "address"; }]; readonly name: "transferOwnership"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly internalType: "bytes32"; readonly name: ""; readonly type: "bytes32"; }]; readonly name: "unwrappers"; readonly outputs: readonly [{ readonly internalType: "contract ITransactionUnwrapper"; readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "view"; readonly type: "function"; }]; declare const posterAbi: readonly [{ readonly inputs: readonly [{ readonly internalType: "string"; readonly name: "content"; readonly type: "string"; }, { readonly internalType: "string"; readonly name: "tag"; readonly type: "string"; }]; readonly name: "post"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; //#endregion //#region src/main/keys.d.ts /** * Encodes a human-readable key for addressing roles or allowances to a bytes32 string. * Detects if the input is already encoded. */ declare const encodeKey: (key: string) => `0x${string}`; /** * Decodes a bytes32 encoded string to a human-readable key for addressing roles or allowances. * Detects if the input is already decoded. */ declare const decodeKey: (key: string) => string; //#endregion //#region src/main/postRole.d.ts /** * Posts a role configuration to Zodiac Roles app for storage * @returns The hash under which permissions have been stored */ declare const postRole: ({ targets, annotations, members }: { targets?: Target[]; annotations?: Annotation[]; members?: `0x${string}`[]; }) => Promise; //#endregion //#region src/main/licensing.d.ts type LicenseErrorStatus = "BLOCKED" | "UNLICENSED_FEATURE"; declare class LicenseError extends Error { owner: PrefixedAddress; status: LicenseErrorStatus; constructor(message: string, owner: PrefixedAddress, status: LicenseErrorStatus); } type ChainPrefix = (typeof chains)[ChainId]["prefix"]; type PrefixedAddress = `${ChainPrefix}:0x${Lowercase}`; declare enum License { None = "none", Free = "free", Enterprise = "enterprise", Blocked = "blocked", } declare const fetchLicense: ({ chainId, owner }: { chainId: ChainId; owner: `0x${string}`; }) => Promise; //#endregion export { Allowance, Annotation, ChainId, Clearance, Condition, type ConditionFlat, type ExecutionFlags, ExecutionOptions, Function, type FunctionPermission, type FunctionPermissionCoerced, License, LicenseError, Operator, ParameterType, type Permission, type PermissionCoerced, type PermissionSet, READING_INTEGRITY_DOCS, ReadingIntegrityError, type ReadingIntegrityOptions, type ReadingIntegrityScope, Role, RolesModifier, Status, Target, type TargetPermission, TupleScopings, chains, checkReadingIntegrity, coercePermission, conditionAddress, conditionHash, conditionId, decodeKey, encodeKey, fetchLicense, flattenCondition, forAll, index_d_exports, normalizeCondition, permissionId, postRole, posterAbi, processPermissions, reconstructPermissions, rolesAbi, targetId, targetIntegrity, validatePresets }; //# sourceMappingURL=index-CKXmv_sR.d.mts.map