SDK Reference
Permissions
Permission allows you to manage permissions for IP Accounts within Story.
Permission
Methods
- set_permission
- create_set_permission_signature
- set_all_permissions
set_permission
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.
Method |
---|
set_permission |
Parameters:
ip_id
: The IP ID that grants the permission forsigner
.signer
: The address that can callto
on behalf of theipAccount
.to
: The address that can be called by thesigner
(currently only modules can beto
)permission
: The new permission level.func
: [Optional] The function selector string ofto
that can be called by thesigner
on behalf of theipAccount
. By default, it allows all functions.tx_options
: [Optional] Transaction options dictionary.
create_set_permission_signature
Specific permission overrides wildcard permission with signature.
Method |
---|
create_set_permission_signature |
Parameters:
ip_id
: The IP ID that grants the permission forsigner
.signer
: The address that can callto
on behalf of theipAccount
.to
: The address that can be called by thesigner
(currently only modules can beto
)permission
: The new permission level.func
: [Optional] The function selector string ofto
that can be called by thesigner
on behalf of theipAccount
. By default, it allows all functions.deadline
: [Optional] The deadline for the signature in milliseconds, default is 1000ms.tx_options
: [Optional] Transaction options dictionary.
set_all_permissions
Sets permission to a signer for all functions across all modules.
Method |
---|
set_all_permissions |
Parameters:
ip_id
: The IP ID that grants the permission forsigner
.signer
: The address of the signer receiving the permissions.permission
: The new permission.tx_options
: [Optional] Transaction options dictionary.