Skip to content

Commit

Permalink
feat: add impersonate in enact-migration; add supply caps and speeds;…
Browse files Browse the repository at this point in the history
… update description; update verify checks
  • Loading branch information
dmitriy-woof-software committed Jun 7, 2024
1 parent 336c08e commit c89cda2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/enact-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ on:
description: Run ID for Artifact
eth_pk:
description: Ignore if you plan to use WalletConnect, otherwise, you can paste in a Ethereum private key
impersonateAccount:
description: Impersonate Account
required: false
default: ''
jobs:
enact-migration:
name: Enact Migration
Expand Down Expand Up @@ -114,7 +118,18 @@ jobs:
GOV_NETWORK_PROVIDER: ${{ fromJSON('["", "http://localhost:8685"]')[github.event.inputs.eth_pk == '' && env.GOV_NETWORK != ''] }}
GOV_NETWORK: ${{ env.GOV_NETWORK }}
REMOTE_ACCOUNTS: ${{ fromJSON('["", "true"]')[github.event.inputs.eth_pk == ''] }}

if: github.event.inputs.impersonateAccount == ''
- name: Run Enact Migration (impersonate)
run: |
yarn hardhat migrate --network ${{ github.event.inputs.network }} --deployment ${{ github.event.inputs.deployment }} --enact --overwrite ${{ fromJSON('["", "--simulate"]')[github.event.inputs.simulate == 'true'] }} ${{ fromJSON('["", "--no-enacted"]')[github.event.inputs.no_enacted == 'true'] }} ${{ github.event.inputs.migration }} --impersonate ${{ github.event.inputs.impersonateAccount }}
env:
DEBUG: true
ETH_PK: "${{ inputs.eth_pk }}"
NETWORK_PROVIDER: ${{ fromJSON('["", "http://localhost:8585"]')[github.event.inputs.eth_pk == ''] }}
GOV_NETWORK_PROVIDER: ${{ fromJSON('["", "http://localhost:8685"]')[github.event.inputs.eth_pk == '' && env.GOV_NETWORK != ''] }}
GOV_NETWORK: ${{ env.GOV_NETWORK }}
REMOTE_ACCOUNTS: ${{ fromJSON('["", "true"]')[github.event.inputs.eth_pk == ''] }}
if: github.event.inputs.impersonateAccount != ''
- name: Commit changes
if: ${{ github.event.inputs.simulate == 'false' }}
run: |
Expand Down
12 changes: 6 additions & 6 deletions deployments/arbitrum/weth/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
},
"tracking": {
"indexScale": "1e15",
"baseSupplySpeed": "0e15",
"baseBorrowSpeed": "0e15",
"baseSupplySpeed": "69444444444e0",
"baseBorrowSpeed": "46296296296e0",
"baseMinForRewards": "1000e18"
},
"assets": {
Expand All @@ -32,23 +32,23 @@
"borrowCF": 0.82,
"liquidateCF": 0.87,
"liquidationFactor": 0.92,
"supplyCap": "0e18"
"supplyCap": "550e18"
},
"rETH": {
"address": "0xEC70Dcb4A1EFa46b8F2D97C310C9c4790ba5ffA8",
"decimals": "18",
"borrowCF": 0.90,
"liquidateCF": 0.93,
"liquidationFactor": 0.97,
"supplyCap": "0e18"
"supplyCap": "800e18"
},
"wstETH": {
"address": "0x5979D7b546E38E414F7E9822514be443A4800529",
"decimals": "18",
"borrowCF": 0.88,
"liquidateCF": 0.93,
"liquidationFactor": 0.97,
"supplyCap": "0e18"
"supplyCap": "2000e18"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default migration('1713517203_configurate_and_ens', {
}
];

const description = "# Initialize cWETHv3 on Arbitrum\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes deployment of Compound III to the Arbitrum network. This proposal takes the governance steps recommended and necessary to initialize a Compound III WETH market on Arbitrum; upon execution, cWETHv3 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/add-eth-market-on-arbitrum/5252/2).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/856), [deploy market GitHub action run]() and [forum discussion](https://www.comp.xyz/t/add-eth-market-on-arbitrum/5252).\n\n\n## Proposal Actions\n\nThe first proposal action sets the Comet configuration and deploys a new Comet implementation on Arbitrum. This sends the encoded `setFactory`, `setConfiguration`, `deployAndUpgradeTo` calls across the bridge to the governance receiver on Arbitrum. It also calls `setRewardConfig` on the Arbitrum rewards contract, to establish Artitrum’s bridged version of COMP as the reward token for the deployment and set the initial supply speed to be 6 COMP/day and borrow speed to be 4 COMP/day.\n\nThe second action wraps ETH as WETH so it can be then transferred.\n\nThe third action approves (ArbitrumL1GatewayRouter) [TokenMessenger](https://etherscan.io/address/0x72Ce9c846789fdB6fC1f34aC4AD25Dd9ef7031ef) to take the Timelock's WETH on Mainnet, in order to seed the market reserves through the arbitrumL1GatewayRouter.\n\nThe fourth action bridges WETH from mainnet via ‘outboundTransfer’ function on ArbitrumL1GatewayRouter’s contract to mint native WETH to Comet on Arbitrum.\n\nThe fifth 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 Arbitrum cUSDCv3 market.\n";
const description = "# Initialize cWETHv3 on Arbitrum\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes deployment of Compound III to the Arbitrum network. This proposal takes the governance steps recommended and necessary to initialize a Compound III WETH market on Arbitrum; upon execution, cWETHv3 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/add-eth-market-on-arbitrum/5252/2).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull60), [deploy market GitHub action run](https://github.com/woof-software/comet/actions/runs/9419069237/job/25948008428) and [forum discussion](https://www.comp.xyz/t/add-eth-market-on-arbitrum/5252).\n\n\n## Proposal Actions\n\nThe first proposal action sets the Comet configuration and deploys a new Comet implementation on Arbitrum. This sends the encoded `setFactory`, `setConfiguration`, `deployAndUpgradeTo` calls across the bridge to the governance receiver on Arbitrum. It also calls `setRewardConfig` on the Arbitrum rewards contract, to establish Artitrum’s bridged version of COMP as the reward token for the deployment and set the initial supply speed to be 6 COMP/day and borrow speed to be 4 COMP/day.\n\nThe second action wraps ETH as WETH so it can be then transferred.\n\nThe third action approves (ArbitrumL1GatewayRouter) [TokenMessenger](https://etherscan.io/address/0x72Ce9c846789fdB6fC1f34aC4AD25Dd9ef7031ef) to take the Timelock's WETH on Mainnet, in order to seed the market reserves through the arbitrumL1GatewayRouter.\n\nThe fourth action bridges WETH from mainnet via ‘outboundTransfer’ function on ArbitrumL1GatewayRouter’s contract to mint native WETH to Comet on Arbitrum.\n\nThe fifth 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 Arbitrum cWETHv3 market.\n";
const txn = await govDeploymentManager.retry(async () =>
trace(await governor.propose(...(await proposal(mainnetActions, description))))
);
Expand Down Expand Up @@ -211,9 +211,9 @@ export default migration('1713517203_configurate_and_ens', {
const weETHInfo = await comet.getAssetInfoByAddress(weETH.address);
const rETHInfo = await comet.getAssetInfoByAddress(rETH.address);
const wstETHInfo = await comet.getAssetInfoByAddress(wstETH.address);
// expect(weETHInfo.supplyCap).to.be.eq(exp(550, 18));
// expect(wstETHInfo.supplyCap).to.be.eq(exp(2000, 18));
// expect(rETHInfo.supplyCap).to.be.eq(exp(800, 18));
expect(weETHInfo.supplyCap).to.be.eq(exp(550, 18));
expect(wstETHInfo.supplyCap).to.be.eq(exp(2000, 18));
expect(rETHInfo.supplyCap).to.be.eq(exp(800, 18));

expect(await comet.pauseGuardian()).to.be.eq('0x78E6317DD6D43DdbDa00Dce32C2CbaFc99361a9d');

Expand Down Expand Up @@ -290,7 +290,7 @@ export default migration('1713517203_configurate_and_ens', {
});

// 8.
// expect(await comet.baseTrackingSupplySpeed()).to.be.equal(exp(6, 15));
// expect(await comet.baseTrackingBorrowSpeed()).to.be.equal(exp(4, 15));
expect(await comet.baseTrackingSupplySpeed()).to.be.equal(exp(6 / 86400, 15, 18));
expect(await comet.baseTrackingBorrowSpeed()).to.be.equal(exp(4 / 86400, 15, 18));
}
});

0 comments on commit c89cda2

Please sign in to comment.