From 6744d272fb290688fa1a1daf4b2a331ef8ce59cf Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:47:30 +0200 Subject: [PATCH 01/10] =?UTF-8?q?=F0=9F=94=A8=20factory:=20get=20version?= =?UTF-8?q?=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccountFactory/06_FactoryGetVersion.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/AccountFactory/06_FactoryGetVersion.s.sol diff --git a/script/AccountFactory/06_FactoryGetVersion.s.sol b/script/AccountFactory/06_FactoryGetVersion.s.sol new file mode 100644 index 0000000..744647a --- /dev/null +++ b/script/AccountFactory/06_FactoryGetVersion.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { AccountFactory } from "src/v1/AccountFactory.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title FactoryGetVersion +/// @notice Fetch the version of the factory +contract FactoryGetVersion is BaseScript { + function run() public broadcast returns (uint256 version) { + // address of the factory we wanna use + address factoryAddress = vm.envAddress("FACTORY"); + AccountFactory factory = AccountFactory(factoryAddress); + + // fetch the version of the factory + version = factory.version(); + } +} From 7394b983433f7913aa8c7e3f8e479f77de970ac7 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:47:54 +0200 Subject: [PATCH 02/10] =?UTF-8?q?=F0=9F=94=A8=20factory:=20script=20to=20f?= =?UTF-8?q?etch=20account=20implem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_FactoryGetAccountImplem.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/AccountFactory/07_FactoryGetAccountImplem.s.sol diff --git a/script/AccountFactory/07_FactoryGetAccountImplem.s.sol b/script/AccountFactory/07_FactoryGetAccountImplem.s.sol new file mode 100644 index 0000000..a0bb7d8 --- /dev/null +++ b/script/AccountFactory/07_FactoryGetAccountImplem.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { AccountFactory } from "src/v1/AccountFactory.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title FactoryGetAccountImplem +/// @notice Fetch the account implementation used +contract FactoryGetAccountImplem is BaseScript { + function run() public broadcast returns (address accountImplementation) { + // address of the factory we wanna use + address factoryAddress = vm.envAddress("FACTORY"); + AccountFactory factory = AccountFactory(factoryAddress); + + // fetch the version of the factory + accountImplementation = factory.accountImplementation(); + } +} From 4248d4b63a4d424da63c0693efa59e5adc494a87 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:02 +0200 Subject: [PATCH 03/10] =?UTF-8?q?=F0=9F=94=A8=20factory:=20get=20owner=20s?= =?UTF-8?q?cript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/AccountFactory/08_FactoryGetOwner.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/AccountFactory/08_FactoryGetOwner.s.sol diff --git a/script/AccountFactory/08_FactoryGetOwner.s.sol b/script/AccountFactory/08_FactoryGetOwner.s.sol new file mode 100644 index 0000000..6bc38b9 --- /dev/null +++ b/script/AccountFactory/08_FactoryGetOwner.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { AccountFactory } from "src/v1/AccountFactory.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title FactoryGetOwner +/// @notice Fetch the owner of the factory +contract FactoryGetOwner is BaseScript { + function run() public broadcast returns (address owner) { + // address of the factory we wanna use + address factoryAddress = vm.envAddress("FACTORY"); + AccountFactory factory = AccountFactory(factoryAddress); + + // fetch the version of the factory + owner = factory.owner(); + } +} From f962c5e8675d136786db1532b96ddd0f3ff2f645 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:14 +0200 Subject: [PATCH 04/10] =?UTF-8?q?=F0=9F=94=A8=20paymaster:=20get=20version?= =?UTF-8?q?=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Paymaster/05_PaymasterGetVersion.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/Paymaster/05_PaymasterGetVersion.s.sol diff --git a/script/Paymaster/05_PaymasterGetVersion.s.sol b/script/Paymaster/05_PaymasterGetVersion.s.sol new file mode 100644 index 0000000..e420be2 --- /dev/null +++ b/script/Paymaster/05_PaymasterGetVersion.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { Paymaster } from "src/v1/Paymaster.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title PaymasterGetVersion +/// @notice Fetch the version of the paymaster +contract PaymasterGetVersion is BaseScript { + function run() public broadcast returns (uint256 version) { + // address of the paymaster we wanna use + address paymasterAddress = vm.envAddress("PAYMASTER"); + Paymaster paymaster = Paymaster(paymasterAddress); + + // fetch the version of the paymaster + version = paymaster.version(); + } +} From a6ac8f7e3fccb413a5127f2c8a5c806af80cc3c0 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:19 +0200 Subject: [PATCH 05/10] =?UTF-8?q?=F0=9F=94=A8=20paymaster:=20get=20owner?= =?UTF-8?q?=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Paymaster/06_PaymasterGetOwner.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/Paymaster/06_PaymasterGetOwner.s.sol diff --git a/script/Paymaster/06_PaymasterGetOwner.s.sol b/script/Paymaster/06_PaymasterGetOwner.s.sol new file mode 100644 index 0000000..c85cd66 --- /dev/null +++ b/script/Paymaster/06_PaymasterGetOwner.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { Paymaster } from "src/v1/Paymaster.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title PaymasterGetOwner +/// @notice Fetch the owner of the paymaster +contract PaymasterGetOwner is BaseScript { + function run() public broadcast returns (address owner) { + // address of the paymaster we wanna use + address paymasterAddress = vm.envAddress("PAYMASTER"); + Paymaster paymaster = Paymaster(paymasterAddress); + + // fetch the owner of the paymaster + owner = paymaster.owner(); + } +} From 751c934c80d240342e9d0681d28ab9e53fd4d058 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:23 +0200 Subject: [PATCH 06/10] =?UTF-8?q?=F0=9F=94=A8=20paymaster:=20get=20operato?= =?UTF-8?q?r=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Paymaster/07_PaymasterGetOperator.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/Paymaster/07_PaymasterGetOperator.s.sol diff --git a/script/Paymaster/07_PaymasterGetOperator.s.sol b/script/Paymaster/07_PaymasterGetOperator.s.sol new file mode 100644 index 0000000..a5e9047 --- /dev/null +++ b/script/Paymaster/07_PaymasterGetOperator.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { Paymaster } from "src/v1/Paymaster.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title PaymasterGetOperator +/// @notice Fetch the operator of the paymaster +contract PaymasterGetOperator is BaseScript { + function run() public broadcast returns (address operator) { + // address of the paymaster we wanna use + address paymasterAddress = vm.envAddress("PAYMASTER"); + Paymaster paymaster = Paymaster(paymasterAddress); + + // fetch the operator of the paymaster + operator = paymaster.operator(); + } +} From a67c2c06e8444aff7ecaa573c4c2046410b5c842 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:30 +0200 Subject: [PATCH 07/10] =?UTF-8?q?=F0=9F=94=A8=20paymaster:=20get=20deposit?= =?UTF-8?q?=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Paymaster/08_PaymasterGetDeposit.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/Paymaster/08_PaymasterGetDeposit.s.sol diff --git a/script/Paymaster/08_PaymasterGetDeposit.s.sol b/script/Paymaster/08_PaymasterGetDeposit.s.sol new file mode 100644 index 0000000..e1e0683 --- /dev/null +++ b/script/Paymaster/08_PaymasterGetDeposit.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { Paymaster } from "src/v1/Paymaster.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title PaymasterGetDeposit +/// @notice Fetch the current deposit of the paymaster +contract PaymasterGetDeposit is BaseScript { + function run() public broadcast returns (uint256 balance) { + // address of the paymaster we wanna use + address paymasterAddress = vm.envAddress("PAYMASTER"); + Paymaster paymaster = Paymaster(paymasterAddress); + + // fetch the current deposit of the paymaster + balance = paymaster.getDeposit(); + } +} From f4b88d92cf70cec0d07ee790804ecc11cd207ac7 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:36 +0200 Subject: [PATCH 08/10] =?UTF-8?q?=F0=9F=94=A8=20paymaster:=20get=20entrypo?= =?UTF-8?q?int=20address=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Paymaster/09_PaymasterGetEntrypoint.s.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 script/Paymaster/09_PaymasterGetEntrypoint.s.sol diff --git a/script/Paymaster/09_PaymasterGetEntrypoint.s.sol b/script/Paymaster/09_PaymasterGetEntrypoint.s.sol new file mode 100644 index 0000000..c30caf1 --- /dev/null +++ b/script/Paymaster/09_PaymasterGetEntrypoint.s.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { Paymaster } from "src/v1/Paymaster.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title PaymasterGetEntrypoint +/// @notice Fetch the entrypoint used by the paymaster +contract PaymasterGetEntrypoint is BaseScript { + function run() public broadcast returns (address entryPointAddress) { + // address of the paymaster we wanna use + address paymasterAddress = vm.envAddress("PAYMASTER"); + Paymaster paymaster = Paymaster(paymasterAddress); + + // fetch the entrypoint used by the paymaster + entryPointAddress = address(paymaster.entryPoint()); + } +} From 37a26137ab49df544b5f72e9643b2102ec6637a5 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:46 +0200 Subject: [PATCH 09/10] =?UTF-8?q?=F0=9F=94=A8=20paymaster:=20script=20to?= =?UTF-8?q?=20transfer=20operator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../10_PaymasterTransferOperator.s.sol | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 script/Paymaster/10_PaymasterTransferOperator.s.sol diff --git a/script/Paymaster/10_PaymasterTransferOperator.s.sol b/script/Paymaster/10_PaymasterTransferOperator.s.sol new file mode 100644 index 0000000..c94100c --- /dev/null +++ b/script/Paymaster/10_PaymasterTransferOperator.s.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { Paymaster } from "src/v1/Paymaster.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title PaymasterTransferOperator +/// @notice Transfer the operator role to someone else +contract PaymasterTransferOperator is BaseScript { + function run() public broadcast { + // address of the paymaster we wanna use + address paymasterAddress = vm.envAddress("PAYMASTER"); + Paymaster paymaster = Paymaster(paymasterAddress); + + // address of the new operator + address newOperator = vm.envAddress("NEW_OPERATOR"); + + // fetch the operator of the paymaster + paymaster.transferOperator(newOperator); + } +} From 6e976270bddaf83e1bcf7f8e267c4f56f37511c7 Mon Sep 17 00:00:00 2001 From: qd-qd Date: Tue, 2 Apr 2024 19:48:51 +0200 Subject: [PATCH 10/10] =?UTF-8?q?=F0=9F=94=A8=20paymaster:=20script=20to?= =?UTF-8?q?=20transfer=20owner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Paymaster/11_PaymasterTransferOwner.s.sol | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 script/Paymaster/11_PaymasterTransferOwner.s.sol diff --git a/script/Paymaster/11_PaymasterTransferOwner.s.sol b/script/Paymaster/11_PaymasterTransferOwner.s.sol new file mode 100644 index 0000000..e5fad65 --- /dev/null +++ b/script/Paymaster/11_PaymasterTransferOwner.s.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: APACHE-2.0 +pragma solidity >=0.8.19 <0.9.0; + +import { Paymaster } from "src/v1/Paymaster.sol"; +import { BaseScript } from "../Base.s.sol"; + +/// @title PaymasterTransferOwner +/// @notice Transfer the owner role to someone else +contract PaymasterTransferOwner is BaseScript { + function run() public broadcast { + // address of the paymaster we wanna use + address paymasterAddress = vm.envAddress("PAYMASTER"); + Paymaster paymaster = Paymaster(paymasterAddress); + + // address of the new owner + address newOwner = vm.envAddress("NEW_OWNER"); + + // fetch the owner of the paymaster + paymaster.transferOwnership(newOwner); + } +}