-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds support for Sepolia and deploys a new USDC market there. More work will need to be done to migrate cross-chain governance from L2s to point to Sepolia instead of Goerli, but this should help to unblock developers that need access to a Comet on Sepolia.
- Loading branch information
1 parent
22cf923
commit 745fddd
Showing
12 changed files
with
243 additions
and
8 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,54 @@ | ||
{ | ||
"name": "Compound USDC", | ||
"symbol": "cUSDCv3", | ||
"baseToken": "USDC", | ||
"baseTokenAddress": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", | ||
"baseTokenPriceFeed": "0xA2F78ab2355fe2f984D808B5CeE7FD0A93D5270E", | ||
"pauseGuardian": "0x008a4C5448ac1Df676d6F39A0C6F13b21b189389", | ||
"borrowMin": "1e0", | ||
"storeFrontPriceFactor": 0.5, | ||
"targetReserves": "5000000e6", | ||
"rates": { | ||
"supplyKink": 0.85, | ||
"supplySlopeLow": 0.048, | ||
"supplySlopeHigh": 1.6, | ||
"supplyBase": 0, | ||
"borrowKink": 0.85, | ||
"borrowSlopeLow": 0.053, | ||
"borrowSlopeHigh": 1.7, | ||
"borrowBase": 0.015 | ||
}, | ||
"tracking": { | ||
"indexScale": "1e15", | ||
"baseSupplySpeed": "0.000011574074074074073e15", | ||
"baseBorrowSpeed": "0.0011458333333333333e15", | ||
"baseMinForRewards": "100e6" | ||
}, | ||
"rewardToken": "COMP", | ||
"assets": { | ||
"COMP": { | ||
"priceFeed": "0x619db7F74C0061E2917D1D57f834D9D24C5529dA", | ||
"decimals": "18", | ||
"borrowCF": 0.65, | ||
"liquidateCF": 0.7, | ||
"liquidationFactor": 0.92, | ||
"supplyCap": "500000e18" | ||
}, | ||
"WBTC": { | ||
"priceFeed": "0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43", | ||
"decimals": "8", | ||
"borrowCF": 0.7, | ||
"liquidateCF": 0.75, | ||
"liquidationFactor": 0.93, | ||
"supplyCap": "35000e8" | ||
}, | ||
"WETH": { | ||
"priceFeed": "0x694AA1769357215DE4FAC081bf1f309aDC325306", | ||
"decimals": "18", | ||
"borrowCF": 0.82, | ||
"liquidateCF": 0.85, | ||
"liquidationFactor": 0.93, | ||
"supplyCap": "1000000e18" | ||
} | ||
} | ||
} |
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,79 @@ | ||
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager'; | ||
import { DeploySpec, cloneGov, deployComet, exp, sameAddress, wait } from '../../../src/deploy'; | ||
|
||
const clone = { | ||
wbtc: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', | ||
weth: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' | ||
}; | ||
|
||
export default async function deploy(deploymentManager: DeploymentManager, deploySpec: DeploySpec): Promise<Deployed> { | ||
const deployed = await deployContracts(deploymentManager, deploySpec); | ||
await mintTokens(deploymentManager); | ||
return deployed; | ||
} | ||
|
||
async function deployContracts(deploymentManager: DeploymentManager, deploySpec: DeploySpec): Promise<Deployed> { | ||
const trace = deploymentManager.tracer() | ||
const signer = await deploymentManager.getSigner(); | ||
|
||
// Deploy governance contracts | ||
const { COMP, fauceteer, timelock } = await cloneGov(deploymentManager); | ||
|
||
// Clone collateral assets from mainnet | ||
const WBTC = await deploymentManager.clone('WBTC', clone.wbtc, []); | ||
const WETH = await deploymentManager.clone('WETH', clone.weth, []); | ||
|
||
// Deploy all Comet-related contracts | ||
const deployed = await deployComet(deploymentManager, deploySpec); | ||
const { rewards } = deployed; | ||
|
||
// Deploy Bulker | ||
const bulker = await deploymentManager.deploy( | ||
'bulker', | ||
'bulkers/BaseBulker.sol', | ||
[timelock.address, WETH.address] | ||
); | ||
|
||
await deploymentManager.idempotent( | ||
async () => (await COMP.balanceOf(rewards.address)).eq(0), | ||
async () => { | ||
trace(`Sending some COMP to CometRewards`); | ||
const amount = exp(1_000_000, 18); | ||
trace(await wait(COMP.connect(signer).transfer(rewards.address, amount))); | ||
trace(`COMP.balanceOf(${rewards.address}): ${await COMP.balanceOf(rewards.address)}`); | ||
trace(`COMP.balanceOf(${signer.address}): ${await COMP.balanceOf(signer.address)}`); | ||
} | ||
); | ||
|
||
return { ...deployed, fauceteer, bulker }; | ||
} | ||
|
||
async function mintTokens(deploymentManager: DeploymentManager) { | ||
const trace = deploymentManager.tracer(); | ||
const signer = await deploymentManager.getSigner(); | ||
const contracts = await deploymentManager.contracts(); | ||
const fauceteer = contracts.get('fauceteer'); | ||
|
||
trace(`Attempting to mint as ${signer.address}...`); | ||
|
||
const WETH = contracts.get('WETH'); | ||
await deploymentManager.idempotent( | ||
async () => (await WETH.balanceOf(signer.address)).lt(exp(0.01, 18)), | ||
async () => { | ||
trace(`Minting 0.01 WETH for signer (this is a precious resource!)`); | ||
trace(await wait(WETH.connect(signer).deposit({ value: exp(0.01, 18) }))); | ||
trace(`WETH.balanceOf(${signer.address}): ${await WETH.balanceOf(signer.address)}`); | ||
} | ||
); | ||
|
||
const WBTC = contracts.get('WBTC'); | ||
await deploymentManager.idempotent( | ||
async () => (await WBTC.balanceOf(fauceteer.address)).eq(0), | ||
async () => { | ||
trace(`Minting 20 WBTC to fauceteer`); | ||
const amount = exp(20, await WBTC.decimals()); | ||
trace(await wait(WBTC.connect(signer).mint(fauceteer.address, amount))); | ||
trace(`WBTC.balanceOf(${fauceteer.address}): ${await WBTC.balanceOf(fauceteer.address)}`); | ||
} | ||
); | ||
} |
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,78 @@ | ||
import baseRelationConfig from '../../relations'; | ||
|
||
export default { | ||
...baseRelationConfig, | ||
// USDC / USD price feed | ||
'0xa2f78ab2355fe2f984d808b5cee7fd0a93d5270e': { | ||
artifact: 'contracts/IPriceFeed.sol:IPriceFeed' | ||
}, | ||
// WBTC / USD price feed | ||
'0x1b44f3514812d835eb1bdb0acb33d3fa3351ee43': { | ||
artifact: 'contracts/IPriceFeed.sol:IPriceFeed' | ||
}, | ||
// WETH / USD price feed | ||
'0x694aa1769357215de4fac081bf1f309adc325306': { | ||
artifact: 'contracts/IPriceFeed.sol:IPriceFeed' | ||
}, | ||
fxRoot: { | ||
relations: { | ||
stateSender: { | ||
field: async fxRoot => fxRoot.stateSender() | ||
} | ||
} | ||
}, | ||
arbitrumInbox: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
}, | ||
relations: { | ||
arbitrumBridge: { | ||
field: async inbox => inbox.bridge() | ||
} | ||
} | ||
}, | ||
arbitrumL1GatewayRouter: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
baseL1CrossDomainMessenger: { | ||
delegates: { | ||
// Not great, but this address shouldn't change and is very difficult to grab on-chain (private methods) | ||
field: async () => '0xa042e16781484716c1Ef448c919af7BCd9607467' | ||
} | ||
}, | ||
baseL1StandardBridge: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
lineaMessageService: { | ||
artifact: 'contracts/bridges/linea/IMessageService.sol:IMessageService', | ||
// delegates: { | ||
// field: { | ||
// slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
// } | ||
// } | ||
}, | ||
lineaL1TokenBridge: { | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
lineaL1usdcBridge: { | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"comet": "0xAec1F48e02Cfb822Be958B68C7957156EB3F0b6e", | ||
"configurator": "0xc28aD44975C614EaBe0Ed090207314549e1c6624", | ||
"rewards": "0x8bF5b658bdF0388E8b482ED51B14aef58f90abfD", | ||
"fauceteer": "0x68793eA49297eB75DFB4610B68e076D2A5c7646C", | ||
"bulker": "0x157c001bb1F8b33743B14483Be111C961d8e11dE" | ||
} |
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