Prerequisites
1
Deploy Your Rollup and Install Minitiad CLI
First, launch your rollup. For local deployments, you can use the Weave CLI to launch a rollup.Once your rollup is running, we need to fetch the rollup’s version. To do so, run the following command:The output will be in the format below. The We then need to install the
version
field is the rollup’s version.minitiad
CLI that matches the rollup’s version.2
Create an operator and VIP contract deployer account
Next, we will create a VIP operator account and a VIP contract deployer account to deploy the VIP scoring contract.Alternatively, if you want to use a Ledger hardware wallet, you can use the
- The VIP operator account will receive the VIP operator rewards
- the VIP contract deployer account will handle the deployment of the VIP scoring contract.
--recover
option to recover it using a BIP39 mnemonic phrase. If you do not have a mnemonic phrase, you can create a new account without this option.--ledger
option to create an account that uses Ledger for signing transactions.3
Deploy the VIP Scoring Contract
In this step, you will deploy the VIP scoring contract that tracks addresses and scores. To do so, follow the steps based on your rollup’s VM.The VIP scoring contract must specify the stage at which the rollup participates in VIP when deployed. To retrieve the current VIP stage, choose the example for your network and run either the curl request or the TypeScript example. Both will query the VIP module store on L1 and return the current VIP stage information.Save the deployed contract address. It will be required for the VIP whitelist proposal.
curl
initia.js
Clone the Compile the Deploy the contract. Make sure to set the
vip-score-evm
repository.VIPScore.sol
contract. If you do not have Foundry installed, follow the Foundry installation instructions.JSON_RPC_URL
, PRIVATE_KEY
, and INIT_STAGE
environment variables before running the script. Set JSON_RPC_URL
to your rollup’s RPC endpoint, PRIVATE_KEY
to the VIP contract deployer key, and INIT_STAGE
to the starting VIP stage number.To get INIT_STAGE
, you can check the current VIP stage by using the curl request or the TypeScript example provided in the previous note.4
Register the Rollup in the Initia Registry
Clone the Initia Registry repository.Then, add your rollup information to the registry repo before submitting a pull request. For detailed instructions, see the Initia Registry page.
5
Whitelist VIP Proposal
Draft a forum post with the whitelist template and include your operator address, scoring policy, and VIP score contract address. The full procedure is described in the Whitelisting Rollup for VIP guide. This proposal is required only for mainnet rollups. For testnet deployments, contact the Initia team directly to have your rollup whitelisted.
6
Operate the VIP Scoring Contract
Each VIP stage follows the same sequence of steps. Use the methods below to update scores and finalize each stage.
This code snippet shows how to use the viem library to interact with the VIP scoring contract:
Action | Method | Description |
---|---|---|
Update scores | updateScores(stage, addrs[], amounts[]) | Update the scores for a list of addresses in the specified stage |
Finalize stage | finalizeStage(uint64 stage) | Finalize the given stage, preventing further changes and prepares the contract for the next stage |
vip-score-evm-tutorial.ts
To get the EVM chain ID, call the
eth_chainId
JSON-RPC method. For example, using curl
: