Skip to content

Commit

Permalink
Update etherscan verify script
Browse files Browse the repository at this point in the history
  • Loading branch information
134dd3v committed Mar 16, 2023
1 parent 221d02d commit b524be8
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 39 deletions.
2 changes: 0 additions & 2 deletions deploy/dn-gmx-trader-hedge-strategy-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
log: true,
waitConfirmations,
});

// TODO proxy and initialize
};

export default func;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"deploy:goerli": "hardhat deploy --network goerli && yarn etherscan --network goerli",
"deploy:localhost": "hardhat --network localhost deploy",
"deploy:rinkeby": "hardhat deploy --network rinkeby && yarn etherscan --network rinkeby",
"etherscan": "hardhat etherscan-verify",
"etherscan": "hardhat etherscan-verify --network arbmain",
"etherscan2": "TS_NODE_SKIP_IGNORE=true hardhat run scripts/etherscan-verify.ts --network arbmain",
"format": "prettier --check contracts test",
"format:fix": "prettier --write contracts test",
"size": "hardhat size-contracts",
Expand Down
112 changes: 76 additions & 36 deletions scripts/etherscan-verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { Deployment } from 'hardhat-deploy/types';
import { getNetworkInfo } from '../deploy/network-info';
import {
DnGmxBatchingManager__factory,
DnGmxBatchingManagerGlp__factory,
DnGmxJuniorVault__factory,
DnGmxSeniorVault__factory,
DnGmxTraderHedgeStrategy__factory,
} from '../typechain-types';

async function main() {
Expand All @@ -14,60 +16,98 @@ async function main() {

const ProxyAdmin = await hreVerify('ProxyAdmin');

const DnGmxJuniorVaultManagerLibrary = await hreVerify('DnGmxJuniorVaultManagerLibrary');
const QuoterLibrary = await hreVerify('QuoterLibrary');
const DnGmxJuniorVaultManagerLibrary = await hreVerify('DnGmxJuniorVaultManagerLibrary', {
libraries: {
QuoterLib: QuoterLibrary.address,
},
});
const DnGmxJuniorVaultLogic = await hreVerify('DnGmxJuniorVaultLogic', {
libraries: {
DnGmxJuniorVaultManager: DnGmxJuniorVaultManagerLibrary.address,
},
});
const DnGmxSeniorVaultLogic = await hreVerify('DnGmxSeniorVaultLogic');
const DnGmxBatchingManager = await hreVerify('DnGmxBatchingManager');
const DnGmxBatchingManagerLogic = await hreVerify('DnGmxBatchingManagerLogic');
const DnGmxBatchingManagerGlpLogic = await hreVerify('DnGmxBatchingManagerGlpLogic');
const DnGmxTraderHedgeStrategyLogic = await hreVerify('DnGmxTraderHedgeStrategyLogic');

const DnGmxJuniorVault = await hreVerify('DnGmxJuniorVault', {
constructorArguments: [
DnGmxJuniorVaultLogic.address,
ProxyAdmin.address,
DnGmxJuniorVault__factory.createInterface().encodeFunctionData('initialize', [
'Delta Netural GMX Vault (Junior)', // _name
'DN_GMX_JUNIOR', // _symbol
ni.UNI_V3_SWAP_ROUTER,
ni.GMX_REWARD_ROUTER,
ni.GMX_MINT_BURN_REWARD_ROUTER,
{
weth: ni.WETH_ADDRESS,
wbtc: ni.WBTC_ADDRESS,
sGlp: ni.GMX_SGLP_ADDRESS,
usdc: ni.USDC_ADDRESS,
},
ni.AAVE_POOL_ADDRESS_PROVIDER,
]),
],
});
const DnGmxJuniorVault = await get('DnGmxJuniorVault');
// const DnGmxJuniorVault = await hreVerify('DnGmxJuniorVault', {
// constructorArguments: [
// DnGmxJuniorVaultLogic.address,
// ProxyAdmin.address,
// DnGmxJuniorVault__factory.createInterface().encodeFunctionData('initialize', [
// 'Delta Netural GMX Vault (Junior)', // _name
// 'DN_GMX_JUNIOR', // _symbol
// ni.UNI_V3_SWAP_ROUTER,
// ni.GMX_REWARD_ROUTER,
// ni.GMX_MINT_BURN_REWARD_ROUTER,
// {
// weth: ni.WETH_ADDRESS,
// wbtc: ni.WBTC_ADDRESS,
// sGlp: ni.GMX_SGLP_ADDRESS,
// usdc: ni.USDC_ADDRESS,
// },
// ni.AAVE_POOL_ADDRESS_PROVIDER,
// ]),
// ],
// });

// await hreVerify('DnGmxSeniorVault', {
// constructorArguments: [
// DnGmxSeniorVaultLogic.address,
// ProxyAdmin.address,
// DnGmxSeniorVault__factory.createInterface().encodeFunctionData('initialize', [
// ni.USDC_ADDRESS,
// 'Delta Netural GMX Vault (Senior)',
// 'DN_GMX_SENIOR',
// ni.AAVE_POOL_ADDRESS_PROVIDER,
// ]),
// ],
// });

await hreVerify('DnGmxSeniorVault', {
// await hreVerify('DnGmxBatchingManager', {
// constructorArguments: [
// DnGmxBatchingManagerLogic.address,
// ProxyAdmin.address,
// DnGmxBatchingManager__factory.createInterface().encodeFunctionData('initialize', [
// ni.GMX_SGLP_ADDRESS,
// ni.USDC_ADDRESS,
// ni.GMX_REWARD_ROUTER,
// ni.GLP_MANAGER,
// DnGmxJuniorVault.address,
// ni.KEEPER_BATCHING_MANAGER,
// ]),
// ],
// });

await hreVerify('DnGmxBatchingManagerGlp', {
constructorArguments: [
DnGmxSeniorVaultLogic.address,
DnGmxBatchingManagerGlpLogic.address,
ProxyAdmin.address,
DnGmxSeniorVault__factory.createInterface().encodeFunctionData('initialize', [
ni.USDC_ADDRESS,
'Delta Netural GMX Vault (Senior)',
'DN_GMX_SENIOR',
ni.AAVE_POOL_ADDRESS_PROVIDER,
DnGmxBatchingManagerGlp__factory.createInterface().encodeFunctionData('initialize', [
ni.GMX_SGLP_ADDRESS,
ni.GMX_MINT_BURN_REWARD_ROUTER,
ni.GLP_MANAGER,
DnGmxJuniorVault.address,
ni.KEEPER_BATCHING_MANAGER,
]),
],
});

await hreVerify('DnGmxBatchingManager', {
await hreVerify('DnGmxTraderHedgeStrategy', {
constructorArguments: [
DnGmxBatchingManager.address,
DnGmxTraderHedgeStrategyLogic.address,
ProxyAdmin.address,
DnGmxBatchingManager__factory.createInterface().encodeFunctionData('initialize', [
ni.GMX_SGLP_ADDRESS,
ni.USDC_ADDRESS,
ni.GMX_REWARD_ROUTER,
DnGmxTraderHedgeStrategy__factory.createInterface().encodeFunctionData('initialize', [
ni.KEEPER_BATCHING_MANAGER,
ni.GMX_VAULT,
ni.GLP_MANAGER,
DnGmxJuniorVault.address,
ni.KEEPER_BATCHING_MANAGER,
ni.GLP_ADDRESS,
ni.WETH_ADDRESS,
ni.WBTC_ADDRESS,
]),
],
});
Expand Down

0 comments on commit b524be8

Please sign in to comment.