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

ToB improvements #736

Merged
merged 7 commits into from
Apr 10, 2023
Merged

ToB improvements #736

merged 7 commits into from
Apr 10, 2023

Conversation

grandizzy
Copy link
Contributor

@grandizzy grandizzy commented Apr 10, 2023

Ensure that comments in code always reflect the code’s intended behavior.

  • the comment on Deposits.sol#L195 says the following code is Case 1 above but it’s actually case 2.
  • The section header in Pool.sol#L702 says External Functions but is more precisely External View Functions.
  • In IPositionManagerOwnerActions.sol#L24 and L54, the references to setPositionOwner are incorrect.
  • In Contracts/README.MD#L8, remove references to cryptopunks and crypto kitties.
  • In BorrowerActions#L292, the comment should read: revert if no amount to pull or repay.
  • The comment in Auctions.sol#L1269, should be removed, as totalBondEscrowed is updated in the Pool’s withdrawBonds function.

Constant variable WAD is declared but not used in Maths.sol.

Add tests for Maths.maxInt and Maths.minInt

In LenderActions.sol#L185-191 should use Buckets.addLenderLPs.

@grandizzy grandizzy changed the title ToB improvement: Ensure that comments in code always reflect the code… ToB improvements Apr 10, 2023
Copy link
Contributor

@EdNoepel EdNoepel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@MikeHathaway MikeHathaway left a comment

Choose a reason for hiding this comment

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

LGTM - just a few questions

@@ -21,7 +21,6 @@ interface IPositionManagerOwnerActions {
* @dev The array of buckets is expected to be constructed off chain by scanning events for that lender.
* @dev The NFT must have already been created, and the number of buckets to be memorialized at a time determined by function caller.
* @dev An additional call is made to the pool to transfer the LPs from their previous owner, to the Position Manager.
* @dev Pool.setPositionOwner() must be called prior to calling this method.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be some sort of comment pointing to the need to approve the lp transfers?

Copy link
Contributor Author

@grandizzy grandizzy Apr 10, 2023

Choose a reason for hiding this comment

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

good point, can you suggest a nice wording for this? And should be applied only when memorializing position, and not for reedemPositions if I am not wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would this work d58fe44 ?

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 actually got this right with 0a50f8e :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just saw the request - yeah that looks great!

src/libraries/internal/Maths.sol Show resolved Hide resolved
@grandizzy grandizzy merged commit a375bf7 into develop Apr 10, 2023
@grandizzy grandizzy deleted the tob-comments-improvement branch April 10, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants