code-423n4 / 2022-03-lifinance-findings

6 stars 4 forks source link

QA Report #202

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

LOW AND NC for LIFI by PeritoFlores

Functions addDex and _removeDex lack of event emission

Functions addDex and _removeDex lack of event emission. So you are not aware if the dex was added/removed correctly from the whitelist . It is recommended to emit events. Maybe just after push/pop.

function addDex(address _dex) external {  //DexManagerFacet#L17
    LibDiamond.enforceIsContractOwner();

    if (s.dexWhitelist[_dex] == true) {
        return;
    }

    s.dexWhitelist[_dex] = true;
    s.dexs.push(_dex);  
    @audit  emit some event
}

function _removeDex(uint256 index) private { //DexManagerFacet#L17
    // Move the last element into the place to delete
    s.dexs[index] = s.dexs[s.dexs.length - 1];
    // Remove the last element
    s.dexs.pop(); 
    @audit emit some event 
    }
H3xept commented 2 years ago

Closed by lifinance/lifi-contracts@7e723fe79b6af76bb019f4106a892923f0d10681