Audit reference: [FIL-1132b525-L07]
From the audit
Four error calls in FilecoinPayV1.sol have incorrect parameter order compared to their error definitions in Errors.sol. The affected errors are:
- LockupRateLessThanOldRate is called with
(railId, rail.from, oldRate, payer.lockupRate) but the error definition expects (uint256 railId, address from, uint256 lockupRate, uint256 oldRate), meaning oldRate and payer.lockupRate
are swapped.
- CannotSettleFutureEpochs is called with (railId, untilEpoch, block.number) but the error definition expects
(uint256 railId, uint256 maxAllowedEpoch, uint256 attemptedEpoch), meaning untilEpoch and block.number are swapped.
- InsufficientFundsForSettlement is called with
(rail.token, rail.from, grossSettledAmount, payer.funds) but the error definition expects (IERC20 token,address from, uint256 available, uint256 required), meaning grossSettledAmount and payer.funds are swapped.
- InsufficientNativeTokenForBurn is called with
(msg.value, auctionPrice) but the error definition expects (uint256 required, uint256 sent), meaning msg.value and auctionPrice are swapped.
We should fix these
Audit reference:
[FIL-1132b525-L07]From the audit
(railId, rail.from, oldRate, payer.lockupRate)but the error definition expects(uint256 railId, address from, uint256 lockupRate, uint256 oldRate), meaning oldRate and payer.lockupRateare swapped.
(uint256 railId, uint256 maxAllowedEpoch, uint256 attemptedEpoch), meaning untilEpoch and block.number are swapped.(rail.token, rail.from, grossSettledAmount, payer.funds)but the error definition expects(IERC20 token,address from, uint256 available, uint256 required), meaning grossSettledAmount and payer.funds are swapped.(msg.value, auctionPrice)but the error definition expects(uint256 required, uint256 sent), meaning msg.value and auctionPrice are swapped.We should fix these