-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
1,202 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/contracts/docs/src/src/dollar/Diamond.sol/contract.Diamond.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/contracts/docs/src/src/dollar/Diamond.sol/struct.DiamondArgs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/src/dollar/access/AccessControlInternal.sol/abstract.AccessControlInternal.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/contracts/docs/src/src/dollar/core/CreditNft.sol/contract.CreditNft.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tracts/docs/src/src/dollar/core/ERC1155Ubiquity.sol/abstract.ERC1155Ubiquity.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../contracts/docs/src/src/dollar/core/ERC20Ubiquity.sol/abstract.ERC20Ubiquity.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/contracts/docs/src/src/dollar/core/StakingShare.sol/contract.StakingShare.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ocs/src/src/dollar/core/UbiquityCreditToken.sol/contract.UbiquityCreditToken.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ocs/src/src/dollar/core/UbiquityDollarToken.sol/contract.UbiquityDollarToken.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...src/dollar/core/UbiquityGovernanceToken.sol/contract.UbiquityGovernanceToken.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ocs/src/src/dollar/facets/AccessControlFacet.sol/contract.AccessControlFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../docs/src/src/dollar/facets/BondingCurveFacet.sol/contract.BondingCurveFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/contracts/docs/src/src/dollar/facets/ChefFacet.sol/contract.ChefFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...src/src/dollar/facets/CollectableDustFacet.sol/contract.CollectableDustFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ts/docs/src/src/dollar/facets/CreditClockFacet.sol/contract.CreditClockFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/src/dollar/facets/CreditNftManagerFacet.sol/contract.CreditNftManagerFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...NftRedemptionCalculatorFacet.sol/contract.CreditNftRedemptionCalculatorFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...CreditRedemptionCalculatorFacet.sol/contract.CreditRedemptionCalculatorFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...llar/facets/CurveDollarIncentiveFacet.sol/contract.CurveDollarIncentiveFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...acts/docs/src/src/dollar/facets/DiamondCutFacet.sol/contract.DiamondCutFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../docs/src/src/dollar/facets/DiamondLoupeFacet.sol/contract.DiamondLoupeFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
200 changes: 200 additions & 0 deletions
200
.../facets/DirectGovernanceFarmerFacet.sol/contract.DirectGovernanceFarmerFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
# DirectGovernanceFarmerFacet | ||
[Git Source](https://github.com/ubiquity/ubiquity-dollar/blob/c84a9cbe167218aefb4a9feb40e2abcd74899167/src/dollar/facets/DirectGovernanceFarmerFacet.sol) | ||
|
||
**Inherits:** | ||
[Modifiers](/src/dollar/libraries/LibAppStorage.sol/contract.Modifiers.md) | ||
|
||
Simpler Staking Facet | ||
|
||
How it works: | ||
1. User sends stablecoins (DAI / USDC / USDT / Dollar) | ||
2. Deposited stablecoins are added to Dollar-3CRV Curve MetaPool | ||
3. User gets Dollar-3CRV LP tokens | ||
4. Dollar-3CRV LP tokens are transferred to the staking contract | ||
5. User gets a staking share id | ||
|
||
|
||
## Functions | ||
### initialize | ||
|
||
it works as a constructor to set contract values at storage | ||
|
||
|
||
```solidity | ||
function initialize( | ||
address _manager, | ||
address base3Pool, | ||
address ubiquity3PoolLP, | ||
address _ubiquityDollar, | ||
address zapPool | ||
) public onlyAdmin; | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`_manager`|`address`|Ubiquity Manager| | ||
|`base3Pool`|`address`|Base3Pool Address| | ||
|`ubiquity3PoolLP`|`address`|Ubiquity3PoolLP Address| | ||
|`_ubiquityDollar`|`address`|Ubiquity Dollar Address| | ||
|`zapPool`|`address`|ZapPool Address| | ||
|
||
|
||
### depositSingle | ||
|
||
Deposits a single token to staking | ||
|
||
Stable coin (DAI / USDC / USDT / Ubiquity Dollar) => Dollar-3CRV LP => Ubiquity Staking | ||
|
||
How it works: | ||
1. User sends stablecoins (DAI / USDC / USDT / Dollar) | ||
2. Deposited stablecoins are added to Dollar-3CRV Curve MetaPool | ||
3. User gets Dollar-3CRV LP tokens | ||
4. Dollar-3CRV LP tokens are transferred to the staking contract | ||
5. User gets a staking share id | ||
|
||
|
||
```solidity | ||
function depositSingle(address token, uint256 amount, uint256 durationWeeks) | ||
external | ||
nonReentrant | ||
returns (uint256 stakingShareId); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`token`|`address`|Token deposited : DAI, USDC, USDT or Ubiquity Dollar| | ||
|`amount`|`uint256`|Amount of tokens to deposit (For max: `uint256(-1)`)| | ||
|`durationWeeks`|`uint256`|Duration in weeks tokens will be locked (1-208)| | ||
|
||
|
||
### depositMulti | ||
|
||
Deposits into Ubiquity protocol | ||
|
||
Stable coins (DAI / USDC / USDT / Ubiquity Dollar) => uAD3CRV-f => Ubiquity StakingShare | ||
|
||
STEP 1 : Change (DAI / USDC / USDT / Ubiquity dollar) to 3CRV at uAD3CRV MetaPool | ||
|
||
STEP 2 : uAD3CRV-f => Ubiquity StakingShare | ||
|
||
|
||
```solidity | ||
function depositMulti(uint256[4] calldata tokenAmounts, uint256 durationWeeks) | ||
external | ||
nonReentrant | ||
returns (uint256 stakingShareId); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`tokenAmounts`|`uint256[4]`|Amount of tokens to deposit (For max: `uint256(-1)`) it MUST follow this order [Ubiquity Dollar, DAI, USDC, USDT]| | ||
|`durationWeeks`|`uint256`|Duration in weeks tokens will be locked (1-208)| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`stakingShareId`|`uint256`|Staking share id| | ||
|
||
|
||
### withdrawId | ||
|
||
Withdraws from Ubiquity protocol | ||
|
||
Ubiquity StakingShare => uAD3CRV-f => stable coin (DAI / USDC / USDT / Ubiquity Dollar) | ||
|
||
STEP 1 : Ubiquity StakingShare => uAD3CRV-f | ||
|
||
STEP 2 : uAD3CRV-f => stable coin (DAI / USDC / USDT / Ubiquity Dollar) | ||
|
||
|
||
```solidity | ||
function withdrawId(uint256 stakingShareId) external nonReentrant returns (uint256[4] memory tokenAmounts); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`stakingShareId`|`uint256`|Staking Share Id to withdraw| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`tokenAmounts`|`uint256[4]`|Array of token amounts [Ubiquity Dollar, DAI, USDC, USDT]| | ||
|
||
|
||
### withdraw | ||
|
||
Withdraws from Ubiquity protocol | ||
|
||
Ubiquity StakingShare => uAD3CRV-f => stable coin (DAI / USDC / USDT / Ubiquity Dollar) | ||
|
||
STEP 1 : Ubiquity StakingShare => uAD3CRV-f | ||
|
||
STEP 2 : uAD3CRV-f => stable coin (DAI / USDC / USDT / Ubiquity Dollar) | ||
|
||
|
||
```solidity | ||
function withdraw(uint256 stakingShareId, address token) external nonReentrant returns (uint256 tokenAmount); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`stakingShareId`|`uint256`|Staking Share Id to withdraw| | ||
|`token`|`address`|Token to withdraw to : DAI, USDC, USDT, 3CRV or Ubiquity Dollar| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`tokenAmount`|`uint256`|Amount of token withdrawn| | ||
|
||
|
||
### isIdIncluded | ||
|
||
Checks whether `id` exists in `idList[]` | ||
|
||
|
||
```solidity | ||
function isIdIncluded(uint256[] memory idList, uint256 id) external pure returns (bool); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`idList`|`uint256[]`|Array to search in| | ||
|`id`|`uint256`|Value to search in `idList`| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`<none>`|`bool`|Whether `id` exists in `idList[]`| | ||
|
||
|
||
### isMetaPoolCoin | ||
|
||
Helper function that checks that `token` is one of the underlying MetaPool tokens or stablecoin from MetaPool | ||
|
||
|
||
```solidity | ||
function isMetaPoolCoin(address token) external pure returns (bool); | ||
``` | ||
**Parameters** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`token`|`address`|Token address to check| | ||
|
||
**Returns** | ||
|
||
|Name|Type|Description| | ||
|----|----|-----------| | ||
|`<none>`|`bool`|Whether `token` is one of the underlying MetaPool tokens or stablecoin from MetaPool| | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...llar/facets/DollarMintCalculatorFacet.sol/contract.DollarMintCalculatorFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/src/dollar/facets/DollarMintExcessFacet.sol/contract.DollarMintExcessFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../contracts/docs/src/src/dollar/facets/ManagerFacet.sol/contract.ManagerFacet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.