Skip to content

Commit

Permalink
[#4] Use calldata instead of memory to optimize gas usage
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Jul 3, 2023
1 parent 926191d commit c389ea8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/SafeProtocolMediator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ contract SafeProtocolMediator is ISafeProtocolMediator {
data = new bytes[](transaction.actions.length);
uint256 length = transaction.actions.length;
for (uint256 i = 0; i < length; ++i) {
SafeProtocolAction memory safeProtocolAction = transaction.actions[i];
SafeProtocolAction calldata safeProtocolAction = transaction.actions[i];
(bool isActionSuccessful, bytes memory resultData) = ISafe(safe).execTransactionFromModuleReturnData(
safeProtocolAction.to,
safeProtocolAction.value,
Expand Down Expand Up @@ -101,7 +101,7 @@ contract SafeProtocolMediator is ISafeProtocolMediator {
address safe,
SafeRootAccess calldata rootAccess
) external override onlyEnabledModule(safe) returns (bytes memory data) {
SafeProtocolAction memory safeProtocolAction = rootAccess.action;
SafeProtocolAction calldata safeProtocolAction = rootAccess.action;

if (!ISafeProtocolModule(msg.sender).requiresRootAccess() || !enabledModules[safe][msg.sender].rootAddressGranted) {
revert ModuleRequiresRootAccess(msg.sender);
Expand Down

0 comments on commit c389ea8

Please sign in to comment.