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

Typo after abi formatting using interface.format function #3372

Closed
Kharabet opened this issue Sep 9, 2022 · 1 comment
Closed

Typo after abi formatting using interface.format function #3372

Kharabet opened this issue Sep 9, 2022 · 1 comment
Labels
C-bug Category: bugs S-unconfirmed Status: Issue might be valid, but it’s not yet confirmed

Comments

@Kharabet
Copy link

Kharabet commented Sep 9, 2022

Describe the bug
I was trying to get l1BaseFee using OVMGasPriceOracle contract. I have initialized it using the following code:

  const OVMGasPriceOracle = getContractFactory('OVM_GasPriceOracle').attach(
    predeploys.OVM_GasPriceOracle
  )
  const formatted = OVMGasPriceOracle.interface.format(ethers.utils.FormatTypes.json) as string
  const abi = JSON.parse(formatted)
  return new web3.eth.Contract(abi, OVMGasPriceOracle.address)

In formatted there is a typo in abi structure: ouput instead of output which doesn't allow to parse the result of the method call

image

Additional context
The issue comes actually from ethers.js formatter and they have fixed it here ethers-io/ethers.js#1275 in version 5.0.29

In package json I see ethers.js v 5.0.0 as a dependency. Upgrading it to v 5.0.29 would resolve the issue

@smartcontracts smartcontracts added C-bug Category: bugs S-unconfirmed Status: Issue might be valid, but it’s not yet confirmed labels Sep 9, 2022
@smartcontracts
Copy link
Contributor

The @eth-optimism/contracts package has ethers@^5 as a peer dependency, so the version of ethers will depend on the version you have installed in your project. If you install the latest version of ethers within your project, this should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bugs S-unconfirmed Status: Issue might be valid, but it’s not yet confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants