Skip to content

gianluigi1961/MarketNFT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Market NFT smart contract

MarketNFT : a Simple smart contract for the sale of NFTs
is ERC721 contract

Etherscan url:
https://goerli.etherscan.io/address/0xFeb5E20605730914Ec94e165A57A3648A8019F3B#code

Storage data

mapping(string => uint) prices: Prive of NFTs
mapping(string => uint) names: NFT id (by name)
string private tempUri: the temporary NFT json metadata url

Events

Trasfer (mint) event emitted from ERC721
Trasfer (NFT sale) event emitted from ERC721

Public functions

ownerOf(string memory _name)
The owner of the NFT with the given NFT name
@_name: name of the NFT

unpause
The contract owner start the NFTs sales

mint(string memory _name, string memory _description, uint _price, string memory _url)
The contract owner mint the NFTs
@_name: name of the NFT
@_description: description of the NFT
@_price: price of the NFT
@_url: NFT json metadata url

mintMultiple(string[] memory _name, string[] memory _description, uint[] _price, string[] memory _url)
The contract owner mint a collection of NFTs
@_name: array of name of the NFT
@_description: array of description of the NFT
@_price: array of price of the NFT
@_url: array of NFT json metadata url

buy(string memory _name)
Customers buy the NFT by name
@_name: name of the NFT

approveByName(address _to, string memory _name)
The NFTs owner approve
@_to: address to approve
@_name: name of the NFT

transferFromByName(address _from, address _to, string memory _name)
The NFTs approved address transfer to new address
@_from: address from transfer
@_to: address to transfer
@_name: name of the NFT

walletOf(address _owner)
The wallet of the specified address
@_owner : wallet address

getBalance
Return the current contract balance

withdraw(uint _amount)
Owner can withdraw Contract balance
@_amount: amount to withdraw

tokenURI(uint256 _id)
Return the Metadata token uri
@_id : id of the NFT


Modifiers

isNotMinted(string memory _name)

isMintedById(uint _id)

isMinted(string memory _name)

isOpenSale

About

Blockchain Solidity project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published