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

Issue 141 claim to backstop #142

Merged
merged 5 commits into from
Nov 10, 2023
Merged

Issue 141 claim to backstop #142

merged 5 commits into from
Nov 10, 2023

Conversation

markuspluna
Copy link
Contributor

User claims now are deposited directly into whatever backstop module they previously deposited in

@markuspluna markuspluna requested a review from mootz12 November 9, 2023 00:53
Copy link
Contributor

@mootz12 mootz12 left a comment

Choose a reason for hiding this comment

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

Approving - but we should hold off merging for #143

Comment on lines 30 to 35
TokenClient::new(e, &blnd_id).approve(
&e.current_contract_address(),
&lp_id,
&claimed,
&(e.ledger().sequence() + 10),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

we can omit this approval after the merge of the Comet update

Copy link
Contributor

Choose a reason for hiding this comment

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

This being said, this PR should probably follow the Comet one.

Comment on lines +47 to +60
let mut pool_balance = storage::get_pool_balance(e, &pool_id);
let mut user_balance = storage::get_user_balance(e, &pool_id, to);

// Deposit LP tokens into pool backstop
let to_mint = pool_balance.convert_to_shares(deposit_amount);
pool_balance.deposit(deposit_amount, to_mint);
user_balance.add_shares(to_mint);

storage::set_pool_balance(e, &pool_id, &pool_balance);
storage::set_user_balance(e, &pool_id, to, &user_balance);
e.events().publish(
(Symbol::new(&e, "deposit"), pool_id, to),
(deposit_amount, to_mint),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

not a massive fan of this logic being duplicated, but there doesn't seem to be that easy of a way around it without a bunch of refactoring to make things consistent

Comment on lines 44 to 45
pub pool: Address,
pub user: Address,
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I see why these needed to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I needed them public for tests and forgot to remove whoops

Copy link
Contributor

@mootz12 mootz12 left a comment

Choose a reason for hiding this comment

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

LG2M

@mootz12 mootz12 merged commit 2a0fdc9 into main Nov 10, 2023
3 checks passed
@mootz12 mootz12 deleted the issue-141-claim-to-backstop branch November 10, 2023 14:12
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.

2 participants