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

Refactored interest auction to use backstop token donations #188

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

markuspluna
Copy link
Contributor

Still need to fix tests

@markuspluna markuspluna requested a review from mootz12 January 19, 2024 17:36
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.

Implementation looks good to me. Changes are pretty minor, only drawback is that liquidators will be filling auctions with backstop tokens, but it's worth it IMO to prevent the gulp_usdc sandwich attack vector.

Leaving as request changes until test updates are complete.

Comment on lines 94 to 97
let (aqua_id, aqua_client) = create_token(&e, &bombadil, 7, "AQUA");
let (test1_id, test1_client) = create_token(&e, &bombadil, 7, "TEST1");
let (test2_id, test2_client) = create_token(&e, &bombadil, 7, "TEST2");
let (test3_id, test3_client) = create_token(&e, &bombadil, 7, "TEST3");
Copy link
Contributor

Choose a reason for hiding this comment

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

assuming these were part of exploratory testing?

Copy link
Contributor

Choose a reason for hiding this comment

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

bumping this. Can we clean the test fixture up?

  • clean

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.

Some minor test improvements and cleanup - looks good otherwise!

Comment on lines -26 to 30
let res_asset_address = reserve_list.get_unchecked(i);
for res_asset_address in assets.iter() {
// don't store updated reserve data back to ledger. This will occur on the the auction's fill.
let reserve = pool.load_reserve(e, &res_asset_address, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a test that verifies invalid reserves throws an error?

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't notice in the test diff.

  • Add negative test for set of addresses with an invalid reserve address

Comment on lines 94 to 97
let (aqua_id, aqua_client) = create_token(&e, &bombadil, 7, "AQUA");
let (test1_id, test1_client) = create_token(&e, &bombadil, 7, "TEST1");
let (test2_id, test2_client) = create_token(&e, &bombadil, 7, "TEST2");
let (test3_id, test3_client) = create_token(&e, &bombadil, 7, "TEST3");
Copy link
Contributor

Choose a reason for hiding this comment

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

bumping this. Can we clean the test fixture up?

  • clean

@mootz12 mootz12 linked an issue Jan 21, 2024 that may be closed by this pull request
@mootz12 mootz12 merged commit 4035456 into main Jan 22, 2024
3 checks passed
@mootz12 mootz12 deleted the remove-donate-usdc branch January 22, 2024 14:20
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.

Backstop: gulp_usdc has 100% slippage tolerance
2 participants