code-423n4 / 2021-04-maple-findings

0 stars 0 forks source link

Unnecessary `transferOwnership` funciton call in `MplRewards.sol` and `oracle/ChainlinkOracle.sol`. #116

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

Nothing about security but gas optimization.

Proof of Concept

Both contract MplRewards and ChainlinkOracle inherits Ownable, where the _owner variable is initialized (also with an event OwnershipTransferred emitted) during contract creation. There is no need for explicitly calling transferOwnership one more time.

Tools Used

None

Recommended Mitigation Steps

Remove the transferOwnership function in both contracts.

lucas-manuel commented 3 years ago

This is intentional because we want to transferOwnership from the deployer address to the governor