薄荷ERC721令牌到特定帐户

发布于 2025-01-29 04:37:34 字数 106 浏览 4 评论 0原文

如何将NFT直接铸造到某人的钱包中?我已经为NFT固定了IPF,并使用松露控制台将其用于薄荷。我能够铸造令牌,但它们仅来自我的钱包。我需要以MetAmask记录的用户的名义将其铸造。有人可以帮忙吗?

How can I mint an NFT using ERC 721 directly to someone's wallet? I have done IPFS pinning for my NFT and am using truffle console to mint. I am able to mint the tokens but they are from my wallet only. I need it to be minted in the name of metamask logged user. Can someone help?

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

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

发布评论

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

评论(1

要向某个用户铸造,您必须在薄荷功能中添加一个参数。

function mint(address _to, ...) public payable {
    // ...
    _safeMint(_to, ...);
}

这样的东西。然后,在您的DAPP中,您只需将连接的钱包的地址添加为_TO参数。

To mint to a certain user, you'd have to add a parameter to your mint function.

function mint(address _to, ...) public payable {
    // ...
    _safeMint(_to, ...);
}

Something like this. And then in your dApp you'd simply add the connected wallet's address as the _to parameter.

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