Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Skip to Content
ensforgeHCA

hcaAdmin.grantUpgradeSetRoles

Grants root roles on the HCA upgrade set (role admins only). Parameters, return value, errors and examples for hcaAdmin.grantUpgradeSetRoles in @ensforge/hca.

Writeexperimental
Since v1.0.0View source

Experimental

@ensforge/hca is experimental: its API can change in a minor release.

Grants root roles on the HCA upgrade set (role admins only). Resolves once the transaction is submitted.

When to use

Use to let another account approve HCA upgrade targets.

Signature

function grantUpgradeSetRoles(
  client: Like,
  options: grantUpgradeSetRoles.Options & Write.Options,
): Promise<grantUpgradeSetRoles.ReturnType>

Call it as ens.hcaAdmin.grantUpgradeSetRoles(options) on a client, or Actions.hcaAdmin.grantUpgradeSetRoles(client, options).

Parameters

OptionTypeDefaultDescription
grantee (required)stringAccount to grant.
roles (required)bigintRole bitmap.

Also takes the write options.

Returns

Resolves to Write.Result. Submitted transaction hashes and the plan that produced them.

FieldTypeDescription
hashHexHash of the last transaction.
hashesreadonly Hex[]Every submitted transaction, in order.
idstringEIP-5792 bundle id when the calls were sent as one batch.
planPlanThe plan the write executed: its steps, in order, as they were submitted.

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_ADDRESSan invalid address.
HcaErrorHCA_UNAVAILABLEon chains without an HCA deployment.

It can also fail with the errors every write can (Errors.WriteError: the common errors plus InsufficientFundsError, TransactionError, UnsupportedError, UserRejectedError, WalletError).

See How errors work.

Examples

Granting upgrade-set roles
const { hash } = await ens.hcaAdmin.grantUpgradeSetRoles({ grantee, roles })

Plan methods

Each method takes the same options as hcaAdmin.grantUpgradeSetRoles and sends nothing. See Preview before sending.

MethodDescription
hcaAdmin.grantUpgradeSetRoles.prepare(options)Builds the plan without sending anything.
hcaAdmin.grantUpgradeSetRoles.simulate(options)Simulates the plan with eth_call, reporting each step.
hcaAdmin.grantUpgradeSetRoles.estimateGas(options)Estimates the gas and ETH the plan needs.

Wait for the receipt with grantUpgradeSetRolesSync

Grants root roles on the HCA upgrade set (role admins only). Resolves once the receipt is in.

Use when the next step depends on the change being on-chain.

hcaAdmin.grantUpgradeSetRolesSync takes the same options plus confirmations and timeout.

Resolves to Write.SyncResult. Receipts plus the submitted hashes and plan.

Granting upgrade-set roles and waiting
const { receipt } = await ens.hcaAdmin.grantUpgradeSetRolesSync({ grantee, roles })

Was this page helpful?