🦊 [Plugin] Web3 & MetaMask by NovaBloq

Does anyone know the best way to get the ownerOf of a ERC-1155 token ID?

I think this function is possible for ERC-721’s but not for ERC-1155.

I tried but it gave a funcDirectory is not a function mesaage.

Thank you!

Hmm, thank you for pointing it out, we will take a look on what can be done.

I took a look, looks like ERC1155 doesn’t have “ownerOf” function, try balanceOf instead.

Thank you for looking into it!!!

Okay yeah, that did not throw the function error.

If I were to put the token ID in parameter 1 would it return me the balance of the Token ID or the balance of any token minted from that contract address?

I’m trying to verify a user holds a specific token ID minted from the rarible smart contract that has many different NFT’s being minted from it.

Cheers!

It will show the balance of this specific ID.

This is great!! Just a question, does it also capture the events even if the page is not loaded/ opened?

I was trying to call Balance of Token function in The plugin
but it’s throwing out error said Metamask RPC Error, I used the right Contract Address & Wallet Address, can I know why? My contract is not exactly a token but an NFT. Is that reason why?

Thanks

Bug check question:

Are you sure that the plugin is getting accurate gas costs?

It appears web3 injecting on remix.ethereum and a few NFT project sites this plugin is returning substantially higher gas costs, sometimes $300-$1200 more expensive on networks using this plugin vs taking the same action with same ABI/Bytecode/arguments when testing elsewhere.

I tested on FTM, poly, and eth

here is a video for reference

The plugin doesn’t do anything with gas price calculations.
The difference you see is the difference in the parameters you give, I assume that when deploying on remix the parameters are transmitted in a compressed way, I’m not sure how.

The main thing you have to understand is that the plugin have nothing to do with gas price.
It is the same web3.js injected in the browser as on remix site, same extension…

Look for a few tutorials about how gas price is calculated.

1 Like

Yes, use the Read Contract function for an NFT token.

is there anyway to run the plugin element actions as a backend workflow?

@joshsgalbreath
Web3/metamask are browsed sided, you’ll need to do client side.

What actions are you trying to accomplish server side?

2 Likes

Thanks for the response, I have a token on the polygon network that I want to airdrop to a list of addresses. I was hoping to automate this process. I’m unsure if this is possible as I’d have to sign every transaction. Im using polygon to lower gas.

@joshsgalbreath
best way to do this is to code it into the smart contract itself using access roles OR batch transfers which require only 1 sign.

function sendBatch(address[] addrs) public payable {
for(uint i = 0; i < addrs.length; i++) {
addrs[i].transfer(msg.value.div(addrs.length));
}
}

1 Like


why i cant see plugin elements?

Plugin elements must be added on the page first. Find them in Visual Elements section

I am facing the same problem. I subscribed to the plugin 1 hr back. Still I can’t see the actions.

Plugin is visible in the Bubble apps Plugins page

i figured that out you have to draw element in page
there will be element for metamask in element bar on left side

Plugin elements must be added on the page first! Find them in Visual Elements section and drag them on page

So there is no way for ABI or ByteCode to automatically generate in bubble when using the deploy contract feature? Im trying to have a form deploy a contract to create a BEP20 or ERC20 token. I would populate elements of the ABI with dynamic data from my form.