Has anyone know how to storeDict() in Tact?
For now, I use StoreRefs(dict_variable.toCell()) to store, but it seems like it’s different than using storeDict() in Typescript
Oct 11, 2023, 11:31 AM
.storeUint(1, 1).storeRef(d.toCell())
Oct 11, 2023, 11:32 AM
Why have to storeUint(1,1) first?
Oct 11, 2023, 11:32 AM
Because dict is basically a MaybeRef structure. So you first store one bit indicating whether the dict is empty or not, and then if it’s not, the dict itself in a reference
Oct 11, 2023, 11:36 AM
However, i will get error code 5 (Integer out of expected range) when i execute testing
Reference tx: https://testnet.tonviewer.com/kQAlWOcArecooF3NOiKjz18zdLM19ivvs3dA3LawsI6TlCIm/transaction/a089be76ba4845b283f68cec92676d44a766efe3e83d14afc98d2879cf4423f7
Reference tx: https://testnet.tonviewer.com/kQAlWOcArecooF3NOiKjz18zdLM19ivvs3dA3LawsI6TlCIm/transaction/a089be76ba4845b283f68cec92676d44a766efe3e83d14afc98d2879cf4423f7
Oct 11, 2023, 11:45 AM
You should do storeUint(1, 1). Not int.
Or you can use storeInt(-1, 1) for the same effect
Oct 11, 2023, 11:46 AM
I would like to ask for further help. There is still difference between tact Cell and typescript Cell.
Oct 11, 2023, 11:58 AM