for this example I used,
I used a Opensea contract for methods of ERC1155 https://github.com/ProjectOpenSea/opensea-creatures/tree/df8baafd8e8cb60f847b3ede640105f0bad6d057
I used a contract from manifold.xyz -> RoyaltyRegistrySolidity https://github.com/manifoldxyz/royalty-registry-solidity/tree/f7ab884983506301a353684ccd112ef97bf8b6f5 I am also based on official documentation https://eips.ethereum.org/EIPS/eip-2981
npm truffle
NPM INSTALL
-
truffle develop // Launch truffle console in dev
-
migrate // COMPILE + DEPLOY ON YOUR DEV BLOCKCHAIN
-
myNFT = await MyNFT.deployed() // SET YOUR DEPLOYED CONTRACT AT VAR
-
myNFT.create(accounts[0],12,10,"",[]) // CREATE (MINT) a NFT ID 12 with 10 supply
-
myNFT.mint(accounts[0],28,1,[]) // ADD 1 supply for ID 12
-
myNFT.royaltyInfo(12, 100) //IF id 12 BUY FOR 100ETH
-
myNFT.setTokenRoyalty(12, accoutns[0], 2000) //IF id 12 have 20% of royalty
-
myNFT.royaltyInfo(12, 100) //IF id 12 BUY FOR 100ETH
-
myNFT.supportsInterface("0xd9b67a26") // RETURN TRUE IF SUPPORT ERC1155
-
myNFT.supportsInterface("0x2a55205a") // RETURN TRUE IF SUPPORT EIP2981