-
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.
Deploy and proposal for native USDC market on Arbitrum Goerli (#793)
* Deploy Arbitrum goerli for usdc native (#778) * initial gen * remove files * rename directory * add scenario * upadte deploy script * renamde to usdc.n * added relations for scenario test * add scenario test to CI * add migration scrtips, but just changed the USDC reference address * update migration script * since it's native, we shouldn't need usdc bridge things in migration * try to fix the liquidator scenario errors * intent * change those to be 0 initially * FINALLY scneario passed :D * don't re-deploy bulker * set a number in configuration to make bulker tests pass * set configuration to 0 supply cap for initialization, although it will fail the bulker test * update liquidity pool to use the one with better liquidity * after new pool use better liquidity, now able to bump up the volume * remove v2 rewards config step, crank down borrowMin * update migration description * remove trailing newline * ok need to referencing existing rewards in deploy script to share the rewards' * naming changes * added cctp contracts address to roots and update relayArbitrummessage * add l2 cctp * depositForBurn() to use CCTP to send native USDC to arbitrum comet * finally relayArbitrum works with CCTP * format * update to turn off bridge market's reward speed * fix scenarios and slightly reduced volume in liquidator scenarios (somehow during testing the pool the bot uses to flashloan have been withdrew and don't have full liquidity to cover tests * now it has just enough liquidity to pass the test, reverted the liquidation scenario back to usual amount * address comments: remove network prefixes, move contract import from deploy to migration scripts, move relay specific contracts to relay script * remove network prefixes, and rename bridgeComet to usdceComet * rename/refactor usdc -> usdc.e, and usdc.n -> usdc. Also rename deplyoment name for to and to * luckily by the time of testing now Jul 6th 1:40PM PST, we have enough liquidity in the uniswap USDC.e:USDC pool to cover the unchanged volume liquidation scenarios test * rename usdc.n to usdc * make yarn lint happy * rename bridged version to .e to match with mainnet * ported changes to testnet * update on workflow * hmm the error is gone * change default supply reward speed on new comet to be 0 * move migration steps out of this branch * add readme.md to corner cases when deploy new market on the chain with an existing market already * add line * removed USDC in relations * update version to unblock deploy workerflow for now * use dummy requested_network id * try arbitrum goerli network id right away * change a bit on how it locates the hardhat config base * remove hardcoded network chain-id * no more manual wallet project id input * use env.GOV_NETWORK * GOV_NETWORK got some errors :[ * try this seacrest with fixes * try new seacrest :D * Modified deployment roots from GitHub Actions * Migrate Arbitrum Goerli Native usdc (#779) * migration scripts commits * set supply and borrow speeds to be non zero * add diff check * add diff checker * added comments on checks * now scenario run is passing, but with the cost of removing linea's contract addresses from goerli/roots.json * add linea back, but scenario run will fail. But it's not related to arbitrum-goerli * Upgrade git action to use new seacrest (#782) * upgrade git action to use new seacrest * Fix unverified Linea Goerli contract issue (#787) * addressed comments * first initial working version of CCTP attestation script to help check with circle attestation status to mint native USDC to destination * attestation script with sending txn on user behalf * fix lint * fix lint * Modified migration from GitHub Actions --------- Co-authored-by: Kevin Cheng <[email protected]> Co-authored-by: GitHub Actions Bot <> * removed asdf config file that should've been ignored * add native usdc whale for arbitrum goerli --------- Co-authored-by: GitHub Actions Bot <> Co-authored-by: Kevin Cheng <[email protected]> * revert some mixed up changes when extracted from #769 * fix name * update reference path * fix lint * Update hardhat.config.ts Co-authored-by: Kevin Cheng <[email protected]> * Update hardhat.config.ts Co-authored-by: Kevin Cheng <[email protected]> * fix error --------- Co-authored-by: Kevin Cheng <[email protected]>
- Loading branch information
1 parent
761028a
commit 9a962f0
Showing
17 changed files
with
569 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"name": "Compound USDC", | ||
"symbol": "cUSDCv3", | ||
"baseToken": "USDC.e", | ||
"baseTokenAddress": "0x8FB1E3fC51F3b789dED7557E680551d93Ea9d892", | ||
"baseTokenPriceFeed": "0x1692Bdd32F31b831caAc1b0c9fAF68613682813b", | ||
"borrowMin": "100e6", | ||
"pauseGuardian": "0x6C2fD6738e43ce0cc4A6f23a37e3a733516794A0", | ||
"storeFrontPriceFactor": 0.5, | ||
"targetReserves": "5000000e6", | ||
"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": "0e15", | ||
"baseBorrowSpeed": "0e15", | ||
"baseMinForRewards": "10000e6" | ||
}, | ||
"assets": { | ||
"LINK": { | ||
"address": "0xbb7303602be1b9149b097aafb094ffce1860e532", | ||
"priceFeed": "0xd28Ba6CA3bB72bF371b80a2a0a33cBcf9073C954", | ||
"decimals": "18", | ||
"borrowCF": 0.775, | ||
"liquidateCF": 0.825, | ||
"liquidationFactor": 0.95, | ||
"supplyCap": "5000000e18" | ||
}, | ||
"WETH": { | ||
"address": "0xe39ab88f8a4777030a534146a9ca3b52bd5d43a3", | ||
"priceFeed": "0x62CAe0FA2da220f43a51F86Db2EDb36DcA9A5A08", | ||
"decimals": "18", | ||
"borrowCF": 0.775, | ||
"liquidateCF": 0.825, | ||
"liquidationFactor": 0.95, | ||
"supplyCap": "5000e18" | ||
}, | ||
"WBTC": { | ||
"address": "0x22d5e2dE578677791f6c90e0110Ec629be9d5Fb5", | ||
"priceFeed": "0x6550bc2301936011c1334555e62A87705A81C12C", | ||
"decimals": "8", | ||
"borrowCF": 0.7, | ||
"liquidateCF": 0.75, | ||
"liquidationFactor": 0.93, | ||
"supplyCap": "300e8" | ||
} | ||
} | ||
} |
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,70 @@ | ||
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager'; | ||
import { DeploySpec, deployComet } from '../../../src/deploy'; | ||
|
||
const SECONDS_PER_DAY = 24 * 60 * 60; | ||
|
||
const GOERLI_TIMELOCK = '0x8Fa336EB4bF58Cfc508dEA1B0aeC7336f55B1399'; | ||
|
||
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 USDC = await deploymentManager.existing('USDC', '0x8FB1E3fC51F3b789dED7557E680551d93Ea9d892', 'arbitrum-goerli'); | ||
const LINK = await deploymentManager.existing('LINK', '0xbb7303602be1b9149b097aafb094ffce1860e532', 'arbitrum-goerli'); | ||
const WETH = await deploymentManager.existing('WETH', '0xe39ab88f8a4777030a534146a9ca3b52bd5d43a3', 'arbitrum-goerli'); | ||
const WBTC = await deploymentManager.existing('WBTC', '0x22d5e2dE578677791f6c90e0110Ec629be9d5Fb5', 'arbitrum-goerli'); | ||
|
||
// Deploy ArbitrumBridgeReceiver | ||
const bridgeReceiver = await deploymentManager.deploy( | ||
'bridgeReceiver', | ||
'bridges/arbitrum/ArbitrumBridgeReceiver.sol', | ||
[] | ||
); | ||
|
||
// Deploy Local Timelock | ||
const localTimelock = await deploymentManager.deploy( | ||
'timelock', | ||
'vendor/Timelock.sol', | ||
[ | ||
bridgeReceiver.address, // admin | ||
10 * 60, // delay | ||
14 * SECONDS_PER_DAY, // grace period | ||
10 * 60, // minimum delay | ||
30 * SECONDS_PER_DAY // maximum delay | ||
] | ||
); | ||
|
||
// Initialize ArbitrumBridgeReceiver | ||
await deploymentManager.idempotent( | ||
async () => !(await bridgeReceiver.initialized()), | ||
async () => { | ||
trace(`Initializing BridgeReceiver`); | ||
await bridgeReceiver.initialize( | ||
GOERLI_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, | ||
bulker | ||
}; | ||
} |
File renamed without changes.
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,29 @@ | ||
import baseRelationConfig from '../../relations'; | ||
|
||
export default { | ||
...baseRelationConfig, | ||
governor: { | ||
artifact: 'contracts/bridges/arbitrum/ArbitrumBridgeReceiver.sol:ArbitrumBridgeReceiver' | ||
}, | ||
ClonableBeaconProxy: { | ||
artifact: 'contracts/ERC20.sol:ERC20' | ||
}, | ||
// USDC | ||
'0x8FB1E3fC51F3b789dED7557E680551d93Ea9d892': { | ||
artifact: 'contracts/ERC20.sol:ERC20', | ||
delegates: { | ||
field: { | ||
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' | ||
} | ||
} | ||
}, | ||
// WETH | ||
'0xe39ab88f8a4777030a534146a9ca3b52bd5d43a3': { | ||
artifact: 'contracts/ERC20.sol:ERC20', | ||
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": "0x1d573274E19174260c5aCE3f2251598959d24456", | ||
"configurator": "0x1Ead344570F0f0a0cD86d95d8adDC7855C8723Fb", | ||
"rewards": "0x8DA65F8E3Aa22A498211fc4204C498ae9050DAE4", | ||
"bridgeReceiver": "0xAC9fC1a9532BC92a9f33eD4c6Ce4A7a54930F376", | ||
"bulker": "0x987350Af5a17b6DdafeB95E6e329c178f44841d7" | ||
} |
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.