The solidity contracts to coordinate the nodes and tasks.
For the current off-chain task dispatch architecture and the active Relay integration contract set, see ./docs/contract-roles-and-status.md.
The contracts are developed using Hardhat 3.
Install the dependencies before compilation:
$ npm installRun the Hardhat compile command using npm:
$ npm run compileStore the rollup deployer private key in the Hardhat keystore:
$ npx hardhat keystore set L2_ROLLUP_DEPLOYER_PRIVATE_KEYGenerate a new wallet when a fresh deployer account is required:
$ npx tsx scripts/generate-wallet.tsBase mainnet uses https://mainnet.base.org by default. Base Sepolia uses https://sepolia.base.org by default. Set BASE_RPC_URL or BASE_SEPOLIA_RPC_URL in the environment to override either endpoint.
Deploy the L1 ERC-20 Crynux token with Hardhat Ignition:
$ npm run deploy:l1:erc20-crynux-token -- --network <network>Create a deployment parameter file for the emission contract:
{
"DeployEmissionErc20": {
"tokenAddress": "0x0000000000000000000000000000000000000001",
"mode": 0,
"daoTreasuryAddress": "0x0000000000000000000000000000000000000002",
"relayWalletColdAddress": "0x0000000000000000000000000000000000000003",
"startTimestamp": 1735689600,
"initialEmissionIndex": 0,
"initCostCNX": 0
}
}Parameter requirements:
tokenAddress: deployedCrynuxTokenaddress.mode: emission mode enum value.0is Primary and1is Mirror.daoTreasuryAddress: immutable DAO treasury receiver address.relayWalletColdAddress: immutable relay cold wallet receiver address.startTimestamp: emission schedule start timestamp in seconds.initialEmissionIndex: number of already completed emission periods when the contract is deployed.initCostCNX: startup cost in whole CNX units, deducted from the first DAO emission in Primary mode. Mirror mode requires this to be0.
Deploy the emission contract with Hardhat Ignition:
$ npm run deploy:emission:erc20 -- --network <network> --parameters ./cache/deploy-emission-erc20-params.jsonCreate a deployment parameter file for the L2 node contracts:
{
"DeployNodeContracts": {
"relayOperatorAddress": "0x000000000000000000000000000000000000dEaD",
"creditsAdminAddress": "0x000000000000000000000000000000000000bEEF",
"parameterWriterAddress": "0x000000000000000000000000000000000000c0De",
"slashReceiverAddress": "0x000000000000000000000000000000000000FEE1"
}
}Parameter requirements:
relayOperatorAddress: Relay runtime signer forNodeStaking.unstakeandNodeStaking.slashStaking.creditsAdminAddress: bootstrap credit issuance signer forCredits.createCredits.parameterWriterAddress: initial writer forParameterControllergoverned operational parameter updates.slashReceiverAddress: immutable slash receiver for bothNodeStakingandDelegatedStaking. This address is set in constructors and cannot be changed after deployment.
Deploy the L2 node contracts with Hardhat Ignition:
$ npm run deploy:l2:node-contracts -- --network <network> --parameters ./cache/deploy-l2-node-contracts-params.json