Documentation
Onchain Theming
Managing Roles

Managing Admin Roles

Under the hood of Flexible (opens in a new tab), there's an access control module (opens in a new tab) within the Theme Registry (opens in a new tab) contract that determines the administrative rights and access levels for each theme under a given platformIndex. By design, the person who creates a platformIndex is given admin rights to update themes automatically. Moreover, extra methods are provided for easy management of multiple administrators in a deployment.

How to Grant Admin Roles

Quickstart

Dash

Visit Etherscan

  • Go to the Etherscan (opens in a new tab) website and enter this contract address into the search bar. This will take you to the contract's page, where you can view its transactions, events, and other details.
0x9a23AE640040e4d34E9e00E500003000017144F4

Connect Wallet

  • To write functions to the contract, you need to connect a Web3-enabled wallet, such as MetaMask, Rainbow, or Coinbase, to Etherscan.
  • On the contract's page, click on the "Connect to Web3" button located on the top right corner. This will prompt you to connect your wallet.
  • Follow the on-screen instructions to connect your wallet.

Write Contract

  • Once your wallet is connected, navigate to the "Write Contract" tab on the contract's Etherscan page. This tab lists all the writable functions available in the contract.
  • Select the function you want to interact with from the list.
  • To access the write function for granting roles, you can click here (opens in a new tab)

Input parameters

  • You'll need to provide the required input parameters.

Inputs for grantRoles()

  1. Input your platform index. If you haven't minted it yet, check out our Getting Started page.

  2. Provide the tuple using the following format:

[["0x0000000000000000000000000000000000000000", "1"]]
  1. Substitute the 0x address with the desired address for assigning the role.

  2. Substitute the # for the role you desire to give the address

Definitions for access roles

NameValue
0 NO ROLE
1 MANAGER = Able make changes to a platform's theme
2 ADMIN = Able make changes to a platforms's theme, and add and revoke admin roles

Dash

If you experience any errors make sure your tuple is formatted correctly.

Confirm the transaction:

  • Once you've filled in the required input parameters and attached any necessary ETH, click the "Write" button next to the function. This will prompt a confirmation window from your Web3 wallet.
  • Keep in mind that you'll have to pay gas fees for the transaction, so make sure you have enough ETH in your wallet to cover these costs.
  • Review the transaction details, and if everything looks correct, confirm the transaction.
  • After confirming the transaction,you can view its details on Etherscan by clicking on the transaction hash.

Remember that writing functions to a smart contract often involves modifying its state, which may have irreversible consequences. Ensure you understand the function you're interacting with and the potential implications of the transaction before you proceed. Feel free to test this on testnet first.