1

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 !

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
    );
  • 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 May 9 '18 at 17:52
  • They have both token interfaces in the contract. – conwise17 May 10 '18 at 11:24
2

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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