Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,39 @@ module.exports = {
},
},
},
plugins: ["@typescript-eslint", "unused-imports", "simple-import-sort", "prettier"],
rules: {
"import/no-extraneous-dependencies": "off",
"no-console": "off",
"import/prefer-default-export": "off",
"unused-imports/no-unused-imports": "error",
"simple-import-sort/imports": [
"warn",
{
groups: [
// Side effect imports
["^\\u0000"],
// React Package(s) comes first as seperate group
["^react(-dom(/client)?)?$"],
// All other imports
["^@?\\w"],
["^((?!\\u0000$)|/.*|$)"],
["^\\."],
// Type imports: keep these last!
["^@?\\w.*\\u0000$"],
["^.*\\u0000$"],
["^\\..*\\u0000$"],
],
},
],
"no-nested-ternary": 1,
"no-await-in-loop": 1,
"no-restricted-syntax": 1,
"@typescript-eslint/dot-notation": 1,
"@typescript-eslint/no-use-before-define": 1,
"@typescript-eslint/no-loop-func": 1,
"@typescript-eslint/no-unused-expressions": 1,
"@typescript-eslint/consistent-type-imports": "error",
"lines-between-class-members": 0,
"prefer-destructuring": [
1,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-sol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-ts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-emissions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-feeders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-governance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-masset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-polygon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-rewards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-savings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.16.1
node-version: 14.19.3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ We publish the contract artifacts to an npm package called [@mstable/protocol](h

### Prerequisites

- Node.js v14.16.1 (you may wish to use [nvm][1])
- [ganache-cli][2]
- Node.js v14.19.3 (you may wish to use [nvm][1])

### Installing dependencies

Expand Down Expand Up @@ -106,7 +105,6 @@ Codebase rules are enforced through a passing [GitHub Actions](https://github.co
<br />

[1]: https://github.com/nvm-sh/nvm
[2]: https://github.com/trufflesuite/ganache-cli

### Command Line Interface

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.18.3",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"ethereum-waffle": "^3.0.0",
"hardhat-abi-exporter": "^2.2.1",
"humanize-duration": "^3.21.0",
Expand Down
5 changes: 3 additions & 2 deletions tasks/SaveWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import "ts-node/register"
import "tsconfig-paths/register"

import { task, types } from "hardhat/config"

import { SaveWrapper__factory } from "../types/generated"
import { getSigner } from "./utils/signerFactory"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
import { getChain, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
import { verifyEtherscan } from "./utils/etherscan"
import { getChain, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"

task("SaveWrapper.deploy", "Deploy a new SaveWrapper")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
Expand Down
8 changes: 4 additions & 4 deletions tasks/bridge.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable no-restricted-syntax */
import { subtask, task, types } from "hardhat/config"

import { IChildToken__factory, IRootChainManager__factory } from "types/generated"
import { simpleToExactAmount } from "@utils/math"
import { ethers } from "ethers"
import { subtask, task, types } from "hardhat/config"
import { IChildToken__factory, IRootChainManager__factory } from "types/generated"

import { logTxDetails } from "./utils"
import { getSigner } from "./utils/signerFactory"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"

subtask("bridge-deposit", "Sends mainnet token to Polygon across Polygon's PoS Bridge")
.addOptionalParam("token", "Symbol of mainnet token that is to be sent. eg MTA or mBTC", "MTA", types.string)
Expand Down
6 changes: 4 additions & 2 deletions tasks/deployBriber.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import "ts-node/register"
import "tsconfig-paths/register"

import { task, types } from "hardhat/config"
import { GaugeBriber__factory, ERC20__factory, SavingsManager__factory } from "types/generated"
import { ERC20__factory, GaugeBriber__factory, SavingsManager__factory } from "types/generated"

import { deployContract } from "./utils/deploy-utils"
import { getSigner } from "./utils/signerFactory"
import { verifyEtherscan } from "./utils/etherscan"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"

task("deploy-GaugeBriber")
.addOptionalParam("speed", "Defender Relayer speed param: 'safeLow' | 'average' | 'fast' | 'fastest'", "fast", types.string)
Expand Down
11 changes: 6 additions & 5 deletions tasks/deployEmissionsController.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import "ts-node/register"
import "tsconfig-paths/register"

import { simpleToExactAmount } from "@utils/math"
import { task, types } from "hardhat/config"
import { MockRootChainManager__factory } from "types/generated"
import { simpleToExactAmount } from "@utils/math"
import { getSigner } from "./utils/signerFactory"

import { deployContract } from "./utils/deploy-utils"
import {
deployBalRewardsForwarder,
deployBasicForwarder,
deployBridgeForwarder,
deployVotiumBribeForwarder,
deployEmissionsController,
deployL2BridgeRecipients,
deployL2EmissionsController,
deployRevenueBuyBack,
deploySplitRevenueBuyBack,
deployBalRewardsForwarder,
deployVotiumBribeForwarder,
} from "./utils/emissions-utils"
import { getChain, resolveAddress } from "./utils/networkAddressFactory"
import { deployContract } from "./utils/deploy-utils"
import { getSigner } from "./utils/signerFactory"
import { Chain } from "./utils/tokens"

task("deploy-emissions-polly", "Deploys L2EmissionsController and L2 Bridge Recipients for Polygon mUSD Vault and FRAX Farm")
Expand Down
22 changes: 10 additions & 12 deletions tasks/deployFeeders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
import "ts-node/register"
import "tsconfig-paths/register"

import { task, types } from "hardhat/config"
import {
FeederPool__factory,
CompoundIntegration__factory,
CompoundIntegration,
AlchemixIntegration,
AlchemixIntegration__factory,
FeederWrapper__factory,
} from "types/generated"
import { simpleToExactAmount } from "@utils/math"
import { ALCX, alUSD, BUSD, CREAM, cyMUSD, GUSD, mUSD, tokens } from "./utils/tokens"
import { task, types } from "hardhat/config"
import { AlchemixIntegration__factory, CompoundIntegration__factory, FeederPool__factory, FeederWrapper__factory } from "types/generated"

import type { AlchemixIntegration, CompoundIntegration } from "types/generated"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
import { getSigner } from "./utils/signerFactory"
import { deployFeederPool, deployVault, FeederData, VaultData } from "./utils/feederUtils"
import { deployFeederPool, deployVault } from "./utils/feederUtils"
import { getChain, getChainAddress, resolveToken } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"
import { ALCX, alUSD, BUSD, CREAM, cyMUSD, GUSD, mUSD, tokens } from "./utils/tokens"


import type { FeederData, VaultData } from "./utils/feederUtils"

task("deployFeederPool", "Deploy Feeder Pool")
.addParam("masset", "Token symbol of mAsset. eg mUSD", "mUSD", types.string)
Expand Down
26 changes: 17 additions & 9 deletions tasks/deployIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,35 @@
import "ts-node/register"
import "tsconfig-paths/register"

import { ZERO_ADDRESS } from "@utils/constants"
import { simpleToExactAmount } from "@utils/math"
import { encodeUniswapPath } from "@utils/peripheral/uniswap"
import { subtask, task, types } from "hardhat/config"
import {
AaveV2Integration,
AaveV2Integration__factory,
DelayedProxyAdmin__factory,
Liquidator,
Liquidator__factory,
Masset__factory,
PAaveIntegration,
PAaveIntegration__factory,
Unliquidator,
Unliquidator__factory,
} from "types/generated"
import { simpleToExactAmount } from "@utils/math"
import { encodeUniswapPath } from "@utils/peripheral/uniswap"
import { ZERO_ADDRESS } from "@utils/constants"

import type { AaveV2Integration, Liquidator, PAaveIntegration, Unliquidator } from "types/generated"
import { deployContract, logTxDetails } from "./utils/deploy-utils"
import { AAVE, ALCX, Chain, COMP, stkAAVE, tokens } from "./utils/tokens"
import { verifyEtherscan } from "./utils/etherscan"
import { getChain, getChainAddress, resolveAddress, resolveToken } from "./utils/networkAddressFactory"
import { getSigner } from "./utils/signerFactory"
import { verifyEtherscan } from "./utils/etherscan"
import { AAVE, ALCX, Chain, COMP, stkAAVE, tokens } from "./utils/tokens"











task("integration-aave-deploy", "Deploys an instance of AaveV2Integration contract")
.addParam(
Expand Down
2 changes: 1 addition & 1 deletion tasks/deployMV3.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import "ts-node/register"
import "tsconfig-paths/register"

import { task } from "hardhat/config"
import { DEAD_ADDRESS } from "@utils/constants"
import { simpleToExactAmount } from "@utils/math"
import { task } from "hardhat/config"

const defaultConfig = {
a: 120,
Expand Down
26 changes: 12 additions & 14 deletions tasks/deployMbtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@
import "ts-node/register"
import "tsconfig-paths/register"

import { btcBassets, startingCap, config, mBtcName, mBtcSymbol, DeployedBasset } from "@utils/btcConstants"
import { btcBassets, config, mBtcName, mBtcSymbol, startingCap } from "@utils/btcConstants"
import { DEAD_ADDRESS, ZERO_ADDRESS } from "@utils/constants"
import { Signer } from "ethers"
import { task } from "hardhat/config"
import { BN, simpleToExactAmount } from "@utils/math"
import { formatEther } from "ethers/lib/utils"
import { task } from "hardhat/config"
import {
SavingsContract,
Masset,
AssetProxy__factory,
MockERC20,
MockERC20__factory,
MockInitializableToken__factory,
SavingsContract__factory,
BoostDirector__factory,
BoostedVault__factory,
BoostedVault,
ERC20__factory,
SaveWrapper__factory,
MockERC20__factory,
MockInitializableToken__factory,
RenWrapper__factory,
BoostDirector__factory,
IERC20Metadata,
SaveWrapper__factory,
SavingsContract__factory,
Unwrapper__factory,
} from "types/generated"
import { simpleToExactAmount, BN } from "@utils/math"

import type { DeployedBasset } from "@utils/btcConstants"
import type { Signer } from "ethers"
import type { BoostedVault, IERC20Metadata, Masset, MockERC20, SavingsContract } from "types/generated"

interface CommonAddresses {
mta: string
Expand Down
Loading