Skip to main content
The One-Time Actions docs are under active development and will be subject to changes.
A budget has two types of roles that can be granted: ADMIN and MANAGER. These roles can be accessed through the Roles enum:
  • The MANAGER role allows an address to manage funds within the budget and deploy boosts using available funds.
  • The ADMIN role allows an address to grant and revoke roles on the budget as well as manage available funds.
Accounts authorized with the MANAGER role are allowed to disburse available funds from the budget, so make sure you trust the address before granting permissions.

API

grantRoles

Grants access control roles to an address.
You can grant both ADMIN and MANAGER roles at once:

Parameters

string
required
The address to grant the roles to.
bigint
required
The roles to grant, accessed via the Roles enum.
Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying writeContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<void>

grantManyRoles

Grants access control roles to multiple addresses. The roles array must match the addresses array in length and order.

Parameters

string[]
required
Array of addresses to grant roles to.
bigint[]
required
Array of roles to grant, accessed via the Roles enum.
Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying writeContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<void>

revokeRoles

Revokes access control roles from an address.
You can revoke both ADMIN and MANAGER roles at once:

Parameters

string
required
The address to revoke roles from.
bigint
required
The roles to revoke, accessed via the Roles enum.
Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying writeContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<void>

revokeManyRoles

Revokes access control roles from multiple addresses. The roles array must match the addresses array in length and order.

Parameters

string[]
required
Array of addresses to revoke roles from.
bigint[]
required
Array of roles to revoke, accessed via the Roles enum.
Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying writeContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<void>

setAuthorized

Grants or revokes the MANAGER role for multiple addresses. The authorized values array must match the addresses array in length and order.

Parameters

string[]
required
Array of addresses to set authorization for.
boolean[]
required
Array of boolean values where true grants and false revokes the MANAGER role.
Omit<wagmi.WriteContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying writeContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<void>

isAuthorized

Checks if an address is authorized to manage the budget. Returns true if the address is authorized, otherwise false.

Parameters

string
required
The address to check authorization for.
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<boolean>
Returns true if the address is authorized, otherwise false.

hasAllRoles

Checks if an address has all the roles specified. Returns true if the address has all the roles, otherwise false.

Parameters

string
required
The address to check roles for.
bigint
required
The roles to check for, accessed via the Roles enum.
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<boolean>
Returns true if the address has all the specified roles, otherwise false.

hasAnyRole

Checks if an address has at least one of the roles specified. Returns true if the address has at least one of the roles, otherwise false.

Parameters

string
required
The address to check roles for.
bigint
required
The roles to check for, accessed via the Roles enum.
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<boolean>
Returns true if the address has at least one of the specified roles, otherwise false.

rolesOf

Returns the an array of roles for a given address. Returns an empty array if the address has no roles. 1n = Roles.MANAGER, 2n = Roles.ADMIN

Parameters

string
required
The address to check roles for.
Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<bigint[]>
Returns an array of roles for the address.

owner

Returns the budget owner’s address.

Parameters

Omit<wagmi.ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>
Optional parameters to pass to the underlying readContract method. Checkout wagmi’s documentation for more information. address, args, functionName, abi are handled for you under the hood.

Returns

Promise<string>
The budget owners address.