Closed sherlock-admin4 closed 1 month ago
0xlookman
medium
The function getTokenName in ArrakisMetaVaultFactory.sol returns token symbols instead of names which is not what it is intended to do.
getTokenName
ArrakisMetaVaultFactory.sol
Users should be able to get the names of tokens in ArrakisMetaVaultFactory.sol using the getTokenName function.
But this function returns the tokens' symbols instead of the tokens' names. Hence returning to users false information.
function getTokenName( address token0_, address token1_ ) public view returns (string memory) { string memory symbol0 = IERC20Metadata(token0_).symbol(); string memory symbol1 = IERC20Metadata(token1_).symbol(); return _append("Arrakis Modular ", symbol0, "/", symbol1); }
Users are not able to get the correct names of tokens which can make them do wrong decisions about which tokens to use.
https://github.com/ArrakisFinance/arrakis-modular/blob/395fa728f6a2fc39ff30f55585ca1d191f56d7e3/src/ArrakisMetaVaultFactory.sol#L322
Manual Review
function getTokenName( address token0_, address token1_ ) public view returns (string memory) { - string memory symbol0 = IERC20Metadata(token0_).symbol(); + string memory symbol0 = IERC20Metadata(token0_).name(); - string memory symbol1 = IERC20Metadata(token1_).symbol(); + string memory symbol1 = IERC20Metadata(token1_).name(); return _append("Arrakis Modular ", symbol0, "/", symbol1); }
Make the above changes in your code of the getTokenName function.
0xlookman
medium
0xlookman:- ArrakisMetaVaultFactory.sol::getTokenName returns token symbol instead of Token name.
0xlookman
medium
Summary
The function
getTokenName
inArrakisMetaVaultFactory.sol
returns token symbols instead of names which is not what it is intended to do.Vulnerability Detail
Users should be able to get the names of tokens in
ArrakisMetaVaultFactory.sol
using thegetTokenName
function.But this function returns the tokens' symbols instead of the tokens' names. Hence returning to users false information.
Impact
Users are not able to get the correct names of tokens which can make them do wrong decisions about which tokens to use.
Code Snippet
https://github.com/ArrakisFinance/arrakis-modular/blob/395fa728f6a2fc39ff30f55585ca1d191f56d7e3/src/ArrakisMetaVaultFactory.sol#L322
Tool used
Manual Review
Recommendation
Make the above changes in your code of the
getTokenName
function.