QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Valid

Incorrect event emitted in `setUpdateWeightRunnerAddress()` function

[L-01] Incorrect event emitted in `setUpdateWeightRunnerAddress()` function

Summary

Incorrect event emitted in `setUpdateWeightRunnerAddress()` function. When changing the UpdateWeightRunner.sol address, the event should emit 2 params - old and new addresses:

event UpdateWeightRunnerAddressUpdated(address indexed oldAddress, address indexed newAddress);

The issue is that this function does not store the old address in memory, but returns the updated updateWeightRunner variable as first param instead of old updateWeightRunner:

function setUpdateWeightRunnerAddress(address _updateWeightRunner) external override {
require(msg.sender == quantammAdmin, "ONLYADMIN");
updateWeightRunner = UpdateWeightRunner(_updateWeightRunner);
emit UpdateWeightRunnerAddressUpdated(address(updateWeightRunner), _updateWeightRunner);
}

Impact

Frontend or other off-chain services may display incorrect values, potentially misleading users, disrupt update tracking and make it difficult to find updates.

Recommendations

function setUpdateWeightRunnerAddress(address _updateWeightRunner) external override {
require(msg.sender == quantammAdmin, "ONLYADMIN");
+ address oldUpdateWeightRunner = updateWeightRunner;
updateWeightRunner = UpdateWeightRunner(_updateWeightRunner);
- emit UpdateWeightRunnerAddressUpdated(address(updateWeightRunner), _updateWeightRunner);
+ emit UpdateWeightRunnerAddressUpdated(oldUpdateWeightRunner, _updateWeightRunner);
}
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_setUpdateWeightRunnerAddress_emit_only_new_address

Likelihood: Low, changing this address is rare. Impact: Low, incorrect event.

Support

FAQs

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

Give us feedback!