relevant tag icon
ERC4337 Sender Creator
copy icon
Infinitism
• version 1.0.0
ERC4337
EIP4337
Deployable

ERC4337 Sender Creator

Helper contract for EntryPoint, to call userOp.initCode from a "neutral" address, which is explicitly not the entryPoint itself.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

Infinitism

Last Publish

3/15/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
SenderCreator.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; /** * helper contract for EntryPoint, to call userOp.initCode from a "neutral" address, * which is explicitly not the entryPoint itself. */ contract SenderCreator { /** * call the "initCode" factory to create and return the sender account address * @param initCode the initCode value from a UserOp. contains 20 bytes of factory address, followed by calldata * @return sender the returned address of the created account, or zero address on failure. */ function createSender(bytes calldata initCode) external returns (address sender) { address factory = address(bytes20(initCode[0 : 20])); bytes memory initCallData = initCode[20 :]; bool success; /* solhint-disable no-inline-assembly */ assembly { success := call(gas(), factory, 0, add(initCallData, 0x20), mload(initCallData), 0, 32) sender := mload(0) } if (!success) { sender = address(0); } } }

Get Cookin'
share iconShare

copy iconNo-Code Deploy
copy iconDownload Source
copy iconnpx cookbookdev i ERC4337-Sender-Creator
copy icon

Bytecode

Download

Verification

Download

Last Publish

3/15/2023

Solidity Compiler

v0.8.12+commit.f00d7308

Version

1.0.0

Creator

Infinitism

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.