获得基本合同和代理合同的ABI

发布于 2025-02-09 18:12:47 字数 546 浏览 1 评论 0 原文

这是一个示例 -

这是我用于铸造的代理合同,问题是当我使用 Etherscan API获取其ABI时,它没有 Mint 函数。 Mint 函数仅在基本合同上可用,这是一个 -

所以我的问题是是否有可能同时获得ABI或我如何知道我应该从哪里获得基础ABI。我正在使用 ethers 库。

This is an example - https://etherscan.io/address/0x769250862220d509fb9bed5f88d824c9fb74a833.

It is a proxy contract which I use for minting, the problem is it doesn't have mint function when I use etherscan API to get its ABI. Mint function is only available on base contract which is this one - https://etherscan.io/address/0x29d1ab5f6bab57708a1935df104d985f4611dad6#code

So my question is if there is any possibility to get maybe both ABI's or how do I know where should I get base ABI. I am using ethers library.

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

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

发布评论

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

评论(1

铁憨憨 2025-02-16 18:12:47

就我的关注而言,除非在Explorer中验证合同,否则我们将无法获得ABI,而Ethers将永远不会给ABI,因为其中包括生成相同的合同来源。

我们来自Explorer的API,

https://docs.etherscan.io/api-endpoints/contracts#get-contract-contract-for-verified-contract-contract-source-codes

这适用于所有经过验证的合同,还具有限制请求率,,,,

As far as my concern, we cannot get abi unless the contract is verified in explorer, ethers will never give the abi, as that includes the contract source to generate the same.

we have the api's from explorers,

https://docs.etherscan.io/api-endpoints/contracts#get-contract-abi-for-verified-contract-source-codes

this works for all verified contracts, also has a limit rate of requests,

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