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

Add USDC market on Scroll mainnet #824

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c9d6bd8
debug
Aug 30, 2023
2052b10
update price feed
Sep 1, 2023
35d0a4a
update config
Sep 1, 2023
f0f3398
temp workaround
Sep 1, 2023
4aa336b
add scroll to scenarios
Sep 1, 2023
11a826f
uncomment spider debug messages
Sep 7, 2023
ef562e7
add scroll relations
Sep 7, 2023
e99e2f1
catch failed spider crawls
Sep 7, 2023
e3bb341
Fix spider for scroll
kevincheng96 Sep 7, 2023
4f40e49
update bridge receiver to be compatible with scroll bridge
Sep 8, 2023
5148b9a
update relations
Sep 8, 2023
62589ae
Modified deployment roots from GitHub Actions
Sep 11, 2023
76091fd
Merge branch 'main' of github.com:compound-finance/comet
Sep 11, 2023
04139b5
remove console.log
Sep 11, 2023
b72a9df
rename scroll messenger
Sep 11, 2023
cf25e22
add scroll to governance scenarios
Sep 11, 2023
f06c198
adapt scroll relay message fn
Sep 12, 2023
5d4f484
Merge branch 'isabellewei/scroll-deploy' of github.com:compound-finan…
Sep 14, 2023
d9e6a55
fix unit tests
Sep 19, 2023
582b5f2
rename contracts and update message relaying
Sep 27, 2023
42b1363
Merge branch 'isabellewei/scroll-deploy' of github.com:compound-finan…
Sep 27, 2023
742892b
Merge branch 'isabellewei/scroll-deploy' of github.com:compound-finan…
Sep 28, 2023
4912c5f
Merge branch 'isabellewei/scroll-deploy' of github.com:compound-finan…
Oct 1, 2023
6632c40
Merge branch 'isabellewei/scroll-deploy' of github.com:compound-finan…
Oct 25, 2023
aca0b92
update scroll testnet block explorer URL
Oct 25, 2023
d461ce1
remove base fee
Oct 26, 2023
dcae3f3
fix scroll l2 sender address
Oct 26, 2023
2003c6d
remove old roots
Oct 26, 2023
e695355
fix type errors
Oct 26, 2023
75e0ea3
Modified deployment roots from GitHub Actions
Oct 26, 2023
18ce6a8
proposal for intializing usdc market on scroll goerli
Nov 2, 2023
9a62f93
add configurator to scroll relations
Nov 4, 2023
d712351
Merge branch 'isabellewei/scroll-deploy' of github.com:compound-finan…
Nov 7, 2023
0d421ad
PR comments
Nov 9, 2023
ff98c16
add docstrings
Jan 3, 2024
d51e02e
emit event when intializing ScrollBridgeReceiver
Jan 3, 2024
9001e27
PR comments
Jan 4, 2024
23de1e8
update comment
Jan 4, 2024
3bde642
add usdc market on scroll mainnet
isabellewei Jan 25, 2024
c1d8c0a
fix wseth
isabellewei Jan 26, 2024
d06e1f4
create migration
isabellewei Jan 26, 2024
c653f86
use gauntlet recommended parameters
isabellewei Jan 30, 2024
05a9bc1
Merge branch 'isabellewei/scroll-deploy' of github.com:compound-finan…
isabellewei Feb 2, 2024
f0c6ac2
Merge branch 'main' into isabellewei/scroll-mainnet
isabellewei Feb 2, 2024
cb459f3
lint and fix timelock params
isabellewei Feb 2, 2024
d4a0097
set rewards speed to 0
isabellewei Feb 6, 2024
1f0d2c3
add pause guardian
isabellewei Feb 7, 2024
12f8856
fix scientific notation
isabellewei Feb 7, 2024
d804f03
add scroll mainnet roots
isabellewei Feb 8, 2024
0577a5b
update scroll relations for wsteth
isabellewei Feb 14, 2024
9b24330
PR comments
isabellewei Feb 14, 2024
b3c91f8
update wsteth/USD price feed to exchange rate based
isabellewei Feb 16, 2024
64b6126
Modified deployment roots from GitHub Actions
Feb 16, 2024
a159d37
update proposal description
isabellewei Feb 16, 2024
8bc26f1
update scroll governance proposal to bridge USDC instead of COMP
isabellewei Feb 21, 2024
4a20baa
final PR comments
isabellewei Feb 23, 2024
d1c3189
set message value on propsal actions
isabellewei Mar 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployments/mainnet/usdc/relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
}
}
},
scrollL1TokenBridge: {
scrollL1USDCGateway: {
delegates: {
field: {
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc'
Expand Down
2 changes: 1 addition & 1 deletion deployments/mainnet/usdc/roots.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"baseL1CrossDomainMessenger": "0x866E82a600A1414e583f7F13623F1aC5d58b0Afa",
"baseL1StandardBridge": "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
"scrollMessenger": "0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367",
"scrollL1TokenBridge": "0xF8B1378579659D8F7EE5f3C929c2f3E332E41Fd6"
"scrollL1USDCGateway": "0xf1AF3b23DE0A5Ca3CAb7261cb0061C0D779A5c7B"
}
2 changes: 1 addition & 1 deletion deployments/scroll/usdc/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default async function deploy(
'wstETH:priceFeed',
'pricefeeds/MultiplicativePriceFeed.sol',
[
'0xe428fbdbd61CC1be6C273dC0E27a1F43124a86F3', // wstETH / ETH price feed
'0xE61Da4C909F7d86797a0D06Db63c34f76c9bCBDC', // wstETH-stETH price feed
'0x6bF14CB0A831078629D993FDeBcB182b21A8774C', // ETH / USD price feed
8, // decimals
'wstETH / USD price feed' // description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const ENSSubdomainLabel = 'v3-additional-grants';
const ENSSubdomain = `${ENSSubdomainLabel}.${ENSName}`;
const ENSTextRecordKey = 'v3-official-markets';
const scrollCOMPAddress = '0x643e160a3C3E2B7eae198f0beB1BfD2441450e86';
const scrollL1StandardERC20GatewayAddress = "0xD8A791fE2bE73eb6E6cF1eb0cb3F36adC9B3F8f9"

export default migration('1706149385_configurate_and_ens', {
prepare: async (deploymentManager: DeploymentManager) => {
Expand All @@ -32,9 +31,9 @@ export default migration('1706149385_configurate_and_ens', {

const {
scrollMessenger,
scrollL1TokenBridge,
scrollL1USDCGateway,
governor,
COMP,
USDC
} = await govDeploymentManager.getContracts();

// ENS Setup
Expand Down Expand Up @@ -79,7 +78,7 @@ export default migration('1706149385_configurate_and_ens', {
]
);

const COMPAmountToBridge = exp(10_000, 18);
const USDCAmountToBridge = exp(10_000, 18);

const actions = [
// 1. Set Comet configuration + deployAndUpgradeTo new Comet and set reward config on Scroll
Expand All @@ -89,17 +88,17 @@ export default migration('1706149385_configurate_and_ens', {
args: [bridgeReceiver.address, 0, l2ProposalData, 600_000]
},

// 2. Approve Scroll's L1StandardERC20Gateway to take Timelock's COMP (for bridging)
// 2. Approve Scroll's L1 USDC Gateway to take Timelock's USDC (for bridging)
{
contract: COMP,
contract: USDC,
signature: 'approve(address,uint256)',
args: [scrollL1StandardERC20GatewayAddress, COMPAmountToBridge]
args: [scrollL1USDCGateway.address, USDCAmountToBridge]
},
// 3. Bridge COMP from Ethereum to Scroll Comet using L1GatewayRouter
// 3. Bridge USDC from Ethereum to Scroll Comet using L1 USDC Gateway
{
contract: scrollL1TokenBridge,
contract: scrollL1USDCGateway,
signature: 'depositERC20(address,address,uint256,uint256)',
args: [COMP.address, rewards.address, COMPAmountToBridge, 300_000]
args: [USDC.address, comet.address, USDCAmountToBridge, 300_000]
},
// 4. Update the list of official markets
{
Expand All @@ -113,7 +112,7 @@ export default migration('1706149385_configurate_and_ens', {
];

const description =
'# Configurate Scroll cUSDCv3 market, set reward config, bridge over USDC and COMP, and update ENS text record.';
"# Initialize cUSDCv3 on Scroll\n\nThis proposal takes the governance steps recommended and necessary to initialize a Compound III USDC market on Scroll; upon execution, cUSDCv3 will be ready for use. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). Although real tests have also been run over the Goerli/Scroll Alpha bridge, this will be the first proposal to actually bridge from Ethereum mainnet to Scroll mainnet, and therefore includes risks not present in previous proposals.\n\nAlthough the proposal sets the entire configuration in the Configurator, with parameters based off of the [recommendations from Gauntlet](https://www.comp.xyz/t/deploy-compound-iii-on-scroll/4917/3).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/824) and [forum discussion](https://www.comp.xyz/t/deploy-compound-iii-on-scroll/4917).\n\n\n## Proposal Actions\n\nThe first proposal action sets the Comet configuration and deploys a new Comet implementation on Scroll. This sends the encoded `setConfiguration` and `deployAndUpgradeTo` calls across the bridge to the governance receiver on Scroll. It also calls `setRewardConfig` on the Scroll rewards contract to establish Scroll’s bridged version of COMP as the reward token for the deployment (note that rewards speeds have been set to 0, as Gauntlet has recommended to hold off on including rewards in the comet deployment for now).\n\nThe second action approves Scroll’s [L1USDCGateway](https://etherscan.io/address/0xf1AF3b23DE0A5Ca3CAb7261cb0061C0D779A5c7B) to take Timelock's USDC, in order to seed the market reserves through the bridge.\n\nThe third action deposits 10K USDC from mainnet to the Scroll L1USDCGateway contract to bridge to Comet.\n\nThe fourth action updates the ENS TXT record `v3-official-markets` on `v3-additional-grants.compound-community-licenses.eth`, updating the official markets JSON to include the new Scroll cUSDCv3 market.";
const txn = await govDeploymentManager.retry(async () =>
trace(await governor.propose(...(await proposal(actions, description))))
);
Expand Down
10 changes: 5 additions & 5 deletions deployments/scroll/usdc/roots.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"comet": "0x66ffeb3340f263C209ED0477556cEc6f8Dae2e66",
"configurator": "0x51BcA85688acC4Ff31CEfC63006b35169E168a70",
"rewards": "0x341a826A93FF509776310f38111703Dc0744E5b4",
"bridgeReceiver": "0x022678DE7d582aBF16735551bB3ad77Ec9f99A5B",
"comet": "0xB2f97c1Bd3bf02f5e74d13f02E3e26F93D77CE44",
"configurator": "0xECAB0bEEa3e5DEa0c35d3E69468EAC20098032D7",
"rewards": "0x70167D30964cbFDc315ECAe02441Af747bE0c5Ee",
"bridgeReceiver": "0xC6bf5A64896D679Cf89843DbeC6c0f5d3C9b610D",
"l2Messenger": "0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC",
"l2ERC20Gateway": "0xE2b4795039517653c5Ae8C2A9BFdd783b48f447A",
"l2ETHGateway": "0x6EA73e05AdC79974B931123675ea8F78FfdacDF0",
"l2WETHGateway": "0x7003E7B7186f0E6601203b99F7B8DECBfA391cf9",
"l2WstETHGateway": "0x8aE8f22226B9d789A36AC81474e633f8bE2856c9",
"bulker": "0xA5D3bedBAcAFCa95021c17748780889aA8DDbC23"
"bulker": "0x53C6D04e3EC7031105bAeA05B36cBc3C987C56fA"
}