简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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