code-423n4 / 2021-09-wildcredit-findings

0 stars 0 forks source link

TridentRouter.isWhiteListed(...) Misleading name #94

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/sushiswap/trident/blob/9f949d9bddf7f12775e0c6ae641e9305c4762ea2/contracts/TridentRouter.sol#L357-L362

function isWhiteListed(address pool) internal {
        if (!whitelistedPools[pool]) {
            require(masterDeployer.pools(pool), "INVALID POOL");
            whitelistedPools[pool] = true;
        }
    }

The name isWhiteListed(pool) implies that it returns a bool value that indicates whether the pool is whitelisted. However, it actually reverts when it's not whitelisted.

Consider changing the name to requireWhiteListed(pool).

itsmetechjay commented 2 years ago

Withdrawn by warden. Per WatchPug: "I mistakenly submitted some issues of sushi to wild credit while having two tabs open at the same time."