Contracts
Core contracts
The Builders
contract serves as the core logic hub of the protocol. It enables the creation and management of builder pools. Each pool is uniquely identified by a name and configured with a set of parameters. Pools can be created by any user, but the builder address assigned during creation becomes the administrator of that pool.
Users can freely stake tokens into any existing pool. The protocol tracks both actual deposits and virtual deposits — the latter being weighted values adjusted by a time-based lock multiplier (power factor). This multiplier incentivizes users to hold their tokens for longer periods by increasing their share of rewards. The global reward calculation is based on a rate applied across all builder pools, ensuring fair distribution depending on virtual deposit weight.
Pool administrators have the authority to claim the accumulated rewards of their pool. They can also designate an address to receive those rewards. However, they are not allowed to withdraw user deposits or alter past deposits. The claim process respects claim lock deadlines for the all stakers in the pool.
The BuildersTreasury
contract acts as the token vault for reward distribution. It is only callable by the Builders
contract. When a builder claims rewards, the treasury contract transfers the net reward amount (after applying protocol fees) to the specified receiver address. The pool administrators receives the reward for the entire pool, and they are expected to handle any internal distribution if needed.
Importantly, this contract must be funded by the Morpheus protocol administrators, as all reward calculations are performed on Ethereum and rely on the balance available in this contract. The treasury tracks distributed rewards and current token availability to ensure accurate accounting.
Fee management is delegated to the FeeConfig
contract, which defines how much fee should be applied to specific actions like claiming or withdrawing. The contract owner (administrator of the FeeConfig
contract) can set a base fee rate, as well as custom fees per operation and per address. Fees are expressed as a percentage and routed to a treasury address.
This modular fee configuration allows the protocol to evolve and adapt to different economic models or integrations, while maintaining strict access control over critical parameters.
Periphery
OpenZeppelin
Used extensively across contracts to support secure access control and upgradeability:
OwnableUpgradeable
– enables ownership access control.UUPSUpgradeable
– facilitates contract upgradeability via the UUPS (Universal Upgradeable Proxy Standard) pattern.
Links:
Last updated
Was this helpful?