2

I would like to do a smart contract that allow me to buy an ERC721 token using an ERC20 token to pay

In my mind is something like: -I create a ERC721 token -I create a ERC20 token -I have a plattaform to buy the ERC721 with the ERC20 token

Thanks for the help !

2 Answers 2

0

If you go through the contract both 721 and erc20 interfaces are coded in. and the functions that allow the tokens to be transferred are at the bottom of the contract. If you fork the code and edit your problem should be solved (Y)

   // Transfer sale amount to seller
    acceptedToken.transferFrom(
        msg.sender,
        seller,
        price.sub(saleShareAmount)
    );

    // Transfer asset owner
    nonFungibleRegistry.safeTransferFrom(
        seller,
        msg.sender,
        assetId
    );
2
  • so it's not posible to use your own erc20 token instead of eth to pay ? I'm confuse because in decentraland.org they use an erc20 token called MANA to buy NFT called LAND
    – cris-ech
    Commented May 9, 2018 at 17:52
  • They have both token interfaces in the contract.
    – conwise17
    Commented May 10, 2018 at 11:24
3

Take a look at how this is built, probably useful:

https://github.com/decentraland/marketplace-contracts/blob/master/contracts/marketplace/Marketplace.sol

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.