Skip to content

Commit da4142a

Browse files
feat: account implementation
1 parent ad0e82e commit da4142a

File tree

15 files changed

+11
-19
lines changed

15 files changed

+11
-19
lines changed

src/StartaleSmartAccount.sol

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -316,17 +316,12 @@ contract StartaleSmartAccount is IStartaleSmartAccount, BaseAccount, ExecutionHe
316316
}
317317

318318
/// @notice Retrieves the address of the current implementation from the EIP-1967 slot.
319-
/// @notice Checks the 1967 implementation slot, if not found then checks the slot defined by address (Biconomy V2 smart account)
319+
/// @notice Checks the 1967 implementation slot
320320
/// @return implementation The address of the current contract implementation.
321321
function getImplementation() external view returns (address implementation) {
322322
assembly {
323323
implementation := sload(_ERC1967_IMPLEMENTATION_SLOT)
324324
}
325-
if (implementation == address(0)) {
326-
assembly {
327-
implementation := sload(address())
328-
}
329-
}
330325
}
331326

332327
/// @notice Checks if a specific module type is supported by this smart account.
@@ -383,9 +378,7 @@ contract StartaleSmartAccount is IStartaleSmartAccount, BaseAccount, ExecutionHe
383378
}
384379

385380
/// Upgrades the contract to a new implementation and calls a function on the new contract.
386-
/// @notice Updates two slots 1. ERC1967 slot and
387-
/// 2. address() slot in case if it's potentially upgraded earlier from Biconomy V2 account,
388-
/// as Biconomy v2 Account (proxy) reads implementation from the slot that is defined by its address
381+
/// @notice Updates the slot ERC1967 slot
389382
/// @param newImplementation The address of the new contract implementation.
390383
/// @param data The calldata to be sent to the new implementation.
391384
function upgradeToAndCall(address newImplementation, bytes calldata data) public payable virtual override withHook {
@@ -394,11 +387,7 @@ contract StartaleSmartAccount is IStartaleSmartAccount, BaseAccount, ExecutionHe
394387
assembly {
395388
res := gt(extcodesize(newImplementation), 0)
396389
}
397-
require(res, InvalidImplementationAddress());
398-
// update the address() storage slot as well.
399-
assembly {
400-
sstore(address(), newImplementation)
401-
}
390+
if (!res) revert InvalidImplementationAddress();
402391
UUPSUpgradeable.upgradeToAndCall(newImplementation, data);
403392
}
404393

src/interfaces/IERC4337Account.sol

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import {PackedUserOperation} from 'account-abstraction/interfaces/PackedUserOper
88
/// @dev Provides a structure for implementing custom validation logic and execution methods that comply with ERC-4337 "account abstraction" specs.
99
/// The validation method ensures proper signature and nonce verification before proceeding with transaction execution, critical for securing userOps.
1010
/// Also allows for the optional definition of an execution method to handle transactions post-validation, enhancing flexibility.
11-
/// @author @livingrockrises | Biconomy | chirag@biconomy.io
12-
/// @author @aboudjem | Biconomy | adam.boudjemaa@biconomy.io
13-
/// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io
14-
/// @author @zeroknots | Rhinestone.wtf | zeroknots.eth
11+
/// @author Startale
1512
/// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady
1613
interface IERC4337Account {
1714
/// Validate user's signature and nonce

src/utils/AccountProxy.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.28;
3+
4+
contract AccountProxy {}

src/utils/Bootstrap.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.28;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.28;
33

4-
import {IntegrationBase} from 'test/integration/IntegrationBase.sol';
4+
import {IntegrationBase} from 'test/foundry/integration/IntegrationBase.sol';
55

66
contract IntegrationGreeter is IntegrationBase {
77
function test_Greet() public {
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/invariants/fuzz/handlers/guided/Greeter.t.sol renamed to test/foundry/invariants/fuzz/handlers/guided/Greeter.t.sol

File renamed without changes.

test/invariants/fuzz/handlers/unguided/Greeter.t.sol renamed to test/foundry/invariants/fuzz/handlers/unguided/Greeter.t.sol

File renamed without changes.

0 commit comments

Comments
 (0)