Skip to content

Commit

Permalink
Fix supply cap migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincheng96 committed Jun 27, 2023
1 parent dfd1754 commit f3e7890
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deployments/linea-goerli/usdc/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"baseToken": "USDC",
"baseTokenAddress": "0xf56dc6695cF1f5c364eDEbC7Dc7077ac9B586068",
"baseTokenPriceFeed": "0xcb81fffa91cd5f3436318d25057c1d5df8e23f95",
"borrowMin": "1e6",
"borrowMin": "0.001e18",
"storeFrontPriceFactor": 0.5,
"targetReserves": "1000000e6",
"rates": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../../../../src/deploy';
import { expect } from 'chai';

export default migration('1687878801_increase-supply-caps', {
export default migration('1687878801_increase_supply_caps', {
prepare: async (deploymentManager: DeploymentManager) => {
return {};
},
Expand All @@ -29,6 +29,7 @@ export default migration('1687878801_increase-supply-caps', {
const {
bridgeReceiver,
comet,
cometAdmin,
configurator,
} = await deploymentManager.getContracts();

Expand All @@ -45,15 +46,20 @@ export default migration('1687878801_increase-supply-caps', {
configuration
)
);
const deployAndUpgradeToCalldata = utils.defaultAbiCoder.encode(
['address', 'address'],
[configurator.address, comet.address]
);
const l2ProposalData = utils.defaultAbiCoder.encode(
['address[]', 'uint256[]', 'string[]', 'bytes[]'],
[
[configurator.address],
[0],
[configurator.address, cometAdmin.address],
[0, 0],
[
'setConfiguration(address,(address,address,address,address,address,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint104,uint104,uint104,(address,address,uint8,uint64,uint64,uint64,uint128)[]))',
'deployAndUpgradeTo(address,address)',
],
[setConfigurationCalldata],
[setConfigurationCalldata, deployAndUpgradeToCalldata],
]
);

Expand Down Expand Up @@ -94,11 +100,12 @@ export default migration('1687878801_increase-supply-caps', {
// 1.
const stateChanges = await diffState(comet, getCometConfig, preMigrationBlockNumber);
expect(stateChanges).to.deep.equal({
baseBorrowMin: exp(0.001, 18),
WETH: {
supplyCap: exp(10000000, 18)
supplyCap: exp(10_000_000, 18)
},
WBTC: {
supplyCap: exp(300000, 18)
supplyCap: exp(30_000, 18)
},
});
}
Expand Down

0 comments on commit f3e7890

Please sign in to comment.