Skip to content

Commit

Permalink
fix: rename cleanup v2 (#188)
Browse files Browse the repository at this point in the history
* fix: use deploy 7579 proxy account interface

Attempting to deploy to sepolia and updating the contract locations is
harder than just changing the interface which still exists and is
compatiable

* Reapply "chore: rename to reflect SSO interface"

This reverts commit 0bf91c6.
There's an extra allow-list for the factory that would have fixed this

* fix: remove 7579 account interface entirely

I had added this for backwards compatibility, thinking we'd update the
front-end and the old front-end would need to work with the new back
end.
Instead the deployment process might be reversed, where we update the
back-end and the front-end will point to the old back-end during the
rollover.

* fix: update paymaster contract location

Still need to deploy to sepolia and get addresses for that?

* fix: add deployed contracts

Will open up the allow-list PR for commit

---------

Co-authored-by: Lyova Potyomkin <[email protected]>
  • Loading branch information
cpb8010 and ly0va authored Nov 21, 2024
1 parent 1c69674 commit ff066de
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 665 deletions.
12 changes: 6 additions & 6 deletions packages/auth-server/stores/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ type ChainContracts = PasskeyRequiredContracts & {
};
export const contractsByChain: Record<SupportedChainId, ChainContracts> = {
[zksyncSepoliaTestnet.id]: {
session: "0x360A6930cD57175fD2fc21BF331C777EB7b522d6",
passkey: "0x7AC1718A54372B5D5fDAca2B7aB6dC6019078d20",
accountFactory: "0xD0CDc89E09dff81571D96465dFcf6737454C4AFe",
accountPaymaster: "0xAdbfC97D4c04e87e939eC6DbE0FCC9968A573900",
session: "0xf9021FbAA2bE6B8b15716C6A7a5E518EaAD23221",
passkey: "0x5Ca8686f2f82d0491C6cE86d176D5167A01D3c09",
accountFactory: "0x9Dce7B4507cE36dE875626A260ac7be2b0c04331",
accountPaymaster: "0x685af8Bc672D5916A4a97536e73bce0407CB4BEf",
},
[zksyncInMemoryNode.id]: {
session: "0x8543528a4561E3a5EC7d51Bfd3776457b0E7b7dc",
passkey: "0x07734BA326b6AD13BfC0115b0903EB14268F1617",
passkey: "0x975df0c7f5CB728ae9F96480491Ec5d1E17296f4",
accountFactory: "0xaAF5f437fB0524492886fbA64D703df15BF619AE",
accountPaymaster: "0x2879853afd8d066ca66e224A8E85621aC43d6F59",
accountPaymaster: "0xcE98d6E9456CdFE5eDC1Ce6c32eEce8F71AF6b74",
},
};

Expand Down
8 changes: 3 additions & 5 deletions packages/contracts/src/AAFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.24;
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractsCaller.sol";

import { IClaveAccount } from "./interfaces/IClaveAccount.sol";
import { ISsoAccount } from "./interfaces/ISsoAccount.sol";
import { UpgradeableBeacon } from "./UpgradeableBeacon.sol";

import "./helpers/Logger.sol";
Expand All @@ -19,9 +19,7 @@ contract AAFactory is UpgradeableBeacon {
beaconProxyBytecodeHash = _beaconProxyBytecodeHash;
}

function addNewUniqueId(bytes32 uniqueAccountId) external {}

function deployProxy7579Account(
function deployProxySsoAccount(
bytes32 salt,
string calldata uniqueAccountId,
bytes[] calldata initialValidators,
Expand Down Expand Up @@ -50,7 +48,7 @@ contract AAFactory is UpgradeableBeacon {
Logger.logAddress(accountAddress);

// add session-key/spend-limit module (similar code)
IClaveAccount(accountAddress).initialize(initialValidators, initialModules, initialK1Owners);
ISsoAccount(accountAddress).initialize(initialValidators, initialModules, initialK1Owners);

if (accountMappings[uniqueAccountId] != address(0)) {
revert("Account already exists");
Expand Down
289 changes: 0 additions & 289 deletions packages/contracts/src/ERC7579Account.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ModeCode } from "./libraries/ERC7579Mode.sol";
import { ERC1271Handler } from "./handlers/ERC1271Handler.sol";
import { BatchCaller } from "./batch/BatchCaller.sol";

import { IClaveAccount } from "./interfaces/IClaveAccount.sol";
import { ISsoAccount } from "./interfaces/ISsoAccount.sol";

import "./helpers/Logger.sol";

Expand All @@ -32,15 +32,15 @@ import "./helpers/Logger.sol";
* @author https://getclave.io
*/

contract ClaveAccount is
contract SsoAccount is
Initializable,
UpgradeManager,
HookManager,
ModuleManager,
ERC1271Handler,
TokenCallbackHandler,
BatchCaller,
IClaveAccount
ISsoAccount
{
// Helper library for the Transaction struct
using TransactionHelper for Transaction;
Expand Down Expand Up @@ -201,9 +201,9 @@ contract ClaveAccount is
transaction.processPaymasterInput();
}

/// @dev type(IClave).interfaceId indicates Clave accounts
/// @dev type(ISsoAccount).interfaceId indicates SSO accounts
function supportsInterface(bytes4 interfaceId) public view override(IERC165, TokenCallbackHandler) returns (bool) {
return interfaceId == type(IClaveAccount).interfaceId || super.supportsInterface(interfaceId);
return interfaceId == type(ISsoAccount).interfaceId || super.supportsInterface(interfaceId);
}

function _validateTransaction(
Expand Down
Loading

0 comments on commit ff066de

Please sign in to comment.