在我的 web3 项目中,我使用 "ethers": '^5.4.7'
但是我需要将 @orionprotocol/sdk 节点模块集成到我的项目中。
问题是这个模块需要 "ethers": '^6.7.0'
我以为我可以通过将以太币升级到版本6来做到这一点....
const tokenFrom = from === ethers.constants.AddressZero ? nativeToken : from;
const tokenTo = to === ethers.constants.AddressZero ? nativeToken : to;
// above code does not work in ethers v6, because there is no scope named "ethers.constants" and so on...
...
但是,我在 ethers v5 中编写的原始代码不再起作用。
当然,我可以将所有原始代码升级到新版本的以太坊,但我认为这对我来说并不是一个正确的解决方案。
您可以: