diff --git a/deploy/scripts/mainnet/0016-CarbonVortex-upgrade.ts b/deploy/scripts/mainnet/0016-CarbonVortex-upgrade.ts new file mode 100644 index 00000000..e296b764 --- /dev/null +++ b/deploy/scripts/mainnet/0016-CarbonVortex-upgrade.ts @@ -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);