Hi!
Yes, easy!
The logic would be something like this:
On page load, get balance of NFT for connected wallet
If it is more than 0, then show content, else show something else or deny access.
There are many ways to do it but the point is that is absolutely doable
Ok first of all any default NFT will have a function balanceOf in the smart contract.
Use that in the action Smart Contract - Read from the plugin
In the filed Action name write balanceOf
Field Parameter 1 set NFT1 contract address
Field Parameter 2 set user wallet address
Save the result from the state Contract Read - Result in a custom state or in the database.
Do the same thing for the NFT2 and so on.
We have a demo page with read contract example here. Take a look in the app editor as well.
Am I right in thinking that’s what all “swap” apps do right? @ezdev . E.g. pancake swap, sushi swap etc. Another question would be where can I find such contract, and if I do find it how to integrate it in the app?
At the base level yes but they all have small differences between each other.
By a custom smart contract I mean that you should build one yourself if you want to receive a small fee. There are many solidity devs that could do that for you.
However, a swap is not only a contract that swaps tokens, it needs liquidity, where you will get the tokens to swap? Pancake swap, sushi swap all have enormous liquidity.
One simple way to do it would be that your smart contract would interact for example with pancake smart contract and will take a small fee, but in this case, user will pay double fee, for pancake and for your contract.
If you solve this, it will be really easy to integrate in the app with web3 plugin using read and write smart contract functions (we have a few demo pages with this)
Just another question sorry. Still in regards to the swap. You see how these swap apps I mentioned before give you an approximation on how much you would receive for the swap and all the fees associated and so on? With this plugin how do you get those values?
Hi! Is it possible to pass a list of contract addresses to Smart Contract - Read and get a list of results? For example, I’d like to get the balanceOf of each contract address a user has interacted with.
Hello, I am new. I watched the video “Interact with Smart Contract” and I have a question. Can I do multiple transactions in the same block? A path of 4 steps. Thank you.
is there the possibility of using my own contract and my own currency for integrations and payments? if it’s a game for example, pay the player for such activity and buy an nft on my platform for example.