Skip to content

Commit

Permalink
Refactor codebase to replace '@aa-v7' with '@aa', update user operati…
Browse files Browse the repository at this point in the history
…on handling to use PackedUserOperation, remove deprecated scripts, and improve gas limit packing logic.
  • Loading branch information
ylv-io committed Dec 18, 2024
1 parent 4344a5d commit 7d1ab5d
Show file tree
Hide file tree
Showing 65 changed files with 314 additions and 1,431 deletions.
2 changes: 1 addition & 1 deletion certora/conf/KintoID_Generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"verify": "KintoIDHarness:certora/spec/Generic.spec",
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/KintoID_Monitor1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"verify": "KintoIDHarness:certora/spec/KintoID/Monitor.spec",
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/KintoID_Monitor2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"verify": "KintoIDHarness:certora/spec/KintoID/Monitor.spec",
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/KintoID_SanctionsTraits.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"verify": "KintoIDHarness:certora/spec/KintoID/SanctionsTraits.spec",
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/KintoID_Viewer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"verify":"KintoIDHarness:certora/spec/KintoID/Viewer.spec",
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/KintoWallet.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts',
'@aa/=node_modules/account-abstraction-0.7.0/contracts',

'ds-test/=node_modules/forge-std/lib/ds-test/src',
'forge-std/=node_modules/forge-std/src',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/KintoWalletFactory.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"verify":"KintoWalletFactory:certora/spec/KintoWalletFactory/Factory.spec",
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/SponsorPaymaster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
2 changes: 1 addition & 1 deletion certora/conf/SponsorPaymaster_additional.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"packages": [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand Down
3 changes: 1 addition & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ffi = true
solc_version = "0.8.24"
remappings = [
'node_modules/account-abstraction-0.7.0:@openzeppelin/contracts/=node_modules/openzeppelin-contracts-5.0.1',
'@aa-v7/=node_modules/account-abstraction-0.7.0/contracts/',
'@aa/=node_modules/account-abstraction-0.7.0/contracts/',

'ds-test/=node_modules/forge-std/lib/ds-test/src/',
'forge-std/=node_modules/forge-std/src/',
Expand All @@ -28,7 +28,6 @@ remappings = [
'@openzeppelin/contracts-upgradeable/=node_modules/openzeppelin-contracts-upgradeable/',

'node_modules/account-abstraction:@openzeppelin/contracts/=node_modules/openzeppelin-contracts',
'@aa/=node_modules/account-abstraction/contracts/',

'@solady/=node_modules/solady/src/',
'solady/=node_modules/solady/src/',
Expand Down
26 changes: 0 additions & 26 deletions remappings.txt

This file was deleted.

5 changes: 0 additions & 5 deletions script/actions/deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ contract DeployerScript is Create2Helper, DeployerHelper {

privateKey > 0 ? vm.broadcast(privateKey) : vm.broadcast();
_walletFactory.initialize();

// set wallet factory in EntryPoint
if (log) console.log("Setting wallet factory in entry point to: ", address(_walletFactory));
privateKey > 0 ? vm.broadcast(privateKey) : vm.broadcast();
entryPoint.setWalletFactory(address(_walletFactory));
}

function deployKintoWallet() public returns (KintoWallet _kintoWallet) {
Expand Down
19 changes: 8 additions & 11 deletions script/actions/send-user-operation.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import {IEntryPoint, UserOperation} from "@aa/core/BaseAccount.sol";
import {IEntryPoint} from "@aa/core/BaseAccount.sol";
import {PackedUserOperation} from "@aa/interfaces/PackedUserOperation.sol";

import {MigrationHelper} from "@kinto-core-script/utils/MigrationHelper.sol";

Expand All @@ -21,25 +22,21 @@ contract SendUserOperationScript is MigrationHelper {
uint256 nonce = json.readUint(".inflatedOp.nonce");
bytes memory callData = json.readBytes(".inflatedOp.callData");
bytes memory initCode = json.readBytes(".inflatedOp.initCode ");
uint256 callGasLimit = json.readUint(".inflatedOp.callGasLimit");
uint256 verificationGasLimit = json.readUint(".inflatedOp.verificationGasLimit");
bytes32 accountGasLimits = json.readBytes32(".inflatedOp.accountGasLimits");
bytes32 gasFees = json.readBytes32(".inflatedOp.gasFees");
uint256 preVerificationGas = json.readUint(".inflatedOp.preVerificationGas");
uint256 maxFeePerGas = json.readUint(".inflatedOp.maxFeePerGas");
uint256 maxPriorityFeePerGas = json.readUint(".inflatedOp.maxPriorityFeePerGas");
bytes memory paymasterAndData = json.readBytes(".inflatedOp.paymasterAndData");
bytes memory signature = json.readBytes(".inflatedOp.signature");

UserOperation[] memory userOps = new UserOperation[](1);
userOps[0] = UserOperation({
PackedUserOperation[] memory userOps = new PackedUserOperation[](1);
userOps[0] = PackedUserOperation({
sender: sender,
nonce: nonce,
initCode: initCode,
callData: callData,
callGasLimit: callGasLimit,
verificationGasLimit: verificationGasLimit,
preVerificationGas: preVerificationGas,
maxFeePerGas: maxFeePerGas,
maxPriorityFeePerGas: maxPriorityFeePerGas,
accountGasLimits: accountGasLimits,
gasFees: gasFees,
paymasterAndData: paymasterAndData,
signature: signature
});
Expand Down
46 changes: 0 additions & 46 deletions script/migrations/08-deploy_kinto_app.s.sol

This file was deleted.

55 changes: 0 additions & 55 deletions script/migrations/09-deploy_registry_proxy.s.sol

This file was deleted.

70 changes: 0 additions & 70 deletions script/migrations/10-upgrade_wallet_v3.s.sol

This file was deleted.

Loading

0 comments on commit 7d1ab5d

Please sign in to comment.