Reinclusion

When the OptiSwap team discovered this issue, we ran the numbers and determined HOGE transaction costs were more than double what they could be with 0 exclusions.

At the time, ownership of the contract was in a multi-signature wallet. We managed to track down the correct people to discuss the issue, and over the course of several months guided the fix.

Once all the reinclusions were executed, many of the branching logic paths were closed off, greatly simplifying the execution traces reachable in the HOGE contract:

    function _transfer(address sender, address recipient, uint256 amount) private {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");
        require(amount > 0, "Transfer amount must be greater than zero");
        if (_isExcluded[sender] && !_isExcluded[recipient]) {
            _transferFromExcluded(sender, recipient, amount);
        } else if (!_isExcluded[sender] && _isExcluded[recipient]) {
            _transferToExcluded(sender, recipient, amount);
        } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
            _transferStandard(sender, recipient, amount);
        } else if (_isExcluded[sender] && _isExcluded[recipient]) {
            _transferBothExcluded(sender, recipient, amount);
        } else {
            _transferStandard(sender, recipient, amount);
        }
    }

Last updated