Closed code423n4 closed 2 years ago
WatchPug
https://github.com/code-423n4/2021-12-nftx/blob/194073f750b7e2c9a886ece34b6382b4f1355f36/nftx-protocol-v2/contracts/solidity/NFTXSimpleFeeDistributor.sol#L162-L163
bytes memory payload = abi.encodeWithSelector(INFTXLPStaking.receiveRewards.selector, _vaultId, amountToSend); (bool success, ) = address(_receiver.receiver).call(payload);
payload is unnecessary as it's being used only once. Can be changed to:
payload
(bool success, ) = address(_receiver.receiver).call( abi.encodeWithSelector(INFTXLPStaking.receiveRewards.selector, _vaultId, amountToSend) );
https://github.com/code-423n4/2021-12-nftx/blob/194073f750b7e2c9a886ece34b6382b4f1355f36/nftx-protocol-v2/contracts/solidity/NFTXMarketplaceZap.sol#L312-L313
uint256 remaining = WETH.balanceOf(address(this)); WETH.transfer(to, remaining);
remaining is unnecessary as it's being used only once. Can be changed to:
remaining
WETH.transfer(to, WETH.balanceOf(address(this)));
NFTX Contract.
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-12-nftx/blob/194073f750b7e2c9a886ece34b6382b4f1355f36/nftx-protocol-v2/contracts/solidity/NFTXSimpleFeeDistributor.sol#L162-L163
payload
is unnecessary as it's being used only once. Can be changed to:https://github.com/code-423n4/2021-12-nftx/blob/194073f750b7e2c9a886ece34b6382b4f1355f36/nftx-protocol-v2/contracts/solidity/NFTXMarketplaceZap.sol#L312-L313
remaining
is unnecessary as it's being used only once. Can be changed to: