Skip to content

Commit

Permalink
Add Module v0.2.0 Deployment (#12)
Browse files Browse the repository at this point in the history
This PR adds the new v0.2.0 canonical 4337 module deployment.

Note that we additionally **removed the old v0.1.0 deployment** because
of a known medium severity issue with the module.
  • Loading branch information
nlordell authored Dec 11, 2023
1 parent dcf458e commit 64f74d7
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"released": true,
"contractName": "AddModulesLib",
"version": "0.1.0",
"version": "0.2.0",
"networkAddresses": {
"5": "0x191EFDC03615B575922289DC339F4c70aC5C30Af",
"137": "0x191EFDC03615B575922289DC339F4c70aC5C30Af",
"80001": "0x191EFDC03615B575922289DC339F4c70aC5C30Af",
"11155111": "0x191EFDC03615B575922289DC339F4c70aC5C30Af"
"5": "0x8EcD4ec46D4D2a6B64fE960B3D64e8B94B2234eb",
"137": "0x8EcD4ec46D4D2a6B64fE960B3D64e8B94B2234eb",
"80001": "0x8EcD4ec46D4D2a6B64fE960B3D64e8B94B2234eb",
"11155111": "0x8EcD4ec46D4D2a6B64fE960B3D64e8B94B2234eb"
},
"abi": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"released": true,
"contractName": "Safe4337Module",
"version": "0.1.0",
"version": "0.2.0",
"networkAddresses": {
"5": "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38",
"137": "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38",
"80001": "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38",
"11155111": "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38"
"5": "0xa581c4A4DB7175302464fF3C06380BC3270b4037",
"137": "0xa581c4A4DB7175302464fF3C06380BC3270b4037",
"80001": "0xa581c4A4DB7175302464fF3C06380BC3270b4037",
"11155111": "0xa581c4A4DB7175302464fF3C06380BC3270b4037"
},
"abi": [
{
Expand Down Expand Up @@ -185,56 +185,73 @@
{
"inputs": [
{
"internalType": "address",
"name": "safe",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "preVerificationGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "verificationGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "callGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxFeePerGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxPriorityFeePerGas",
"type": "uint256"
},
{
"internalType": "address",
"name": "entryPoint",
"type": "address"
"components": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "initCode",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "callGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "verificationGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "preVerificationGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxFeePerGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxPriorityFeePerGas",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "paymasterAndData",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"internalType": "struct UserOperation",
"name": "userOp",
"type": "tuple"
}
],
"name": "getOperationHash",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"name": "operationHash",
"type": "bytes32"
}
],
Expand Down
8 changes: 4 additions & 4 deletions src/safe-4337-module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Safe4337Module010 from './assets/safe-4337-module/v0.1.0/safe-4337-module.json';
import AddModulesLib010 from './assets/safe-4337-module/v0.1.0/add-modules-lib.json';
import Safe4337Module020 from './assets/safe-4337-module/v0.2.0/safe-4337-module.json';
import AddModulesLib020 from './assets/safe-4337-module/v0.2.0/add-modules-lib.json';
import { DeploymentFilter, Deployment } from './types';
import { applyFilterDefaults, findDeployment } from './utils';

// The array should be sorted from the latest version to the oldest.
const SAFE_4337_MODULE_DEPLOYMENTS: Deployment[] = [Safe4337Module010];
const ADD_MODULES_LIB_DEPLOYMENTS: Deployment[] = [AddModulesLib010];
const SAFE_4337_MODULE_DEPLOYMENTS: Deployment[] = [Safe4337Module020];
const ADD_MODULES_LIB_DEPLOYMENTS: Deployment[] = [AddModulesLib020];

export const getSafe4337ModuleDeployment = (filter?: DeploymentFilter): Deployment | undefined => {
return findDeployment(applyFilterDefaults(filter), SAFE_4337_MODULE_DEPLOYMENTS);
Expand Down

0 comments on commit 64f74d7

Please sign in to comment.