code-423n4 / 2023-02-gogopool-mitigation-contest-findings

0 stars 0 forks source link

Mitigation Confirmed for MR-Mitigation of M-20: Issue mitigated #60

Open code423n4 opened 1 year ago

code423n4 commented 1 year ago

This is a straightforward mitigated change. Nevertheless, I have added the following assertions to further confirm that maxMint() and maxDeposit() could only return correct values, i.e 0, when the contract is paused:

    function testMaxMint() public {
        address liqStaker = getActor("liqStaker");
        assertEq(ggAVAX.maxMint(liqStaker), type(uint256).max);

        vm.prank(address(ocyticus));
        dao.pauseContract("TokenggAVAX");

+       assertFalse(ggAVAX.maxMint(liqStaker) == 1);        
        assertEq(ggAVAX.maxMint(liqStaker), 0);
    }

    function testMaxDeposit() public {
        address liqStaker = getActor("liqStaker");
        assertEq(ggAVAX.maxDeposit(liqStaker), type(uint256).max);

        vm.prank(address(ocyticus));
        dao.pauseContract("TokenggAVAX");

+       assertFalse(ggAVAX.maxDeposit(liqStaker) == 1);     
        assertEq(ggAVAX.maxDeposit(liqStaker), 0);
    }
c4-judge commented 1 year ago

GalloDaSballo marked the issue as satisfactory