[英]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
);
}
i'am facing the problem in msg.sender and adress 0 i don't know where is the problem我在 msg.sender 和地址 0 中遇到问题 我不知道问题出在哪里
I think the issue is you are not modified the function as payable
.我认为问题是您没有将 function 修改为
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
.您没有显示完整代码,我认为您发布的代码在 function 中,而这个 function 必须标记为
payable
。 if this is not the case, share the full function code please.如果不是这种情况,请分享完整的 function 代码。 A common mistake is not to wrap
msg.sender
with payable(msg.sender)
.一个常见的错误是没有用
payable(msg.sender)
包装msg.sender
。 because since solidity 0.6.0 msg.sender
is not payable any more.因为自从 solidity 0.6.0
msg.sender
不再需要支付。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.