Migration from v2 to v4
Deploy the RewardPool
сontract
RewardPool
сontractDeploy the RewardPool
contract, which is responsible for managing MOR token emission logic. Inside RewardPool
, set up an array of emission curves.
[
{
payoutStart: 1707393600,
decreaseInterval: 86400,
initialReward: wei(3456),
rewardDecrease: wei(0.59255872824),
isPublic: true,
},
{
payoutStart: 1707393600,
decreaseInterval: 86400,
initialReward: wei(3456),
rewardDecrease: wei(0.59255872824),
isPublic: false,
},
{
payoutStart: 1707393600,
decreaseInterval: 86400,
initialReward: wei(3456),
rewardDecrease: wei(0.59255872824),
isPublic: false,
},
{
payoutStart: 1707393600,
decreaseInterval: 86400,
initialReward: wei(3456),
rewardDecrease: wei(0.59255872824),
isPublic: false,
},
{
payoutStart: 1707393600,
decreaseInterval: 86400,
initialReward: wei(576),
rewardDecrease: wei(0.09875978804),
isPublic: false,
},
]
The BuildersV4
contract will use the emission curve with index 3
, which should represent the reward schedule for Builders.
Upgrade the BuildersTreasury to BuildersTreasuryV2
Use the UUPS upgrade pattern to update the BuildersTreasury
proxy contract to the new BuildersTreasuryV2
implementation with upgradeTo()
function. Once upgraded, perform the necessary configuration steps below.
Upgrade the BuildersV2 to BuildersV4
Use the UUPS upgrade pattern to update the BuildersV2
proxy contract to the new BuildersV4
implementation with upgradeTo()
function. Once upgraded, perform the necessary configuration steps below.
Set the RewardPool
address
RewardPool
addressCall setRewardPool()
on the BuildersV4
contract to assign the newly deployed RewardPool
contract.
Set the networkShare
networkShare
Call setNetworkShare()
to configure the percentage of MOR rewards that should be distributed to Subnets. This value is specified in precision units, where 1 * 1025 = 100%, 0.2 * 1025 = 20%...
Set the networkShareOwner
(optional)
networkShareOwner
(optional)Call setNetworkShareOwner
to assign the address that is allowed to update the networkShare
value in the future. This allows dynamic tuning of rewards per network if needed.
Configure Subnet creation fee (Optional)
If you want to require a fee for creating subnets:
First, configure the
FeeConfig
contract by adding a new fee entry for the operation keybuildersV4.fee.subnet.create
.Then call
setSubnetCreationFeeAmount
on theBuildersV4
contract with the fee amount in MOR tokens.
Fund the Treasury
Transfer the required amount of MOR tokens to the BuildersTreasuryV2
contract. This contract will be responsible for sending rewards to subnet admins during the claim()
process.
Last updated
Was this helpful?