Skip to content
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

Arbitrary conditional vault #244

Conversation

metaproph3t
Copy link
Member

No description provided.

@metaproph3t metaproph3t force-pushed the arbitrary-conditional-vault branch from 759409e to d0bf35f Compare August 26, 2024 18:26
@Henry-E Henry-E assigned Henry-E and unassigned Henry-E Aug 27, 2024
@Henry-E Henry-E self-requested a review August 27, 2024 06:26
@Henry-E
Copy link
Collaborator

Henry-E commented Aug 27, 2024

I will try to give this a read through when i get a chance if that's helpful

/// Once resolved, the sum of all outcome resolutions is exactly 1.
#[account]
pub struct Question {
pub question_id: [u8; 32],
Copy link
Collaborator

@0xbigz 0xbigz Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32 characters might be kinda smol, if its just an ID (and not characters) why do it like this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's supposed to be a hash

@metaproph3t metaproph3t marked this pull request as ready for review August 29, 2024 21:11
@metaproph3t metaproph3t changed the base branch from develop to arbitrary-conditional-vault August 29, 2024 21:11
@metaproph3t metaproph3t merged commit 54dd6fa into metaDAOproject:arbitrary-conditional-vault Aug 29, 2024
1 check passed
@Henry-E Henry-E removed their request for review August 30, 2024 05:18

total_redeemable += ((user_conditional_token_account.amount as u128
* question.payout_numerators[payout_index] as u128)
/ question.payout_denominator as u128) as u64;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doing a mix of Solana Context and (unsafe) math logic within one function. would be great to split up math and state modification logic from solana account loader stuff. this makes rust tests much easier to write and lets you fuzz more easily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants