Skip to content

Audit Fix L07: Invalid order of parameters in errors #284

Description

@ZenGround0

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    🐱 Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions