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

Address OZ's feedback on USDT comet support #818

Merged
merged 36 commits into from
Feb 7, 2024

Conversation

cwang25
Copy link
Contributor

@cwang25 cwang25 commented Nov 8, 2023

No description provided.

contracts/Comet.sol Outdated Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
test/supply-test.ts Outdated Show resolved Hide resolved
test/supply-test.ts Outdated Show resolved Hide resolved
test/supply-test.ts Outdated Show resolved Hide resolved
test/supply-test.ts Outdated Show resolved Hide resolved
test/supply-test.ts Outdated Show resolved Hide resolved
test/withdraw-test.ts Outdated Show resolved Hide resolved
test/withdraw-test.ts Outdated Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
cwang25 and others added 3 commits November 8, 2023 18:45
Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
contracts/Comet.sol Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
contracts/CometCore.sol Outdated Show resolved Hide resolved
contracts/CometCore.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@kevincheng96 kevincheng96 left a comment

Choose a reason for hiding this comment

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

Nice, just a few final comments. But this is looking almost ready now 👍

contracts/Comet.sol Show resolved Hide resolved
test/buy-collateral-test.ts Outdated Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
contracts/Comet.sol Outdated Show resolved Hide resolved
test/buy-collateral-test.ts Outdated Show resolved Hide resolved
@@ -562,5 +562,68 @@ describe('buyCollateral', function () {
// EvilToken attack should be blocked, so totalSupplyBase should be 0
expect(evilBobPortfolio.internal.EVIL).to.equal(0);
});

it('reentrant supply is reverted', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be buycollateral, not supply. same for comments in test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok renamed to buyCollateral. :)
Thought in the existing test is using 'supply', and decided to name it the same.
(I guess that rationale with that was the retrant attack loop is happening in supplyFrom via buyCollateral)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see. That means the test isn't testing the right function. It should be triggering reentrancy via BuyCollateral. I think you'll have to set it in the EvilToken.

cwang25 and others added 7 commits February 5, 2024 18:56
Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
Copy link
Contributor

@kevincheng96 kevincheng96 left a comment

Choose a reason for hiding this comment

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

Great, looks ready to merge

@cwang25 cwang25 merged commit 513f451 into hans/goerli-usdt-deploy Feb 7, 2024
18 of 34 checks passed
vincetiu8 pushed a commit to vincetiu8/comet that referenced this pull request Apr 1, 2024
vincetiu8 pushed a commit to vincetiu8/comet that referenced this pull request May 3, 2024
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