-
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.
- Loading branch information
1 parent
23de1e8
commit 3bde642
Showing
14 changed files
with
223 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "Compound USDC", | ||
"symbol": "cUSDCv3", | ||
"baseToken": "USDC", | ||
"baseTokenAddress": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4", | ||
"baseTokenPriceFeed": "0x43d12Fb3AfCAd5347fA764EeAB105478337b7200", | ||
"borrowMin": "0.001e6", | ||
"storeFrontPriceFactor": 0.5, | ||
"targetReserves": "1000000e6", | ||
"rates": { | ||
"supplyKink": 0.8, | ||
"supplySlopeLow": 0.0325, | ||
"supplySlopeHigh": 0.4, | ||
"supplyBase": 0, | ||
"borrowKink": 0.8, | ||
"borrowSlopeLow": 0.035, | ||
"borrowSlopeHigh": 0.25, | ||
"borrowBase": 0.015 | ||
}, | ||
"tracking": { | ||
"indexScale": "1e15", | ||
"baseSupplySpeed": "0.000402083333333e15", | ||
"baseBorrowSpeed": "0.000402083333333e15", | ||
"baseMinForRewards": "1000e6" | ||
}, | ||
"assets": { | ||
"WETH": { | ||
"address": "0x5300000000000000000000000000000000000004", | ||
"priceFeed": "0x6bF14CB0A831078629D993FDeBcB182b21A8774C", | ||
"decimals": "18", | ||
"borrowCF": 0.775, | ||
"liquidateCF": 0.825, | ||
"liquidationFactor": 0.95, | ||
"supplyCap": "10000000e18" | ||
}, | ||
"wstETH": { | ||
"address": "0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32", | ||
"decimals": "18", | ||
"borrowCF": 0.90, | ||
"liquidateCF": 0.93, | ||
"liquidationFactor": 0.95, | ||
"supplyCap": "80_000e18" | ||
} | ||
} | ||
} |
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,89 @@ | ||
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager'; | ||
import { DeploySpec, deployComet, exp, wait } from '../../../src/deploy'; | ||
|
||
const secondsPerDay = 24 * 60 * 60; | ||
|
||
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'); | ||
|
||
// 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 | ||
10 * 60, // delay | ||
14 * secondsPerDay, // grace period | ||
10 * 60, // minimum delay | ||
30 * secondsPerDay // maximum delay | ||
]); | ||
|
||
// Deploy multiplicative price feed for wstETH / USD | ||
const wstETHMultiplicativePriceFeed = await deploymentManager.deploy( | ||
'wstETH:priceFeed', | ||
'pricefeeds/MultiplicativePriceFeed.sol', | ||
[ | ||
'0xe428fbdbd61CC1be6C273dC0E27a1F43124a86F3', // wstETH / ETH 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/MainnetBulker.sol', | ||
[ | ||
await comet.governor(), // admin_ | ||
WETH.address, // weth_ | ||
wstETH.address // wsteth_ | ||
] | ||
); | ||
|
||
return { | ||
...deployed, | ||
bridgeReceiver, | ||
l2Messenger, | ||
l2ERC20Gateway, | ||
l2ETHGateway, | ||
l2WETHGateway, | ||
bulker, | ||
}; | ||
} |
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 @@ | ||
import baseRelationConfig from '../../relations'; | ||
|
||
export default { | ||
...baseRelationConfig, | ||
governor: { | ||
artifact: 'contracts/bridges/scroll/ScrollBridgeReceiver.sol:ScrollBridgeReceiver' | ||
}, | ||
l2Messenger: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
l2ERC20Gateway: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
l2ETHGateway: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
l2WETHGateway: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
} | ||
}; |
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