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

Proposal for Scroll WETH market #97

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions .github/workflows/deploy-market.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- name: Seacrest
uses: hayesgm/seacrest@5748b3a066f517973ca2ca03d0af39bbf2b82d10
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/enact-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- name: Get governance network
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prepare-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- name: Seacrest
uses: hayesgm/seacrest@5748b3a066f517973ca2ca03d0af39bbf2b82d10
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-contract-linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-eslint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-forge-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}

- name: Build Comet with older solc versions
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-gas-profiler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
bases: [ development, mainnet, mainnet-weth, mainnet-usdt, mainnet-wsteth, mainnet-usds, goerli, goerli-weth, sepolia-usdc, sepolia-weth, fuji, mumbai, polygon, polygon-usdt, arbitrum-usdc.e, arbitrum-usdc, arbitrum-weth, arbitrum-usdt, arbitrum-goerli-usdc, arbitrum-goerli-usdc.e, base-usdbc, base-weth, base-usdc, base-aero, base-goerli, base-goerli-weth, linea-goerli, optimism-usdc, optimism-usdt, optimism-weth, mantle-usde, scroll-goerli, scroll-usdc]
bases: [ development, mainnet, mainnet-weth, mainnet-usdt, mainnet-wsteth, mainnet-usds, goerli, goerli-weth, sepolia-usdc, sepolia-weth, fuji, mumbai, polygon, polygon-usdt, arbitrum-usdc.e, arbitrum-usdc, arbitrum-weth, arbitrum-usdt, arbitrum-goerli-usdc, arbitrum-goerli-usdc.e, base-usdbc, base-weth, base-usdc, base-aero, base-goerli, base-goerli-weth, linea-goerli, optimism-usdc, optimism-usdt, optimism-weth, mantle-usde, scroll-goerli, scroll-usdc, scroll-weth]
name: Run scenarios
env:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
Expand All @@ -20,6 +20,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-semgrep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
container:
# A Docker image with Semgrep installed. Do not change this.
image: returntocorp/semgrep
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }}
SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions deployments/mainnet/usdc/relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ export default {
}
}
},
scrollL1ETHGateway: {
delegates: {
field: {
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc'
}
}
},
scrollL1USDCGateway: {
delegates: {
field: {
Expand Down
1 change: 1 addition & 0 deletions deployments/mainnet/usdc/roots.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"mantleL1CrossDomainMessenger": "0x676A795fe6E43C17c668de16730c3F690FEB7120",
"mantleL1StandardBridge": "0x95fC37A27a2f68e3A647CDc081F0A89bb47c3012",
"scrollMessenger": "0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367",
"scrollL1ETHGateway": "0x7F2b8C31F88B6006c382775eea88297Ec1e3E905",
"scrollL1USDCGateway": "0xf1AF3b23DE0A5Ca3CAb7261cb0061C0D779A5c7B"
}
60 changes: 60 additions & 0 deletions deployments/scroll/weth/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "Compound WETH",
"symbol": "cWETHv3",
"baseToken": "WETH",
"baseTokenAddress": "0x5300000000000000000000000000000000000004",
"borrowMin": "0.000001e18",
"pauseGuardian": "0x0747a435b8a60070A7a111D015046d765098e4cc",
"storeFrontPriceFactor": 0.7,
"targetReserves": "5000e18",
"rates": {
"supplyKink": 0.9,
"supplySlopeLow": 0.0216,
"supplySlopeHigh": 1.125,
"supplyBase": 0,
"borrowKink": 0.9,
"borrowSlopeLow": 0.0155,
"borrowSlopeHigh": 1.26,
"borrowBase": 0.01
},
"tracking": {
"indexScale": "1e15",
"baseSupplySpeed": "0e15",
"baseBorrowSpeed": "0e15",
"baseMinForRewards": "1e18"
},
"assets": {
"weETH": {
"address": "0x01f0a31698C4d065659b9bdC21B3610292a1c506",
"decimals": "18",
"borrowCF": 0.9,
"liquidateCF": 0.93,
"liquidationFactor": 0.96,
"supplyCap": "20000e18"
},
"wrsETH": {
"address": "0xa25b25548B4C98B0c7d3d27dcA5D5ca743d68b7F",
"decimals": "18",
"borrowCF": 0.88,
"liquidateCF": 0.91,
"liquidationFactor": 0.96,
"supplyCap": "4000e18"
},
"wstETH": {
"address": "0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32",
"decimals": "18",
"borrowCF": 0.9,
"liquidateCF": 0.93,
"liquidationFactor": 0.97,
"supplyCap": "3000e18"
},
"PufETH": {
"address": "0xc4d46E8402F476F269c379677C99F18E22Ea030e",
"decimals": "18",
"borrowCF": 0.88,
"liquidateCF": 0.91,
"liquidationFactor": 0.95,
"supplyCap": "1000e18"
}
}
}
117 changes: 117 additions & 0 deletions deployments/scroll/weth/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager';
import { DeploySpec, deployComet, exp } from '../../../src/deploy';

export default async function deploy(deploymentManager: DeploymentManager, deploySpec: DeploySpec): Promise<Deployed> {
const trace = deploymentManager.tracer();
const ethers = deploymentManager.hre.ethers;

const weETH = await deploymentManager.existing(
'weETH',
'0x01f0a31698C4d065659b9bdC21B3610292a1c506',
'scroll'
);
const wrsETH = await deploymentManager.existing(
'wrsETH',
'0xa25b25548B4C98B0c7d3d27dcA5D5ca743d68b7F',
'scroll'
);
const wstETH = await deploymentManager.existing(
'wstETH',
'0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32',
'scroll'
);
const pufETH = await deploymentManager.existing(
'PufETH',
'0xc4d46E8402F476F269c379677C99F18E22Ea030e',
'scroll'
);

const COMP = await deploymentManager.existing(
'COMP',
'0x643e160a3C3E2B7eae198f0beB1BfD2441450e86',
'scroll'
);

const WETH = await deploymentManager.existing(
'WETH',
'0x5300000000000000000000000000000000000004',
'scroll'
);

const l2Messenger = await deploymentManager.existing('l2Messenger','0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC','scroll');
const l2ERC20Gateway = await deploymentManager.existing('l2ERC20Gateway','0xE2b4795039517653c5Ae8C2A9BFdd783b48f447A','scroll');
const l2ETHGateway = await deploymentManager.existing('l2ETHGateway', '0x6EA73e05AdC79974B931123675ea8F78FfdacDF0', 'scroll');
const l2WETHGateway = await deploymentManager.existing('l2WETHGateway','0x7003E7B7186f0E6601203b99F7B8DECBfA391cf9','scroll');
const l2WstETHGateway = await deploymentManager.existing('l2WstETHGateway', '0x8aE8f22226B9d789A36AC81474e633f8bE2856c9', 'scroll');

const wethConstantPriceFeed = await deploymentManager.deploy(
'WETH:priceFeed',
'pricefeeds/ConstantPriceFeed.sol',
[
8, // decimals
exp(1, 8) // constantPrice
]
);

const weETHPriceFeed = await deploymentManager.deploy(
'weETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x57bd9E614f542fB3d6FeF2B744f3B813f0cc1258', // weETH / ETH price feed, we treat eETH as 1:1 with ETH
8 // decimals
]
);

const wrsETHPriceFeed = await deploymentManager.deploy(
'wrsETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x3a44916dc37Bb7D73419Fc6492d6d9Dfd8e6ddf7', // wrsETH (same as rsETH) / ETH price feed
8 // decimals
]
);

const wstETHETHPriceFeed = await deploymentManager.deploy(
'wstETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0xE61Da4C909F7d86797a0D06Db63c34f76c9bCBDC', // wstETH / ETH price feed, we treat stETH as 1:1 with ETH
8 // decimals
]
);

const pufETHPriceFeed = await deploymentManager.deploy(
'PufETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x7C6Da2C92caCe9F77274379Dc32a1eEE0B4C5FfD', // pufETH / ETH price feed
8 // decimals
]
);

// Import shared contracts from cUSDCv3 deployment
const cometAdmin = await deploymentManager.fromDep('cometAdmin', 'scroll', 'usdc', true);
const cometFactory = await deploymentManager.fromDep('cometFactory', 'scroll', 'usdc', true);
const $configuratorImpl = await deploymentManager.fromDep('configurator:implementation', 'scroll', 'usdc', true);
const configurator = await deploymentManager.fromDep('configurator', 'scroll', 'usdc', true);
const rewards = await deploymentManager.fromDep('rewards', 'scroll', 'usdc', true);
const bulker = await deploymentManager.fromDep('bulker', 'scroll', 'usdc', true);
const localTimelock = await deploymentManager.fromDep('timelock', 'scroll', 'usdc', true);
const bridgeReceiver = await deploymentManager.fromDep('bridgeReceiver', 'scroll', 'usdc', true);

// Deploy Comet
const deployed = await deployComet(deploymentManager, deploySpec);

return {
...deployed,
bridgeReceiver,
l2Messenger,
l2ERC20Gateway,
l2ETHGateway,
l2WETHGateway,
l2WstETHGateway,
bulker,
rewards,
COMP
};
}
Loading
Loading