Hi, I am trying to init a contract with TonWeb library. I can't init the dict in the contract. Contract deploys but after the first call, it starts retuning exit code 9. This is my code.

Mar 16, 2023, 9:05 PM
I found this function in Tonweb Lib and yought that writing 0 would work
Mar 16, 2023, 9:07 PM
Probably there is some error when you read that dict.
Most probably, you read fields in incorrect order (I think this is the most popular error) 😀
Mar 16, 2023, 9:27 PM
You mean on the contract side?
Mar 16, 2023, 9:28 PM
Yes. Serialization of dict looks correct.
Mar 16, 2023, 9:29 PM
Actually, savedata doesn't get dict. It's set in the contract.
This is the savedata:
save_data(positive, negative, veto, abstain, contract_time_of_deployment);
And in contract, it sets the dict like this:
(_, int flag) = checker.dict_get?(267, sender_address);
if flag {
return ();
}

;; Add to the dictionary if the address does not match
checker~dict_set(267, sender_address, "");
What may be the problem with the contract?
Can you look at our code I provided in previous message and give us an example for storing dicts?
Mar 16, 2023, 9:51 PM
You have answered that to this contract.
What is it that we have been missing
It should not be this hard to find how to initialize a dict properly
You mentioned something about the order what do you mean by that, also what are the other errors?
Mar 16, 2023, 11:01 PM

© 2024 Draquery.com All rights reserved.