Skip to content

Conversation

@WalidOfNow
Copy link
Contributor

Security Checklist

  • 1. Re-Entrancy
  • 2. Arithmetic Over/Under Flows
  • 3. Unexpected Ether
  • 4. Delegatecall
  • 5. Default Visibilities
  • 6. Entropy Illusion
  • 7. External Contract Referencing
  • 8. Short Address/Parameter Attack (off chain)
  • 9. Unchecked CALL Return Values
  • 10. Race Conditions / Front Running
  • 11. Denial Of Service (DOS)
  • 12. Block Timestamp Manipulation
  • 13. Constructors with Care
  • 14. Uninitialized Storage Pointers
  • 15. Floating Points and Precision
  • 16. Tx.Origin Authentication
  • 17. Address.isContract Re-Entrancy via Constructor

⚠️ NOTES ⚠️

Make sure to think about each of these exploits in this PR.

@WalidOfNow WalidOfNow changed the title feat: gas optimizations feat: gas optimizations for position mover May 29, 2023
@WalidOfNow WalidOfNow marked this pull request as ready for review May 30, 2023 03:10
@WalidOfNow WalidOfNow requested a review from a team as a code owner May 30, 2023 03:10

require(
loanData.state == BDaoDataTypes.LoanState.Active,
"Loan not active"

Choose a reason for hiding this comment

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

suggestion : use Errors.xxx

PositionMoverVars memory tmpVar;

(, borrowAmount) = lendPoolLoan.getLoanReserveBorrowAmount(loanId);
tmpVar.borrowAmounts = new uint256[](loanIds.length);

Choose a reason for hiding this comment

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

could we cache "loanIds.length" as a uint value to save gas?

nextIndex = index + 1;
if (
nextIndex < tokenIdsLength &&
tmpVar.nftAssets[index] == tmpVar.nftAssets[nextIndex]

Choose a reason for hiding this comment

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

Suggestion more readable : currentSupplyAsset == tmpVar.nftAssets[nextIndex]

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