在函数调用中进行参数的无效类型。无效的隐式转换从地址到地址应付请求的地址.sg.sender和adress 0

发布于 2025-01-23 16:52:38 字数 861 浏览 0 评论 0原文

    // create the fllow to transform the ownership of the nft
    //from the item owner(seller) to the contract that will transact to the buyer
    IERC721(nftcontract).transferFrom(msg.sender,address(this),tokenId);

    //after the marketitem is created
    //the market item creation is an event executed by this contract so we must emit it so that the details of the market item will be listned to or used
    emit MarketItemcreated(
     ItemId,
     nftcontract,//the nft because the nft contract address means the nft created
     tokenId,
     msg.sender,//seller is the msg.sender                              // we don't do payable because we emit only the details of the cretaedmarketid (what the market id contain)
     address(0),//no one yet own this nft
     price,
    false//not yet solde    
    );
}

我在味精中面临问题。

    // create the fllow to transform the ownership of the nft
    //from the item owner(seller) to the contract that will transact to the buyer
    IERC721(nftcontract).transferFrom(msg.sender,address(this),tokenId);

    //after the marketitem is created
    //the market item creation is an event executed by this contract so we must emit it so that the details of the market item will be listned to or used
    emit MarketItemcreated(
     ItemId,
     nftcontract,//the nft because the nft contract address means the nft created
     tokenId,
     msg.sender,//seller is the msg.sender                              // we don't do payable because we emit only the details of the cretaedmarketid (what the market id contain)
     address(0),//no one yet own this nft
     price,
    false//not yet solde    
    );
}

i'am facing the problem in msg.sender and adress 0 i don't know where is the problem

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

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

发布评论

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

评论(1

几味少女 2025-01-30 16:52:38

我认为问题是您没有将函数修改为付款。您没有显示完整的代码,我认为您发布的代码在一个函数内部,并且此函数必须标记为付款。如果不是这种情况,请共享完整的功能代码。一个常见的错误是不要将msg.sender付款(msg.sender)。因为由于坚固性0.6.0 msg.sender不再应付。

I think the issue is you are not modified the function as payable. You are not showing the full code, I think the code that you posted is inside a function and this function has to be marked as payable. if this is not the case, share the full function code please. A common mistake is not to wrap msg.sender with payable(msg.sender). because since solidity 0.6.0 msg.sender is not payable any more.

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