diff --git a/tasks/deploy_forwarder_mainnet.js b/tasks/deploy_forwarder_mainnet.js index 40b5cb4..ec9fd16 100644 --- a/tasks/deploy_forwarder_mainnet.js +++ b/tasks/deploy_forwarder_mainnet.js @@ -2,11 +2,11 @@ const { task } = require('hardhat/config') const { ADDRESSES: { - MAINNET: { PNT, ERC20_VAULT, FORWARDER, SAFE } + MAINNET: { PNT, ETHPNT, ERC20_VAULT, FORWARDER_PNT, FORWARDER_ETHPNT, SAFE } } } = require('../lib/constants') -const deploy = async (_args, _hre) => { +const deployForwarderPNT = async (_args, _hre) => { if (_hre.network.name !== 'mainnet') { throw new Error('Invalid network') } @@ -17,9 +17,26 @@ const deploy = async (_args, _hre) => { } // eslint-disable-next-line no-unused-vars -const transferOwnership = async (_args, _hre) => { - const c = await _hre.ethers.getContractAt('Forwarder', FORWARDER) +const deployForwarderEthPNT = async (_args, _hre) => { + if (_hre.network.name !== 'mainnet') { + throw new Error('Invalid network') + } + const Forwarder = await _hre.ethers.getContractFactory('Forwarder') + console.log('Deploying forwarder on Ethereum ...') + const forwarder = await Forwarder.deploy(ETHPNT, ERC20_VAULT) + console.log('Forwarder deployed at', forwarder.target) +} + +// eslint-disable-next-line no-unused-vars +const transferOwnershipForwarderPNT = async (_args, _hre) => { + const c = await _hre.ethers.getContractAt('Forwarder', FORWARDER_PNT) + await c.transferOwnership(SAFE) +} + +// eslint-disable-next-line no-unused-vars +const transferOwnershipForwarderEthPNT = async (_args, _hre) => { + const c = await _hre.ethers.getContractAt('Forwarder', FORWARDER_ETHPNT) await c.transferOwnership(SAFE) } -task('deploy:forwarder-mainnet', 'Deploy Forwarder on Mainnet', deploy) +task('deploy:forwarder-mainnet', 'Deploy Forwarder on Mainnet', deployForwarderPNT)