solidity – How to Price Your NFT with Your Own Token

nftsolidity

I want to create an NFT Game in which users can buy NFT with my custom token.

for example, Decentraland has a token called Mana.
as you can see they listed the NFT with Mana!

Decentraland NFT example on OpenSea

enter image description here

In OpenSea there is an option to list NFT with a custom token but it's deprecated

enter image description here

as you can see there is a custom token like GALA

enter image description here

but it's deprecated and I can't add the new token

enter image description here

What is my problem

I know how to create a token and NFT
but I don't know how to list it on my custom token

What I tried

I could create a token and NFT

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract Shiaf is ERC20 {
    constructor() ERC20("Shiaf", "MTK") {
        _mint(msg.sender, 10000000 * 10 ** decimals());
    }
}

Update

I asked someone and he told me:

Well, this depends in what you prefer to do, but you could do your own
marketplace to sell the nfts and only accept as a payment method your
own token or you could write some mint function for your nft that in
order for mint take some amount of tokens from the user

this is exactly what I want but I don't know how to accept as a payment method my own token

Best Answer

Well, this depends in what you prefer to do, but you could do your own marketplace to sell the nfts and only accept as a payment method your own token or you could write some mint function for your nft that in order for mint take some amount of tokens from the user

If this is what you actually want, then you can do it easily.
You can run your own marketplace and accept your tokens from the user to sell them. You can see this example here.
[https://shop.foxfinance.io/homepage] [https://bscscan.com/address/0x435Cd5A3d0be367Da997a547Fdf0e482587008DA#code]

Related Topic