Skip to content

Commit

Permalink
add vortex 2.0 upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanzhelyazkov committed Aug 23, 2024
1 parent d119ac2 commit 6e61525
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions deploy/scripts/mainnet/0016-CarbonVortex-upgrade.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { DeployFunction } from 'hardhat-deploy/types';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployedContracts, upgradeProxy, InstanceName, setDeploymentMetadata } from '../../../utils/Deploy';
import { NATIVE_TOKEN_ADDRESS } from '../../../utils/Constants';

/**
* upgrade carbon vortex 2.0 to v2:
* add maxInput to trade function
* fix upgradeable contract
*/
const func: DeployFunction = async ({ getNamedAccounts }: HardhatRuntimeEnvironment) => {
const { deployer, bnt, vault, oldVortex } = await getNamedAccounts();
const carbonController = await DeployedContracts.CarbonController.deployed();

await upgradeProxy({
name: InstanceName.CarbonVortex,
from: deployer,
args: [carbonController.address, vault, oldVortex, bnt, NATIVE_TOKEN_ADDRESS, bnt],
checkVersion: false
});

return true;
};

export default setDeploymentMetadata(__filename, func);

0 comments on commit 6e61525

Please sign in to comment.