DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing Event Emissions for Critical State Changes [Lack of Transparency]

Summary

Multiple critical state-changing functions lack event emissions, making it difficult to track important contract changes off-chain.

Vulnerability Details

Several functions that modify critical state variables don't emit events:

// GmxProxy.sol
function setPerpVault(address _perpVault, address market) external {
require(tx.origin == owner(), "not owner");
require(_perpVault != address(0), "zero address");
require(perpVault == address(0), "already set");
perpVault = _perpVault;
gExchangeRouter.setSavedCallbackContract(market, address(this));
// No event emission
}
function updateGmxAddresses(...) external onlyOwner {
// Updates multiple critical addresses
// No event emission
}
// PerpetualVault.sol
function deposit(uint256 amount) external payable nonReentrant {
// ... deposit logic ...
// Missing event: emit Minted(counter, msg.sender, 0, amount);
}

Impact

  • Difficult to track critical state changes off-chain

  • Reduced transparency for users and monitoring systems

  • Complicated debugging and auditing process

  • Limited ability to create accurate historical records

Recommendations

Add events for all critical state changes:

// In GmxProxy.sol
event PerpVaultSet(address indexed perpVault, address indexed market);
event GmxAddressesUpdated(
address indexed orderHandler,
address indexed liquidationHandler,
address indexed adlHandler,
// ... other addresses
);
function setPerpVault(address _perpVault, address market) external {
// ... existing checks ...
perpVault = _perpVault;
gExchangeRouter.setSavedCallbackContract(market, address(this));
emit PerpVaultSet(_perpVault, market);
}
function updateGmxAddresses(...) external onlyOwner {
// ... address updates ...
emit GmxAddressesUpdated(
_orderHandler,
_liquidationHandler,
_adlHandler,
// ... other addresses
);
}
Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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

Give us feedback!