-
Notifications
You must be signed in to change notification settings - Fork 144
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
Optionally require a deposit to make a proposal #11
Conversation
8be8131
to
375fa57
Compare
.add_messages(prop.msgs) | ||
.add_attribute("action", "execute") | ||
.add_attribute("sender", info.sender) | ||
.add_attribute("proposal_id", proposal_id.to_string())) | ||
} | ||
|
||
fn get_proposal_deposit_refund_message( | ||
proposer: &Addr, | ||
config: &ProposalDeposit, |
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.
Making a comment for later, but feel this variable could be named a bit better... like why not deposit
or proposal_deposit
? Not a big deal though... good enough for now.
}, | ||
} | ||
) | ||
} | ||
|
||
#[test] | ||
fn test_proposal_deposit_works() { |
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 be a separate ticket, but we should add a test to check the when the proposal deposit is 0, it all works without having to set an allowance. Will make a ticket.
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.
All the existing tests have the proposal deposit set to zero, so we should be good from a coverage perspective. Thought could make sense to have a explicit test to document the requirement.
This PR closes #1.
The dao can now be configured to require a deposit to make a proposal. The deposit is returned if the proposal passes and becomes property of the dao if the proposal fails.
This change will require future work to prevent the dao from accidentally spending proposal deposit funds. This will most likely be implemented by having a separate contract for managing the deposit funds to make the distinction more clear.
This PR also persists the proposer's address to the proposal state object. This was necessary to return the proposal deposit and seems generally useful.