Skip to main content

Check if Syndicate is activated

The Syndicate contract for a given LSD network might not be activated sometimes due to a delay when a proposer joins. Below is a script for a LSD user to check if the Syndicate for the LSD network their validator is a part of needs to be activated, and the user can accordingly activate it.

Copy the script to check if Syndicate is not activated

You can find the script as a part of the stakehouse-sdk package.

  1. Install stakehouse-sdk in your working directory by running npm i @blockswaplab/stakehouse-sdk in your terminal.
  2. Go to the node modules of your directory and find @blockswaplab folder.
  3. Go to stakehouse-sdk, then scripts and copy nonActivatedSyndicate.js to your working directory.

Install the required dependencies and run the script

Install the packages required for running the script by running the following in your terminal

npm i [email protected] graphql-request axios prompt-sync dotenv

Now you can run the following command to run the script

node nonActivatedSyndicate.js

The script will prompt you to enter your BLS key. Make sure your validator has minted derivatives before running this, or else it will throw an error

Once you enter the BLS key, if the Syndicate requires activation, it will show an output in the following format

[
{
'LSD Index': '26',
'LSD Network Ticker': 'BLOCK',
'Liquid Staking Manager': '0xf8bfe8faecdf6327609a6d3c4f1a5177450dd447',
'DAO': '0x2469fd78c379ac4629037e1b29c2e05edd9fca21',
'Syndicate': '0x3d18b44e0d4f5f9066750c366287b0a1c9c75bda',
'Non-activated Proposers': '1'
}
]

If it does not show any output then the Syndicate is already active.

Activating the Syndicate

If you wish to activate a Syndicate, follow the steps below:

  1. Create a new script file, and import the following packages
const { ethers } = require("ethers");
const { StakehouseSDK } = require("@blockswaplab/stakehouse-sdk");
  1. Create a signer and provider instance. Infura is used in the following example. You can find the list of other providers supported by ethers here.
const provider = new ethers.providers.InfuraProvider("mainnet", {
projectId: <YOUR_INFURA_PROJECT_ID>,
projectSecret: <YOUR_INFURA_PROJECT_SECRET>
});

const signer = new ethers.Wallet(<YOUR_PRIVATE_KEY>, provider);
  1. Create the contract instance and activate proposer
const contract = (await sdk.contractInstance).syndicate(<SYNDICATE_ADDRESS>)
const tx = await contract.activateProposers();
console.log(tx)