Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-ubik committed Aug 28, 2020
1 parent c042df3 commit 0f92f3a
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 36 deletions.
2 changes: 1 addition & 1 deletion contracts/stableCoin/microservices/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

interface IERC20 {
function mint(uint256 amount) external;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

interface IMVDFunctionalitiesManager {
function isAuthorizedFunctionality(address functionality) external view returns (bool);
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/microservices/IMVDProxy.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

interface IMVDProxy {
function getToken() external view returns (address);
Expand Down
4 changes: 3 additions & 1 deletion contracts/stableCoin/microservices/IStateHolder.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pragma solidity ^0.6.0;
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

interface IStateHolder {
function clear(string calldata varName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

import "./IERC20.sol";
import "./IMVDFunctionalitiesManager.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/Address.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

/**
* @dev Collection of functions related to the address type
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/Context.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

/**
* @dev Provides information about the current execution context, including the
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/ERC20.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

import "./Context.sol";
import "./IERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/IDoubleProxy.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

// DOCUMENT
interface IDoubleProxy {
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

/**
* @dev Interface of the ERC20 standard as defined in the EIP.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

// DOCUMENT
interface IMVDFunctionalitiesManager {
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/IMVDProxy.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

// DOCUMENT
interface IMVDProxy {
Expand Down
38 changes: 22 additions & 16 deletions contracts/stableCoin/standalone/IStableCoin.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

/**
* @title Interface for the "uSD" AKA "uniswap State Dollar", Unifi stablecoin.
* @dev Define the interface for the usD
* @title Interface for the $uSD aka unified Stable Dollar.
* @dev Define the interface for the $usD
*
* The core idea behind Unified Stable Coin is to implement a stable coin collateralized by pools of whitelisted
* stable coins on UniSwap. By hedging across several pools and implementing simple yet effective
* rebalancing schemes, $uSD is able reduce an holder exposure to a stable-coin failure.
*
*/
interface IStableCoin {
/**
Expand All @@ -14,7 +19,7 @@ interface IStableCoin {
* @param symbol ticker for the StableCoin ERC20 token
* @param doubleProxy address for the DoubleProxy
* @param allowedPairs array of Uniswap Pairs to be set as whitelisted source tokens
* @param rebalanceRewardMultiplier multiplier used to compute how many unifi tokens to mint during uSD rebalance
* @param rebalanceRewardMultiplier multiplier used to compute how many unifi tokens to mint during $uSD rebalance
* @param timeWindows time windows inside which some time-delimited operations can be performed
* @param mintables max amount of mintables inside a timeWindow
*/
Expand Down Expand Up @@ -81,17 +86,17 @@ interface IStableCoin {
/**
* @dev Compute the reward of the rebalanceByDebt() operation.
*
* @param burnt amount of of uSD burnt
* @param burnt amount of of $uSD burnt
*/
function calculateRebalanceByDebtReward(uint256 burnt) external view returns (uint256 reward);

/**
* @dev Convert from one of the allowed whitelisted tokens to uSD
* @dev Convert from one of the allowed whitelisted tokens to $uSD
*
* @param tokenAddress Address of the token to convert
* @param amount Amount of Unifi token to be converted
*
* @return Amount of uSD tokens
* @return Amount of $uSD tokens
*/
function fromTokenToStable(address tokenAddress, uint256 amount)
external
Expand All @@ -100,7 +105,7 @@ interface IStableCoin {

/**
* Mint logic of the StableCoin.
* @dev Mint the uSD token
* @dev Mint the $uSD token
*
* @param pairIndex Index of the pair inside the allowedPairs array
* @param amountA The amount of tokenA to add as liquidity if the B/A price is <=
Expand All @@ -112,7 +117,7 @@ interface IStableCoin {
* @param amountBMin Bounds the extent to which the A/B price can go up before the transaction reverts.
* Must be <= amountBDesired
*
* @return Amount of freshly minted uSD token
* @return Amount of freshly minted $uSD token
*/
function mint(
uint256 pairIndex,
Expand All @@ -124,7 +129,7 @@ interface IStableCoin {

/**
* Mint logic of the StableCoin.
* @dev Mint the uSD token
* @dev Mint the $uSD token
*
* @param pairIndex Index of the pair inside the allowedPairs array
* @param amountAMin The minimum amount of tokenA that must be received for the transaction not to revert
Expand All @@ -142,8 +147,8 @@ interface IStableCoin {
) external returns (uint256 amountA, uint256 amountB);

/**
* @dev Rebalance by Credit is triggered when the total amount of source tokens' value is greater
* than uSD circulating supply. Rebalancing is done by withdrawing the excess from the pool.
* @dev Rebalance by Credit is triggered when the total amount of source tokens' is greater
* than $uSD circulating supply. Rebalancing is done by withdrawing the excess from the pool.
*
* @notice Positive imbalances can be caused by the accrual of liquidity provider fee. Withdrawn tokens
* are stored inside the Unifi DFO as a source of long-term value
Expand All @@ -156,11 +161,12 @@ interface IStableCoin {
) external returns (uint256 redeemed);

/**
* @dev Rebalance by Credit is triggered when the total amount of source tokens' value is greater
* than uSD circulating supply. Rebalancing is done by withdrawing the excess from the pool.
* @dev Rebalance by Debt is triggered when the total amount of source tokens' is lesser
* than $uSD circulating supply. Rebalancing is done by minting new equity ($unifi) at premium
* in exchange for burning $uSD.
*
* @notice Positive imbalances can be caused by the accrual of liquidity provider fee. Withdrawn tokens
* are stored inside the Unifi DFO as a source of long-term value
* @notice Negative imbalances can be caused by the failure of a Stable Coin in one of the whitelisted
* source pairs.
*/
function rebalanceByDebt(uint256 amount) external returns (uint256);
}
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/IStateHolder.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

// DOCUMENT
interface IStateHolder {
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/IUniswapV2Pair.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

// DOCUMENT
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/IUniswapV2Router.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

/**
* @title Uniswap V2 Router
Expand Down
2 changes: 1 addition & 1 deletion contracts/stableCoin/standalone/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
Expand Down
4 changes: 2 additions & 2 deletions contracts/stableCoin/standalone/StableCoin.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma solidity ^0.7.0;

import "./ERC20.sol";
import "./IStableCoin.sol";
Expand All @@ -13,7 +13,7 @@ import "./IUniswapV2Router.sol";

/**
* @title StableCoin
* @dev Contract for the "uSD" Stable Coin.
* @dev Contract for the $uSD Stable Coin.
* It's an ERC20 token extended with the IStableCoin interface and DFO protocol magic.
*/
contract StableCoin is ERC20, IStableCoin {
Expand Down
2 changes: 1 addition & 1 deletion docs/to_lowercase.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/bash

sed -i -E 's/(\(#.*)/\L\1\E/g' md-build/stableCoin/**/*.md
sed -i -E 's/((#.*)/L1E/g' md-build/stableCoin/**/*.md
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"docs:build": "yarn docs:docgen && yarn docs:mkdocs:build",
"docs:clean": "rm -r docs/{md-build,build}",
"docs:serve": "yarn docs:docgen && yarn docs:mkdocs:serve",
"docs:docgen": "cd docs && solidity-docgen -i ../contracts -o md-build -t solidity-docgen-templates && cp ../*.md md-build",
"docs:docgen": "cd docs && solidity-docgen -i ../contracts -o md-build -t solidity-docgen-templates && cp ../*.md md-build && ./to_lowercase.sh",
"docs:mkdocs:build": "cd docs && mkdocs build",
"docs:mkdocs:serve": "yarn docs:docgen && cd docs && mkdocs serve"
}
Expand Down

0 comments on commit 0f92f3a

Please sign in to comment.