Skip to content

Commit

Permalink
refactor(tasks): cleanup and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvinparikh committed Nov 18, 2022
1 parent ceb5a04 commit 992304a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
14 changes: 14 additions & 0 deletions deploy_polygon/011_deploy_opUSDC-Earn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ const func: DeployFunction = async ({
"10000000000000", //uint256 _totalValueLockedLimitUT
],
},
onUpgrade: {
methodName: "initialize",
args: [
registryProxyAddress, //address _registry
MULTI_CHAIN_VAULT_TOKENS[chainId].USDC.hash, //bytes32 _underlyingTokensHash
"0x4a7e14b2b81abccd2dfd58372f0cbd5b5512749fbafee2e2cda5c56ac0fc947a", //bytes32 _whitelistedAccountsRoot
"USDC", //string memory _symbol
"1", //uint256 _riskProfileCode
"907136802102229675083754464877550363794833538656521846974622833684986724352", //uint256 _vaultConfiguration
"100000000000", //uint256 _userDepositCapUT
"0", //uint256 _minimumDepositValueUT
"10000000000000", //uint256 _totalValueLockedLimitUT
],
},
},
},
maxPriorityFeePerGas: BigNumber.from(feeData["maxPriorityFeePerGas"]), // Recommended maxPriorityFeePerGas
Expand Down
2 changes: 1 addition & 1 deletion helpers/types/registryV2/RegistryStorageV2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export class RegistryStorageV2 extends BaseContract {
toBlock?: string | number | undefined,
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;

interface: RegistryStorageInterface;
interface: RegistryStorageV2Interface;

functions: {
aprOracle(overrides?: CallOverrides): Promise<[string]>;
Expand Down
2 changes: 1 addition & 1 deletion helpers/types/registryV2/RegistryV2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ export class RegistryV2 extends BaseContract {
toBlock?: string | number | undefined,
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;

interface: RegistryInterface;
interface: RegistryV2Interface;

functions: {
"addRiskProfile(uint256,string,string,(uint8,uint8))"(
Expand Down
10 changes: 8 additions & 2 deletions tasks/actions/upgrade-and-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ task(TASKS.ACTION_TASKS.UPGRADE_TO_AND_CALL.NAME, TASKS.ACTION_TASKS.UPGRADE_TO_
vaultProxyAddress,
BigNumber.from("0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103"),
);
const oldVaultProxyInstance = <VaultV5>await ethers.getContractAt(VaultV5__factory.abi, vaultProxyAddress);
const oldVaultProxyInstance = <VaultV5>(
await ethers.getContractAt(
VaultV5__factory.abi,
vaultProxyAddress,
await ethers.getSigner("0xDa1d30af457b8386083C66c9Df7A86269bEbFDF8"),
)
);
const _underlyingToken = await oldVaultProxyInstance.underlyingToken();
const _underlyingTokenInstance = <ERC20>await ethers.getContractAt(ERC20__factory.abi, _underlyingToken);
const _registry = await oldVaultProxyInstance.registryContract();
Expand All @@ -43,7 +49,7 @@ task(TASKS.ACTION_TASKS.UPGRADE_TO_AND_CALL.NAME, TASKS.ACTION_TASKS.UPGRADE_TO_
const _minimumDepositValueUT = await oldVaultProxyInstance.minimumDepositValueUT();
const _totalValueLockedLimitUT = await oldVaultProxyInstance.totalValueLockedLimitUT();
let vaultProxyInstance;
if (storage === "0x") {
if (storage === ethers.constants.HashZero) {
console.log("Identified as VaultProxy");
vaultProxyInstance = <InitializableImmutableAdminUpgradeabilityProxy>(
await ethers.getContractAt(InitializableImmutableAdminUpgradeabilityProxy__factory.abi, vaultProxyAddress)
Expand Down

0 comments on commit 992304a

Please sign in to comment.