mstable / mstable-contracts Goto Github PK
View Code? Open in Web Editor NEW📃 Smart Contracts that make up the core of the mStable protocol
License: GNU Affero General Public License v3.0
📃 Smart Contracts that make up the core of the mStable protocol
License: GNU Affero General Public License v3.0
Is your feature request related to a problem? Please describe.
The mAssets in mStable SAVE contracts (SavingsContract.sol) are deposited to produce imAssets
. This collateral can be recycled to produce additional yield by adding an IConnector
to the contract. Currently there is no active IConnector
on mUSD SAVE.
Currently there exists a market on Cream Finance's Iron Bank (https://creamdotfinance.medium.com/introducing-the-iron-bank-bab9417c9a) that could act as a lending market for mUSD. In addition, there is an active proposal for mUSD to be listed on Aave as a market.
Describe the solution you'd like
The solution:
IConnector
interface for mUSD
that deposits the collateral to Creams Iron Bank (https://v1.yearn.finance/lending) and tracks the interest generatedAdditional context
There are a number of properties that must be fulfilled here. See the IConnector
interface for more details, or the _poke
function in SavingsContract.sol
, or take a look at some of the example connectors in z_mocks/savings
.
I'm getting the following error when deploying the contracts with yarn migrate
to a local network with ganache:
yarn run v1.22.4
$ truffle migrate --network development --reset
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'development'
> Network id: 5777
> Block gas limit: 6721975 (0x6691b7)
1_main.js
=========
/home/gus/Projects/mstable/mStable-contracts/node_modules/ts-node/dist/index.js:175
throw error;
^
TSError: ⨯ Unable to compile TypeScript:
migrations/src/1_initial_migration.ts:9:20 - error TS2503: Cannot find namespace 'Truffle'.
9 artifacts: Truffle.Artifacts;
~~~~~~~
migrations/src/1_initial_migration.ts:2:22 - error TS6053: File '/home/gus/Projects/mstable/mStable-contracts/types/generated/index.d.ts' not found.
2 /// <reference path="../../types/generated/index.d.ts" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
migrations/src/1_initial_migration.ts:3:22 - error TS6053: File '/home/gus/Projects/mstable/mStable-contracts/types/generated/types.d.ts' not found.
3 /// <reference path="../../types/generated/types.d.ts" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at createTSError (/home/gus/Projects/mstable/mStable-contracts/node_modules/ts-node/src/index.ts:245:12)
at reportTSError (/home/gus/Projects/mstable/mStable-contracts/node_modules/ts-node/src/index.ts:249:19)
at getOutput (/home/gus/Projects/mstable/mStable-contracts/node_modules/ts-node/src/index.ts:357:34)
at Object.compile (/home/gus/Projects/mstable/mStable-contracts/node_modules/ts-node/src/index.ts:415:32)
at Module.m._compile (/home/gus/Projects/mstable/mStable-contracts/node_modules/ts-node/src/index.ts:493:43)
at Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Object.require.extensions.<computed> [as .ts] (/home/gus/Projects/mstable/mStable-contracts/node_modules/ts-node/src/index.ts:496:12)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at require (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/require/require.js:54:1)
at /home/gus/Projects/mstable/mStable-contracts/migrations/1_main.js:4:26
at Script.runInContext (vm.js:131:20)
at Script.runInNewContext (vm.js:137:17)
at Object.file (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/require/require.js:92:1)
at Migration._load (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/migrate/migration.js:43:1)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Migration.run (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/migrate/migration.js:167:1)
at Object.runMigrations (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/migrate/index.js:148:1)
at Object.runFrom (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:253:1)
at /home/gus/Projects/mstable/mStable-contracts/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:218:1
Truffle v5.1.22 (core: 5.1.22)
Node v12.18.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I'm executing the instructions presented on Readme
, and wasn't able to find any truffle
or typescript
issues regarding it not finding the namespace. Also, the types generated in the initial migration
are not found, am I missing something?
Thanks in advance
Is your feature request related to a problem? Please describe.
Run yarn compile
and you will see a LOT of yellow warning text show up. Some of these are very very minor, some can potentially come into a larger issue.
Describe the solution you'd like
Resolve all of these warnings by modifying the solidity code, or add rules to the compiler to dismiss them, such that we have no warnings left when compilation happens.
Additional context
There is no real reason to receive warnings for the contracts in z_mocks
since they are unused - these can simply be turned off.
Is your feature request related to a problem? Please describe.
Recently this repo was ported from solc 0.5.16 to 0.8.x, and truffle/web3.js to hardhat/ethers.js.
There are a number of contracts that have not yet been migrated, and will be used in future product releases.
Describe the solution you'd like
This issue proposes that the IncentivisedVotingLockup.sol
is ported from master
to master-v2
. This includes:
This is the implementation of RPF Stake BPT staked in mStable into Balancer Staking contracts on the mStable Forum.
Details are documented in MCCP 21.
Is your feature request related to a problem? Please describe.
Users wish to deploy their own feeder pools permissionlessly
Describe the solution you'd like
Factory contract with configurable parameters to deploy feeder pools, and test cases to support this
Is your feature request related to a problem? Please describe.
Recently this repo was ported from solc 0.5.16 to 0.8.x, and truffle/web3.js to hardhat/ethers.js.
There are a number of contracts that have not yet been migrated, and will be used in future product releases.
Describe the solution you'd like
This issue proposes that the Liquidator.sol
is ported from master
to master-v2
. This includes:
I guess this issue is more for the backlog, but it would be nice to have an instance running on the rinkeby test network.
Is your feature request related to a problem? Please describe.
mStable plan to introduce a number of mAssets and feeder pools this year. Both of these deploy scripts are specific and should be made generic to support n deployments.
Describe the solution you'd like
Fork the existing deployMBTC hardhat task and make a generic deployment script for mAssets
Extra context
At a simple level, most of the "mBTC specific" things in the current deploy script are superficial. Only the mainnet deploy and re-deployment scripts have specific info in them - they may benefit from additional arguments to use for the pools deployment.
Is your feature request related to a problem? Please describe.
Recently this repo was ported from solc 0.5.16 to 0.8.x, and truffle/web3.js to hardhat/ethers.js.
There are a number of contracts that have not yet been migrated, and will be used in future product releases.
Describe the solution you'd like
This issue proposes that the SavingsManager.sol
is ported from master
to master-v2
. This includes:
Is your feature request related to a problem? Please describe.
Allow KeeperDAO keepers to arbitrage the AMM (mAsset). In order to give KeeperDAO an edge and to allow them to reach arbitrage price first, set fees to 0 for KeeperDAO keepers. Only whitelisted keepers can call the special function to bypass the fee.
Describe the solution you'd like
Relevant contracts:
mStable-contracts/Masset.sol at master · mstable/mStable-contracts · GitHub mStable-contracts/MassetLogic.sol at master · mstable/mStable-contracts · GitHub
Additional context
More info: https://forum.mstable.org/t/rfc-explore-a-keeperdao-coordination-facility-for-mstable-amm/798/9
Pass Criteria
Is your feature request related to a problem? Please describe.
There are a number of typescript errors dotted around the codebase, for example in test-utils/math.ts
(or most of the test-utils
folder)
Describe the solution you'd like
Clean out the test
and test-utils
folders, as well as any root level files, that have:
MIP 26 vote was passed. We should stop liquidating COMP and stkAave rewards. A contract to claim and send the rewards to the Treasury is specified in https://mips.mstable.org/MIPS/mip-26.html
Liquidator
module in the Nexus to new Unliquidator contractLiquidator
moduleIs your feature request related to a problem? Please describe.
Recently this repo was ported from solc 0.5.16 to 0.8.x, and truffle/web3.js to hardhat/ethers.js.
There are a number of contracts that have not yet been migrated, and will be used in future product releases.
Describe the solution you'd like
This issue proposes that the Nexus.sol
is ported from master
to master-v2
. This includes:
Test Body
Is your feature request related to a problem? Please describe.
It would be good to be able to have double incentives on mStable. Consider the scenario in which Protocol X is incentivising liquidity of a given token Y (through a contract like StakingRewards.sol), and mStable also wish to incentivise this token Y. It would be good to wrap X's rewards contract with a contract Z, to offer both tokens in one.
Describe the solution you'd like
A contract written that forks from the existing StakingRewards.sol
, and facilitates the ability to wrap another rewards contract. Each time a user deposits or withdraws (i.e. in updateReward
) all tokens that were accrued in the underlying contract would be collected and then factored into the reward distribution.
For example, if 100 tokens were received from X, you would need to then distribute this amount between the participants in Z between now and the time of the previous collection. This would introduce a second layer of accounting in the contract.
Probably, should be set to redemptionFee
mStable-contracts/contracts/masset/Masset.sol
Line 543 in d4c3001
topLineEmission
in the EmissionController.sol to reflect the linear emissions function: https://forum.mstable.org/t/mccp-24-reduce-weekly-mta-emissions/912Is your feature request related to a problem? Please describe.
Recently this repo was ported from solc 0.5.16 to 0.8.x, and truffle/web3.js to hardhat/ethers.js.
There are a number of contracts that have not yet been migrated, and will be used in future product releases.
Describe the solution you'd like
This issue proposes that the StakingRewards.sol
is ported from master
to master-v2
. This includes:
Is your feature request related to a problem? Please describe.
Recently this repo was ported from solc 0.5.16 to 0.8.x, and truffle/web3.js to hardhat/ethers.js.
There are a number of contracts that have not yet been migrated, and will be used in future product releases.
Describe the solution you'd like
This issue proposes that the RewardsDistributor.sol
is ported from master
to master-v2
. This includes:
How can we help?
I suggest adding issues to the repo for devs that could be interested to help on the project and tag the one that are good for beginners with good first issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.