Skip to content

Commit

Permalink
fix: fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaShWoof committed Jan 23, 2025
1 parent c2cfbbc commit 029bff2
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 55 deletions.
2 changes: 1 addition & 1 deletion deployments/linea/usdc/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"baseToken": "USDC",
"baseTokenAddress": "0x176211869cA2b568f2A7D4EE941E073a821EE1ff",
"baseTokenPriceFeed": "0xAADAa473C1bDF7317ec07c915680Af29DeBfdCb5",
"pauseGuardian": "0x5A1e5d7E09cA94506084a26304d53A138145bF52",
"borrowMin": "1e6",
"storeFrontPriceFactor": 0.6,
"targetReserves": "20_000_000e6",
Expand Down Expand Up @@ -35,7 +36,6 @@
},
"wstETH": {
"address": "0xB5beDd42000b71FddE22D3eE8a79Bd49A568fC8F",
"priceFeed": "0x8eCE1AbA32716FdDe8D6482bfd88E9a0ee01f565",
"decimals": "18",
"borrowCF": 0.82,
"liquidateCF": 0.87,
Expand Down
34 changes: 22 additions & 12 deletions deployments/linea/usdc/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ const DAY = 24 * HOUR;

const MAINNET_TIMELOCK = '0x6d903f6003cca6255d85cca4d3b5e5146dc33925';

const WSTETH_TO_STETH_PRICE_FEED = '0x3C8A95F2264bB3b52156c766b738357008d87cB7';
const ETH_TO_USD_PRICE_FEED = '0x3c6Cd9Cc7c7a4c2Cf5a82734CD249D7D593354dA';

const L2MESSAGE_SERVICE_ADDRESS = '0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec';
const L2STANDARD_BRIDGE_ADDRESS = '0x353012dc4a9A6cF55c941bADC267f82004A8ceB9';
const L2USDC_BRIDGE_ADDRESS = '0xA2Ee6Fce4ACB62D95448729cDb781e3BEb62504A';

export default async function deploy(
deploymentManager: DeploymentManager,
deploySpec: DeploySpec
Expand Down Expand Up @@ -46,30 +53,33 @@ async function deployContracts(
'linea'
);

const wstETHtoUsdPriceFeed = await deploymentManager.deploy(
'wstETH:priceFeed',
'pricefeeds/MultiplicativePriceFeed.sol',
[
WSTETH_TO_STETH_PRICE_FEED, // wstETH / stETH price feed
ETH_TO_USD_PRICE_FEED, // ETH / USD price feed (we consider stETH / ETH as 1:1)
8, // decimals
'wstETH / USD price feed' // description
]
);


const l2MessageService = await deploymentManager.existing(
'l2MessageService',
[
'0x05d43713B7E333d2D54be65cE3b5F3698aB960Fd',
'0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec',
],
L2MESSAGE_SERVICE_ADDRESS,
'linea'
);

const l2StandardBridge = await deploymentManager.existing(
'l2StandardBridge',
[
'0xD90ed3D4f9d11262d3D346a4369058d5B3777137',
'0x353012dc4a9A6cF55c941bADC267f82004A8ceB9',
],
L2STANDARD_BRIDGE_ADDRESS,
'linea'
);

const l2USDCBridge = await deploymentManager.existing(
'l2USDCBridge',
[
'0x6D967F862d8c5D9E230a976AB2063eD1d4D7A43c',
'0xA2Ee6Fce4ACB62D95448729cDb781e3BEb62504A',
],
L2USDC_BRIDGE_ADDRESS,
'linea'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default migration('1736257010_configurate_and_ens', {
const officialMarkets = JSON.parse(officialMarketsJSON);
const updatedMarkets = {
...officialMarkets,
42161: [
59144: [
{
baseSymbol: 'USDC',
cometAddress: comet.address,
Expand Down Expand Up @@ -237,6 +237,24 @@ export default migration('1736257010_configurate_and_ens', {
cometAddress: '0xaeB318360f27748Acb200CE616E389A6C9409a07'
}
],
42161: [
{
baseSymbol: 'USDC.e',
cometAddress: '0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA',
},
{
baseSymbol: 'USDC',
cometAddress: '0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf',
},
{
baseSymbol: 'WETH',
cometAddress: '0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486',
},
{
baseSymbol: 'USDT',
cometAddress: '0xd98Be00b5D27fc98112BdE293e487f8D4cA57d07',
},
],
5000: [
{
baseSymbol: 'USDe',
Expand Down Expand Up @@ -267,7 +285,7 @@ export default migration('1736257010_configurate_and_ens', {
cometAddress: '0xB2f97c1Bd3bf02f5e74d13f02E3e26F93D77CE44'
},
],
42161: [
59144: [
{
baseSymbol: 'USDC',
cometAddress: comet.address,
Expand Down
8 changes: 8 additions & 0 deletions deployments/linea/usdc/relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export default {
},
},
},
l2USDCBridge: {
delegates: {
field: {
slot:
'0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc',
},
},
},
l2StandardBridge: {
delegates: {
field: {
Expand Down
1 change: 1 addition & 0 deletions deployments/linea/usdc/roots.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"l2TokenBridge": "0x353012dc4a9a6cf55c941badc267f82004a8ceb9",
"l2USDCBridge": "0xA2Ee6Fce4ACB62D95448729cDb781e3BEb62504A",
"l2MessageService": "0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec"
}
2 changes: 1 addition & 1 deletion deployments/linea/usdt/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"baseToken": "USDT",
"baseTokenAddress": "0xA219439258ca9da29E9Cc4cE5596924745e12B93",
"baseTokenPriceFeed": "0xefCA2bbe0EdD0E22b2e0d2F8248E99F4bEf4A7dB",
"pauseGuardian": "0x5A1e5d7E09cA94506084a26304d53A138145bF52",
"borrowMin": "1e6",
"storeFrontPriceFactor": 0.6,
"targetReserves": "20_000_000e6",
Expand Down Expand Up @@ -35,7 +36,6 @@
},
"wstETH": {
"address": "0xB5beDd42000b71FddE22D3eE8a79Bd49A568fC8F",
"priceFeed": "0x8eCE1AbA32716FdDe8D6482bfd88E9a0ee01f565",
"decimals": "18",
"borrowCF": 0.82,
"liquidateCF": 0.87,
Expand Down
33 changes: 21 additions & 12 deletions deployments/linea/usdt/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ const DAY = 24 * HOUR;

const MAINNET_TIMELOCK = '0x6d903f6003cca6255d85cca4d3b5e5146dc33925';

const WSTETH_TO_STETH_PRICE_FEED = '0x3C8A95F2264bB3b52156c766b738357008d87cB7';
const ETH_TO_USD_PRICE_FEED = '0x3c6Cd9Cc7c7a4c2Cf5a82734CD249D7D593354dA';

const L2MESSAGE_SERVICE_ADDRESS = '0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec';
const L2STANDARD_BRIDGE_ADDRESS = '0x353012dc4a9A6cF55c941bADC267f82004A8ceB9';
const L2USDC_BRIDGE_ADDRESS = '0xA2Ee6Fce4ACB62D95448729cDb781e3BEb62504A';

export default async function deploy(
deploymentManager: DeploymentManager,
deploySpec: DeploySpec
Expand Down Expand Up @@ -46,30 +53,32 @@ async function deployContracts(
'linea'
);

const wstETHtoUsdPriceFeed = await deploymentManager.deploy(
'wstETH:priceFeed',
'pricefeeds/MultiplicativePriceFeed.sol',
[
WSTETH_TO_STETH_PRICE_FEED, // wstETH / stETH price feed
ETH_TO_USD_PRICE_FEED, // ETH / USD price feed (we consider stETH / ETH as 1:1)
8, // decimals
'wstETH / USD price feed' // description
]
);

const l2MessageService = await deploymentManager.existing(
'l2MessageService',
[
'0x05d43713B7E333d2D54be65cE3b5F3698aB960Fd',
'0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec',
],
L2MESSAGE_SERVICE_ADDRESS,
'linea'
);

const l2StandardBridge = await deploymentManager.existing(
'l2StandardBridge',
[
'0xD90ed3D4f9d11262d3D346a4369058d5B3777137',
'0x353012dc4a9A6cF55c941bADC267f82004A8ceB9',
],
L2STANDARD_BRIDGE_ADDRESS,
'linea'
);

const l2USDCBridge = await deploymentManager.existing(
'l2USDCBridge',
[
'0x6D967F862d8c5D9E230a976AB2063eD1d4D7A43c',
'0xA2Ee6Fce4ACB62D95448729cDb781e3BEb62504A',
],
L2USDC_BRIDGE_ADDRESS,
'linea'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default migration('1736946439_configurate_and_ens', {

const updatedMarkets = {
...officialMarkets,
42161: [
59144: [
{
baseSymbol: 'USDT',
cometAddress: comet.address,
Expand Down Expand Up @@ -160,7 +160,7 @@ export default migration('1736946439_configurate_and_ens', {
}
];

const description = 'DESCRIPTION';
const description = '# Initialize cUSDTv3 on Linea network\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes the deployment of Compound III to the Linea network. This proposal takes the governance steps recommended and necessary to initialize a Compound III USDT market on Linea; upon execution, cUSDTv3 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). The new parameters include setting the risk parameters based off of the [recommendations from Gauntlet](https://www.comp.xyz/t/deploy-compound-iii-on-linea/4460/19).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/953), [deploy market GitHub action run](<>) and [forum discussion](https://www.comp.xyz/t/deploy-compound-iii-on-linea/4460).\n\n\n## Proposal Actions\n\nThe first proposal action sets the Comet configuration and deploys a new Comet implementation on Linea. This sends the encoded `setFactory`, `setConfiguration`, `deployAndUpgradeTo` calls across the bridge to the governance receiver on Linea.\n\nThe second action reduces Compound’s [cUSDT](https://etherscan.io/address/0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9) reserves and transfers it to Timelock, in order to seed the market reserves for the Linea cUSDTv3 Comet.\n\nThe third action approves 0 USDT from Timelock to [LineaL1TokenBridge](https://etherscan.io/address/0x051F1D88f0aF5763fB888eC4378b4D8B29ea3319) to reset potential previous approves.\n\nThe fourth action approves 100K USDT to [LineaL1TokenBridge](https://etherscan.io/address/0x051F1D88f0aF5763fB888eC4378b4D8B29ea3319) to take Timelock\'s USDT on Mainnet, in order to seed the market reserves through the bridge.\n\nThe fifth action bridges USDT from mainnet via Linea`s bridge contract and sends it to Comet on Linea.\n\nThe sixth 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 Linea cUSDTv3 market.';
const txn = await govDeploymentManager.retry(async () =>
trace(await governor.propose(...(await proposal(mainnetActions, description))))
);
Expand Down Expand Up @@ -268,6 +268,24 @@ export default migration('1736946439_configurate_and_ens', {
cometAddress: '0xaeB318360f27748Acb200CE616E389A6C9409a07'
}
],
42161: [
{
baseSymbol: 'USDC.e',
cometAddress: '0xA5EDBDD9646f8dFF606d7448e414884C7d905dCA',
},
{
baseSymbol: 'USDC',
cometAddress: '0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf',
},
{
baseSymbol: 'WETH',
cometAddress: '0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486',
},
{
baseSymbol: 'USDT',
cometAddress: '0xd98Be00b5D27fc98112BdE293e487f8D4cA57d07',
},
],
5000: [
{
baseSymbol: 'USDe',
Expand Down Expand Up @@ -298,7 +316,7 @@ export default migration('1736946439_configurate_and_ens', {
cometAddress: '0xB2f97c1Bd3bf02f5e74d13f02E3e26F93D77CE44'
},
],
42161: [
59144: [
// {
// baseSymbol: 'USDC',
// cometAddress: '<>',
Expand Down
5 changes: 3 additions & 2 deletions deployments/linea/weth/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"symbol": "cWETHv3",
"baseToken": "WETH",
"baseTokenAddress": "0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",
"borrowMin": "0.1e18",
"pauseGuardian": "0x5A1e5d7E09cA94506084a26304d53A138145bF52",
"borrowMin": "0.01e18",
"storeFrontPriceFactor": 0.7,
"targetReserves": "5_000e18",
"rates": {
Expand All @@ -20,7 +21,7 @@
"indexScale": "1e15",
"baseSupplySpeed": "0e0",
"baseBorrowSpeed": "0e0",
"baseMinForRewards": "100e18"
"baseMinForRewards": "10e18"
},
"assets": {
"ezETH": {
Expand Down
25 changes: 10 additions & 15 deletions deployments/linea/weth/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const DAY = 24 * HOUR;

const MAINNET_TIMELOCK = '0x6d903f6003cca6255d85cca4d3b5e5146dc33925';

const L2MESSAGE_SERVICE_ADDRESS = '0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec';
const L2STANDARD_BRIDGE_ADDRESS = '0x353012dc4a9A6cF55c941bADC267f82004A8ceB9';
const L2USDC_BRIDGE_ADDRESS = '0xA2Ee6Fce4ACB62D95448729cDb781e3BEb62504A';

export default async function deploy(
deploymentManager: DeploymentManager,
deploySpec: DeploySpec
Expand Down Expand Up @@ -64,7 +68,7 @@ async function deployContracts(
'wstETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x3C8A95F2264bB3b52156c766b738357008d87cB7', // wstETH / ETH price feed
'0x3C8A95F2264bB3b52156c766b738357008d87cB7', // wstETH / stETH (we consider stETH / ETH as 1:1) price feed
8 // decimals
]
);
Expand Down Expand Up @@ -96,7 +100,7 @@ async function deployContracts(
'weETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x1FBc7d24654b10c71fd74d3730d9Df17836181EF', // weETH / ETH price feed
'0x1FBc7d24654b10c71fd74d3730d9Df17836181EF', // weETH / eETH (we consider eETH / ETH as 1:1) price feed
8 // decimals
]
);
Expand All @@ -117,31 +121,22 @@ async function deployContracts(
'wrsETH / ETH price feed' // description
]
);

const l2MessageService = await deploymentManager.existing(
'l2MessageService',
[
'0x05d43713B7E333d2D54be65cE3b5F3698aB960Fd',
'0x508Ca82Df566dCD1B0DE8296e70a96332cD644ec',
],
L2MESSAGE_SERVICE_ADDRESS,
'linea'
);

const l2StandardBridge = await deploymentManager.existing(
'l2StandardBridge',
[
'0xD90ed3D4f9d11262d3D346a4369058d5B3777137',
'0x353012dc4a9A6cF55c941bADC267f82004A8ceB9',
],
L2STANDARD_BRIDGE_ADDRESS,
'linea'
);

const l2USDCBridge = await deploymentManager.existing(
'l2USDCBridge',
[
'0x6D967F862d8c5D9E230a976AB2063eD1d4D7A43c',
'0xA2Ee6Fce4ACB62D95448729cDb781e3BEb62504A',
],
L2USDC_BRIDGE_ADDRESS,
'linea'
);

Expand Down
Loading

0 comments on commit 029bff2

Please sign in to comment.