Skip to content

[PR #38] p3: constructor zero-address guards (!aavePool, !swapRouter) have no tests #134

@obchain

Description

@obchain

Summary

CharonLiquidator's constructor validates both constructor arguments:

require(_aavePool != address(0), "!aavePool");
require(_swapRouter != address(0), "!swapRouter");

Neither guard is tested. These are the only immutable configuration checks for the contract's two critical external dependencies. If either address is misconfigured at deploy time, the contract is permanently bricked (immutables cannot be changed post-deploy).

Location

contracts/test/CharonLiquidator.t.sol — no constructor tests present

Fix

Add two tests (can be in a new Section F — Constructor):

function test_constructor_revertsOnZeroAavePool() public {
    vm.expectRevert(bytes("!aavePool"));
    new CharonLiquidator(address(0), STUB_ROUTER);
}

function test_constructor_revertsOnZeroSwapRouter() public {
    vm.expectRevert(bytes("!swapRouter"));
    new CharonLiquidator(STUB_POOL, address(0));
}

Refs #38

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions