So, I’m trying to create a decentralized voting application. I’m thinking maybe for a start I should create a “poll dapp”. Are you aware of any project that is currently doing this? I’m still conceptualizing and trying to understand Algorand’s architecture though. So, with that said:
- What types of global variables are available for smart contracts? Can they store an array of strings for example? Integers? Or they store addresses only?
I’m guessing any time of data can be stored as long as its “limited to 64 bytes of storage each for both global and local storage”. Also from further reading; " The
goal CLI supports passing strings, ints, base64 encoded data, and addresses as parameters".
This I think answers my question but further comments would be appreciated.
- Also, how can one change their values? Can it be done through sdk functions interacting with the smart contract (calling through some sdk method/function passing some value into the sc) or to change their value it has to be done through the smart contract code itself?
“Arguments can be passed to any of the supported application transaction calls, including create. The number and type can also be different for any subsequent calls to the stateful smart contract. The
goal CLI supports passing strings, ints, base64 encoded data, and addresses as parameters. To pass a parameter supply the
--app-arg option to the call and supply the value according to the format…”
So, again I’m guessing, we’ve got the sc running with its own ID on the bc and through a dapp implementing Algorand’s SDK we’d make a call and send the information. My question now is how would this information be validated before being updated to the global / local variable? Is it up to the programmer to decide how the sc validates calls?
If this question wasn’t clear enough please do say I’ll try to clarify.
- “To continue with the voting application, the smart contract can be combined with a voting token implemented as an Algorand ASA to create a permissioned voting application. When used in this fashion, a voter would spend a voting token at the same time they submit their vote to the stateful smart contract. These two transactions would be grouped using Algorand’s Atomic Transfers to guarantee both happen at the same time. A centralized source would be responsible for giving out the voting tokens. This is just one example of combining several technologies with stateful smart contracts.”
So, your suggestion is to have some form of centralized entity that will be responsible for handling “voting tokens” as assets.
Then the role of the sc will function as a trusted third party process that makes sure each token that is stored on the blockchain is of legit origin or that it was cast according a specific set of rules? Or otherwise is there another role for the sc in this context?
- When it is said in the text “centralized” does it really mean “permissioned”? Because afaik even permissioned bc are decentralized to a large degree (even if not as much as permissionless).
Thank you in advance.