New answers tagged

1

The main benefit of big_maps with respect to maps is that the gas costs of big_map operations don't depend on the number of elements stored in the big_map. Regarding storage size, when you store a key-value mapping in a big_map, you store the value but not the key; instead you store the hash of the key. This hash always takes exactly 32 bytes. The rest of ...


2

big_map is extremely expensive. It allows you to put as much data as you want in the contract, but you end up paying more in counterpart. Check this example: It produces 2 identical contacts, one uses a map and the other uses a big map. import smartpy as sp class MyContract(sp.Contract): def __init__(self, **kargs): self.init(**kargs) @sp....


0

The FA1.2 template was updated this week by Keefer Taylor. It will be updated in https://smartpy.io templates this weekend. Template link: https://smartpy.io/ide?cid=Qma5v9x6xjbzB82hjhr5Y5Sw2oppRzhyNBN11eVVyXpvxv&k=ea98e1d25d85d92f75c7 Here is an example after deployment: https://tzcomet.io/#/explorer%3Fexplorer-input%...


1

For a 20*11 area, you can use a bytes array of length round_up(20 * 11 / 8) = 28 bytes. The type for bytes is sp.TBytes in SmartPy. However, there is no update in place operation so operations may be a bit complex and costly to write (but highly doable).


Top 50 recent answers are included