在确认浏览器或Chrome扩展名交易之前,如何获得Web3合同地址?
假设我想购买NFT,我的Metamask弹出窗口打开,要求我确认交易。在那里,您可以看到合同地址...但是如何使用浏览器中的JavaScript或扩展名中的JavaScript访问此合同地址(仅检索该值,不要更改:) :))?
Let's say I want to buy an NFT and my Metamask popup opens asking me to confirm the transaction. There you can see the contract address... but how can I access this contract address (just retrieve the value, not change it :) ) programmatically using javascript in the browser or an extension?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嘿,要在控制台上获取合同地址,只需在.sol文件中包含此代码,并更新代码的ABI。
在前端,与您的智能合约施加了作用,并将结果在控制台中包含在您的index.js文件中
Hey for getting the contract address on your console just include this code in the .sol file and also update the abi of the code .
And in the frontend to intract with your smart contract and for getting the result in the console include this in your index.js file