-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from teller-protocol/zk-cra/market-handler
market handler merge into cra
- Loading branch information
Showing
202 changed files
with
190,131 additions
and
4,871 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
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
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,36 @@ | ||
name: Compile & Run Smart Contract Unit Tests | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Build Project - Polygon | ||
runs-on: ubuntu-latest | ||
environment: testing-keys | ||
env: | ||
MNEMONIC_KEY: ${{ secrets.MNEMONIC_KEY }} | ||
ALCHEMY_MAINNET_KEY: ${{ secrets.ALCHEMY_MAINNET_KEY }} | ||
ALCHEMY_RINKEBY_KEY: ${{ secrets.ALCHEMY_RINKEBY_KEY }} | ||
ALCHEMY_ROPSTEN_KEY: ${{ secrets.ALCHEMY_ROPSTEN_KEY }} | ||
ALCHEMY_KOVAN_KEY: ${{ secrets.ALCHEMY_KOVAN_KEY }} | ||
MATIC_MAINNET_KEY: ${{ secrets.MATIC_MAINNET_KEY }} | ||
MATIC_MUMBAI_KEY: ${{ secrets.MATIC_MUMBAI_KEY }} | ||
INFURA_KEY: ${{ secrets.INFURA_KEY }} | ||
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} | ||
CMC_KEY: ${{ secrets.CMC_KEY }} | ||
GAS_PRICE_GWEI_KEY: 20 | ||
GAS_WEI_KEY: 2500000 | ||
ADDRESS_COUNT_KEY: 20 | ||
DEFAULT_ADDRESS_INDEX_KEY: 0 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
registry-url: 'https://registry.npmjs.org/' | ||
- name: Install dependencies - Polygon | ||
run: | | ||
yarn --network-concurrency 1 | ||
- name: Compiling and Executing Tests - Polygon | ||
run: | | ||
yarn test polygon |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"func-visibility": ["warn", { "ignoreConstructors": true }], | ||
"check-send-result": "warn", | ||
"reentrancy": "warn", | ||
"quotes": "error", | ||
"compiler-version": "off", | ||
"contract-name-camelcase": "off", | ||
"no-empty-blocks": "off", | ||
"func-name-mixedcase": "off", | ||
"func-visibility": ["warn", { "ignoreConstructors": true }], | ||
"max-line-length": ["warn", 120], | ||
"no-empty-blocks": "off", | ||
"no-inline-assembly": "off", | ||
"prettier/prettier": "warn", | ||
"quotes": "error", | ||
"reentrancy": "warn", | ||
"var-name-mixedcase": "off" | ||
}, | ||
"plugins": ["prettier"] | ||
} | ||
} |
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 |
---|---|---|
@@ -1,53 +1,120 @@ | ||
import { AssetSettings } from '../types/custom/config-types' | ||
import { AssetType } from '../utils/consts' | ||
|
||
const mainnetAssetSettings: AssetSettings = { | ||
DAI: [ | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Address }, | ||
{ key: 'aToken', value: 'ADAI', type: AssetType.Address }, | ||
{ key: 'yVault', value: 'YDAI', type: AssetType.Address }, | ||
{ key: 'pPool', value: 'PCDAI', type: AssetType.Address }, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 10000000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDC: [{ key: 'cToken', value: 'CUSDC', type: AssetType.Address }], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Address }], | ||
} | ||
|
||
export const assetSettings: Record<string, AssetSettings> = { | ||
kovan: { | ||
DAI: [ | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Address }, | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Token }, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 100000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDC: [{ key: 'cToken', value: 'CUSDC', type: AssetType.Address }], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Address }], | ||
USDC: [{ key: 'cToken', value: 'CUSDC', type: AssetType.Token }], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Token }], | ||
}, | ||
rinkeby: { | ||
DAI: [ | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Address }, | ||
{ key: 'pPool', value: 'PCDAI', type: AssetType.Address }, | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Token }, | ||
{ | ||
key: 'pPool', | ||
value: '0x4706856FA8Bb747D50b4EF8547FE51Ab5Edc4Ac2', | ||
type: AssetType.Address, | ||
}, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 100000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDC: [{ key: 'cToken', value: 'CUSDC', type: AssetType.Address }], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Address }], | ||
USDC: [ | ||
{ key: 'cToken', value: 'CUSDC', type: AssetType.Token }, | ||
{ | ||
key: 'pPool', | ||
value: '0xde5275536231eCa2Dd506B9ccD73C028e16a9a32', | ||
type: AssetType.Address, | ||
}, | ||
], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Token }], | ||
}, | ||
ropsten: { | ||
DAI: [ | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Address }, | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Token }, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 100000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDC: [{ key: 'cToken', value: 'CUSDC', type: AssetType.Address }], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Address }], | ||
USDC: [{ key: 'cToken', value: 'CUSDC', type: AssetType.Token }], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Token }], | ||
}, | ||
mainnet: { | ||
DAI: [ | ||
{ key: 'cToken', value: 'CDAI', type: AssetType.Token }, | ||
{ key: 'aToken', value: 'ADAI', type: AssetType.Token }, | ||
{ key: 'yVault', value: 'YDAI', type: AssetType.Token }, | ||
{ | ||
key: 'pPool', | ||
value: '0xEBfb47A7ad0FD6e57323C8A42B2E5A6a4F68fc1a', | ||
type: AssetType.Address, | ||
}, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 10000000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDT: [ | ||
{ key: 'cToken', value: 'CUSDT', type: AssetType.Token }, | ||
{ key: 'aToken', value: 'AUSDT', type: AssetType.Token }, | ||
{ key: 'yVault', value: 'YUSDT', type: AssetType.Token }, | ||
{ | ||
key: 'pPool', | ||
value: '0x481f1BA81f7C01400831DfF18215961C3530D118', | ||
type: AssetType.Address, | ||
}, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 10000000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDC: [ | ||
{ key: 'cToken', value: 'CUSDC', type: AssetType.Token }, | ||
{ | ||
key: 'pPool', | ||
value: '0xde9ec95d7708b8319ccca4b8bc92c0a3b70bf416', | ||
type: AssetType.Address, | ||
}, | ||
], | ||
WETH: [{ key: 'cToken', value: 'CETH', type: AssetType.Token }], | ||
}, | ||
polygon: { | ||
DAI: [ | ||
{ key: 'aToken', value: 'ADAI', type: AssetType.Token }, | ||
{ | ||
key: 'pPool', | ||
value: '0xFECFa775643eb8C0F755491Ba4569e501764DA51', | ||
type: AssetType.Address, | ||
}, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 10000000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDT: [ | ||
{ key: 'aToken', value: 'AUSDT', type: AssetType.Token }, | ||
{ | ||
key: 'pPool', | ||
value: '0x887E17D791Dcb44BfdDa3023D26F7a04Ca9C7EF4', | ||
type: AssetType.Address, | ||
}, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 10000000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDC: [{ key: 'aToken', value: 'AUSDC', type: AssetType.Token }], | ||
WETH: [{ key: 'aToken', value: 'AETH', type: AssetType.Token }], | ||
}, | ||
polygon_mumbai: { | ||
DAI: [ | ||
{ key: 'aToken', value: 'ADAI', type: AssetType.Token }, | ||
{ key: 'MaxLoanAmount', value: 25000, type: AssetType.Amount }, | ||
{ key: 'MaxTVL', value: 10000000, type: AssetType.Amount }, | ||
{ key: 'MaxDebtRatio', value: 5000, type: AssetType.Uint }, | ||
], | ||
USDC: [{ key: 'aToken', value: 'AUSDC', type: AssetType.Token }], | ||
WETH: [{ key: 'aToken', value: 'AETH', type: AssetType.Token }], | ||
}, | ||
hardhat: mainnetAssetSettings, | ||
localhost: mainnetAssetSettings, | ||
mainnet: mainnetAssetSettings, | ||
} |
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
Oops, something went wrong.