Skip to content

Commit

Permalink
Merge branch 'main' of github.com:safe-global/safe-modules into deps/…
Browse files Browse the repository at this point in the history
…bump
  • Loading branch information
mmv08 committed Dec 12, 2024
2 parents 4fa5de0 + 0b9ea28 commit 23589e2
Show file tree
Hide file tree
Showing 48 changed files with 3,457 additions and 605 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/certora_passkey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: certora

on:
push:
branches:
- main
paths:
- modules/passkey/**
pull_request:
branches:
- main
paths:
- modules/passkey/**

workflow_dispatch:

jobs:
verify:
runs-on: ubuntu-latest
strategy:
matrix:
rule:
[
'GetConfigurationConf',
'GetSigner',
'ProxySimulator',
'SafeWebAuthnSignerFactory',
'SafeWebAuthnSignerProxy',
'SafeWebAuthnSignerSingleton',
'SignerCreationCantOverride',
'SingletonIsValidSignatureRevertingConditions',
'ValidSignatureForSignerIntegrity',
'VerifyEQtoIsValidSignatureForSigner',
'WebAuthn',
]
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install python
uses: actions/setup-python@v4
with: { python-version: 3.11 }

- name: Install certora cli
run: pip install -r modules/passkey/certora/requirements.txt

- name: Install solc
run: |
wget https://github.com/ethereum/solidity/releases/download/v0.8.26/solc-static-linux
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc8.26
- name: Install dependencies
run: pnpm install

- name: Verify rule ${{ matrix.rule }}
working-directory: ./modules/passkey
run: |
echo "Certora key length" ${#CERTORAKEY}
certoraRun certora/conf/${{ matrix.rule }}.conf --wait_for_results=all
env:
CERTORAKEY: ${{ secrets.CERTORA_KEY }}
8 changes: 4 additions & 4 deletions examples/4337-gas-metering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
"@alchemy/aa-alchemy": "3.19.0",
"@alchemy/aa-core": "3.19.0",
"@gelatonetwork/relay-sdk": "^5.5.6",
"alchemy-sdk": "3.4.3",
"alchemy-sdk": "3.5.0",
"dotenv": "^16.4.5",
"ethers": "^6.13.4",
"permissionless": "0.1.45",
"viem": "2.21.25"
"viem": "2.21.51"
},
"devDependencies": {
"@types/node": "^20.14.10",
"tsx": "4.19.1",
"typescript": "^5.6.3"
"tsx": "4.19.2",
"typescript": "^5.7.2"
}
}
10 changes: 5 additions & 5 deletions examples/4337-passkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@account-abstraction/contracts": "0.7.0",
"@safe-global/safe-4337": "0.3.0",
"@safe-global/safe-contracts": "1.4.1-2",
"@safe-global/safe-deployments": "^1.37.10",
"@safe-global/safe-deployments": "^1.37.18",
"@safe-global/safe-modules-deployments": "^2.2.4",
"@safe-global/safe-passkey": "workspace:^0.2.1-1",
"@web3modal/ethers": "^4.1.11",
Expand All @@ -24,12 +24,12 @@
"react-router-dom": "^6.27.0"
},
"devDependencies": {
"@types/react": "^18.3.11",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.7.1",
"@vitejs/plugin-react-swc": "^3.7.2",
"react-router": "^6.27.0",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"vite": "^5.4.8",
"vite-plugin-commonjs": "^0.10.3"
"vite-plugin-commonjs": "^0.10.4"
}
}
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.17.2
certora-cli==7.21.1
13 changes: 7 additions & 6 deletions modules/4337/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"benchmark": "pnpm run test test/gas/*.ts",
"deploy-all": "hardhat deploy-contracts --network",
"deploy": "hardhat deploy --network",
"deploy-custom": "rm -rf deployments/custom && npm run deploy custom",
"lint": "pnpm run lint:sol && npm run lint:ts",
"lint:sol": "solhint 'contracts/**/*.sol'",
"lint:ts": "eslint ./src && eslint ./test",
Expand All @@ -47,28 +48,28 @@
"url": "https://github.com/safe-global/safe-modules/issues"
},
"devDependencies": {
"@noble/curves": "^1.6.0",
"@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.19",
"@types/mocha": "^10.0.9",
"@types/mocha": "^10.0.10",
"@types/node": "^20.14.10",
"@types/yargs": "^17.0.33",
"cbor": "^9.0.2",
"debug": "^4.3.7",
"dotenv": "^16.4.5",
"ethers": "^6.13.4",
"hardhat": "^2.22.13",
"hardhat": "^2.22.16",
"hardhat-deploy": "^0.12.4",
"husky": "^9.1.6",
"husky": "^9.1.7",
"solc": "0.8.23",
"solhint": "^5.0.3",
"ts-node": "^10.9.2",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"yargs": "^17.7.2"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions modules/allowances/.env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
MNEMONIC=
INFURA_KEY=
ETHERSCAN_API_KEY=
CUSTOM_NODE_URL=
12 changes: 11 additions & 1 deletion modules/allowances/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getSingletonFactoryInfo } from '@safe-global/safe-singleton-factory'

dotenv.config()

const { INFURA_KEY, MNEMONIC, ETHERSCAN_API_KEY } = process.env
const { INFURA_KEY, MNEMONIC, ETHERSCAN_API_KEY, CUSTOM_NODE_URL } = process.env

const sharedNetworkConfig: HttpNetworkUserConfig = {
accounts: {
Expand All @@ -19,6 +19,15 @@ const sharedNetworkConfig: HttpNetworkUserConfig = {
},
}

const customNetwork = CUSTOM_NODE_URL
? {
custom: {
...sharedNetworkConfig,
url: CUSTOM_NODE_URL,
},
}
: {}

const config: HardhatUserConfig = {
paths: {
artifacts: 'build/artifacts',
Expand Down Expand Up @@ -78,6 +87,7 @@ const config: HardhatUserConfig = {
...sharedNetworkConfig,
url: `https://api.avax.network/ext/bc/C/rpc`,
},
...customNetwork,
},
deterministicDeployment,
namedAccounts: {
Expand Down
9 changes: 5 additions & 4 deletions modules/allowances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test": "hardhat test",
"coverage": "hardhat coverage",
"deploy": "hardhat deploy-verify --network",
"deploy-custom": "rm -rf deployments/custom && npm run deploy custom",
"prepare": "pnpm run clean && npm run build",
"lint": "pnpm run lint:sol && npm run lint:ts",
"lint:sol": "solhint 'contracts/**/*.sol'",
Expand All @@ -35,22 +36,22 @@
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@openzeppelin/contracts": "^5.0.2",
"@safe-global/safe-contracts": "1.4.1-2",
"@safe-global/safe-deployments": "^1.37.10",
"@safe-global/safe-deployments": "^1.37.18",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/mocha": "^10.0.9",
"@types/mocha": "^10.0.10",
"@types/node": "^20.14.10",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"ethers": "^6.13.4",
"hardhat": "^2.22.13",
"hardhat": "^2.22.16",
"hardhat-deploy": "^0.12.4",
"solhint": "^5.0.3",
"solidity-coverage": "^0.8.13",
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
}
}
25 changes: 25 additions & 0 deletions modules/passkey/certora/conf/GetConfigurationConf.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"assert_autofinder_success": true,
"files": [
"certora/munged/SafeWebAuthnSignerSingleton.sol",
"certora/harnesses/GetConfigurationProxyHarness.sol",
"contracts/SafeWebAuthnSignerFactory.sol"
],
"link": [
"GetConfigurationProxyHarness:_SINGLETON=SafeWebAuthnSignerSingleton"
],
"loop_iter": "6",
"optimistic_hashing": true,
"optimistic_loop": true,
"packages": [
"@safe-global=node_modules/@safe-global",
"@account-abstraction=node_modules/@account-abstraction"
],
"process": "emv",
"prover_args": [
" -split false"
],
"rule_sanity": "basic",
"solc": "solc8.26",
"verify": "GetConfigurationProxyHarness:certora/specs/GetConfigurationSpec.spec"
}
23 changes: 23 additions & 0 deletions modules/passkey/certora/conf/GetSigner.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"assert_autofinder_success": true,
"files": [
"certora/harnesses/GetSignerHarness.sol",
"contracts/SafeWebAuthnSignerSingleton.sol",
"contracts/SafeWebAuthnSignerProxy.sol"
],
"hashing_length_bound": "4694",
"link": [
"GetSignerHarness:SINGLETON=SafeWebAuthnSignerSingleton"
],
"loop_iter": "144",
"optimistic_hashing": true,
"optimistic_loop": true,
"packages": [
"@safe-global=node_modules/@safe-global",
"@account-abstraction=node_modules/@account-abstraction"
],
"process": "emv",
"rule_sanity": "basic",
"solc": "solc8.26",
"verify": "GetSignerHarness:certora/specs/GetSigner.spec"
}
27 changes: 27 additions & 0 deletions modules/passkey/certora/conf/ProxySimulator.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"assert_autofinder_success": true,
"files": [
"certora/harnesses/ProxySimulator.sol",
"contracts/SafeWebAuthnSignerProxy.sol",
"contracts/SafeWebAuthnSignerSingleton.sol",
"contracts/libraries/P256.sol",
"certora/harnesses/WebAuthnHarnessWithMunge.sol"
],
"hashing_length_bound": "2048",
"link": [
"ProxySimulator:_proxy=SafeWebAuthnSignerProxy",
"SafeWebAuthnSignerProxy:_VERIFIERS=P256",
"SafeWebAuthnSignerProxy:_SINGLETON=SafeWebAuthnSignerSingleton"
],
"loop_iter": "6",
"optimistic_hashing": true,
"optimistic_loop": true,
"packages": [
"@safe-global=node_modules/@safe-global",
"@account-abstraction=node_modules/@account-abstraction"
],
"process": "emv",
"rule_sanity": "basic",
"solc": "solc8.26",
"verify": "ProxySimulator:certora/specs/ProxySimulator.spec"
}
30 changes: 30 additions & 0 deletions modules/passkey/certora/conf/SafeWebAuthnSignerFactory.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"assert_autofinder_success": true,
"files": [
"certora/harnesses/FactoryHarnessForSignerConsistency.sol",
"certora/harnesses/WebAuthnHarnessWithMunge.sol",
"contracts/SafeWebAuthnSignerSingleton.sol",
"contracts/SafeWebAuthnSignerProxy.sol"
],
"link": [
"FactoryHarnessForSignerConsistency:SINGLETON=SafeWebAuthnSignerSingleton"
],
"loop_iter": "6",
"optimistic_hashing": true,
"optimistic_loop": true,
"packages": [
"@safe-global=node_modules/@safe-global",
"@account-abstraction=node_modules/@account-abstraction"
],
"rule": [
"createAndGetSignerEquivalence",
"getSignerRevertingConditions",
"hasNoCodeIntegrity",
"isValidSignatureForSignerConsistency",
"singletonNeverChanges"
],
"process": "emv",
"rule_sanity": "basic",
"solc": "solc8.26",
"verify": "FactoryHarnessForSignerConsistency:certora/specs/SafeWebAuthnSignerFactoryWithMunge.spec"
}
23 changes: 23 additions & 0 deletions modules/passkey/certora/conf/SafeWebAuthnSignerProxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"assert_autofinder_success": true,
"files": [
"contracts/SafeWebAuthnSignerProxy.sol",
"contracts/SafeWebAuthnSignerSingleton.sol",
"contracts/libraries/P256.sol"
],
"link": [
"SafeWebAuthnSignerProxy:_VERIFIERS=P256",
"SafeWebAuthnSignerProxy:_SINGLETON=SafeWebAuthnSignerSingleton"
],
"loop_iter": "6",
"optimistic_hashing": true,
"optimistic_loop": true,
"packages": [
"@safe-global=node_modules/@safe-global",
"@account-abstraction=node_modules/@account-abstraction"
],
"process": "emv",
"rule_sanity": "basic",
"solc": "solc8.26",
"verify": "SafeWebAuthnSignerProxy:certora/specs/SafeWebAuthnSignerProxy.spec"
}
23 changes: 23 additions & 0 deletions modules/passkey/certora/conf/SafeWebAuthnSignerSingleton.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"assert_autofinder_success": true,
"files": [
"contracts/SafeWebAuthnSignerFactory.sol",
"contracts/SafeWebAuthnSignerSingleton.sol",
"contracts/libraries/P256.sol",
"certora/harnesses/WebAuthnHarnessWithMunge.sol"
],
"link": [
"SafeWebAuthnSignerFactory:SINGLETON=SafeWebAuthnSignerSingleton"
],
"loop_iter": "6",
"optimistic_hashing": true,
"optimistic_loop": true,
"packages": [
"@safe-global=node_modules/@safe-global",
"@account-abstraction=node_modules/@account-abstraction"
],
"process": "emv",
"rule_sanity": "basic",
"solc": "solc8.26",
"verify": "SafeWebAuthnSignerSingleton:certora/specs/SafeWebAuthnSignerSingleton.spec"
}
Loading

0 comments on commit 23589e2

Please sign in to comment.