web3py中的验证

发布于 2025-02-13 02:24:16 字数 665 浏览 3 评论 0 原文

uniswap_v3_quoter_contract.functions.quoteExactInputSingle(wbtc_token, weth_token, web3.toWei(0.01, 'ether'), 3000, 0).call()

提出错误

ValidationError: 
Could not identify the intended function with name `quoteExactInputSingle`, positional argument(s) of type `(<class 'str'>, <class 'str'>, <class 'int'>, <class 'int'>, <class 'int'>)` and keyword argument(s) of type `{}`.
Found 1 function(s) with the name `quoteExactInputSingle`: ['quoteExactInputSingle(address,address,uint24,uint256,uint160)']
Function invocation failed due to no matching argument types.

我尝试了很多次,但行不通

uniswap_v3_quoter_contract.functions.quoteExactInputSingle(wbtc_token, weth_token, web3.toWei(0.01, 'ether'), 3000, 0).call()

raise error

ValidationError: 
Could not identify the intended function with name `quoteExactInputSingle`, positional argument(s) of type `(<class 'str'>, <class 'str'>, <class 'int'>, <class 'int'>, <class 'int'>)` and keyword argument(s) of type `{}`.
Found 1 function(s) with the name `quoteExactInputSingle`: ['quoteExactInputSingle(address,address,uint24,uint256,uint160)']
Function invocation failed due to no matching argument types.

I've tried many times but it doesn't work

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染火枫林 2025-02-20 02:24:16

您有错误,因为您提交字符串而不是地址格式。
如果您正在使用web3 python()可以使用is_checksum_address验证格式或to_checksum_address以更改字符串以进行地址格式。

You have the error because you submit string instead of address format.
if you are using web3 python (https://web3py.readthedocs.io/en/latest/web3.main.html#addresses) you can use is_checksum_address to verify the format or to_checksum_address to change your string to address format.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文