MEDIUM severity: After disabling burning with `CentralToken::disableBurning` calling `PaymentSettler::enableBurning` leads to stuck funds. **Description:** Burning of child tokens can be disabled, even after `PaymentSettler::enableBurning(...)` is called by and admin calling `CentralToken::disableBurning()` directly.

The correct way to re-enable burning is to call `CentralToken::enableBurning(burnPayout)` (even though the...

Vulnerable code:
function enableBurning(uint64 burnPayout) external nonReentrant {
        address sender = _msgSender();
        if (sender != paymentSettler)
            _checkCanCall(sender, _msgData());
@>      else totalBurnPayout = burnPayout;
    ...

(B1 + B2) - (x * B1 / S + (S - x)*B2/S)
== (B1 + B2) - (x * B1 / S + S * B2 / S - x * B2 / S)
== (B1 + B2) - (x/S* (B1 - B2) + B2)
== B1 - x/S * (B1 - B2)

function test_cyfrin_EnableAfterDisableLeadsToStuckFunds() public {
        address user0 = getDomesticUser(0);
        address user1 = getDomesticUser(1);
        uint64 BURN_FUNDS_0 = 1_000_000e6;
        uint64 BURN_FUNDS_1 = 700_000e6;

        uint64 INITIAL_SUPPLY = 10_000;
        uint64 BURN_AMOUNT = 3000;

        centralTokenProxy.mint(address(this), INITIAL_SUPPLY);
        centralTokenProxy.dynamicTransfer(user0, BURN_AMOUNT);
        centralTokenProxy.dynamicTransfer(user1, INITIAL_SUPPLY - BURN_AMOUNT);

        (uint128 usdBal0 , , bool burnEnabled0,) = paySettlerProxy.tokenData(address(centralTokenProxy));
        assertEq(usdBal0, 0);
        assertEq(burnEnabled0, false);

        // initiateBurning
        paySettlerProxy.initiateBurning(address(centralTokenProxy));
        skip(1 days + 1);

        IERC20(address(stableCoin)).approve(address(paySettlerProxy), type(uint256).max);
        paySettlerProxy.enableBurning(address(centralTokenProxy), address(this), BURN_FUNDS_0);
        (uint128 usdBal1,,bool burnEnabled1,) = paySettlerProxy.tokenData(address(centralTokenProxy));
        assertEq(usdBal1, 1_000_000e6);
        assertEq(centralTokenProxy.totalSupply(), INITIAL_SUPPLY);
        assertEq(centralTokenProxy.preBurnSupply(), INITIAL_SUPPLY);
        assertEq(centralTokenProxy.totalBurnPayout(), BURN_FUNDS_0);
        assertEq(burnEnabled1, true);

        vm.startPrank(user0);
        d_childTokenProxy.burn(); // burns INITIAL_SUPPLY - BURN_AMOUNT tokens
        vm.stopPrank();

        (uint128 usdBal2,,,) = paySettlerProxy.tokenData(address(centralTokenProxy));
        assertEq(usdBal2, BURN_FUNDS_0 - BURN_AMOUNT * BURN_FUNDS_0 / INITIAL_SUPPLY);
        assertEq(centralTokenProxy.totalSupply(), INITIAL_SUPPLY - BURN_AMOUNT);
        assertEq(centralTokenProxy.preBurnSupply(), INITIAL_SUPPLY);
        assertEq(centralTokenProxy.totalBurnPayout(), BURN_FUNDS_0);

        // Disable Burning
        centralTokenProxy.disableBurning();
        (,,bool burnEnabled2_5,) = paySettlerProxy.tokenData(address(centralTokenProxy));
        assertEq(burnEnabled2_5, true); // PaymentSettler still reports that the burn is enabled

        paySettlerProxy.enableBurning(address(centralTokenProxy), address(this), BURN_FUNDS_1);
        (uint128 usdBal3 , , , bool burnEnabled3) = paySettlerProxy.tokenData(address(centralTokenProxy));
        assertEq(usdBal3, usdBal2 + BURN_FUNDS_1);
        assertTrue(burnEnabled3);
        uint256 totalSupply3 = centralTokenProxy.totalSupply();
        uint64  preBurnSupply3 = centralTokenProxy.preBurnSupply();
        uint64  totalBurnPayout3 = centralTokenProxy.totalBurnPayout();
        uint256 valueOfTokens = totalSupply3 * totalBurnPayout3 / preBurnSupply3;

        assertEq(totalSupply3, INITIAL_SUPPLY - BURN_AMOUNT);
        assertEq(preBurnSupply3, INITIAL_SUPPLY);
        assertEq(totalBurnPayout3, BURN_FUNDS_1);

        vm.startPrank(user1);
        d_childTokenProxy.burn(); // burn all remaining tokens
        vm.stopPrank();

        (uint128 usdBalEnd , , , ) = paySettlerProxy.tokenData(address(centralTokenProxy));
        assertEq(usdBalEnd, usdBal2 + BURN_FUNDS_1 - valueOfTokens);
        assertEq(int64(uint64(usdBalEnd)), int64(BURN_FUNDS_0) - int64(BURN_AMOUNT) * (int64(BURN_FUNDS_0) - int64(BURN_FUNDS_1))/ int64(INITIAL_SUPPLY));
        assertEq(centralTokenProxy.totalSupply(), 0);
    }