Class SimpleDenyList

A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list

SimpleDenyList

Hierarchy (view full)

Constructors

Properties

base: `0x${string}` = ...

A static property representing the address of the base implementation on chain, used when cloning base contracts.

registryType: RegistryType = RegistryType.ALLOW_LIST

The target's registry type.

abi: readonly [{
    type: "constructor";
    inputs: readonly [];
    stateMutability: "nonpayable";
}, {
    type: "error";
    inputs: readonly [];
    name: "AlreadyInitialized";
}, {
    type: "error";
    inputs: readonly [];
    name: "CloneAlreadyInitialized";
}, {
    type: "error";
    inputs: readonly [];
    name: "InitializerNotImplemented";
}, {
    type: "error";
    inputs: readonly [];
    name: "InvalidInitialization";
}, {
    type: "error";
    inputs: readonly [];
    name: "InvalidInitializationData";
}, {
    type: "error";
    inputs: readonly [];
    name: "LengthMismatch";
}, {
    type: "error";
    inputs: readonly [];
    name: "NewOwnerIsZeroAddress";
}, {
    type: "error";
    inputs: readonly [];
    name: "NoHandoverRequest";
}, {
    type: "error";
    inputs: readonly [];
    name: "NotInitializing";
}, {
    type: "error";
    inputs: readonly [];
    name: "Unauthorized";
}, {
    type: "event";
    anonymous: false;
    inputs: readonly [{
        name: "version";
        internalType: "uint64";
        type: "uint64";
        indexed: false;
    }];
    name: "Initialized";
}, {
    type: "event";
    anonymous: false;
    inputs: readonly [{
        name: "pendingOwner";
        internalType: "address";
        type: "address";
        indexed: true;
    }];
    name: "OwnershipHandoverCanceled";
}, {
    type: "event";
    anonymous: false;
    inputs: readonly [{
        name: "pendingOwner";
        internalType: "address";
        type: "address";
        indexed: true;
    }];
    name: "OwnershipHandoverRequested";
}, {
    type: "event";
    anonymous: false;
    inputs: readonly [{
        name: "oldOwner";
        internalType: "address";
        type: "address";
        indexed: true;
    }, {
        name: "newOwner";
        internalType: "address";
        type: "address";
        indexed: true;
    }];
    name: "OwnershipTransferred";
}, {
    type: "function";
    inputs: readonly [];
    name: "cancelOwnershipHandover";
    outputs: readonly [];
    stateMutability: "payable";
}, {
    type: "function";
    inputs: readonly [{
        name: "pendingOwner";
        internalType: "address";
        type: "address";
    }];
    name: "completeOwnershipHandover";
    outputs: readonly [];
    stateMutability: "payable";
}, {
    type: "function";
    inputs: readonly [];
    name: "getComponentInterface";
    outputs: readonly [{
        name: "";
        internalType: "bytes4";
        type: "bytes4";
    }];
    stateMutability: "pure";
}, {
    type: "function";
    inputs: readonly [{
        name: "data_";
        internalType: "bytes";
        type: "bytes";
    }];
    name: "initialize";
    outputs: readonly [];
    stateMutability: "nonpayable";
}, {
    type: "function";
    inputs: readonly [{
        name: "user_";
        internalType: "address";
        type: "address";
    }, {
        name: "";
        internalType: "bytes";
        type: "bytes";
    }];
    name: "isAllowed";
    outputs: readonly [{
        name: "";
        internalType: "bool";
        type: "bool";
    }];
    stateMutability: "view";
}, {
    type: "function";
    inputs: readonly [];
    name: "owner";
    outputs: readonly [{
        name: "result";
        internalType: "address";
        type: "address";
    }];
    stateMutability: "view";
}, {
    type: "function";
    inputs: readonly [{
        name: "pendingOwner";
        internalType: "address";
        type: "address";
    }];
    name: "ownershipHandoverExpiresAt";
    outputs: readonly [{
        name: "result";
        internalType: "uint256";
        type: "uint256";
    }];
    stateMutability: "view";
}, {
    type: "function";
    inputs: readonly [];
    name: "renounceOwnership";
    outputs: readonly [];
    stateMutability: "payable";
}, {
    type: "function";
    inputs: readonly [];
    name: "requestOwnershipHandover";
    outputs: readonly [];
    stateMutability: "payable";
}, {
    type: "function";
    inputs: readonly [{
        name: "users_";
        internalType: "address[]";
        type: "address[]";
    }, {
        name: "denied_";
        internalType: "bool[]";
        type: "bool[]";
    }];
    name: "setDenied";
    outputs: readonly [];
    stateMutability: "nonpayable";
}, {
    type: "function";
    inputs: readonly [{
        name: "interfaceId";
        internalType: "bytes4";
        type: "bytes4";
    }];
    name: "supportsInterface";
    outputs: readonly [{
        name: "";
        internalType: "bool";
        type: "bool";
    }];
    stateMutability: "view";
}, {
    type: "function";
    inputs: readonly [{
        name: "newOwner";
        internalType: "address";
        type: "address";
    }];
    name: "transferOwnership";
    outputs: readonly [];
    stateMutability: "payable";
}] = simpleDenyListAbi
_isBase: boolean = true

A property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.

_payload: undefined | SimpleDenyListPayload

The deployable payload used either for contract construction or initialization

_config: Config
_address: undefined | `0x${string}`

The internally managed address for this contract

_account?: Account

If it exists, Viem Local Account, if in a Node environment

Accessors

  • get address(): undefined | `0x${string}`
  • A getter returning this contract's deployed address, if it exists.

    Returns undefined | `0x${string}`

Methods

  • Check if a user is authorized (i.e. not denied)

    Parameters

    • address: `0x${string}`

      The address of the user

    • Optionalparams: Partial<Omit<ReadContractParameters<readonly [{
          type: "constructor";
          inputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "error";
          inputs: readonly [];
          name: "AlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "CloneAlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InitializerNotImplemented";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitialization";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitializationData";
      }, {
          type: "error";
          inputs: readonly [];
          name: "LengthMismatch";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NewOwnerIsZeroAddress";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NoHandoverRequest";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NotInitializing";
      }, {
          type: "error";
          inputs: readonly [];
          name: "Unauthorized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "version";
              internalType: "uint64";
              type: "uint64";
              indexed: false;
          }];
          name: "Initialized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverCanceled";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverRequested";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "oldOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }, {
              name: "newOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipTransferred";
      }, {
          type: "function";
          inputs: readonly [];
          name: "cancelOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "completeOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "getComponentInterface";
          outputs: readonly [{
              name: "";
              internalType: "bytes4";
              type: "bytes4";
          }];
          stateMutability: "pure";
      }, {
          type: "function";
          inputs: readonly [{
              name: "data_";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "initialize";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "user_";
              internalType: "address";
              type: "address";
          }, {
              name: "";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "isAllowed";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "owner";
          outputs: readonly [{
              name: "result";
              internalType: "address";
              type: "address";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "ownershipHandoverExpiresAt";
          outputs: readonly [{
              name: "result";
              internalType: "uint256";
              type: "uint256";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "renounceOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "requestOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "users_";
              internalType: "address[]";
              type: "address[]";
          }, {
              name: "denied_";
              internalType: "bool[]";
              type: "bool[]";
          }];
          name: "setDenied";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "interfaceId";
              internalType: "bytes4";
              type: "bytes4";
          }];
          name: "supportsInterface";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "newOwner";
              internalType: "address";
              type: "address";
          }];
          name: "transferOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }], "isAllowed">,
          | "address"
          | "args"
          | "abi"
          | "functionName">>

    Returns Promise<boolean>

    • True if the user is authorized
  • Set the denied status of a user. The length of the users_ and denied_ arrays must be the same. This function can only be called by the owner

    Parameters

    • addresses: `0x${string}`[]

      The list of users to update

    • allowed: boolean[]

      The denied status of each user

    • Optionalparams: Partial<Omit<WriteContractParameters<readonly [{
          type: "constructor";
          inputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "error";
          inputs: readonly [];
          name: "AlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "CloneAlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InitializerNotImplemented";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitialization";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitializationData";
      }, {
          type: "error";
          inputs: readonly [];
          name: "LengthMismatch";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NewOwnerIsZeroAddress";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NoHandoverRequest";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NotInitializing";
      }, {
          type: "error";
          inputs: readonly [];
          name: "Unauthorized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "version";
              internalType: "uint64";
              type: "uint64";
              indexed: false;
          }];
          name: "Initialized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverCanceled";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverRequested";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "oldOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }, {
              name: "newOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipTransferred";
      }, {
          type: "function";
          inputs: readonly [];
          name: "cancelOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "completeOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "getComponentInterface";
          outputs: readonly [{
              name: "";
              internalType: "bytes4";
              type: "bytes4";
          }];
          stateMutability: "pure";
      }, {
          type: "function";
          inputs: readonly [{
              name: "data_";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "initialize";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "user_";
              internalType: "address";
              type: "address";
          }, {
              name: "";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "isAllowed";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "owner";
          outputs: readonly [{
              name: "result";
              internalType: "address";
              type: "address";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "ownershipHandoverExpiresAt";
          outputs: readonly [{
              name: "result";
              internalType: "uint256";
              type: "uint256";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "renounceOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "requestOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "users_";
              internalType: "address[]";
              type: "address[]";
          }, {
              name: "denied_";
              internalType: "bool[]";
              type: "bool[]";
          }];
          name: "setDenied";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "interfaceId";
              internalType: "bytes4";
              type: "bytes4";
          }];
          name: "supportsInterface";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "newOwner";
              internalType: "address";
              type: "address";
          }];
          name: "transferOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }], "setDenied">,
          | "address"
          | "args"
          | "abi"
          | "functionName">>

    Returns Promise<void>

  • Set the denied status of a user. The length of the users_ and denied_ arrays must be the same. This function can only be called by the owner

    Parameters

    • addresses: `0x${string}`[]

      The list of users to update

    • allowed: boolean[]

      The denied status of each user

    • Optionalparams: Partial<Omit<WriteContractParameters<readonly [{
          type: "constructor";
          inputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "error";
          inputs: readonly [];
          name: "AlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "CloneAlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InitializerNotImplemented";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitialization";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitializationData";
      }, {
          type: "error";
          inputs: readonly [];
          name: "LengthMismatch";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NewOwnerIsZeroAddress";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NoHandoverRequest";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NotInitializing";
      }, {
          type: "error";
          inputs: readonly [];
          name: "Unauthorized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "version";
              internalType: "uint64";
              type: "uint64";
              indexed: false;
          }];
          name: "Initialized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverCanceled";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverRequested";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "oldOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }, {
              name: "newOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipTransferred";
      }, {
          type: "function";
          inputs: readonly [];
          name: "cancelOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "completeOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "getComponentInterface";
          outputs: readonly [{
              name: "";
              internalType: "bytes4";
              type: "bytes4";
          }];
          stateMutability: "pure";
      }, {
          type: "function";
          inputs: readonly [{
              name: "data_";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "initialize";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "user_";
              internalType: "address";
              type: "address";
          }, {
              name: "";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "isAllowed";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "owner";
          outputs: readonly [{
              name: "result";
              internalType: "address";
              type: "address";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "ownershipHandoverExpiresAt";
          outputs: readonly [{
              name: "result";
              internalType: "uint256";
              type: "uint256";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "renounceOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "requestOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "users_";
              internalType: "address[]";
              type: "address[]";
          }, {
              name: "denied_";
              internalType: "bool[]";
              type: "bool[]";
          }];
          name: "setDenied";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "interfaceId";
              internalType: "bytes4";
              type: "bytes4";
          }];
          name: "supportsInterface";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "newOwner";
              internalType: "address";
              type: "address";
          }];
          name: "transferOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }], "setDenied">,
          | "address"
          | "args"
          | "abi"
          | "functionName">>

    Returns Promise<{
        hash: `0x${string}`;
        result: void;
    }>

  • Check if the contract supports the given interface

    Parameters

    • interfaceId: `0x${string}`

      The interface identifier

    • Optionalparams: Partial<Omit<ReadContractParameters<readonly [{
          type: "error";
          inputs: readonly [];
          name: "CloneAlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InitializerNotImplemented";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitialization";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitializationData";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NotInitializing";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "version";
              internalType: "uint64";
              type: "uint64";
              indexed: false;
          }];
          name: "Initialized";
      }, {
          type: "function";
          inputs: readonly [];
          name: "getComponentInterface";
          outputs: readonly [{
              name: "";
              internalType: "bytes4";
              type: "bytes4";
          }];
          stateMutability: "pure";
      }, {
          type: "function";
          inputs: readonly [{
              name: "";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "initialize";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "interfaceId";
              internalType: "bytes4";
              type: "bytes4";
          }];
          name: "supportsInterface";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }], "supportsInterface">,
          | "address"
          | "args"
          | "abi"
          | "functionName">>

    Returns Promise<boolean>

    • True if the contract supports the interface
  • Return a cloneable's unique identifier for downstream consumers to differentiate various targets All implementations must override this function

    Parameters

    • Optionalparams: Partial<Omit<ReadContractParameters<readonly [{
          type: "error";
          inputs: readonly [];
          name: "CloneAlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InitializerNotImplemented";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitialization";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitializationData";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NotInitializing";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "version";
              internalType: "uint64";
              type: "uint64";
              indexed: false;
          }];
          name: "Initialized";
      }, {
          type: "function";
          inputs: readonly [];
          name: "getComponentInterface";
          outputs: readonly [{
              name: "";
              internalType: "bytes4";
              type: "bytes4";
          }];
          stateMutability: "pure";
      }, {
          type: "function";
          inputs: readonly [{
              name: "";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "initialize";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "interfaceId";
              internalType: "bytes4";
              type: "bytes4";
          }];
          name: "supportsInterface";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }], "getComponentInterface">,
          | "address"
          | "args"
          | "abi"
          | "functionName">>

    Returns Promise<`0x${string}`>

  • A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]. Accepts eventName and eventNames as optional parameters to narrow the returned log types.

    Type Parameters

    • event extends
          | "Initialized"
          | "OwnershipHandoverCanceled"
          | "OwnershipHandoverRequested"
          | "OwnershipTransferred"
    • const abiEvent extends
          | {
              name: event;
          } & {
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "version";
                  internalType: "uint64";
                  type: "uint64";
                  indexed: false;
              }];
              name: "Initialized";
          }
          | {
              name: event;
          } & {
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "pendingOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipHandoverCanceled";
          }
          | {
              name: event;
          } & {
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "pendingOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipHandoverRequested";
          }
          | {
              name: event;
          } & {
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "oldOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }, {
                  name: "newOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipTransferred";
          } =
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "version";
                  internalType: "uint64";
                  type: "uint64";
                  indexed: false;
              }];
              name: "Initialized";
          }, {
              name: event;
          }>
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "pendingOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipHandoverCanceled";
          }, {
              name: event;
          }>
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "pendingOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipHandoverRequested";
          }, {
              name: event;
          }>
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "oldOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }, {
                  name: "newOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipTransferred";
          }, {
              name: event;
          }>

    Parameters

    • Optionalparams: Omit<GetLogsParams<readonly [{
          type: "constructor";
          inputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "error";
          inputs: readonly [];
          name: "AlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "CloneAlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InitializerNotImplemented";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitialization";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitializationData";
      }, {
          type: "error";
          inputs: readonly [];
          name: "LengthMismatch";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NewOwnerIsZeroAddress";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NoHandoverRequest";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NotInitializing";
      }, {
          type: "error";
          inputs: readonly [];
          name: "Unauthorized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "version";
              internalType: "uint64";
              type: "uint64";
              indexed: false;
          }];
          name: "Initialized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverCanceled";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipHandoverRequested";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: "oldOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }, {
              name: "newOwner";
              internalType: "address";
              type: "address";
              indexed: true;
          }];
          name: "OwnershipTransferred";
      }, {
          type: "function";
          inputs: readonly [];
          name: "cancelOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "completeOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "getComponentInterface";
          outputs: readonly [{
              name: "";
              internalType: "bytes4";
              type: "bytes4";
          }];
          stateMutability: "pure";
      }, {
          type: "function";
          inputs: readonly [{
              name: "data_";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "initialize";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "user_";
              internalType: "address";
              type: "address";
          }, {
              name: "";
              internalType: "bytes";
              type: "bytes";
          }];
          name: "isAllowed";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "owner";
          outputs: readonly [{
              name: "result";
              internalType: "address";
              type: "address";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "pendingOwner";
              internalType: "address";
              type: "address";
          }];
          name: "ownershipHandoverExpiresAt";
          outputs: readonly [{
              name: "result";
              internalType: "uint256";
              type: "uint256";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "renounceOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "requestOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "users_";
              internalType: "address[]";
              type: "address[]";
          }, {
              name: "denied_";
              internalType: "bool[]";
              type: "bool[]";
          }];
          name: "setDenied";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: "interfaceId";
              internalType: "bytes4";
              type: "bytes4";
          }];
          name: "supportsInterface";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: "newOwner";
              internalType: "address";
              type: "address";
          }];
          name: "transferOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }], event, abiEvent, abiEvent[]>, "event" | "events"> & {
          eventName?: event;
          eventNames?: event[];
      }

    Returns Promise<GetLogsReturnType<abiEvent, abiEvent[]>>

    const logs = contract.getLogs({ eventName: 'EventName' })
    const logs = contract.getLogs({ eventNames: ['EventName'] })

    @public
    @async
    @template {ContractEvent} event
    @template {ExtractAbiEvent<
    ContractAbi,
    event
    >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]
    @param {?Omit<
    GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,
    'event' | 'events'
    > & {
    eventName?: event;
    eventNames?: event[];
    }} [params]
    @returns {Promise<GetLogsReturnType<abiEvent, abiEvent
  • A typed wrapper for wagmi.watchContractEvent

    Type Parameters

    • event extends
          | "Initialized"
          | "OwnershipHandoverCanceled"
          | "OwnershipHandoverRequested"
          | "OwnershipTransferred"

    Parameters

    • cb: ((log: Log<bigint, number, false,
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "version";
                  internalType: "uint64";
                  type: "uint64";
                  indexed: false;
              }];
              name: "Initialized";
          }, {
              name: event;
          }>
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "pendingOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipHandoverCanceled";
          }, {
              name: event;
          }>
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "pendingOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipHandoverRequested";
          }, {
              name: event;
          }>
          | Extract<{
              type: "event";
              anonymous: false;
              inputs: readonly [{
                  name: "oldOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }, {
                  name: "newOwner";
                  internalType: "address";
                  type: "address";
                  indexed: true;
              }];
              name: "OwnershipTransferred";
          }, {
              name: event;
          }>, true>) => unknown)
        • (log): unknown
        • Parameters

          • log: Log<bigint, number, false,
                | Extract<{
                    type: "event";
                    anonymous: false;
                    inputs: readonly [{
                        name: "version";
                        internalType: "uint64";
                        type: "uint64";
                        indexed: false;
                    }];
                    name: "Initialized";
                }, {
                    name: event;
                }>
                | Extract<{
                    type: "event";
                    anonymous: false;
                    inputs: readonly [{
                        name: "pendingOwner";
                        internalType: "address";
                        type: "address";
                        indexed: true;
                    }];
                    name: "OwnershipHandoverCanceled";
                }, {
                    name: event;
                }>
                | Extract<{
                    type: "event";
                    anonymous: false;
                    inputs: readonly [{
                        name: "pendingOwner";
                        internalType: "address";
                        type: "address";
                        indexed: true;
                    }];
                    name: "OwnershipHandoverRequested";
                }, {
                    name: event;
                }>
                | Extract<{
                    type: "event";
                    anonymous: false;
                    inputs: readonly [{
                        name: "oldOwner";
                        internalType: "address";
                        type: "address";
                        indexed: true;
                    }, {
                        name: "newOwner";
                        internalType: "address";
                        type: "address";
                        indexed: true;
                    }];
                    name: "OwnershipTransferred";
                }, {
                    name: event;
                }>, true>

          Returns unknown

    • Optionalparams: Partial<Omit<UnionCompute<WatchContractEventParameters<readonly [{
          type: "constructor";
          inputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "error";
          inputs: readonly [];
          name: "AlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "CloneAlreadyInitialized";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InitializerNotImplemented";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitialization";
      }, {
          type: "error";
          inputs: readonly [];
          name: "InvalidInitializationData";
      }, {
          type: "error";
          inputs: readonly [];
          name: "LengthMismatch";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NewOwnerIsZeroAddress";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NoHandoverRequest";
      }, {
          type: "error";
          inputs: readonly [];
          name: "NotInitializing";
      }, {
          type: "error";
          inputs: readonly [];
          name: "Unauthorized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
              indexed: ...;
          }];
          name: "Initialized";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
              indexed: ...;
          }];
          name: "OwnershipHandoverCanceled";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
              indexed: ...;
          }];
          name: "OwnershipHandoverRequested";
      }, {
          type: "event";
          anonymous: false;
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
              indexed: ...;
          }, {
              name: ...;
              internalType: ...;
              type: ...;
              indexed: ...;
          }];
          name: "OwnershipTransferred";
      }, {
          type: "function";
          inputs: readonly [];
          name: "cancelOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "completeOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "getComponentInterface";
          outputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          stateMutability: "pure";
      }, {
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "initialize";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }, {
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "isAllowed";
          outputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "owner";
          outputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "ownershipHandoverExpiresAt";
          outputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [];
          name: "renounceOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [];
          name: "requestOwnershipHandover";
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }, {
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "setDenied";
          outputs: readonly [];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "supportsInterface";
          outputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          stateMutability: "view";
      }, {
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "transferOwnership";
          outputs: readonly [];
          stateMutability: "payable";
      }], event, undefined, WebSocketTransport> & ChainIdParameter<Config, number> & SyncConnectedChainParameter>, "address" | "abi">> & {
          eventName?: event;
      }

    Returns Promise<(() => void)>

  • Protected

    Internal function to attach the connected account to write methods to avoid manually passing in an account each call.

    Parameters

    • Optionalaccount: Account

    Returns {
        account: Account;
    } | {
        account: undefined;
    }