Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the contract upgradeability works smoothly in binance and polygon #60

Conversation

softskillpro
Copy link
Member

@terminator0x
#50

you can run "npx hardhat run scripts/upgradeChecks.js"

Please review this PR.
Thank you.

Copy link
Collaborator

@terminator0x terminator0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@softskillpro Niice, we're almost there, please fix the issues requested, rebase and i'll merge

binance: {
url: "https://bsc-dataseed.binance.org/",
chainId: 56,
gasPrice: 20000000000,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this, not necessary


const netinfo = await ethers.provider.getNetwork();
network = netinfo.name;
if (network === "unknown")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to

 if (network === "unknown"){
network = 'mainnet';
 // put the rest of the code here
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question here, do you mean that put the same code here for mainnet?
In my opinion, it's not good we have duplicated code for mainnet, binance and polygon.
so, how about to use if/else for only places where needs a special process for a specific network?
Or we can define configs for each networks, it will makes generalized code.
Forexample, in deploy.js and config.json

	const wrapper = await deployWithProxy(
        Wrapper, 
        OwnableProxy, 
        'WrapAndUnWrap',
		addr.tokens.WETH[network],
		addr.swaps.uniswap[network],
		addr.swaps.uniswapFactory[network],
		addr.tokens.DAI[network],
		addr.tokens.USDT[network],
		addr.tokens.USDC[network]
    );

The more generalized code, easier to understand and more clean.
What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@softskillpro I agree, please implement it this way :)

console.log("Deploying from account: " + ownerAddress);
console.log("");

if (network === "binance") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the same flow for Polygon/Matic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants