Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor dependencies to use latest versions and update CI workflows for safe-modules-allowance. #490

Merged
merged 19 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8196284
Refactor dependencies to use latest versions and update CI workflows …
mmv08 Aug 29, 2024
26f9ba5
Update Safe contracts to build.0 version in the allowances package
mmv08 Aug 29, 2024
b169b8c
Update CI workflow to use allowance coverage report.
mmv08 Aug 29, 2024
7b97063
Update @safe-global/safe-contracts version to exact match
mmv08 Aug 29, 2024
0da7502
Update lockfile dependencies to precise versions
mmv08 Aug 29, 2024
a9a107d
Refactor Certora formal verification job configurations to safe contr…
mmv08 Aug 29, 2024
33c00cb
Update certora-cli dependency to latest version
mmv08 Aug 29, 2024
516d24f
Update dependencies and licenses in various modules
mmv08 Aug 29, 2024
4c9ee80
"Refactor CI workflow to run fmt:check instead of fmt for @safe-globa…
mmv08 Aug 29, 2024
6dcdf78
Refactor configuration to separate lint and lint+fix scripts.
mmv08 Aug 29, 2024
cdb703c
Refactor path configuration for safe modules to remove redundant dire…
mmv08 Aug 29, 2024
77c361c
fix certora config
mmv08 Aug 29, 2024
bc55911
Merge branch 'main' of github.com:safe-global/safe-modules into deps/…
mmv08 Aug 30, 2024
6dfab23
Refactor licenses to LGPL-3.0-only across the project.
mmv08 Aug 30, 2024
2f0a306
Merge branch 'main' of github.com:safe-global/safe-modules into deps/…
mmv08 Sep 26, 2024
4fa5de0
update dependencies, fix certora ci by updating the cli version
mmv08 Sep 26, 2024
23589e2
Merge branch 'main' of github.com:safe-global/safe-modules into deps/…
mmv08 Oct 14, 2024
372d18e
Merge branch 'main' of github.com:safe-global/safe-modules into deps/…
mmv08 Dec 12, 2024
6179e7f
Update dependencies across multiple modules to latest versions
mmv08 Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci_allowance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: safe-modules-allowance
on:
push:
paths:
- 'modules/allowances/**'

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- run: |
pnpm install
pnpm run --filter "@safe-global/safe-allowance-module" coverage
- uses: coverallsapp/github-action@master
with:
path-to-lcov: modules/allowances/coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- run: |
pnpm install
pnpm run --filter "@safe-global/safe-allowance-module" lint
pnpm run --filter "@safe-global/safe-allowance-module" fmt:check
pnpm run --filter "@safe-global/safe-allowance-module" build
18 changes: 9 additions & 9 deletions examples/4337-gas-metering/package.json
Original file line number Diff line number Diff line change
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",
"alchemy-sdk": "3.4.1",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"permissionless": "0.1.39",
"viem": "2.17.4"
"ethers": "^6.13.2",
"permissionless": "0.1.45",
"viem": "2.20.1"
},
"devDependencies": {
"@types/node": "^20.14.10",
"tsx": "4.11.0",
"typescript": "^5.5.2"
"tsx": "4.19.0",
"typescript": "^5.5.4"
}
}
16 changes: 8 additions & 8 deletions examples/4337-passkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
"@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-deployments": "^1.37.3",
"@safe-global/safe-modules-deployments": "^2.2.1",
"@safe-global/safe-passkey": "workspace:^0.2.1-1",
"@web3modal/ethers": "^4.1.11",
"ethers": "^6.13.1",
"ethers": "^6.13.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1"
"react-router-dom": "^6.26.1"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react": "^18.3.4",
"@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",
"react-router": "^6.26.1",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite-plugin-commonjs": "^0.10.1"
}
}
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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously there was a bug with solc's allow path option and certora-cli, now it's fixed we can use it and get rid of the crazy direct links

"verify": "Safe4337Module:certora/specs/Safe4337Module.spec",
"packages": [
"@account-abstraction=../../node_modules/.pnpm/@[email protected]/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_/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/@[email protected]/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_/node_modules/@safe-global"
"@account-abstraction=node_modules/@account-abstraction",
"@safe-global=node_modules/@safe-global"
]
}
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/@[email protected]/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@[email protected][email protected].1_bufferutil@4.0.8_utf-8-validate@6.0.4_/node_modules/@safe-global"
"@safe-global=../../node_modules/.pnpm/@[email protected][email protected].2_bufferutil@4.0.8_utf-8-validate@5.0.10_/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/@[email protected]/node_modules/@account-abstraction",
"@safe-global=../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_/node_modules/@safe-global"
"@account-abstraction=node_modules/@account-abstraction",
"@safe-global=node_modules/@safe-global"
]
}
4 changes: 2 additions & 2 deletions modules/4337/certora/harnesses/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,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.10.1
certora-cli==7.10.2
20 changes: 10 additions & 10 deletions modules/4337/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"devDependencies": {
"@noble/curves": "^1.4.0",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@noble/curves": "^1.5.0",
"@nomicfoundation/hardhat-ethers": "^3.0.7",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^5.0.2",
"@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/chai": "^4.3.19",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.10",
"@types/yargs": "^17.0.32",
"@types/yargs": "^17.0.33",
"cbor": "^9.0.2",
"debug": "^4.3.5",
"debug": "^4.3.6",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"ethers": "^6.13.2",
"hardhat": "^2.22.9",
"hardhat-deploy": "^0.12.4",
"husky": "^9.0.11",
"husky": "^9.1.5",
"solc": "0.8.23",
"solhint": "^5.0.1",
"solhint": "^5.0.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.2",
"typescript": "^5.5.4",
"yargs": "^17.7.2"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion modules/allowances/contracts/test/ISafe.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0 <0.9.0;

interface ISafe {
interface ITestSafe {
function getThreshold() external view returns (uint256);

function getChainId() external view returns (uint256);
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
32 changes: 20 additions & 12 deletions modules/allowances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,25 @@
"prepare": "pnpm run clean && npm run build",
"lint": "pnpm run lint:sol && npm run lint:ts",
"lint:sol": "solhint 'contracts/**/*.sol'",
"lint:ts": "eslint 'tasks/**/*.ts' 'test/**/*.ts' --max-warnings 0 --fix",
"fmt": "pnpm run fmt:sol && npm run fmt:ts",
"fmt:sol": "prettier 'contracts/**/*.sol' -w",
"fmt:ts": "prettier 'tasks/**/*.ts' 'test/**/*.ts' -w"
"lint:sol:fix": "solhint 'contracts/**/*.sol' --fix",
"lint:ts": "eslint 'tasks/**/*.ts' 'test/**/*.ts' --max-warnings 0",
"lint:ts:fix": "eslint 'tasks/**/*.ts' 'test/**/*.ts' --max-warnings 0 --fix",
"fmt": "pnpm run fmt:sol:write && npm run fmt:ts:write",
"fmt:check": "pnpm run fmt:sol:check && npm run fmt:ts:check",
"fmt:sol:check": "prettier 'contracts/**/*.sol' --check",
"fmt:ts:check": "prettier 'tasks/**/*.ts' 'test/**/*.ts' --check",
"fmt:sol:write": "prettier 'contracts/**/*.sol' --write",
"fmt:ts:write": "prettier 'tasks/**/*.ts' 'test/**/*.ts' --write"
},
"author": "[email protected]",
"license": "ISC",
"author": "safe-global",
"license": "GPL-3.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: GPL-3.0 is deprecated. https://spdx.org/licenses/GPL-3.0.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the one we use in the other files, I'd raise this with legal. It says the identifier has been deprecated but not the license. We need a translation from legalese

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to GPL because this is the one we use in other files. I see it's deprecated and asked in Slack which one we should use.

Let's address this later in a different PR (I can also revert the change until we get more clarity)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the one we use in the other files, I'd raise this with legal. It says the identifier has been deprecated but not the license. We need a translation from legalese

The non-deprecated identifier is GPL-3.0-only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, the GPL-3.0 identifier was ambiguous because GPL has a "license update clause" (meaning that if they come up with a GPL-4, then all GPL-3 code will also be licensed under v4). In SPDX, this was represented by GPL-3.0-or-later. GPL-3.0 changed to GPL-3.0-only to avoid confusion (as it is the GPL license opting out of the "license update clause").

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the contract code, this should be LGPL-3.0-only (see the SPDX identifier used in the Solidity code).

"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.7",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@openzeppelin/contracts": "^5.0.2",
"@safe-global/safe-deployments": "^1.37.0",
"@safe-global/safe-contracts": "1.4.1-build.0",
"@safe-global/safe-deployments": "^1.37.3",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/mocha": "^10.0.7",
Expand All @@ -36,13 +44,13 @@
"@typescript-eslint/parser": "^7.12.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"ethers": "^6.13.2",
"hardhat": "^2.22.9",
"hardhat-deploy": "^0.12.4",
"solhint": "^5.0.1",
"solidity-coverage": "^0.8.12",
"solhint": "^5.0.3",
"solidity-coverage": "^0.8.13",
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
"typescript": "^5.5.2"
"typescript": "^5.5.4"
}
}
4 changes: 2 additions & 2 deletions modules/allowances/test/test-helpers/execSafeTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'
import { TransactionRequest, ZeroAddress } from 'ethers'

import { ISafe } from '../../typechain-types'
import { ITestSafe } from '../../typechain-types'

export default async function execSafeTransaction(safe: ISafe, { to, data, value = 0 }: TransactionRequest, signer: SignerWithAddress) {
export default async function execSafeTransaction(safe: ITestSafe, { to, data, value = 0 }: TransactionRequest, signer: SignerWithAddress) {
const address = await safe.getAddress()
const chainId = await safe.getChainId()
const nonce = await safe.nonce()
Expand Down
4 changes: 2 additions & 2 deletions modules/allowances/test/test-helpers/setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'
import hre from 'hardhat'

import { AllowanceModule__factory, ISafe__factory, TestToken, TestToken__factory } from '../../typechain-types'
import { AllowanceModule__factory, ITestSafe__factory, TestToken, TestToken__factory } from '../../typechain-types'

import deploySafeProxy from './deploySafeProxy'
import deploySingletons from './deploySingletons'
Expand All @@ -18,7 +18,7 @@ export default async function setup() {
// both the safe and the allowance work by signature
// connect the contracts to a signer that has funds
// but isn't safe owner, or allowance spender
const safe = ISafe__factory.connect(safeAddress, relayer)
const safe = ITestSafe__factory.connect(safeAddress, relayer)
const allowanceModule = AllowanceModule__factory.connect(allowanceModuleAddress, relayer)

// fund the safe
Expand Down
14 changes: 7 additions & 7 deletions modules/passkey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"prepare": "pnpm run build"
},
"devDependencies": {
"@noble/curves": "^1.4.0",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@noble/curves": "^1.5.0",
"@nomicfoundation/hardhat-ethers": "^3.0.7",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@safe-global/mock-contract": "^4.1.0",
Expand All @@ -57,17 +57,17 @@
"@simplewebauthn/server": "^10.0.1",
"@types/node": "^20.14.10",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"ethers": "^6.13.2",
"hardhat": "^2.22.9",
"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.5.4"
},
"dependencies": {
"@account-abstraction/contracts": "0.7.0",
"@openzeppelin/contracts": "5.0.0",
"@openzeppelin/contracts": "5.0.2",
"cbor-web": "^9.0.2"
}
}
10 changes: 5 additions & 5 deletions modules/recovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-ethers": "^3.0.7",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@types/node": "^20.14.10",
"@types/yargs": "^17.0.32",
"@types/yargs": "^17.0.33",
"dotenv": "^16.4.5",
"ethers": "^6.13.1",
"hardhat": "^2.22.5",
"ethers": "^6.13.2",
"hardhat": "^2.22.9",
"hardhat-deploy": "^0.12.4",
"solc": "0.8.20",
"typescript": "^5.5.2",
"typescript": "^5.5.4",
"yargs": "^17.7.2"
},
"dependencies": {
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
"pnpm": "^9"
},
"devDependencies": {
"@safe-global/safe-singleton-factory": "^1.0.31",
"@safe-global/safe-singleton-factory": "^1.0.32",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"prettier": "^3.3.0",
"prettier-plugin-solidity": "^1.3.1",
"rimraf": "^5.0.7",
"sherif": "^0.10.0"
"eslint-plugin-react-refresh": "^0.4.11",
"prettier": "^3.3.3",
"prettier-plugin-solidity": "^1.4.1",
"rimraf": "^6.0.1",
"sherif": "^0.11.0"
}
}
Loading
Loading