Changelog

From v2 to v4

Builders -> BuildersV2

Storage

Some of the storage variables have been deprecated to unusedStorage... to maintain upgradeability alignment:

  • editPoolDeadline renamed to unusedStorage1_V4Update and deprecated. The functionality of time-limited Subnet editing has been removed.

Some variables were renamed to improve the clarity of the contract logic:

  • totalPoolData renamed to allSubnetsData .

  • builderPools renamed to subnets .

  • buildersPoolData renamed to subnetsData .

  • struct BuilderPool renamed to Subnet .

  • struct BuilderPoolData renamed to SubnetData .

  • struct TotalPoolData renamed to AllSubnetsData .

Introduced new storage fields such as:

  • rewardPool.

  • subnetCreationFeeAmount.

  • networkShare.

  • networkShareOwner.

  • subnetsMetadata.

  • allSubnetsDataV4.

  • FEE_SUBNET_CREATE.

Some existing structures stopped using certain functionality (see here), so some fields were renamed to unusedStorage.. accordingly to reflect their updated purpose.

BuilderPool -> Subnet changes

In the new version of the protocol, the logic of Subnets has been simplified. The claim lock and subnet start time are no longer used — once a Subnet is created, users can immediately start depositing tokens without any time restrictions.

Additionally, support has been added for an extra address (claimAdmin) that can claim rewards on behalf of the main subnet admin. See Subnet.claimAdmin.

Subnets now support metadata, allowing descriptive or auxiliary information to be attached. See SubnetMetadata struct.

Editing is split into two parts: a user can update the main subnet configuration (editSubnet()) and its metadata (editSubnetMetadata()) independently. However, as before, the Subnet name cannot be changed after creation.

The subnet ID format has also been updated: it is now calculated based on the blockchain’s chainId and the subnet name. This ensures uniqueness of names within each network. Existing subnets continue to use the legacy ID format to maintain backward compatibility.

/**
 * @dev Get the Subnet ID by the `subnetName_` and the current `block.chainid`.
 * All Subnets in V4 will have new IDs.
 */
function getSubnetId(string memory subnetName_) public view returns (bytes32) {
  return keccak256(abi.encodePacked(block.chainid, subnetName_));
}

/**
 * @dev Get the Subnet ID by the `subnetName_`. Wee keep this function for backward
 * compatibility.
 */
function getSubnetIdOld(string memory subnetName_) public pure returns (bytes32) {
  return keccak256(abi.encodePacked(subnetName_));
}

Reward Distribution Mechanism Update

The reward distribution logic has been redesigned. Rewards are now continuously distributed to subnets based on an emission curve stored in the RewardPool contract under a specific index - 3. The _getCurrentRate() method has been refactored to accommodate this behavior.

Since the protocol operates in a multichain environment — where a single emission curve serves multiple networks — a networkShare multiplier has been introduced. This multiplier is applied to all rewards distributed on a particular network.

The multiplier can be set either by the protocol administrator or a designated trusted address, stored in variable networkShareOwner and assigned through function setNetworkShareOwner(). Its value must always be less than or equal to 1, and is expected to reflect the total stake volume within the respective network.

The logic for calculating the networkShare multiplier is outside the scope of this change.

Power Factor

Totally deprecated with related functionality.

BuildersTreasury -> BuildersTreasuryV2

The contract has remained mostly unchanged. To improve security, the SafeERC20 library was introduced. The getAllRewards() function was removed, as it is no longer required under the current architecture.

A new function withdraw() was added to allow the multisig (contract owner) to withdraw MOR tokens from the contract as needed. This provides greater flexibility for rewards management and simplifies contract maintenance.

RewardPool

The new protocol architecture introduces the RewardPool contracts to support new business logic.

https://github.com/MorpheusAIs/SmartContracts/pull/54

Last updated

Was this helpful?