# What is Phase?

Phase aims to be a liquidity platform, allowing users to borrow a rock-solid stablecoin while earning yield at the same time. Using your collateral, even while borrowing CASH, you can earn interest with the following instruments:

* Variety of single exposure DeFi opportunities (such as providing collateral for **Aave** or other lending platforms).
* Create liquidity on bridges such as **Stargate** to capture fees from activity.
* Earn native yield from staked decentralized crypto assets such as **cbETH** and **rETH**.
* Provide liquidity to other Phase projects **(IDEA).**

Learn more [here](/vaults/yield-on-collateral).

{% hint style="warning" %}
Before hopping into Phase, please read [the Acknowledgments](/protocol/acknowledgments).
{% endhint %}


# Acknowledgments

While the core of Phase has been audited by the [Omniscia](https://omniscia.io/) team, there is no guarantee that Phase cannot be exploited. A few changes had to be made to a select few core contracts to make the protocol operate properly. These bugs weren't critical but included, for example, not depositing into underlying strategies. These changes can be found on the [Github repo](https://github.com/0xPhase/contracts). More audits will be acquired in the future as the protocol starts to earn a profit.

While smart contracts automate transactions and enhance transparency, they can be vulnerable to sudden and immediate exploitation. Caution, research, and risk management are essential to navigate volatility and maximize benefits.

It's imperative for every user to acknowledge the inherent risks associated with smart contracts and their potential vulnerabilities. Balancing these risks with the benefits requires a well-informed approach. We firmly recommend always staying updated, understanding the implications of the changes, and ensuring that your decisions are made with a comprehensive understanding of potential outcomes.

{% hint style="warning" %}
While the Phase team puts all its efforts into building a secure and viable protocol and getting continuous audits, it cannot promise total safety. Interacting with Phase is an acknowledgment of these risks.
{% endhint %}


# License

The Phase Protocol is licensed under the Business Source License 1.1, which disallows forks until the license changes to the provided open-source license. You are allowed to use, modify, and copy certain parts of Phase. You can use interfaces in your codebase to interact with and extend the protocol. There are also exceptional cases where you can fork the code, such as [proxies](/proxies/overview). These are case-by-case situations and must be explicitly permitted by the **Phase Foundation**.

There might be cases where source code not owned by Phase is accidentally tagged under the BSL 1.1 license, and when such cases are reported to the team they will be swiftly fixed.

{% code title="LICENSE" overflow="wrap" lineNumbers="true" fullWidth="false" %}

```markdown
Business Source License 1.1

License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.

---

Parameters

Licensor: Phase Foundation

Licensed Work: Phase Protocol
The Licensed Work is (c) 2023 Phase Foundation

Change Date: The earlier of 2026-01-01

Change License: GNU General Public License v2.0 or later

---

Terms

The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.

Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.

If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.

You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.

This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.

MariaDB hereby grants you permission to use this License’s text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.

---

Covenants of Licensor

In consideration of the right to use this License’s text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:

1. To specify as the Change License the GPL Version 2.0 or any later version,
   or a license that is compatible with GPL Version 2.0 or a later version,
   where "compatible" means that software provided under the Change License can
   be included in a program with software provided under GPL Version 2.0 or a
   later version. Licensor may specify additional Change Licenses without
   limitation.

2. To either: (a) specify an additional grant of rights to use that does not
   impose any additional restriction on the right granted in this License, as
   the Additional Use Grant; or (b) insert the text "None".

3. To specify a Change Date.

4. Not to modify this License in any other way.

---

Notice

The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.

```

{% endcode %}


# Yield on Collateral

Phase aiming to be a liquidity platform must provide users with tools to use their liquidity. Borrowing cash is the core instrument of Phase, but to achieve higher capital efficiency we also use that collateral to earn yield. This yield must come from a source where losses should be small, unlikely, or impossible. Smart contract hacks, exploits, and rugs do happen, but that is a [risk](/protocol/acknowledgments) **you take** with DeFi. Phase aims to ensure the instruments we use to generate yield on the user's deposits are as safe and well-backed as possible.\
\
Phase is also aiming to build its own in-house financial instruments, giving more use for CASH and providing more secure and undiluted ways to earn with collateral.\
\
There are multiple ways Phase could provide yield from one-sided deposits. The amount available on the mainnet launch is still to be determined, but we will keep adding them as time goes on. Some of the options include:

* Providing collateral on platforms such as Aave and Compound
* One-sided yield farms on tools such as Beefy
* First-party financial instruments


# Credit Accounts

Credit Accounts (CAs) are the bread and butter of Phase. To interact with almost anything in the protocol, a user must create or own a CA. They are based on the ERC721 standard and are non-fungible, meaning every CA is different from each other. There can be only one owner of a CA, though it can be given to any contract or EOA, allowing for multisigs to own and mint CAs.\
\
Creating one is totally free and only requires gas once, creating happens whenever you interact with the protocol and don't have an account yet. A user can only own one CA, though this might change in the future with improvements to UX.

Currently, no vault or user data is stored on the CAs; they are only used as proof of ownership, though this might change in the future. Minting a new account doesn't affect any other positions, as all of them are isolated.


# $CASH

The tokenomics for the CASH stablecoin are pretty simple and straightforward. CASH can only exist by either being backed by collateral in vaults or being burnable for a fixed premium in the [PSM](/cash-stablecoin/psm). The backing nor the price of CASH is **not** algorithmic.\
\
To supplement borrowers having to lock in extra collateral value compared to the value of the received CASH, the protocol allows people to deposit their locked collateral into one-sided first- and third-party yield sources. [Liquidations](/liquidation/math-behind-liquidations) also happen in steps, saving more of your collateral and giving you more time to pay back.


# PSM

The PSM (peg stability module) provides bounds for the price of CASH. It always values CASH at 1$, but through fees the range increases based on the side of the change.

Though Phase's current implementation of the PSM is not the best, as it's giving arbitrage money to arbitragers and not tohe protocol, it is still a working and a necessary peg-stabilizing module for liquidators and users. We are planning on re-designing and replacing the current PSM with one that produces more for the protocol while covering the same price range.

The flowchart below illustrates the simple functionality of the PSM, with Aave being the yield source and USDC being the counter token.

<div align="center"><figure><img src="https://1030308589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSERDvNQcot3i2izYt5Cd%2Fuploads%2FCiflHrVeinK13hFZdJte%2Fimage.png?alt=media&amp;token=8e9bd5fb-1dbb-4bc0-ab22-01bbb60d8f59" alt=""><figcaption><p>Flowchart to visualize the PSM</p></figcaption></figure></div>


# Vault Structure

Every Vault is a unique Clone Diamond. This means the Manager can upgrade all the vaults at once by upgrading the main [Diamond](/proxies/diamonds). Though, upgrading often also needs to call an `initialize` function to upgrade the logic with new variables.\
\
A vault stores info about every [Credit Account](/vaults/credit-accounts) in its storage. A Vault also contains a lot of helpful functionality for frontends and liquidators, including but not limited to the following:

* Getting user info such as deposit and debt value
* Getting liquidation info on users with predictable results once executed on
* Indexing all deposits and actions done on the vault

Vault interfaces:

{% code title="IVault.sol" overflow="wrap" lineNumbers="true" %}

```solidity
// SPDX-License-Identifier: BUSL-1.1
interface IVaultAccounting {
  /// @notice Adds collateral for the user
  /// @param user The user id
  /// @param amount The amount to add
  /// @param extraData The extra adapter data
  function addCollateral(
    uint256 user,
    uint256 amount,
    bytes memory extraData
  ) external payable;

  /// @notice Removes collateral from the user
  /// @param user The user id
  /// @param amount The amount to remove
  /// @param extraData The extra adapter data
  function removeCollateral(
    uint256 user,
    uint256 amount,
    bytes memory extraData
  ) external;

  /// @notice Mints CASH for the user
  /// @param user The user id
  /// @param amount Yhe amount to mint
  function mintUSD(uint256 user, uint256 amount) external;

  /// @notice Mints CASH for the user
  /// @param user The user id
  /// @param amount The amount to mint
  /// @param useMax If minting too much, mint max allowed instead
  function mintUSD(uint256 user, uint256 amount, bool useMax) external;

  /// @notice Repays CASH for the user
  /// @param user The user id
  /// @param shares The amount of shares to repay
  function repayUSD(uint256 user, uint256 shares) external;

  /// @notice Repays CASH for the user
  /// @param user The user id
  /// @param shares The amount of shares to repay
  /// @param useMax If repaying too much, repay as much as wallet balance allows
  function repayUSD(uint256 user, uint256 shares, bool useMax) external;
}

interface IVaultGetters {
  /// @notice Returns if the user is solvent
  /// @param user The user id
  /// @return If the user is solvent
  function isSolvent(uint256 user) external view returns (bool);

  /// @notice Returns the user's debt value in dollars
  /// @param user The user id
  /// @return The debt value
  function debtValue(uint256 user) external view returns (uint256);

  /// @notice Returns the user's deposit value in dollars
  /// @param user The user id
  /// @return The deposit value
  function depositValue(uint256 user) external view returns (uint256);

  /// @notice Returns the user's total deposit in token amount
  /// @param user The user id
  /// @return The total deposit
  function deposit(uint256 user) external view returns (uint256);

  /// @notice Returns the user's yield deposit in token amount
  /// @param user The user id
  /// @return The yield deposit
  function yieldDeposit(uint256 user) external view returns (uint256);

  /// @notice Returns the user's vault deposit in token amount
  /// @param user The user id
  /// @return The vault deposit
  function pureDeposit(uint256 user) external view returns (uint256);

  /// @notice Returns all yield sources used by the user
  /// @param user The user id
  /// @return The list of yield sources
  function yieldSources(uint256 user) external view returns (address[] memory);

  /// @notice Returns the price of the underlying asset from the oracle
  /// @return The underlying asset price
  function price() external view returns (uint256);

  /// @notice Returns the interest rate for the vault
  /// @return The interest rate
  function getInterest() external view returns (uint256);

  /// @notice Returns the total amount of collateral in the vault and invested in all yield sources
  /// @return The amount of collateral
  function collectiveCollateral() external view returns (uint256);

  /// @notice Returns all the available yield sources
  /// @return The list of yield sources
  function allYieldSources() external view returns (address[] memory);

  /// @notice Returns the user info for the user
  /// @param user The user id
  /// @return The user info
  function userInfo(uint256 user) external view returns (UserInfo memory);

  /// @notice Returns the yield info for the source
  /// @param yieldSource The yield source address
  /// @return The yield info
  function yieldInfo(
    address yieldSource
  ) external view returns (YieldInfo memory);

  /// @notice Returns the manager contract
  /// @return The manager contract
  function manager() external view returns (Manager);

  /// @notice Returns the cash contract
  /// @return The cash contract
  function cash() external view returns (ICash);

  /// @notice Returns the treasury contract
  /// @return The treasury contract
  function treasury() external view returns (ITreasury);

  /// @notice Returns the storage contract
  /// @return The storage contract
  function varStorage() external view returns (Storage);

  /// @notice Returns the asset token contract
  /// @return The asset token contract
  function asset() external view returns (IERC20);

  /// @notice Returns the price oracle contract
  /// @return The price oracle contract
  function priceOracle() external view returns (IOracle);

  /// @notice Returns the max mint
  /// @return The max mint
  function maxMint() external view returns (uint256);

  /// @notice Returns the interest contract
  /// @return The interest contract
  function interest() external view returns (IInterest);

  /// @notice Returns the max collateral ratio
  /// @return The max collateral ratio
  function maxCollateralRatio() external view returns (uint256);

  /// @notice Returns the borrow fee
  /// @return The borrow fee
  function borrowFee() external view returns (uint256);

  /// @notice Returns the liquidation fee
  /// @return The liquidation fee
  function liquidationFee() external view returns (uint256);

  /// @notice Returns the health target minimum
  /// @return The health target minimum
  function healthTargetMinimum() external view returns (uint256);

  /// @notice Returns the health target maximum
  /// @return The health target minimum
  function healthTargetMaximum() external view returns (uint256);

  /// @notice Returns the collective debt
  /// @return The collective debt
  function collectiveDebt() external view returns (uint256);

  /// @notice Returns the total debt shares
  /// @return The total debt shares
  function totalDebtShares() external view returns (uint256);

  /// @notice Returns the last debt update timestamp
  /// @return The last debt update timestamp
  function lastDebtUpdate() external view returns (uint256);

  /// @notice Returns if the context is currently locked due to a sensitive function being called
  /// @return If the context is currently locked
  function contextLocked() external view returns (bool);

  /// @notice Returns if the market is current locked
  /// @return If the matket is currently locked
  function marketsLocked() external view returns (bool);
}

interface IVaultLiquidation {
  /// @notice Liquidates a user based on liquidationInfo(user)
  /// @param user The user id
  function liquidateUser(uint256 user) external;

  /// @notice Returns liquidation info about the user
  /// @param user The user id
  /// @return The liquidation info
  function liquidationInfo(
    uint256 user
  ) external view returns (LiquidationInfo memory);
}

interface IVaultSetters {
  /// @notice Sets the health target for a liquidation for the user
  /// @param user The user id
  /// @param healthTarget The health target
  function setHealthTarget(uint256 user, uint256 healthTarget) external;
}

interface IVaultYield {
  /// @notice Deposits collateral into the yield source for the user
  /// @param user The user id
  /// @param yieldSource The yield source
  /// @param amount The deposit amount
  function depositYield(
    uint256 user,
    address yieldSource,
    uint256 amount
  ) external;

  /// @notice Withdraws collateral from the yield source for the user
  /// @param user The user id
  /// @param yieldSource The yield source
  /// @param amount The withdraw amount
  function withdrawYield(
    uint256 user,
    address yieldSource,
    uint256 amount
  ) external;

  /// @notice Withdraws all collateral from the yield source for the user
  /// @param user The user id
  /// @param yieldSource The yield source
  function withdrawFullYield(uint256 user, address yieldSource) external;

  /// @notice Withdraws all collateral from all yield sources for the user
  /// @param user The user id
  function withdrawEverythingYield(uint256 user) external;
}

// solhint-disable-next-line no-empty-blocks
interface IVault is
  IVaultAccounting,
  IVaultGetters,
  IVaultLiquidation,
  IVaultSetters,
  IVaultYield,
  IAccessControl,
  IMulticall
{ }
```

{% endcode %}


# Math behind Liquidations

We have made our own liquidation formula to allow users to choose their preferred liquidation target. Some might want to be liquidated close to the maximum, and some close to the minimum. As the price goes down, every user gets liquidated to the same position, as there is a limit on how far stepped liquidations go, as we don't want the liquidation fees to be less than gas and swap fees.

<table><thead><tr><th>Value</th><th width="428.3333333333333">Description</th><th>Possible Values</th></tr></thead><tbody><tr><td>e</td><td>1 ETH, aka 10¹⁸ wei</td><td>1 ETH</td></tr><tr><td>debt</td><td>User's debt value in dollars</td><td>0 - ∞</td></tr><tr><td>collateral</td><td>User's real collateral value in dollars (not adjusted to the maximum collateral ratio)</td><td>0 - ∞</td></tr><tr><td>health</td><td>Target health ratio</td><td>0 - 1 ETH</td></tr><tr><td>mcr</td><td>Maximum collateral ratio</td><td>0 - 1 ETH</td></tr><tr><td>fee</td><td>Liquidation fee added onto collateral</td><td>0 - 1 ETH</td></tr></tbody></table>

<figure><img src="https://1030308589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSERDvNQcot3i2izYt5Cd%2Fuploads%2FkUVFcJJCroJX3BvvFs9O%2FScreenshot%20from%202022-11-12%2022-30-27.png?alt=media&amp;token=4a3710cb-5268-4a94-b3bb-16b4d1d3473b" alt=""><figcaption><p>The equation used to determine debt and borrow + fee change needed to reach target health.</p></figcaption></figure>

Code we use to calculate the debt and collateral change for a user.&#x20;

{% code title="VaultV1.sol" overflow="wrap" lineNumbers="true" %}

```solidity
  // SPDX-License-Identifier: BUSL-1.1

  /// @notice Returns the liquidation numbers for the user
  /// @param user The user id
  /// @return debtChange The debt change
  function _liquidationAmount(
    uint256 user
  ) internal view returns (uint256 debtChange) {
    VaultStorage storage s = _s();
    UserInfo storage info = s.userInfo[user];

    uint256 collateral = _scaleFromAsset(_deposit(user) * _price()) / 1 ether;
    uint256 debt = _debtValueUser(user);

    if (collateral == 0 || debt == 0) return 0;

    uint256 feefullDebt = _withFee(debt);

    if (debt < _stepMinDeposit() || feefullDebt >= collateral) {
      return debt;
    }

    uint256 liquidationFee = s.liquidationFee;
    uint256 maxCollateralRatio = s.maxCollateralRatio;
    uint256 targetHealth = info.healthTarget;

    uint256 scalar = 1 ether * 1 ether;
    uint256 debtHealth = (debt * scalar) / targetHealth;
    uint256 healthScalar = scalar / targetHealth;
    uint256 feeMultiplier = (liquidationFee * maxCollateralRatio) / 1 ether;

    debtChange =
      (debtHealth - collateral * maxCollateralRatio) /
      (healthScalar - maxCollateralRatio - feeMultiplier);
  }

```

{% endcode %}


# Become a Liquidator

There are no whitelists, applications, or KYC (know your customer) to become a liquidator for Phase. Liquidation is really easy to implement, and the liquidator must always be a contract implementing the `ILiquidator` interface.

A liquidation will only commence once the contract calls `liquidateUser(...)` and the user in question is insolvent. The contract will get called back with `receiveLiquidation(...)` and must contain enough CASH in its balance to pay off the debt change. The contract receives the collateral before having to pay back the debt and is allowed to do anything in order to provide enough CASH.

{% code title="VaultV1.sol" overflow="wrap" lineNumbers="true" %}

```solidity
  // SPDX-License-Identifier: BUSL-1.1

  function liquidateUser(uint256 user) external {
    // Get user liquidation info and check if user is solvent or not
  
    // Give user rebate
    // Change storage
    // Process fees
    
    // Send msg.sender funds and call receiveLiquidation();
    
    // Burn debtChange amount of CASH to veryify 
  }
```

{% endcode %}

{% code title="IVault.sol" overflow="wrap" lineNumbers="true" %}

```solidity
// SPDX-License-Identifier: BUSL-1.1

struct LiquidationInfo {
  bool solvent;
  uint256 borrowChange;
  uint256 assetReward;
  uint256 protocolFee;
  uint256 rebate;
}
```

{% endcode %}

{% code title="ILiquidator.sol" overflow="wrap" lineNumbers="true" %}

```solidity
// SPDX-License-Identifier: BUSL-1.1

interface ILiquidator {
  function receiveLiquidation(
    uint256 toLiquidate,
    IVault.LiquidationInfo memory liquidationInfo
  ) external returns (bytes4);
}
```

{% endcode %}


# Overview

The blockchain is immutable, and once a contract is deployed, you cannot change its code. This works fine for many applications that can deploy a new contract for every new version they create. Sadly, this isn't adequate for Phase's needs as a lot of info is stored in the contract itself and cannot be moved from contract to contract.\
\
We use proxies for almost everything in Phase to get around this issue. A proxy allows us to run any target contract code in the current contract's storage. This means we can deploy a contract once and upgrade its code in the future.\
\
This does have its downside, though, as all the code is upgradable, We have to safeguard and secure the protocol to a point so that a bad actor cannot change code instantly. One contract owned by a timelock will control all the proxies inside Phase. With this, every upgrade and code change has to go through a period where everyone can see them and act accordingly.\
\
Phase uses the following proxy patterns in its systems:

* [Admin Upgradeable Proxy](/proxies/admin-upgradeable-proxy)
* [Storage Upgradeable Proxy](/proxies/storage-upgradeable-proxy)
* [Diamonds](/proxies/diamonds)


# Admin Upgradeable Proxy

The Admin Upgradeable Proxy is based on having the target stored on a specific storage slot changeable by the proxy's owner.

{% code title="AdminUpgradeableProxy.sol" overflow="wrap" lineNumbers="true" %}

```solidity
contract AdminUpgradeableProxy is ProxyOwnable, Proxy {
  bytes32 internal constant _IMPLEMENTATION_SLOT =
    bytes32(uint256(keccak256("proxy.implementation")) - 1);

  event Upgraded(address indexed _implementation);

  constructor(
    address _owner,
    address _target,
    bytes memory _initialCall
  );

  function upgradeTo(
    address _newImplementation,
    bytes memory _oldImplementationData,
    bytes memory _newImplementationData
  ) external;

  function implementation()
    public
    view
    override
    returns (address _implementation);

  function proxyType() public pure override returns (uint256 _type);

  function _setImplementation(address _newImplementation) internal;
}
```

{% endcode %}


# Storage Upgradeable Proxy

The Storage Upgradeable Proxy is based on reading the target from a slot from a Storage. This means multiple proxies can read from the same slot and can all be upgraded at once by changing that Storage slot.

{% hint style="info" %}
The Storage mentioned here is not the internal storage of the contract but a separate contract capable of storing and reading storage slots. This means data is stored elsewhere than the proxy contract itself and can be updated independently of it.
{% endhint %}

{% code title="StorageUpgradeableProxy.sol" overflow="wrap" lineNumbers="true" %}

```solidity
contract StorageUpgradeableProxy is ProxyOwnable, Proxy {
  bytes32 internal constant _STORAGE_SLOT =
    bytes32(uint256(keccak256("proxy.storage")) - 1);

  bytes32 internal constant _SLOT_SLOT =
    bytes32(uint256(keccak256("proxy.storage.slot")) - 1);

  event Upgraded(address indexed _newStorage, bytes32 indexed _newSlot);

  constructor(
    address _owner,
    address _storage,
    bytes32 _slot,
    bytes memory _initialCall
  );

  function upgradeTo(
    address _newStorage,
    bytes32 _newSlot,
    bytes memory _oldImplementationData,
    bytes memory _newImplementationData
  ) external;

  function implementation()
    public
    view
    override
    returns (address _implementation);

  function proxyType() public pure override returns (uint256 _type);

  function _setImplementation(address _newStorage, bytes32 _newSlot) internal;
}
```

{% endcode %}


# Diamonds

Diamonds follow the [EIP-2535](https://eips.ethereum.org/EIPS/eip-2535) spec. A lot of the Diamond code is taken from Mudgen's [diamond-3-hardhat](https://github.com/mudgen/diamond-3-hardhat) repo, though some code style and clarity modifications have been made. We appreciate Mudgen providing a base to build our diamonds on. Even though the Phase source code is licensed under BSL-1.1, we are giving full access to reproduce, copy and fork the diamond code inside the folder linked below.\
\
All of the facets created for diamonds can be found [here](https://github.com/0xPhase/contracts/tree/master/diamond):

* Access Control
* Clock
* Clone
* ERC20
* Loupe (required for the spec)
* Multicall
* Ownable


# Socials

These are our current official socials:

| Platform | Link                            |
| -------- | ------------------------------- |
| Twitter  | <https://twitter.com/0xPhase>   |
| Discord  | <https://discord.gg/gBgVrHZ9zw> |
| Github   | <https://github.com/0xPhase>    |

{% hint style="danger" %}
If a social account is NOT linked here, it is likely a scam. Please be aware of scammers and people trying to impersonate us.
{% endhint %}


