Skip to content

Simple7702Account add a way to use CREATE opcode #591

@tomw1808

Description

@tomw1808

I hope this is the right place to ask, if not please close: Now that we can pull in the Simple7702Account into an EOA it would be great to have also the ability to deploy a new contract through that. I haven't found a way to do that other than routing it externally through a factory contract and I hope I can get some advise.

The current utils/Exec.sol simple does that:

   function call(
        address to,
        uint256 value,
        bytes memory data,
        uint256 txGas
    ) internal returns (bool success) {
        assembly ("memory-safe") {
            success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)
        }
    }

which comes from the BaseAccounts function execute(address target, uint256 value, bytes calldata data) virtual external

It would be great to somehow also have the ability to create new contracts through the contract using at least CREATE. Something like a function createContract(uint256 value, bytes calldata data) which internally calls the CREATE instead of the call(...)

Potentially relevant sidenote: I do know that I could use a factory contract which I can call and basically proxy the contract creation through that, however, it would mean that the address is calculated differently and the msg.sender inside the constructor to be deployed would also be different, which very often defeats the purpose. I'd like to use that in a bundler/paymaster setting where the originating account (msg.sender) is still the EOA address. Is there a way to do that, what are your thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions