Permissions

PermissionClient

Methods

  • setPermission

setPermission

Sets the permission for a specific function call.

Each policy is represented as a mapping from an IP account address to a signer address to a recipient
address to a function selector to a permission level. The permission level can be 0 (ABSTAIN), 1 (ALLOW), or
2 (DENY).

By default, all policies are set to 0 (ABSTAIN), which means that the permission is not set. The owner of IP Account by default has all permission.

MethodType
setPermission(request: SetPermissionsRequest) => Promise<SetPermissionsResponse>

Parameters:

  • request: The request object containing necessary data to set permissions.
  • request.ipId: The IP ID that grants the permission for signer.
  • request.signer: The address that can call to on behalf of the ipAccount.
  • request.to: The address that can be called by the signer (currently only modules can be to)
  • request.permission: The new permission level.
  • request.func: [Optional] The function selector string of to that can be called by the signer on behalf of the ipAccount. Be default, it allows all functions.
  • request.txOptions: [Optional] The transaction options.