-
Notifications
You must be signed in to change notification settings - Fork 39
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
Showing
14 changed files
with
280 additions
and
107 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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"Runtime_AccountCreation": "143836", | ||
"Runtime_Erc20Transfer": "63183", | ||
"Runtime_Erc20Transfer": "63180", | ||
"Runtime_NativeTransfer": "39356", | ||
"UserOp_Erc20Transfer": "172435", | ||
"UserOp_Erc20Transfer": "172432", | ||
"UserOp_NativeTransfer": "148492" | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
{ | ||
"Runtime_AccountCreation": "176256", | ||
"Runtime_BatchTransfers": "92914", | ||
"Runtime_Erc20Transfer": "78346", | ||
"Runtime_InstallSessionKey_Case1": "429647", | ||
"Runtime_NativeTransfer": "54495", | ||
"Runtime_UseSessionKey_Case1_Counter": "78523", | ||
"Runtime_UseSessionKey_Case1_Token": "111836", | ||
"UserOp_BatchTransfers": "197734", | ||
"UserOp_Erc20Transfer": "184708", | ||
"UserOp_InstallSessionKey_Case1": "537327", | ||
"UserOp_NativeTransfer": "160953", | ||
"UserOp_UseSessionKey_Case1_Counter": "194454", | ||
"UserOp_UseSessionKey_Case1_Token": "225438", | ||
"UserOp_deferredValidation": "232882" | ||
"Runtime_AccountCreation": "176235", | ||
"Runtime_BatchTransfers": "92896", | ||
"Runtime_Erc20Transfer": "78331", | ||
"Runtime_InstallSessionKey_Case1": "429572", | ||
"Runtime_NativeTransfer": "54483", | ||
"Runtime_UseSessionKey_Case1_Counter": "78469", | ||
"Runtime_UseSessionKey_Case1_Token": "111779", | ||
"UserOp_BatchTransfers": "197713", | ||
"UserOp_Erc20Transfer": "184690", | ||
"UserOp_InstallSessionKey_Case1": "537249", | ||
"UserOp_NativeTransfer": "160938", | ||
"UserOp_UseSessionKey_Case1_Counter": "194376", | ||
"UserOp_UseSessionKey_Case1_Token": "225357", | ||
"UserOp_deferredValidation": "232843" | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
{ | ||
"Runtime_AccountCreation": "97767", | ||
"Runtime_BatchTransfers": "88746", | ||
"Runtime_Erc20Transfer": "74226", | ||
"Runtime_InstallSessionKey_Case1": "427850", | ||
"Runtime_NativeTransfer": "50385", | ||
"Runtime_UseSessionKey_Case1_Counter": "78826", | ||
"Runtime_UseSessionKey_Case1_Token": "112139", | ||
"UserOp_BatchTransfers": "192863", | ||
"UserOp_Erc20Transfer": "179920", | ||
"UserOp_InstallSessionKey_Case1": "534652", | ||
"UserOp_NativeTransfer": "156195", | ||
"UserOp_UseSessionKey_Case1_Counter": "194706", | ||
"UserOp_UseSessionKey_Case1_Token": "225690", | ||
"UserOp_deferredValidation": "228856" | ||
"Runtime_AccountCreation": "97764", | ||
"Runtime_BatchTransfers": "88740", | ||
"Runtime_Erc20Transfer": "74220", | ||
"Runtime_InstallSessionKey_Case1": "427790", | ||
"Runtime_NativeTransfer": "50382", | ||
"Runtime_UseSessionKey_Case1_Counter": "78772", | ||
"Runtime_UseSessionKey_Case1_Token": "112082", | ||
"UserOp_BatchTransfers": "192854", | ||
"UserOp_Erc20Transfer": "179911", | ||
"UserOp_InstallSessionKey_Case1": "534589", | ||
"UserOp_NativeTransfer": "156189", | ||
"UserOp_UseSessionKey_Case1_Counter": "194643", | ||
"UserOp_UseSessionKey_Case1_Token": "225624", | ||
"UserOp_deferredValidation": "228832" | ||
} |
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
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
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
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,84 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.26; | ||
|
||
import {console} from "forge-std/console.sol"; | ||
|
||
import {ExecutionInstallDelegate} from "../src/helpers/ExecutionInstallDelegate.sol"; | ||
import {Artifacts} from "./Artifacts.sol"; | ||
import {ScriptBase} from "./ScriptBase.sol"; | ||
import {IEntryPoint} from "@eth-infinitism/account-abstraction/interfaces/IEntryPoint.sol"; | ||
|
||
// Deploys the three account implementations and an execution install delegate. This requires the following env | ||
// vars to be set: | ||
// - ENTRY_POINT (optional) | ||
contract DeploySmaStorageScript is ScriptBase, Artifacts { | ||
// State vars for expected addresses and salts. | ||
|
||
IEntryPoint public entryPoint; | ||
|
||
address public executionInstallDelegate; | ||
|
||
address public expectedSemiModularAccountStorageOnlyImpl; | ||
uint256 public semiModularAccountStorageOnlyImplSalt; | ||
|
||
function setUp() public { | ||
// Load the required addresses for the deployment from env vars. | ||
entryPoint = _getEntryPoint(); | ||
|
||
executionInstallDelegate = _getExecutionInstallDelegate(); | ||
|
||
expectedSemiModularAccountStorageOnlyImpl = _getSemiModularAccountStorageOnlyImpl(); | ||
semiModularAccountStorageOnlyImplSalt = _getSaltOrZero("SEMI_MODULAR_ACCOUNT_STORAGE_ONLY_IMPL"); | ||
} | ||
|
||
function run() public onlyProfile("optimized-build-sma-storage") { | ||
console.log("******** Deploying SMA-Storage Implementation *********"); | ||
|
||
_ensureNonzeroArgs(); | ||
|
||
vm.startBroadcast(); | ||
|
||
// At this point, the delegate and entrypoint are valid, so we can safely proceed with | ||
// using them as parameters and accessing them in wrapped functions. | ||
|
||
_safeDeploy( | ||
"Semi Modular Account Storage Only Impl", | ||
expectedSemiModularAccountStorageOnlyImpl, | ||
semiModularAccountStorageOnlyImplSalt, | ||
_getSemiModularAccountStorageOnlyInitcode( | ||
entryPoint, ExecutionInstallDelegate(executionInstallDelegate) | ||
), | ||
_wrappedDeploySemiModularAccountStorageOnly | ||
); | ||
|
||
vm.stopBroadcast(); | ||
|
||
console.log("******** SMA-Storage Implementation Deployed *********"); | ||
} | ||
|
||
// These functions wrap the internal deployment functions to provide access to the needed state variables | ||
// without affecting the expected signature from _safeDeploy. | ||
|
||
function _wrappedDeploySemiModularAccountStorageOnly(bytes32 salt) internal returns (address) { | ||
return _deploySemiModularAccountStorageOnly( | ||
salt, entryPoint, ExecutionInstallDelegate(executionInstallDelegate) | ||
); | ||
} | ||
|
||
function _ensureNonzeroArgs() internal view { | ||
bool shouldRevert; | ||
|
||
if (address(executionInstallDelegate) == address(0)) { | ||
console.log( | ||
"Env Variable 'EXECUTION_INSTALL_DELEGATE' not found or invalid during accounts deployment." | ||
); | ||
shouldRevert = true; | ||
} else { | ||
console.log("Using user-defined ExecutionInstallDelegate at: %x", executionInstallDelegate); | ||
} | ||
|
||
if (shouldRevert) { | ||
revert("Missing or invalid env variables during factory deployment"); | ||
} | ||
} | ||
} |
Oops, something went wrong.