Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Q-2 Unnecessary _msgSender() #488

Closed 0xdcota closed 1 year ago

0xdcota commented 1 year ago

[Q-2] Unnecessary use of _msgSender()

Description

For example :

BaseVault.sol
function approve(address receiver, uint256 shares) public override(ERC20, IERC20) returns (bool) {
    address owner = _msgSender();
        .....
}

BorrowingVault.sol
function borrow(uint256 debt, address receiver, address owner) public override returns (uint256) {
    address caller = _msgSender();

Currently, Fuji's code uses both _msgSender() from the OZ context library and standard msg.sender. However, since Fuji has no intention of enabling meta transactions, using standard msg.sender should work everywhere. Consider using msg.sender in all places to remove this confusion and save a small amount of gas.