Skip to content

bug fix and additional checks - #1

Open
FarzeenKist wants to merge 1 commit into
KishoreVB70:masterfrom
FarzeenKist:patch-1
Open

bug fix and additional checks#1
FarzeenKist wants to merge 1 commit into
KishoreVB70:masterfrom
FarzeenKist:patch-1

Conversation

@FarzeenKist

@FarzeenKist FarzeenKist commented Oct 4, 2022

Copy link
Copy Markdown

Improvements and Fixes

  1. Implemented the IERC721Receiver for best practices when dealing with transfers of NFTs to a foreign contract
  2. Renamed mulDiv into calculateInterestAmount and switched it to be a public function to allow users to have the functionality to calculate the estimated amount they can make off or pay off a loan.
  3. There was also a bug in mulDiv(you can use 250,10, and 100 to see the issue). I've gone ahead and fixed that and also simplified the logic of calculating the interest while also adding a check to prevent loan amount below 1 CUSD as a really low amount could lead to issues where the interest amount would be lower than expected
  4. removed z as an argument for mulDiv as it was constant and unnecessary
  5. Added the modifier exists to prevent access to loans that have not yet been created as this could lead to unexpected behaviors/issues (users could lendMoney function)
  6. Added checks for _nft and _loanDuration to prevent unexpected behaviors/issues as zero being entered as the _loanDuration could lead to issues such as the loan instantly being foreclosed and the borrower being able to take the NFT being used as collateral

@netlify

netlify Bot commented Oct 4, 2022

Copy link
Copy Markdown

Deploy Preview for nftloancelo ready!

Name Link
🔨 Latest commit 0b24269
🔍 Latest deploy log https://app.netlify.com/sites/nftloancelo/deploys/633c399d36c0ab0008a090c9
😎 Deploy Preview https://deploy-preview-1--nftloancelo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

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.

1 participant