FilOzone / FilOzone/filecoin-pay

Audit Fix L07: Invalid order of parameters in errors

Open
#284 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Solidity
Stars
8
Forks
13
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.