code-423n4 / 2022-04-backed-findings

1 stars 1 forks source link

QA Report #100

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Low risk

Loss of precision

Here is a mul after div https://github.com/code-423n4/2022-04-backed/blob/e8015d7c4b295af131f017e646ba1b99c8f608f0/contracts/NFTLoanFacilitator.sol#L382 Should be changed into

        return (loanAmount
            * (block.timestamp - lastAccumulatedTimestamp)
            * (perAnumInterestRate * 1e18) / 365 days
            / 1e21 // SCALAR * 1e18
            + accumulatedInterest;
wilsoncusack commented 2 years ago

the mul is first

gzeoneth commented 2 years ago

The code have / 365 days in the bracket, which will take precedence of the multiplication of 2 brackets. Closing because submitted by contest judge.