Closed sherlock-admin4 closed 5 months ago
msg.sender
Low/Info issue submitted by kgothatso
msg.sender will always be account owner
gas optimization
this function are doing the same thing
function invoke(Invocation[] calldata invocations) external payable { _invoke(msg.sender, invocations); } function invoke(address account, Invocation[] calldata invocations) external payable { _invoke(account, invocations); }
msg.sender will always be account owner because of this check
https://github.com/sherlock-audit/2024-05-kwenta-x-perennial-integration-update/blob/main/perennial-v2/packages/perennial-extensions/contracts/MultiInvoker.sol#L141
https://github.com/sherlock-audit/2024-05-kwenta-x-perennial-integration-update/blob/main/perennial-v2/packages/perennial-extensions/contracts/MultiInvoker.sol#L126
https://github.com/sherlock-audit/2024-05-kwenta-x-perennial-integration-update/blob/main/perennial-v2/packages/perennial-extensions/contracts/MultiInvoker.sol#L133
manual Manual Review
remove one of the functions
msg.sender
will always be account owner, unnecessary function cost more gasLow/Info issue submitted by kgothatso
Summary
msg.sender
will always be account ownerVulnerability Detail
Impact
gas optimization
Code Snippet
this function are doing the same thing
msg.sender
will always be account owner because of this checkhttps://github.com/sherlock-audit/2024-05-kwenta-x-perennial-integration-update/blob/main/perennial-v2/packages/perennial-extensions/contracts/MultiInvoker.sol#L141
https://github.com/sherlock-audit/2024-05-kwenta-x-perennial-integration-update/blob/main/perennial-v2/packages/perennial-extensions/contracts/MultiInvoker.sol#L126
https://github.com/sherlock-audit/2024-05-kwenta-x-perennial-integration-update/blob/main/perennial-v2/packages/perennial-extensions/contracts/MultiInvoker.sol#L133
Tool used
manual Manual Review
Recommendation
remove one of the functions