Issue using mintbaseNew function on 1155 contract with base64 png image

Hey,
I am trying to mint some 1155 tokens using a .png file as the base, minting on chain. I have done this previously on my Manifold ERC-721 contact with the help of a tool called Efficax build by 0xDiid.

I am following the guide for ERC-721 on chain minting:

But attempting to adapt this to work for 1155. The main thing i’ve come up against is what was reported by others who have encountered issues, which is the formatting required for the string, its different for 721 and 1155.

These are the steps I have followed:

  1. Created a .png file
  2. Converted the .png to base64 to get my code which starts data:image/png;base64,…
  3. Opened the URI in a browser tab (looks good)
  4. Used the metadata example, and added my URI
  5. Minify’d it
  6. Added my URI to the string data:application/json;utf8,<YOUR_JSON> to make my final URI
  7. Using function 6 (mintbaseNew) in etherscan, write as proxy, I entered the address to mint the tokens to (my own) and quantity, both inside [ ] and also placed my URI into the uri(string) field.

This is where I cant get past, i’ve tried wrapping the code in [ ], and in [’ … '], i’ve tried swapping between " and ’ in the code. What ever I try I get one of the two messages below:

  • Unexpected token ‘:’
  • Invalid or unexpected token

Below is a sample of my URI I am using:
[‘data:application/json;utf8,{“name”:”In Bloom”,”description”:”A test on chain edition by OL1Y”,”image”:”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYAAAAIACAMAAAC8QUvIAAAAq1BMVEVmk+RHVB4AAACezvt/j1DAB71pqv1jlOlmpvplpPllqf1nmu9jl+xnl+l2u/9ur/9srv9mmO14tP91r/9sqf5op/xmo…=)}’]

As mentioned i’ve tried wrapping with different sets of brackets, and swapping out the " for 's, but nothing works.

Any help would be greatly appreciated. :pray:

Hey! Could you help us debug for you? Please link the transactions and contracts you are interacting with. This will give us a better sense of what’s going on.

Thanks!

1 Like

Hey, thank you!

So the contract is here:
https://goerli.etherscan.io/address/0x71d40da0c68f3e0ab09f0c708a7b4c5f892a8d9b

Currently on testnet.

I haven’t got to the point of being able to submit a transaction, so I dont have any transactions to share.

Ok, I actually think this is an issue with etherscan’s UI right now. Going to try to find an alternative way.

1 Like

Thank you! Appreciate it.

gm.

For string arrays on etherscan you need to remove the brackets.

  • Instead of: ["https://url1.com","https://url2.com"]
  • Do: "https://url1.com","https://url2.com"

gm.

1 Like

I gave this a try but it also didn’t work unfortunately. Hoping it is just an Etherscan UI issue and it can be resolved. :crossed_fingers:

Hey, can you try wrapping it in double quotes? " instead of ’

I would also then escape the " within your JSON to be like "

https://goerli.etherscan.io/address/0x549da4ce35090d024b0a90be90c1e591b178121d

I’ve made a couple test transactions here. LMK if that works for you

Hey, a bit more luck this time, I managed to adapt what you had written in your test, to include my base64 code, and it let me submit the transaction, but it failed and returned this message:

Here is the tx:
https://goerli.etherscan.io/tx/0x6843df0cbfb8c01bfff5cbb7f75ed413812ac4d77a1f802e449d5b7a7eba3f73

Too long?

Yeah my guess is too long - and also that this will likely not be affordable on mainnet.

You used about 28 million gas, while the block limit (for all transactions in the block) is 30 million gas.


g

Sheesh, ok thanks, I need to go back to the drawing board on the final piece, something more simple it seems is key! Thanks for helping me get to the point where I can actually submit the transaction! :pray:

Ok, we have success, almost, i’ve used a new image, the image I indent to mint, which was 16kb, managed to mint 10 tokens using mintbaseNew, cost around 0.022 GoerliETH.

Unfortunatly the image isnt rendering on testnet opensea.

Not sure if this is an issue with opensea, or something I did wrong in the minting. I’ve tried refreshing metadata a few times, but nothing.

You are missing a quote at the end of the string for your image

OJl2kj7TcAAAAASUVORK5CYII=)}

should be

OJl2kj7TcAAAAASUVORK5CYII=)"}

Yeah, Diid pointed this out, and I submitted a new transaction with the string ending in this:
=\”}”
Here is the transaction:
https://goerli.etherscan.io/tx/0xc668b2c4bd6fb16db6dc0107645605e5016ab56e34f269a326448cf568323102

This submitted, but I see have the issue that it doesnt have the name, description or image.

I tried ending it with =)"} as you suggested, but I get the error message back in the Etherscan UI again.

Looks like you are ending it with the " correctly. But you have a bunch of non-standard " in your JSON. Are you editing in like macbook notes app or something?

Every double quote should be ". You have and and other random quotes.


See the difference?

Ahhh yes, using a mac, thank you, let me go through and correct those and try again!

Hey, so I swapped out the dodgy " for "s, then I got an error that it didn’t recognise the ‘name’. I then swapped all but the start and end ", with 's, so ‘name’ etc. this allowed me to submit the transaction, but still not seeing the name, description or image.

:face_with_head_bandage:

Use this -

data:application/json;utf8,{\"name\":\"Soar\",\"description\":\"A test on chain edition by OL1Y\",\"image\":\"data:image/png;base64,iVBORw0KGgoAAA...\"}

Notice that you have to use \" and not '

YES! Thank you, successfully minted. Now to finalise details, and mint on mainnet!

Thanks so much for your help! I will be writing up a thread/article on the process, as this has been a great learning experience.

1 Like