Skip to content

Conversation

naveen-imtb
Copy link

No description provided.

@naveen-imtb naveen-imtb marked this pull request as draft August 28, 2025 04:34
@naveen-imtb naveen-imtb changed the title chore: ID-3927: ERC 7579 compliance [EXPERIMENTAL] [DO NOT MERGE] chore: ID-3927: ERC 7579 compliance Aug 28, 2025
}

function _removeModule(uint256 moduleTypeId, address module) internal {
address[] storage modules = _moduleList[moduleTypeId];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd explore storing the modules in a linked list for example SentinelList (audited) or enumerablemap.

if _moduleList becomes big, the for loop'ed sloads could get expensive on gas

ERC-7579 CORE
//////////////////////////////////////////////////////////////////////////*/

function execute(bytes32 mode, bytes calldata executionCalldata) external override {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is usually reserver for self calls or 4337 EPs. Or by something like ERC-7821

7579 Executors will always use executeFromExecutor

bytes calldata data
) external returns (bool success, bytes memory returnData) {
// Only allow the account itself to execute transactions
require(msg.sender == address(this), "ImmutableExecutor: UNAUTHORIZED");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be careful here for potential reentrancy. if someone manages to coerce the ImmutableExecutor to call it's own onInstall function. it might be possible to chain things together and get arbitrary execution on target

function decodeBatch(bytes calldata executionCalldata)
internal
pure
returns (Execution[] memory executions)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solady's ERC7579Lib has nice decode helper function here that give you calldata pointers for the Execution[]. saves some malloc gas

* @param executionCalldata The encoded execution calldata
* @return executions Array of decoded delegate executions
*/
function decodeDelegateCallBatch(bytes calldata executionCalldata)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually ERC7579 accounts don't implement this. cause you can just delegatecall a multicall that implements batch delegatecall and get the same behavior. reduces code complexity in the account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants