Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge a bunch o' shit #1

Merged
merged 44 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6b3bfbe
Delete contracts directory
CBobRobison Feb 18, 2021
963da1f
Create fees.sol
CBobRobison Feb 18, 2021
76e808c
Add files via upload
CBobRobison Feb 18, 2021
698097c
Delete fees.sol
CBobRobison Feb 18, 2021
5d6d5c5
Add files via upload
CBobRobison Feb 19, 2021
afccd83
Add files via upload
CBobRobison Feb 19, 2021
e62e44d
Fix: changes from 2.18 meeting
Feb 19, 2021
1fb7a45
Add: canMigrate()
Feb 19, 2021
8c21ca4
Change a bunch of stuff
Feb 19, 2021
4a9e499
Fix: calculateMintReturnFromZero(). still need to validate code
Feb 25, 2021
99465f4
Add: calculateFee(), calculateLockedReturn()
Feb 25, 2021
56237c4
Fix: remove safemath and make functions private
Feb 25, 2021
bddedba
Fix: OZ imports
Feb 26, 2021
5c538da
Add: Power.sol
Feb 26, 2021
c49b0dd
Fix: remove EXAMPLE naming
Feb 27, 2021
2c9da2e
Add: contracts/utils dir
Feb 27, 2021
85ace84
Fix: indentation and remove initializable
Feb 27, 2021
01a0869
Add: shell Vault_singleAsset
Feb 27, 2021
14f935c
Changed a bunch of stuff
Feb 27, 2021
7a58906
Add: _calculateWeightedAmount()
Mar 3, 2021
1ead537
Fix: calculate argument order
Mar 3, 2021
8385683
Add: calculateFee() and calculateLockedReturn()
Mar 3, 2021
7008826
Added fees struct and merged admin.sol from main
CBobRobison Mar 5, 2021
194146b
added tabs
CBobRobison Mar 5, 2021
966afb5
Directory
CBobRobison Mar 5, 2021
156dc0f
Add feeRecipient
CBobRobison Mar 5, 2021
9b47933
Fix: do a bunch of shit
Mar 5, 2021
4e4ea7f
Updates
CBobRobison Mar 5, 2021
3ee94af
Fix: turn variables private
Mar 5, 2021
b421a63
Create: Interfaces dir
Mar 5, 2021
cfb8713
Fix: normalize struct nomeclature
Mar 5, 2021
658056b
Save changes
Mar 5, 2021
ca3c5b0
Fix: mint()
Mar 8, 2021
d851a8f
Push changes
Mar 9, 2021
368e782
Fix: vault shit
Mar 10, 2021
73a12e5
03.12.21 shit
Mar 12, 2021
f793f13
Add: encoding for vaults
Mar 15, 2021
274a5ea
Fix: add approved usage and curve registry
Mar 17, 2021
7f25d5d
Refactor: directories
Mar 21, 2021
3f6bd6a
Refactor: curves and imports
Mar 21, 2021
0e8a411
Fix: approved mappings
Mar 21, 2021
6d5279b
Add: register & deactivate funcs for formula & values
Mar 21, 2021
1c3a428
Refactor: rename values => valueSet
Mar 21, 2021
0981ce4
Add: interfaces
Mar 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions contracts/AdditionalContractExamples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Example Additional Contracts
An inventory of various contracts that can be deployed and managed via governance

## Curve Options

Formulas | Values
---------------------- | -----------------------------
BancorZeroFormula.sol | BancorZeroValues.sol
SigmoidalFormula.sol | SigmoidalValues.sol
StepwiseFormula.sol | StepwiseValues.sol

## Vault Options

Vaults | Factories
---------------------- | -----------------------------
Vault_ETH.sol | VaultFactory_ETH.sol
Vault_SingleAsset.sol | VaultFactory_SingleAsset.sol
Vault_Balancer.sol | VaultFactory_Balancer.sol
Vault_Yield.sol | VaultFactory_Yeild.sol

## MigrationVaults

From | To
---------------------- | -----------------------------
Vault_ETH.sol | Vault_ETH.sol
Vault_ETH.sol | Vault_SingleAsset.sol
Vault_ETH.sol | Vault_Balancer.sol
Vault_ETH.sol | Vault_Yield.sol
---------------------- | ----------------------
Vault_SingleAsset.sol | Vault_ETH.sol
Vault_SingleAsset.sol | Vault_SingleAsset.sol
Vault_SingleAsset.sol | Vault_Balancer.sol
Vault_SingleAsset.sol | Vault_Yield.sol
---------------------- | ----------------------
Vault_Balancer.sol | Vault_ETH.sol
Vault_Balancer.sol | Vault_SingleAsset.sol
Vault_Balancer.sol | Vault_Balancer.sol
Vault_Balancer.sol | Vault_Yield.sol
---------------------- | ----------------------
Vault_Yield.sol | Vault_ETH.sol
Vault_Yield.sol | Vault_SingleAsset.sol
Vault_Yield.sol | Vault_Balancer.sol
Vault_Yield.sol | Vault_Yield.sol
109 changes: 0 additions & 109 deletions contracts/Admin.sol

This file was deleted.

94 changes: 0 additions & 94 deletions contracts/Curve.sol

This file was deleted.

128 changes: 128 additions & 0 deletions contracts/Fees.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
pragma solidity ^0.8.0;

contract Fees {

// NOTE: this will be the DAO
modifier onlyOwner() {
require(msg.sender == owner);
_;
}

event SetMintFee(uint256 rate);
event SetBurnBuyerFee(uint256 rate);
event SetBurnOwnerFee(uint256 rate);
event SetTransferFee(uint256 rate);
event SetInterestFee(uint256 rate);
event SetYieldFee(uint256 rate);
event SetOwner(address owner);
event SetFeeRecipient(address recipient);

uint256 private FEE_MAX = 10**18;
/// @dev for when a meToken is minted
uint256 private _mintFee;
/// @dev for when a meToken is burned by non-owner
uint256 private _burnBuyerFee;
/// @dev for when a meToken is burned by owner
uint256 private _burnOwnerFee;
/// @dev for when a meToken is transferred
uint256 private _transferFee;
/// @dev Generated from interest on collateral
uint256 private _interestFee;
/// @dev Generated from liquidity mining
uint256 private _yieldFee;

address public owner;
address public feeRecipient;

constructor(
address owner_,
uint256 mintFee_
uint256 burnBuyerFee_
uint256 burnOwnerFee_
uint256 transferFee_
uint256 interestFee_
uint256 yieldFee_
) public {
owner = owner_;
_mintFee = mintFee_;
_burnBuyerFee = burnBuyerFee_;
_burnOwnerFee = burnOwnerFee_;
_transferFee = transferFee_;
_interestFee = interestFee_;
_yieldFee = yieldFee_;
}

function setMintFee(uint256 amount) external onlyOwner {
require(amount != _mintFee && amount < FEE_MAX, "out of range");
_mintFee = amount;
emit SetMintFee(amount);
}

function setBurnBuyerFee(uint256 amount) external onlyOwner {
require(amount != _burnBuyerFee && amount < FEE_MAX, "out of range");
_burnBuyerFee = amount;
emit SetBurnBuyerFee(amount);
}

function setBurnOwnerFee(uint256 amount) external onlyOwner {
require(amount != _burnOwnerFee && amount < FEE_MAX, "out of range");
_burnOwnerFee = amount;
emit SetBurnOwnerFee(amount);
}

function setTransferFee(uint256 amount) external onlyOwner {
require(amount != _burnOwnerFee && amount < FEE_MAX, "out of range");
_transferFee = amount;
emit SetTransferFee(amount);
}

function setInterestFee(uint256 amount) external onlyOwner {
require(amount != _interestFee && amount < FEE_MAX, "out of range");
_interestFee = amount;
emit SetInterestFee(amount);
}

function setYieldFee(uint256 amount) external onlyOwner {
require(amount != _yieldFee && amount < FEE_MAX, "out of range");
_yieldFee = amount;
emit SetYieldFee(amount);
}

function setOwner(address _owner) external onlyOwner {
require(_owner != owner, "_owner == owner");
owner = _owner;
emit SetOwner(_owner);
}

function setFeeRecipient(address _recipient) onlyOwner {
require(feeRecipient != _recipient, "feeRecipient == _recipient");
feeRecipient = _recipient;
emit SetFeeRecipient(_recipient);
}

function mintFee() public view returns (uint256) {
return _mintFee;
}

function burnBuyerFee() public view returns (uint256) {
return _burnBuyerFee;
}

function burnOwnerFee() public view returns (uint256) {
return _burnOwnerFee;
}

function transferFee() public view returns (uint256) {
return _transferFee;
}

function interestFee() public view returns (uint256) {
return _interestFee;
}

function yieldFee() public view returns (uint256) {
return _yieldFee;
}


}
Loading