Skip to content

Commit

Permalink
Refactor dependencies to use latest versions and update CI workflows …
Browse files Browse the repository at this point in the history
…for safe-modules-allowance. (#490)

This PR:
- Updates the dependencies to use the latest versions
- Adds a CI job for Safe Allowance module
- Fixes a interface name collision between `ISafe` used in tests and in
the production code
- For some reason the tests were not running due to TS complaints, I had
to be more specific with the installed packages for `pnpm` in the Safe
Allowance module
  • Loading branch information
mmv08 authored Dec 12, 2024
1 parent d4f5936 commit cf8b5d3
Show file tree
Hide file tree
Showing 22 changed files with 3,494 additions and 3,133 deletions.
24 changes: 12 additions & 12 deletions examples/4337-gas-metering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Gas Metering Analysis for Safe with 4337 Module",
"homepage": "https://github.com/safe-global/safe-modules/4337-gas-metering",
"license": "GPL-3.0",
"license": "LGPL-3.0-only",
"type": "module",
"private": true,
"scripts": {
Expand Down Expand Up @@ -48,19 +48,19 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"dependencies": {
"@alchemy/aa-accounts": "3.18.2",
"@alchemy/aa-alchemy": "3.18.2",
"@alchemy/aa-core": "3.18.2",
"@alchemy/aa-accounts": "3.19.0",
"@alchemy/aa-alchemy": "3.19.0",
"@alchemy/aa-core": "3.19.0",
"@gelatonetwork/relay-sdk": "^5.5.6",
"alchemy-sdk": "3.3.1",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"permissionless": "0.1.39",
"viem": "2.17.4"
"alchemy-sdk": "3.5.0",
"dotenv": "^16.4.7",
"ethers": "^6.13.4",
"permissionless": "0.1.45",
"viem": "2.21.54"
},
"devDependencies": {
"@types/node": "^20.14.10",
"tsx": "4.11.0",
"typescript": "^5.5.2"
"@types/node": "^22.10.2",
"tsx": "4.19.2",
"typescript": "^5.7.2"
}
}
24 changes: 12 additions & 12 deletions examples/4337-passkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"dependencies": {
"@account-abstraction/contracts": "0.7.0",
"@safe-global/safe-4337": "0.3.0",
"@safe-global/safe-contracts": "1.4.1-build.0",
"@safe-global/safe-deployments": "^1.37.0",
"@safe-global/safe-modules-deployments": "^2.2.0",
"@safe-global/safe-contracts": "1.4.1-2",
"@safe-global/safe-deployments": "^1.37.22",
"@safe-global/safe-modules-deployments": "^2.2.4",
"@safe-global/safe-passkey": "workspace:^0.2.1-1",
"@web3modal/ethers": "^4.1.11",
"ethers": "^6.13.1",
"ethers": "^6.13.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1"
"react-router-dom": "^6.27.0"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"react-router": "^6.23.1",
"typescript": "^5.5.2",
"vite": "^5.3.1",
"vite-plugin-commonjs": "^0.10.1"
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.7.2",
"react-router": "^6.27.0",
"typescript": "^5.7.2",
"vite": "^5.4.8",
"vite-plugin-commonjs": "^0.10.4"
}
}
2 changes: 1 addition & 1 deletion modules/4337/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,4 @@ All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MER

## License

All smart contracts are released under LGPL-3.0.
All smart contracts are released under LGPL-3.0-only.
5 changes: 3 additions & 2 deletions modules/4337/certora/conf/Safe4337Module.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
],
"rule_sanity": "basic",
"solc": "solc8.23",
"solc_allow_path":"../../node_modules",
"verify": "Safe4337Module:certora/specs/Safe4337Module.spec",
"packages": [
"@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global"
"@account-abstraction=node_modules/@account-abstraction",
"@safe-global=node_modules/@safe-global"
]
}
5 changes: 3 additions & 2 deletions modules/4337/certora/conf/SignatureLengthCheck.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"msg": "Safe4337Module: Signatures Length Check",
"rule_sanity": "basic",
"solc": "solc8.23",
"solc_allow_path":"../../node_modules",
"verify": "Safe4337ModuleHarness:certora/specs/SignatureLengthCheck.spec",
"packages": [
"@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global"
"@account-abstraction=node_modules/@account-abstraction",
"@safe-global=node_modules/@safe-global"
]
}
5 changes: 3 additions & 2 deletions modules/4337/certora/conf/TransactionExecutionMethods.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
],
"rule_sanity": "advanced",
"solc": "solc8.23",
"solc_allow_path":"../../node_modules",
"verify": "Safe4337Module:certora/specs/TransactionExecutionMethods.spec",
"packages": [
"@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global"
"@account-abstraction=node_modules/@account-abstraction",
"@safe-global=node_modules/@safe-global"
]
}
5 changes: 3 additions & 2 deletions modules/4337/certora/conf/ValidationDataLastBitOne.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
],
"rule_sanity": "basic",
"solc": "solc8.23",
"solc_allow_path":"../../node_modules",
"verify": "Safe4337Module:certora/specs/ValidationDataLastBitOne.spec",
"packages": [
"@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global"
"@account-abstraction=node_modules/@account-abstraction",
"@safe-global=node_modules/@safe-global"
]
}
5 changes: 2 additions & 3 deletions modules/4337/certora/harnesses/Account.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0;
import {Safe} from "@safe-global/safe-contracts/contracts/Safe.sol";
import {Enum} from "@safe-global/safe-contracts/contracts/common/Enum.sol";

contract Account is Safe {
constructor(
Expand Down Expand Up @@ -99,11 +98,11 @@ contract Account is Safe {
* in case the checkSignature functions reverts.
*/
contract AlwaysRevertingAccount {
function checkSignatures(bytes32 dataHash, bytes memory data, bytes memory signatures) public view {
function checkSignatures(bytes32 dataHash, bytes memory data, bytes memory signatures) public pure {
revert();
}

function getSignatures(bytes calldata signature) external returns (bytes memory slice) {
function getSignatures(bytes calldata signature) external pure returns (bytes memory slice) {
slice = signature[12:];
}
}
2 changes: 1 addition & 1 deletion modules/4337/certora/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
certora-cli==7.20.3
certora-cli==7.21.1
2 changes: 1 addition & 1 deletion modules/4337/certora/specs/Safe4337Module.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Account as safeContract;

methods {
function SUPPORTED_ENTRYPOINT() external returns(address) envfree;
function _._msgSender() internal => ERC2771MessageSender() expect address;
function HandlerContext._msgSender() internal returns(address) => ERC2771MessageSender();
function _.checkSignatures(bytes32, bytes, bytes) external => checkSignaturesFunctionCalled() expect bool;

//ISafe harnessed functions
Expand Down
34 changes: 17 additions & 17 deletions modules/4337/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.3.0-1",
"description": "Safe Module for ERC-4337 support",
"homepage": "https://github.com/safe-global/safe-modules/tree/main/modules/4337",
"license": "GPL-3.0",
"license": "LGPL-3.0-only",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -48,32 +48,32 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"devDependencies": {
"@noble/curves": "^1.4.0",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@noble/curves": "^1.7.0",
"@nomicfoundation/hardhat-ethers": "^3.0.8",
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^5.0.2",
"@openzeppelin/contracts": "^5.1.0",
"@safe-global/safe-4337-local-bundler": "workspace:^0.0.0",
"@safe-global/safe-4337-provider": "workspace:^0.0.0",
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.10",
"@types/yargs": "^17.0.32",
"@types/chai": "^4.3.19",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.2",
"@types/yargs": "^17.0.33",
"cbor": "^9.0.2",
"debug": "^4.3.5",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"debug": "^4.4.0",
"dotenv": "^16.4.7",
"ethers": "^6.13.4",
"hardhat": "^2.22.17",
"hardhat-deploy": "^0.12.4",
"husky": "^9.0.11",
"husky": "^9.1.7",
"solc": "0.8.23",
"solhint": "^5.0.1",
"solhint": "^5.0.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.2",
"typescript": "^5.7.2",
"yargs": "^17.7.2"
},
"dependencies": {
"@account-abstraction/contracts": "0.7.0",
"@safe-global/safe-contracts": "1.4.1-build.0"
"@safe-global/safe-contracts": "1.4.1-2"
}
}
2 changes: 1 addition & 1 deletion modules/4337/src/tasks/deployContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { task } from 'hardhat/config'
task('deploy-contracts', 'Deploys and verifies Safe contracts').setAction(async (_, hre) => {
await hre.run('deploy')
await hre.run('local-verify')
await hre.run('etherscan-verify', { forceLicense: true, license: 'LGPL-3.0' })
await hre.run('etherscan-verify', { forceLicense: true, license: 'LGPL-3.0-only' })
await hre.run('sourcify')
})

Expand Down
1 change: 1 addition & 0 deletions modules/allowances/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import '@nomicfoundation/hardhat-toolbox'
import '@nomicfoundation/hardhat-ethers'
import 'hardhat-deploy'
import './tasks/deploy_verify'
import dotenv from 'dotenv'
Expand Down
25 changes: 14 additions & 11 deletions modules/allowances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,30 @@
"fmt:sol:write": "prettier 'contracts/**/*.sol' --write",
"fmt:ts:write": "prettier 'tasks/**/*.ts' 'test/**/*.ts' --write"
},
"author": "richard@gnosis.io",
"license": "ISC",
"author": "safe-global",
"license": "LGPL-3.0-only",
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.8",
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^5.0.2",
"@safe-global/safe-deployments": "^1.37.0",
"@safe-global/safe-contracts": "1.4.1-2",
"@safe-global/safe-deployments": "^1.37.22",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.10",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.2",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"dotenv": "^16.4.5",
"dotenv": "^16.4.7",
"eslint": "^8.57.0",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"ethers": "^6.13.4",
"hardhat": "^2.22.17",
"hardhat-deploy": "^0.12.4",
"solhint": "^5.0.1",
"solidity-coverage": "^0.8.12",
"solhint": "^5.0.3",
"solidity-coverage": "^0.8.14",
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
"typescript": "^5.5.2"
"typescript": "^5.7.2"
}
}
2 changes: 1 addition & 1 deletion modules/allowances/tasks/deploy_verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ task('deploy-verify', 'Deploys and verifies Safe contracts').setAction(async (_,
await hre.run('sourcify')
await hre.run('etherscan-verify', {
forceLicense: true,
license: 'LGPL-3.0',
license: 'LGPL-3.0-only',
})
})

Expand Down
24 changes: 12 additions & 12 deletions modules/passkey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Safe",
"Safe module"
],
"license": "GPL-3.0",
"license": "LGPL-3.0-only",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -47,28 +47,28 @@
"prepare": "pnpm run build"
},
"devDependencies": {
"@noble/curves": "^1.4.0",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@noble/curves": "^1.7.0",
"@nomicfoundation/hardhat-ethers": "^3.0.8",
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@safe-global/mock-contract": "^4.1.0",
"@safe-global/safe-4337": "workspace:^0.3.0-1",
"@safe-global/safe-4337-local-bundler": "workspace:^0.0.0",
"@safe-global/safe-contracts": "1.4.1-build.0",
"@safe-global/safe-contracts": "1.4.1-2",
"@simplewebauthn/server": "^10.0.1",
"@types/node": "^20.14.10",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"@types/node": "^22.10.2",
"dotenv": "^16.4.7",
"ethers": "^6.13.4",
"hardhat": "^2.22.17",
"hardhat-deploy": "^0.12.4",
"solc": "0.8.26",
"solhint": "^5.0.1",
"solhint": "^5.0.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.2"
"typescript": "^5.7.2"
},
"dependencies": {
"@account-abstraction/contracts": "0.7.0",
"@openzeppelin/contracts": "5.0.0",
"@openzeppelin/contracts": "5.0.2",
"cbor-web": "^9.0.2"
}
}
2 changes: 1 addition & 1 deletion modules/passkey/src/tasks/deployContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ task('deploy-contracts', 'Deploys and verifies Safe contracts').setAction(async
const { address: fclP256Verifier } = await deployments.get('FCLP256Verifier')
await run('verify', { address: fclP256Verifier, contract: 'contracts/verifiers/FCLP256Verifier.sol:FCLP256Verifier' })

await run('etherscan-verify', { forceLicense: true, license: 'LGPL-3.0' })
await run('etherscan-verify', { forceLicense: true, license: 'LGPL-3.0-only' })
await run('sourcify')

// The `SafeWebAuthnSignerSingleton` is deployed by the `SafeWebAuthnSignerFactory` contructor
Expand Down
18 changes: 9 additions & 9 deletions modules/recovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-ethers": "^3.0.8",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@types/node": "^20.14.10",
"@types/yargs": "^17.0.32",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"@types/node": "^22.10.2",
"@types/yargs": "^17.0.33",
"dotenv": "^16.4.7",
"ethers": "^6.13.4",
"hardhat": "^2.22.17",
"hardhat-deploy": "^0.12.4",
"solc": "0.8.20",
"typescript": "^5.5.2",
"typescript": "^5.7.2",
"yargs": "^17.7.2"
},
"dependencies": {
"candide-contracts": "github:5afe/CandideWalletContracts#113d3c059e039e332637e8f686d9cbd505f1e738",
"@openzeppelin/contracts": "4.9.6",
"@safe-global/safe-contracts": "1.4.1-build.0"
"@safe-global/safe-contracts": "1.4.1-2",
"candide-contracts": "github:5afe/CandideWalletContracts#113d3c059e039e332637e8f686d9cbd505f1e738"
}
}
Loading

0 comments on commit cf8b5d3

Please sign in to comment.