Skip to content

24. Smart Contracts

rndquu edited this page Sep 26, 2024 · 14 revisions

Below you will find a brief descriptive overview for each of the primary smart contracts in Ubiquity's collateralized dollar protocol, along with hyperlinks to their source code on Github.

Diamond

[github] [etherscan] [louper]

Main protocol contract that follows ERC-2535 diamond proxy pattern.

Diamond facets

Set of contracts that are part of the Diamond. Facet contracts must always be called via the Diamond proxy contract.

AccessControlFacet

Responsible for managing protocol roles.

[github] [etherscan]

DiamondCutFacet

Allows editing Diamond contract facets and methods.

[github] [etherscan]

DiamondLoupeFacet

Allows to inspect available methods in the Diamond. Really useful for 3rd party services that are able to work with ERC-2535 proxies like https://louper.dev. Notice that https://etherscan.io doesn't support working with Diamond proxies yet.

[github] [etherscan]

ManagerFacet

Sets core protocol parameters.

[github] [etherscan]

OwnershipFacet

Sets protocol owner.

[github] [etherscan]

UbiquityPoolFacet

Allows users to:

  • deposit collateral in exchange for Ubiquity Dollars
  • redeem Ubiquity Dollars in exchange for the earlier provided collateral

[github] [etherscan]

UbiquityDollarToken

USD-pegged token for the Ubiquity protocol.

[github] [etherscan] [gnosis]

Governance

UbiquityGovernance

Ubiquity protocol governance token (UBQ).

[github] [etherscan]

UbiquityAlgorithmicDollarManager

Governance token manager contract.

[github] [etherscan]

Staking

Bonding v1

Deprecated contract for bonding deposits, withdrawals and minting. See BondingV2 for the upgraded contract.

[github] [etherscan]

Bonding v2

Ubiquity Dollar's Bonding contract, which handles staking deposits, withdrawals, and minting. Also allows the BondingManager to take emergency action in raising or lowering the price of uAD by removing uAD or 3CRV LP tokens from the pool, respectively (see functions addLiquidity and removeLiquidity).

The BondingManager has unilateral access to the bonding contract's minting and pool adjustment functions. This permissioned wallet is currently operated by the development team, as per the initial DAO governance operations period. This will be changed following the DAO's continued governance rollout, and manual utilization of these functions using the manager address will only take play via governance votes.

Also contains disabled functions used for the migration from the bonding v1 contract to the v2 contract (see Bonding v2 Upgrade for more).

[github] [etherscan]

BondingShare v1

Constructs the ERC1155Ubiquity contract.

[github] [etherscan]

BondingShare v2

The upgraded contract for handling a user's persistent bonding share NFT, which stores the user's history of interactions with the bonding contract.

[github] [etherscan]

MasterChef v1

Deprecated contract used for UBQ rewards. See MasterChefV2.1 for the upgraded contract.

[github] [etherscan]

MasterChef v2

Contains an error which miscalculates the pending rewards. Its use has been deprecated.

[github] [etherscan]

MasterChef v2.1

Calculates and distributes UBQ rewards to LP token pool stakers based on a deposit time length-based multiplier. The upgraded contract contains logic which handles the persistent bonding share NFT.

[github] [etherscan]

Treasury

[etherscan]

Curve pools

LUSD/UUSD

[etherscan]

UBQ/WETH

[etherscan]

WXDAI/UUSD

[gnosis]

Chainlink feeds

LUSD/USD

[etherscan]

ETH/USD

[etherscan]

Clone this wiki locally