TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: medium
Invalid

Lack of Event Emission in `TempleTeleporter:_lzReceive` Function

Summary

The TempleTeleporter:_lzReceive function is responsible for receiving cross-chain messages and minting tokens to a specified recipient. However, the function lacks event emission, which can reduce transparency, hinder auditability, and obscure transaction details.

Vulnerability Details

The _lzReceive function decodes the payload to retrieve the recipient address and the token amount, then mints tokens accordingly. However, it fails to emit an event that records this minting action. Event logs are critical for providing transparency and ensuring that all actions performed by the contract are traceable and verifiable.

See the following code:

function _lzReceive(
Origin calldata /*_origin*/,
bytes32 /*_guid*/,
bytes calldata _payload,
address /*_executor,*/, // Executor address as specified by the OApp.
bytes calldata /*_extraData */ // Any extra data or options to trigger on receipt.
) internal override {
// Decode the payload to get the message
(address _recipient, uint256 _amount) = abi.decode(_payload, (address, uint256));
temple.mint(_recipient, _amount);
}

Impact

Without event logs, tracking the contract's actions becomes difficult, which can erode user and stakeholder trust. Devs rely on event logs to verify the correctness of transactions. The absence of these logs makes it challenging to audit the contract's behavior. Important details about token transfers, such as recipient addresses and amounts, are not recorded on the blockchain, making it hard to trace token flow.

Tools Used

Manual Reivew

Recommendations

To address this issue, it is recommended to emit an event every time the _lzReceive function mints tokens. This will ensure all critical actions are logged on the blockchain, enhancing transparency, auditability, and traceability.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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