Manually submitting vote results onchain
To maintain decentralisation, we ensure that anyone on chain can submit data that reflects the vote results.
There are 2 main steps:
Encode individual vote results and collate them
Encode the sum of the the individual vote results
How to encode individual vote results:
The VoteExecutorMaster contract exposes view functions for this very purpose.
When encoding the command itself, two pieces of data are returned:
An index
The bytes encoded command data.
How to get the final data to be submitted from individual encoded messages:
Once you have all the indexes and command datas, collate them in arrays (ordered correctly in the pairs you received them from the view functions above) and then call encodeAllMessages.
You will then receive three pieces of data:
Hash of the messages (messagesHash)
Array of encoded messages (messages)
Bytes encoded version of the array of encoded messages. (inputData)
You should then call submitData with (3) bytes encoded 'inputData'.
The hash of the messages should be posted in the discord channel and / or passed to the DAO multisig owners to be approved - to confirm that the submitted data does indeed reflect the results of the votes on snapshot.
Last updated