🦊 [Plugin] Web3 & MetaMask by NovaBloq

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 :slight_smile:

1 Like

And how can I check that these are exactly my NFTs?

Or another case.
Users who have NFT-1 see group-1
Users who have NFT2 see group-2.

If it’s not difficult, tell us in 2 words or tell me where to read)

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.

1 Like

wow, you’re just the best! Thanks)

1 Like

With that swap functionality is is it possibility to charge a commission for the service?

For that you will need a custom smart contract

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)

I see yeah. Can you point me in the right direction of devs that can achieve this?

Use apps like upwork, you can find there any type of devs. I personally don’t know any solidity devs that I could recommend.

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?

Yes you can get the rates, see a related demo here (uniswap clone but on bsc using the pancake swap contract)

Ok so that clone is swapping through the pancake swap contract like you mentioned in a comment prior for me to do so?

Yes, look in the app editor and see how it works and what contract it uses.

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.

Hi, currently not, but we can add this in our to do list for future updates, seems like a good idea.

2 Likes

Thanks, that would be hugely useful!

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.

i tested this a few days ago, seems to work for me.

1 Like