-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add comments #537
chore: add comments #537
Conversation
…knet into chore_add_comments
…hore_add_comments
starknet/src/space/space.cairo
Outdated
fn min_voting_duration(self: @TContractState) -> u32; | ||
|
||
/// Returns the maximum voting duration. Once this duration has elasped, a proposal | ||
/// can be finalized. No other votes can come in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this duration has elapsed, no additional votes can be cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starknet/src/space/space.cairo
Outdated
fn active_voting_strategies(self: @TContractState) -> u256; | ||
|
||
/// The next voting strategy index. Starts at 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index of the next available voting strategy. Starts at 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starknet/src/space/space.cairo
Outdated
/// | ||
/// * `author` - The author of the proposal. | ||
/// * `metadata_uri` - The metadata URI of the proposal. Could be a link to a discussion page, etc. | ||
/// * `execution_strategy` - The execution strategy of the proposal. This is the contract that will be called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The execution strategy for the proposal, consisting of a strategy address and an execution payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starknet/src/space/space.cairo
Outdated
/// * `choice` - The choice to vote for. | ||
/// * `user_voting_strategies` - The voting strategies that the user wants to vote with. This allows to only | ||
/// query the `user_voting_strategies` for voting power instead of iterating through all | ||
/// allowde voting strategies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The strategies to use to compute the voter's voting power, each consisting of a strategy index and an array of user provided parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,8 +1,12 @@ | |||
use sx::utils::math; | |||
|
|||
/// An indexed strategy is used to access a strategy in an array of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A strategy identified by a unique index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starknet/src/types/proposal.cairo
Outdated
@@ -16,15 +16,26 @@ const TWO_POWER_32: u128 = 0x100000000; | |||
const TWO_POWER_64: u128 = 0x10000000000000000; | |||
const TWO_POWER_96: u128 = 0x1000000000000000000000000; | |||
|
|||
/// Definition of a proposal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data stored when a proposal is created. The proposal state at any time consists of this struct along with the corresponding for, against, and abstain vote counts. The proposal status is a function of the proposal state as defined in the execution strategy for the proposal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starknet/src/types/proposal.cairo
Outdated
author: UserAddress, | ||
/// A snapshot of the active voting strategies at the time of proposal creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit array where the index of each each bit corresponds to whether the voting strategy at that index is active at the time of proposal creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -3,7 +3,9 @@ use starknet::{StorageBaseAddress, Store, SyscallResult}; | |||
|
|||
#[derive(Clone, Drop, Option, Serde, starknet::Store)] | |||
struct Strategy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A strategy identified by an address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -17,6 +20,7 @@ struct UpdateSettingsCalldata { | |||
voting_strategies_to_remove: Array<u8>, | |||
} | |||
|
|||
// TODO: use `Default` trait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be done yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to but wasn't working. Will try in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uTACK
Adding documentation comments on the most important function