CarmineOptions / konoha

A toolkit for DAO-like governance on Starknet
Apache License 2.0
23 stars 33 forks source link

Add option adding mechanics #6

Closed tensojka closed 1 year ago

tensojka commented 1 year ago

This proposals adds option adding to the Cairo 1 governance contract.

More options will be added in the next commit in this PR, please review the option-adding code itself. Old option adding code: https://github.com/CarmineOptions/carmine-protocol/blob/master/contracts/governance/orchestration.cairo

tensojka commented 1 year ago

Also uppped default voting time to 1000

tensojka commented 1 year ago

Tested:

gn

tensojka commented 1 year ago

I think we're good to go

Chepelau commented 1 year ago

Looks good to me

StarkFishinator commented 1 year ago

Why is this present? https://github.com/CarmineOptions/governance/blob/d40d0851ffd5db67f0bef45e60d45b45407c6905/src/options.cairo#L83 it is not present in the orechestration.cairo file

StarkFishinator commented 1 year ago

I am only able to compare the add_option and deploy_via_proxy function, the other (add_2906_options, add_2206_options, add_2206_2906_options) are not present in the orchestration.cairo file

tensojka commented 1 year ago

I am only able to compare the add_option and deploy_via_proxy function, the other (add_2906_options, add_2206_options, add_2206_2906_options) are not present in the orchestration.cairo file

They are present in upgrades.cairo in the old Cairo 0 version. I found this to be a bit of a mess and refactored everything option-related into options.cairo. I also added the FutureOption struct so add_option isn't called directly – this will then allow us to more easily add sanity checks or generate FutureOption structs later. (They aren't being generated currently because there's no support for string concatenation, I will have to add that to alexandria.)

tensojka commented 1 year ago

Declared as contract class hash 0x5af04d58b128176d39ffaa4017dbece49cd992b34995f41e54ecf1da52e9a88 in tx 0x15099863cb3220efb367d8ee35198622f4e7798c8b740fa51ee1c625669ca42