Hack Forums
Someone here whos into smart contracts, Solidity & ERC-1155 NFT tokens? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Money (https://hackforums.net/forumdisplay.php?fid=241)
+--- Forum: Crypto Currency (https://hackforums.net/forumdisplay.php?fid=380)
+--- Thread: Someone here whos into smart contracts, Solidity & ERC-1155 NFT tokens? (/showthread.php?tid=6148576)



Someone here whos into smart contracts, Solidity & ERC-1155 NFT tokens? - BapeZ - Apr 9, 2021

Hey peeps. I came across something really interesting by accident and I wanted to ask if someone of you guys can help me. I'm not a dev. I would love to learn how to code, but I haven't started yet. In a chinese TG group of a crypto project I follow, people shared a method how to snipe a NFT sale by executing the contract on the forefront within etherscan.io . The guy shared the contract address where you can access a function called "purchaseNFT" , that only requires you to enter three parameters to purchase the NFT.
1: payable amount in ETH
2: cardId (uint256)
3: _amount (uint256) / the amount of the cards you want to buy

It was a sale of three different NFTs. He provided all three cardId numbers. This is the part I didn't understand. I wasn't able to find this information on my own reading the contract. It looks too complicated to me. I want to know, how did he find the IDs? And the contract address? pls teach me how he did that, I want to learn more about this. 😋 If you think you can help me, slide in my dms.

Thank you ✌


RE: Someone here whos into smart contracts, Solidity & ERC-1155 NFT tokens? - God - Apr 10, 2021

Could you share the contract address if possible?

It's possible that the IDs are marked as private which means you need to read the storage yourself (as opposed to there being a getter function).

Parameter 1 is weird - you don't normally need to specify this amount as you just send this as a plain ether transfer, and the variable msg.value will hold this value.