Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: low
Valid

Missing event emitting in some crucial functions

Missing event emitting in some crucial functions

Summary

There are missing events for some important functions. This will lead to bad problems when trying to track changes off-chain.

There are a total of three functions where event emmitting should be added:

Two of them are in Distributor.sol:
_commissionTransfer

function _commissionTransfer(IERC20 token) internal {
token.safeTransfer(STADIUM_ADDRESS, token.balanceOf(address(this)));
}

_distributed

erc20.safeTransfer(winners[i], amount);

One in ProxyFactory.sol:
_deployProxy

///////////////////////////////////
/////// Internal functions ////////
///////////////////////////////////
/// @dev Deploy proxy and return the proxy address
/// @dev This is an internal function
/// @param organizer The contest organizer
/// @param contestId The contest id
/// @param implementation The implementation address
function _deployProxy(address organizer, bytes32 contestId, address implementation) internal returns (address) {
bytes32 salt = _calculateSalt(organizer, contestId, implementation);
address proxy = address(new Proxy{salt: salt}(implementation));
return proxy;
}

Impact

This is considered a bad practice and does not follow the best practices when writing smart contracts.

Tools Used

Manual Review

Recommendations

Consider following the best practices when building smart contracts by emitting events in crucial functions. This will improve overall code quality, and it will be a lot easier to track changes off-chain.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.