繁体   English   中英

function 调用中的参数类型无效。 从地址到请求的应付地址的隐式转换无效。对于 msg.sender 和地址 0

[英]Invalid type for argument in function call. Invalid implicit conversion from address to address payable requested.for msg.sender and adress 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    
    );
}

我在 msg.sender 和地址 0 中遇到问题 我不知道问题出在哪里

我认为问题是您没有将 function 修改为payable 您没有显示完整代码,我认为您发布的代码在 function 中,而这个 function 必须标记为payable 如果不是这种情况,请分享完整的 function 代码。 一个常见的错误是没有用payable(msg.sender)包装msg.sender 因为自从 solidity 0.6.0 msg.sender不再需要支付。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM