-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add USDC market on Scroll mainnet (#824)
* debug * update price feed * update config * temp workaround * add scroll to scenarios * uncomment spider debug messages * add scroll relations * catch failed spider crawls * Fix spider for scroll * update bridge receiver to be compatible with scroll bridge * update relations * Modified deployment roots from GitHub Actions * remove console.log * rename scroll messenger * add scroll to governance scenarios * adapt scroll relay message fn * fix unit tests * rename contracts and update message relaying * update scroll testnet block explorer URL * remove base fee * fix scroll l2 sender address * remove old roots * fix type errors * Modified deployment roots from GitHub Actions * proposal for intializing usdc market on scroll goerli * add configurator to scroll relations * PR comments * add docstrings * emit event when intializing ScrollBridgeReceiver * PR comments * update comment * add usdc market on scroll mainnet * fix wseth * create migration * use gauntlet recommended parameters * lint and fix timelock params * set rewards speed to 0 * add pause guardian * fix scientific notation * add scroll mainnet roots * update scroll relations for wsteth * PR comments * update wsteth/USD price feed to exchange rate based * Modified deployment roots from GitHub Actions * update proposal description * update scroll governance proposal to bridge USDC instead of COMP * final PR comments * set message value on propsal actions --------- Co-authored-by: Isabelle Wei <isabellewei@Isabelles-MacBook-Pro.local> Co-authored-by: isabelle <isabelle@scroll.io> Co-authored-by: kevincheng96 <kevincheng96@hotmail.com> Co-authored-by: GitHub Actions Bot <>
- Loading branch information
1 parent
b924358
commit bbee087
Showing
18 changed files
with
506 additions
and
13 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
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,46 @@ | ||
{ | ||
"name": "Compound USDC", | ||
"symbol": "cUSDCv3", | ||
"baseToken": "USDC", | ||
"baseTokenAddress": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4", | ||
"baseTokenPriceFeed": "0x43d12Fb3AfCAd5347fA764EeAB105478337b7200", | ||
"borrowMin": "0.001e6", | ||
"pauseGuardian": "0x0747a435b8a60070A7a111D015046d765098e4cc", | ||
"storeFrontPriceFactor": 0.6, | ||
"targetReserves": "1000000e6", | ||
"rates": { | ||
"supplyKink": 0.85, | ||
"supplySlopeLow": 0.048, | ||
"supplySlopeHigh": 1.6, | ||
"supplyBase": 0, | ||
"borrowKink": 0.85, | ||
"borrowSlopeLow": 0.053, | ||
"borrowSlopeHigh": 1.8, | ||
"borrowBase": 0.015 | ||
}, | ||
"tracking": { | ||
"indexScale": "1e15", | ||
"baseSupplySpeed": "0e15", | ||
"baseBorrowSpeed": "0e15", | ||
"baseMinForRewards": "1000e6" | ||
}, | ||
"assets": { | ||
"WETH": { | ||
"address": "0x5300000000000000000000000000000000000004", | ||
"priceFeed": "0x6bF14CB0A831078629D993FDeBcB182b21A8774C", | ||
"decimals": "18", | ||
"borrowCF": 0.8, | ||
"liquidateCF": 0.85, | ||
"liquidationFactor": 0.9, | ||
"supplyCap": "300e18" | ||
}, | ||
"wstETH": { | ||
"address": "0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32", | ||
"decimals": "18", | ||
"borrowCF": 0.75, | ||
"liquidateCF": 0.8, | ||
"liquidationFactor": 0.85, | ||
"supplyCap": "50e18" | ||
} | ||
} | ||
} |
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,87 @@ | ||
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager'; | ||
import { DeploySpec, deployComet, exp, wait } from '../../../src/deploy'; | ||
|
||
const HOUR = 60 * 60; | ||
const DAY = 24 * HOUR; | ||
|
||
const MAINNET_TIMELOCK = '0x6d903f6003cca6255d85cca4d3b5e5146dc33925'; // L1 contract | ||
|
||
export default async function deploy( | ||
deploymentManager: DeploymentManager, | ||
deploySpec: DeploySpec | ||
): Promise<Deployed> { | ||
const trace = deploymentManager.tracer(); | ||
const ethers = deploymentManager.hre.ethers; | ||
|
||
// Pull in existing assets | ||
const WETH = await deploymentManager.existing('WETH','0x5300000000000000000000000000000000000004','scroll'); | ||
const wstETH = await deploymentManager.existing('wstETH', '0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32', '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'); | ||
|
||
// Deploy ScrollBridgeReceiver | ||
const bridgeReceiver = await deploymentManager.deploy( | ||
'bridgeReceiver', | ||
'bridges/scroll/ScrollBridgeReceiver.sol', | ||
[l2Messenger.address] | ||
); | ||
|
||
// Deploy Local Timelock | ||
const localTimelock = await deploymentManager.deploy('timelock', 'vendor/Timelock.sol', [ | ||
bridgeReceiver.address, // admin | ||
1 * DAY, // delay | ||
14 * DAY, // grace period | ||
12 * HOUR, // minimum delay | ||
30 * DAY // maxiumum delay | ||
]); | ||
|
||
// Deploy multiplicative price feed for wstETH / USD | ||
const wstETHMultiplicativePriceFeed = await deploymentManager.deploy( | ||
'wstETH:priceFeed', | ||
'pricefeeds/MultiplicativePriceFeed.sol', | ||
[ | ||
'0xE61Da4C909F7d86797a0D06Db63c34f76c9bCBDC', // wstETH-stETH price feed | ||
'0x6bF14CB0A831078629D993FDeBcB182b21A8774C', // ETH / USD price feed | ||
8, // decimals | ||
'wstETH / USD price feed' // description | ||
] | ||
); | ||
|
||
// Initialize BridgeReceiver | ||
await deploymentManager.idempotent( | ||
async () => !(await bridgeReceiver.initialized()), | ||
async () => { | ||
trace(`Initializing BridgeReceiver`); | ||
await bridgeReceiver.initialize( | ||
MAINNET_TIMELOCK, // govTimelock | ||
localTimelock.address // localTimelock | ||
); | ||
trace(`BridgeReceiver initialized`); | ||
} | ||
); | ||
|
||
// Deploy Comet | ||
const deployed = await deployComet(deploymentManager, deploySpec); | ||
const { comet } = deployed; | ||
|
||
// Deploy Bulker | ||
const bulker = await deploymentManager.deploy('bulker','bulkers/BaseBulker.sol', [ | ||
await comet.governor(), // admin_ | ||
WETH.address, // weth_ | ||
]); | ||
|
||
return { | ||
...deployed, | ||
bridgeReceiver, | ||
l2Messenger, | ||
l2ERC20Gateway, | ||
l2ETHGateway, | ||
l2WETHGateway, | ||
l2WstETHGateway, | ||
bulker, | ||
}; | ||
} |
Oops, something went wrong.