-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b17fa3c
commit 8974142
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
import {EIP712} from "../utils/EIP712.sol"; | ||
import {SignatureCheckerLib} from "../utils/SignatureCheckerLib.sol"; | ||
|
||
/// @notice Input hash helper for predeploy smart accounts using Solady ERC1271. | ||
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/accounts/ERC1271InputGenerator.sol) | ||
/// @author Coinbase (https://github.com/coinbase/smart-wallet/blob/main/src/utils/ERC1271InputGenerator.sol) | ||
/// | ||
/// @dev | ||
/// This contract is not meant to ever actually be deployed, | ||
/// only mock deployed and used via a static `eth_call`. | ||
/// | ||
/// May be useful for generating ERC-6492 compliant signatures. | ||
/// Inspired by Ambire's DeploylessUniversalSigValidator | ||
/// (https://github.com/AmbireTech/signature-validator/blob/main/contracts/DeploylessUniversalSigValidator.sol) | ||
abstract contract ERC1271InputGenerator { | ||
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ | ||
/* CUSTOM ERRORS */ | ||
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ | ||
|
||
/// @dev Account deployment via `accountFactory` with `factoryCalldata` failed. | ||
error AccountDeploymentFailed(); | ||
|
||
/// @dev Account returned from call to `accountFactory` does not match passed account. | ||
error ReturnedAddressDoesNotMatchAccount(); | ||
|
||
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ | ||
/* ERC1271 INPUT HASH GENERATOR */ | ||
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ | ||
|
||
constructor( | ||
address account, | ||
bytes32 hash, | ||
bytes32 parentTypehash, | ||
bytes32 child, | ||
address accountFactory, | ||
bytes memory factoryCalldata | ||
) { | ||
/// @solidity memory-safe-assembly | ||
assembly { | ||
// If the account already exists, call `replaySafeHash` and return the result. | ||
if extcodesize(account) { | ||
// TODO. | ||
} | ||
} | ||
} | ||
} |