0

Actually, I am looking to create a contract in which a variable can be set and later on can be retrieved. All the contracts available there involves struct and multi index table. In EOS, is it possible to write a smart contract without using multi-index table and struct?

  • You could delegate the storage of your state to a different contract. Does that count? – friedger Sep 25 '18 at 16:31
  • That is another thing, I am looking to know something else. – A.K. Sep 26 '18 at 5:28
1

As i know you cannot do that because multi-indexed tables are made to store all states and data,a variable will not store that.Because during transaction it stores only transaction data not your variable state that you might have seen in ethereum blockchain because ethereum have that structure that you can store state in transaction and eos have different structure that cannot used to store data in transaction.

| improve this answer | |
  • You seem right. – A.K. Sep 26 '18 at 5:29
1

The closest thing I can think of is a singleton.

This answer explains how to use it well: https://eosio.stackexchange.com/a/1670/959

| improve this answer | |
  • In the shared answer, logic is almost fine but they too are using struct and multi-index. I am looking to know the limitations of smart contract development in EOS. – A.K. Sep 25 '18 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.