Skip to content

Commit

Permalink
Update IPluginExecutor NatSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
adamegyed committed Nov 29, 2023
1 parent a3a952d commit 0e4b0ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
12 changes: 2 additions & 10 deletions src/account/UpgradeableModularAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ contract UpgradeableModularAccount is
}
}

/// @notice Executes a call from a plugin to another plugin
/// @dev Permissions must be granted to the calling plugin for the call to go through
/// @param data calldata to send to the plugin
/// @return The result of the call
/// @inheritdoc IPluginExecutor
function executeFromPlugin(bytes calldata data) external payable override returns (bytes memory) {
bytes4 selector = bytes4(data[:4]);
address callingPlugin = msg.sender;
Expand Down Expand Up @@ -207,12 +204,7 @@ contract UpgradeableModularAccount is
return returnData;
}

/// @notice Executes a call from a plugin to a non-plugin address
/// @dev Permissions must be granted to the calling plugin for the call to go through
/// @param target address of the target to call
/// @param value value to send with the call
/// @param data calldata to send to the target
/// @return The result of the call
/// @inheritdoc IPluginExecutor
function executeFromPluginExternal(address target, uint256 value, bytes calldata data)
external
payable
Expand Down
18 changes: 10 additions & 8 deletions src/interfaces/IPluginExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
pragma solidity ^0.8.19;

interface IPluginExecutor {
/// @notice Method from calls made from plugins.
/// @param data The call data for the call.
/// @return The return data from the call.
/// @notice Executes a call from a plugin to another plugin.
/// @dev Permissions must be granted to the calling plugin for the call to go through.
/// @param data calldata to send to the plugin
/// @return The result of the call
function executeFromPlugin(bytes calldata data) external payable returns (bytes memory);

/// @notice Method from calls made from plugins.
/// @dev If the target is a plugin, the call SHOULD revert.
/// @param target The target of the external contract to be called.
/// @param value The value to pass.
/// @param data The data to pass.
/// @notice Executes a call from a plugin to a non-plugin address.
/// @dev Permissions must be granted to the calling plugin for the call to go through.
/// @param target address of the target to call
/// @param value value to send with the call
/// @param data calldata to send to the target
/// @return The result of the call
function executeFromPluginExternal(address target, uint256 value, bytes calldata data)
external
payable
Expand Down

0 comments on commit 0e4b0ab

Please sign in to comment.