Migration from v2 to v4
Deployed contracts
Base
BuildersV4 (impl)
BuildersTreasuryV2 (impl)
Arbitrum
BuildersV4 (impl)
BuildersTreasuryV2 (impl)
Upgrade the BuildersTreasury to BuildersTreasuryV2
BuildersTreasury to BuildersTreasuryV2Use 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.
See the BuildersTreasuryV2 (impl) address on the deployed section.
Upgrade the BuildersV2 to BuildersV4
BuildersV2 to BuildersV4Use 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.
See the BuildersV4 (impl) address on the deployed section.
Set the RewardPool address
RewardPool addressCall setRewardPool() on the BuildersV4 contract to assign the newly deployed RewardPool contract.
See the RewardPool address on the deployed section.
Set the networkShare
networkShareCall 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%...
The sum of shares for all networks must be 100% or 1025.
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 fee (optional)
If you want to add a fee for creating subnets:
Сonfigure the
FeeConfigcontract by callingsetFeeForOperation(address sender_, bytes32 operation_, uint256 fee_)where:sender_:BuildersV4contract address (the same asBuildersV2);operation_:0x6275696c6465727356342e6665652e7375626e65742e63726561746500000000;fee_: any value less then 1025;
Then call
setSubnetCreationFeeAmounton theBuildersV4contract with the fee amount in wei.
If you want to add a fee for claim operation
Сonfigure the
FeeConfigcontract by callingsetFeeForOperation(address sender_, bytes32 operation_, uint256 fee_)where:sender_:BuildersV4contract address (the same asBuildersV2);operation_:0x636c61696d000000000000000000000000000000000000000000000000000000;fee_: value, where 1 * 1025 = 100%, 0.2 * 1025 = 20%..
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?