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

Deploy Polygon Amoy, drop Mumbai #492

Merged
merged 7 commits into from
Apr 16, 2024
Merged

Deploy Polygon Amoy, drop Mumbai #492

merged 7 commits into from
Apr 16, 2024

Conversation

dtbuchholz
Copy link
Contributor

Summary

Adds a new utility function to get live gas prices for Amoy and deploys new registry contracts there. Also, drops Mumbai.

Details

For some reason, ethers' built-in method getFeeData (which makes a call to get gas prices from a node) returns absurdly wrong data for Amoy. E.g., maxFeePerGas of 1000000030n and maxPriorityFeePerGas of 1000000000n—but in reality, these are 30x larger at 35185714305n and 35185714290n, respectively. Thus, an API call to the gas station is required. Note: there is a built-in custom gas fee class in ethers, but I couldn't figure out how to use it.

How it was tested

Deploying on live net.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

filecoin: "0x59EF8Bf2d6c102B4c42AEf9189e1a9F0ABfD652d",
// testnets
sepolia: "0xc50C62498448ACc8dBdE43DA77f8D5D2E2c7597D",
"optimism-sepolia": "0x68A2f4423ad3bf5139Db563CF3bC80aA09ed7079",
"arbitrum-sepolia": "0x223A74B8323914afDC3ff1e5005564dC17231d6e",
maticmum: "0x4b48841d4b32C4650E4ABc117A03FE8B51f38F68",
"polygon-amoy": "0x170fb206132b693e38adFc8727dCfa303546Cec1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

README.md Outdated Show resolved Hide resolved
contracts/utils/TablelandDeployments.sol Outdated Show resolved Hide resolved
chainId: 80002,
urls: {
apiURL:
"https://www.oklink.com/api/explorer/v1/polygonamoy/contract/verify/async",
Copy link
Member

Choose a reason for hiding this comment

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

i found this on some SO issue... might not be right

Copy link
Contributor Author

@dtbuchholz dtbuchholz Apr 15, 2024

Choose a reason for hiding this comment

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

ah, yeah should be https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/AMOY_TESTNET. still can't get it to work tho:

Verifying on 'polygon-amoy'...
Verifying implementation: 0x3BDC3E46d8de7A2e67A07Ac917382dB6D94577dc
Successfully submitted source code for contract
contracts/TablelandTables.sol:TablelandTables at 0x3BDC3E46d8de7A2e67A07Ac917382dB6D94577dc
for verification on the block explorer. Waiting for verification result...

We tried verifying your contract TablelandTables without including any unrelated one, but it failed.
Trying again with the full solc input used to compile and deploy it.
This means that unrelated contracts may be displayed on Etherscan...

Successfully submitted source code for contract
contracts/TablelandTables.sol:TablelandTables at 0x3BDC3E46d8de7A2e67A07Ac917382dB6D94577dc
for verification on the block explorer. Waiting for verification result...

Failed to verify implementation contract at 0x3BDC3E46d8de7A2e67A07Ac917382dB6D94577dc: The contract verification failed.
Reason: Fail - Unable to verify

Verifying proxy: 0x170fb206132b693e38adFc8727dCfa303546Cec1
Error: Etherscan API call failed with status 500, response: {"code":"50026","msg":"System error, please try again later.","data":[]}
  • docs ref: here
  • potentially, a known issue with hardhat: here

Copy link
Member

Choose a reason for hiding this comment

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

hmm, 500 error should mean it's an error on oklink's side, but who knows. is the browserUrl correct?

did you by change compile some changes after deploying? NomicFoundation/hardhat#1349 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

might be worth doing a fresh build, deploy, and verify to make sure something weird didn't happen

Copy link
Contributor Author

@dtbuchholz dtbuchholz Apr 15, 2024

Choose a reason for hiding this comment

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

hm, i didn't change the hardhat compiler version or any of the build settings, so i don't think it's that. but, if i change the compiler version to 0.8.20 and try to verify, it confirms that 0.8.19 is the correct version for the contract i deployed:

The contract you want to verify was compiled with solidity 0.8.19, but your configured compiler version is: 0.8.20.

based on the polygon discord, others are having the same issue with oklink. however, the polygon team noted polygonscan will be supporting amoy within the next 2-3 weeks, so it's probably a moot point.

edit: i tried rebuilding/deploying/verifying a new contract w/ my personal wallet. same result, couldn't verify

Copy link
Member

Choose a reason for hiding this comment

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

cool. sg!

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iPaulPro ahh nice, thanks. much better, will add

scripts/utils.ts Show resolved Hide resolved
@dtbuchholz dtbuchholz merged commit ba094f6 into main Apr 16, 2024
2 checks passed
@dtbuchholz dtbuchholz deleted the dtb/deploy-amoy branch April 16, 2024 07:07
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.

4 participants