在函数调用中进行参数的无效类型。无效的隐式转换从地址到地址应付请求的地址.sg.sender和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
);
}
我在味精中面临问题。
// 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题是您没有将函数修改为
付款
。您没有显示完整的代码,我认为您发布的代码在一个函数内部,并且此函数必须标记为付款
。如果不是这种情况,请共享完整的功能代码。一个常见的错误是不要将msg.sender
用付款(msg.sender)
。因为由于坚固性0.6.0msg.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 aspayable
. if this is not the case, share the full function code please. A common mistake is not to wrapmsg.sender
withpayable(msg.sender)
. because since solidity 0.6.0msg.sender
is not payable any more.