• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Tribally-Games / arcade-contracts / 18929517494

30 Oct 2025 04:05AM UTC coverage: 95.724% (-1.5%) from 97.241%
18929517494

push

github

hiddentao
refactor: use custom error reverts for quote calculations

Replace return values with CalculatedAmountOut custom error for quote
operations across adapters and gateway. This improves gas efficiency for
view-only quote simulations by using reverts instead of state-changing
returns.

- Add CalculatedAmountOut error to IDexSwapAdapter interface and LibErrors
- Update DummyDexAdapter and UniversalSwapAdapter getQuote implementations
- Update GatewayFacet calculateUsdc to use custom error
- Add parseCalculatedAmountOut utility in gateway-utils for error parsing
- Update test scripts to handle new quote mechanism
- Improve deployment script verification flow with skip option
- Update deployment addresses for Base and Ronin networks
- Add warning note about non-USDC deposits on Base

54 of 63 branches covered (85.71%)

Branch coverage included in aggregate %.

13 of 17 new or added lines in 4 files covered. (76.47%)

237 of 241 relevant lines covered (98.34%)

18.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/libs/LibToken.sol
1
// SPDX-License-Identifier: AGPL-3.0
2
pragma solidity 0.8.24;
3

4
import { IERC20 } from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
5
import { SafeERC20 } from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
6

7

8
library LibToken {
9
    function transferFrom(address _token, address _from, uint256 _amount) internal {
19✔
10
        IERC20 token = IERC20(_token);
19✔
11
        SafeERC20.safeTransferFrom(token, _from, address(this), _amount);
19✔
12
    }
13

NEW
14
    function transferFrom(address _token, address _from, address _to, uint256 _amount) internal {
×
NEW
15
        IERC20 token = IERC20(_token);
×
NEW
16
        SafeERC20.safeTransferFrom(token, _from, _to, _amount);
×
17
    }
18

19
    function transferTo(address _token, address _to, uint256 _amount) internal {
5✔
20
        IERC20 token = IERC20(_token);
5✔
21
        SafeERC20.safeTransfer(token, _to, _amount);
5✔
22
    }
23
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc