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

Update Contract #8

Open
wants to merge 475 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
475 commits
Select commit Hold shift + click to select a range
ef9c7e9
Remove depth option from the runs with quantifiers
mmv08 Aug 25, 2023
f073326
Merge pull request #637 from safe-global/bug/comment-typo
mmv08 Aug 28, 2023
b5cc57a
Merge pull request #639 from safe-global/docs/1.5.0-changelog
mmv08 Aug 28, 2023
2648cca
Merge pull request #641 from safe-global/deps-bump
mmv08 Aug 28, 2023
0e4db07
Remove rules overlapping with rules in OwnerReach.spec
mmv08 Aug 28, 2023
28dfa59
Use byte instead of and in the SignatureDecoderContract
mmv08 Aug 28, 2023
7e4302f
Merge pull request #645 from safe-global/certora/cleanup
mmv08 Aug 29, 2023
2ca8143
Merge pull request #646 from safe-global/feat/signature-decoder-optim…
mmv08 Aug 29, 2023
52d20f5
remove ewc and volta from the hardhat config
mmv08 Aug 29, 2023
d123ab9
add a rule for module transaction executions
mmv08 Aug 29, 2023
8ba8c83
Merge pull request #647 from safe-global/chore/remove-outdated-networks
mmv08 Aug 30, 2023
cf843da
Merge pull request #648 from safe-global/certora/moduleExecutionRule
mmv08 Aug 30, 2023
8a855b6
Fix linter errors
mmv08 Aug 30, 2023
82dfcc8
Merge pull request #650 from safe-global/fix/linter-warnings
mmv08 Sep 1, 2023
465f491
remove trailing whitespace
jhoenicke Sep 7, 2023
91267d6
push munges
teryanarmen Sep 7, 2023
fb55a5c
Added counter of elements to spec.
jhoenicke Sep 8, 2023
27d1af9
Fix one failing rule
jhoenicke Sep 8, 2023
9e1d57f
fix typo:
owl11 Sep 16, 2023
851d689
Add a 1.3.0 -> 1.4.1 migration contract (#649)
mmv08 Sep 18, 2023
a9075a2
Merge pull request #658 from owl11/patch-1
mmv08 Sep 18, 2023
ccbdddd
Add summarization
mmv08 Sep 18, 2023
8ffae95
Merge pull request #657 from jhoenicke/certoraOwnerReach
mmv08 Sep 19, 2023
c4fb69e
Make checkSignature rule run.
jhoenicke Sep 22, 2023
3aaf2c2
Merge pull request #657 from jhoenicke/certoraOwnerReach
mmv08 Sep 26, 2023
2323407
Merge branch 'feat/external-contract-signature' into feat/fv/checkSig…
mmv08 Sep 26, 2023
aae6453
Merge pull request #661 from jhoenicke/feat/fv/checkSignatures
mmv08 Sep 26, 2023
09dc9ab
adjust the patch file
mmv08 Sep 26, 2023
1abedf3
Merge branch 'main' of github.com:safe-global/safe-contracts into fea…
mmv08 Sep 26, 2023
bc08fb0
Fix the methods block in the specs
mmv08 Sep 27, 2023
dcfcc01
Revert removal of an unused parameters in checkSignatures
mmv08 Sep 29, 2023
1cfa957
Certora: Mutation testing and rule enhancements (#660)
mmv08 Sep 29, 2023
7bd3ea4
Merge branch 'main' of github.com:safe-global/safe-contracts into fea…
mmv08 Sep 29, 2023
765c781
Update README.md to add missing --save-dev
bertux Oct 1, 2023
8249dcb
Feature: 1.5.0 Migration (#652)
mmv08 Oct 9, 2023
fdf9b8c
Bump flat, eth-gas-reporter and solidity-coverage
dependabot[bot] Oct 9, 2023
23f36d5
Merge pull request #665 from bertux/patch-1
mmv08 Oct 9, 2023
0b4ee70
Skip test files in coverage
mmv08 Oct 9, 2023
be0c330
Merge pull request #674 from safe-global/chore/coverage-skip-test
mmv08 Oct 9, 2023
ff4c676
Merge pull request #662 from safe-global/feat/external-contract-signa…
mmv08 Oct 11, 2023
45ed06a
Merge pull request #671 from safe-global/dependabot/npm_and_yarn/flat…
mmv08 Oct 12, 2023
7f13587
Signatures rule fix by copying the options from the original PR
mmv08 Oct 12, 2023
810fad9
Merge pull request #680 from safe-global/certora/signatures-rule-opti…
mmv08 Oct 12, 2023
f839437
Add pre-commit hook for linting and formatting
Uxio0 Oct 20, 2023
b344bd8
Merge pull request #686 from safe-global/add-precommit
mmv08 Oct 20, 2023
bd26f51
Enhance 1.4.1 contract checks for support proxy contract
mmv08 Oct 13, 2023
482332f
Add contract to migrate a Safe from not L2 to L2 (#685)
Uxio0 Oct 31, 2023
357f55e
Merge pull request #683 from safe-global/feature/1.4.1-migration-enha…
mmv08 Oct 31, 2023
373cfd2
Remove bytes from core contract methods and add them to the compatibi…
mmv08 Oct 30, 2023
fd05d21
Mask Immutables in Local Verify Task (#691)
nlordell Nov 1, 2023
52ce39c
Merge pull request #693 from safe-global/feature/remove-bytes-from-ch…
mmv08 Nov 1, 2023
4cee6ee
Add ability to implicitly specify "self" in multi-send
Philogy Nov 8, 2023
baf50a4
Update certora.yml to pin the cli version
mmv08 Nov 9, 2023
bbd9918
Proper parallel coveralls job
mmv08 Nov 9, 2023
650cd2b
Update onlyOwnersGuard, fix incorrect test
mmv08 Nov 11, 2023
8930059
Merge pull request #699 from safe-global/feature/optimize-onlyowners-…
mmv08 Nov 12, 2023
b71c65f
Explicitly Request Required PR Permission for CLA Bot (#692)
nlordell Nov 13, 2023
5aad84f
Merge pull request #695 from Philogy/main
mmv08 Nov 13, 2023
33eb51f
Add a test for forwarding calls to self
mmv08 Nov 13, 2023
ba5324e
Merge pull request #700 from safe-global/feat/multisend-self-tests
mmv08 Nov 14, 2023
915045f
Merge pull request #696 from safe-global/mmv08-patch-1
mmv08 Nov 15, 2023
69caefc
Enable ghost summary for getTransactionHash() (#702)
jhoenicke Nov 20, 2023
fec4b80
Uncomment the execTransaction rule (#705)
mmv08 Nov 22, 2023
4dd232a
Upgrade dependencies
mmv08 Nov 23, 2023
f03dfae
Merge pull request #709 from safe-global/deps/upgrade
mmv08 Nov 23, 2023
22ee559
Hardhat config updated
remedcu Dec 4, 2023
47c9adf
Memory Safe Contracts Written
remedcu Dec 4, 2023
5ee3905
Tests Updated
remedcu Dec 4, 2023
8753bc7
Guidelines Updated
remedcu Dec 4, 2023
d9a6f0c
safe-memory tag added
remedcu Dec 5, 2023
ebf89bb
solhint tags added for inline assembly
remedcu Dec 5, 2023
5cd5e53
SafeProxy assembly updated
remedcu Dec 5, 2023
d9cd9bb
Tests updated for coverage changes
remedcu Dec 5, 2023
4995c3d
solc 0.8.19
remedcu Dec 5, 2023
e287ca7
solcover updated with optimizer config
remedcu Dec 5, 2023
7444b95
fmt command added to package.json
remedcu Dec 5, 2023
c74ef15
solc reverted back to 0.7.6
remedcu Dec 5, 2023
a1a7ce6
Tests updated for coverage gas issue
remedcu Dec 5, 2023
e32f08e
console.logs for checking added
remedcu Dec 5, 2023
3a7bf79
Increased gas for a test with coverage
remedcu Dec 5, 2023
6481742
solc 0.8.19
remedcu Dec 5, 2023
c85784a
applyHarness updated
remedcu Dec 5, 2023
24d5abe
certora applyHarness update
remedcu Dec 5, 2023
5c23638
Reverting back to 0.7.6
remedcu Dec 21, 2023
f715936
Merge pull request #718 from safe-global/optimizer-enabled-with-origi…
remedcu Dec 21, 2023
7dbd1fe
SecuredTokenTransfer made to use free memory instead of scratch space
remedcu Dec 21, 2023
32ce306
viaIR: false in sample env
remedcu Dec 21, 2023
539f2fd
viaIR: false in sample env
remedcu Dec 21, 2023
aa7738a
Merge branch 'optimizer-enabled' of https://github.com/safe-global/sa…
remedcu Dec 21, 2023
534e3f4
Optimization commented and memory-safe edited
remedcu Dec 22, 2023
9166949
Review based safe-memory changes
remedcu Dec 22, 2023
771c969
Remove in assembly of FallbackManager
remedcu Dec 22, 2023
830bfc5
Using data size directly
remedcu Dec 22, 2023
62dcd4a
Using scratch space for in SecuredTokenTransfer
remedcu Dec 22, 2023
149f7e2
removed
remedcu Dec 22, 2023
0586ca8
Test based changes reverted
remedcu Dec 22, 2023
d052266
Comment reinstated
remedcu Dec 22, 2023
e55d181
Comment reinstated at the correct place
remedcu Dec 22, 2023
9c80418
Slight optimization in ModuleManager
remedcu Dec 22, 2023
71ff245
Transferring checkSignatures(...) to Safe
remedcu Dec 26, 2023
20a4bab
Added fmt script to package.json
remedcu Dec 26, 2023
2354477
Removed checkSignatures from CompatibilityFallbackHandler
remedcu Dec 26, 2023
2f2c56c
Tests edited after checkSignatures removal
remedcu Dec 26, 2023
c5f84b7
Add a test for checking return data in execTransactionFromModuleRetur…
mmv08 Nov 23, 2023
f48563d
Using uint256 for v (saves 9 bytes)
remedcu Jan 3, 2024
963c3ca
Guard Storage Slot used directly (saves 17 bytes)
remedcu Jan 3, 2024
b0b84f1
enableModule require -> if with revert (saves 2 bytes)
remedcu Jan 3, 2024
7fbc196
disableModule require -> if with revert (saves 2 bytes)
remedcu Jan 3, 2024
2d2260c
execTransactionFromModule require -> if with revert (saves 2 bytes)
remedcu Jan 3, 2024
a08d15d
Slight optimization in OwnerManager (saves 20 bytes)
remedcu Jan 3, 2024
b979bee
Slight codesize improvement in FallbackManager (saves 17 bytes)
remedcu Jan 3, 2024
0acdd35
Merge pull request #721 from safe-global/checkSignatures
remedcu Jan 4, 2024
fbef92b
Comment typo updated
remedcu Jan 5, 2024
625d96d
Version Overrides for old OZ files
remedcu Jan 5, 2024
b723796
Updating old compiler versions to default one
remedcu Jan 5, 2024
edc2910
Updated harness patch
remedcu Jan 8, 2024
9740605
SafeProxy using scratch space initially
remedcu Jan 8, 2024
0bdca8a
Updated harness patch
remedcu Jan 8, 2024
1cce1e9
Certora Harness Restored
remedcu Jan 8, 2024
5d2df08
EOF for .env.sample
remedcu Jan 8, 2024
5919110
Sigleton -> Singleton typo fixed
remedcu Jan 8, 2024
76a48cc
.env.sample updation
remedcu Jan 8, 2024
50e3d0c
harness timestamp restored
remedcu Jan 8, 2024
81a0fc4
Test Token pragma raised
remedcu Jan 8, 2024
99d7075
Using ErrorMessage for revert
remedcu Jan 8, 2024
c3e2317
Certora Signature Specs Updated
remedcu Jan 8, 2024
082c7af
solcover and .env updated
remedcu Jan 9, 2024
bc16a01
Using scratch space for call result boolean
remedcu Jan 9, 2024
d9069e2
Guidelines Updated
remedcu Jan 9, 2024
36280d3
solhint inline assembly comment
remedcu Jan 9, 2024
85f043f
Using bytes5 instead of string
remedcu Jan 9, 2024
d3f6010
SafeProxy memory-safety reverted
remedcu Jan 10, 2024
6b25caf
Multisend* memory-safety revert
remedcu Jan 10, 2024
c53fdc7
Using returndatasize directly
remedcu Jan 10, 2024
cd87eb0
DelegateCaller memory-safe revert and using returndatasize
remedcu Jan 10, 2024
7c51578
SafeProxy all changes reverted
remedcu Jan 10, 2024
0d24013
Using returndatasize through memory (revert)
remedcu Jan 10, 2024
6230350
contract.ts memory-safe tagging reverted
remedcu Jan 10, 2024
9b7697a
Revert use of uint8 everywhere except Safe contract
remedcu Jan 10, 2024
fc87888
Merge pull request #711 from safe-global/optimizer-enabled
remedcu Jan 10, 2024
8dd165a
Merge branch 'main' into contract-size
remedcu Jan 10, 2024
eebd751
Return Data Test Updated
remedcu Jan 12, 2024
b824669
Locked certora-cli to v5.0.5
remedcu Jan 12, 2024
7709f91
Adding natspec for pre & post guard check functions
remedcu Jan 12, 2024
75a5b7c
Func rename & getting guard during preModuleExecution
remedcu Jan 12, 2024
e3849a3
Fix Typo In Migration Contract Comment
nlordell Jan 12, 2024
9604d93
Rearranging func parameter
remedcu Jan 12, 2024
965e2e9
Merge pull request #728 from safe-global/bug/execTransactionFromModul…
remedcu Jan 12, 2024
fba7acc
Merge branch 'main' into contract-size
remedcu Jan 12, 2024
de17ed6
Merge pull request #729 from safe-global/fix-l2-migration-contract-typo
mmv08 Jan 12, 2024
1bc5036
Pin Certora CLI Version in CI (#730)
nlordell Jan 12, 2024
ac0eda0
Merge pull request #726 from safe-global/contract-size
remedcu Jan 12, 2024
b140318
Adding `ISafe` interface for `CompatibilityFallbackHandler` (#722)
remedcu Jan 16, 2024
914d0f8
Rename repository to safe-smart-account (#733)
akshay-ap Jan 22, 2024
3da1415
Upgrade certora spec files and CI to certora-cli v6 (#732)
mmv08 Feb 5, 2024
3b4c992
Remove OR operator from the benchmark job (#736)
mmv08 Feb 8, 2024
7a872e4
chore: remove useless `and` op (#737)
zhiqiangxu Feb 12, 2024
98429bc
Dependencies: Update all dependencies (#738)
mmv08 Feb 16, 2024
12136fd
Bump undici from 5.23.0 to 5.28.3 (#739)
dependabot[bot] Feb 20, 2024
2278f7c
Using `returndatasize()` in assembly. (#740)
remedcu Mar 7, 2024
bf48615
Fix typos (#744)
xiaoxianBoy Mar 16, 2024
0be700e
Bump follow-redirects from 1.15.2 to 1.15.6 (#745)
dependabot[bot] Mar 27, 2024
1cd7568
Upgrade all dependecies across the board (#746)
mmv08 Mar 28, 2024
2474f63
Bump undici from 5.28.3 to 5.28.4 (#748)
dependabot[bot] Apr 9, 2024
90d7caa
Update Compatibility Signature Verification Functions (#750)
nlordell Apr 18, 2024
ea2f7ca
Fix Safe NatSpec Documentation (#751)
nlordell Apr 18, 2024
8340a4e
Remove Leftover Testing Code In Harness Patch (#756)
nlordell Apr 24, 2024
5feb0d0
Update dependencies to the latest versions (#757)
mmv08 Apr 30, 2024
f830466
Create a separate interface for module guard (#758)
akshay-ap May 24, 2024
a9e3385
Upgrade Certora CLI and Prover to v7.6.3 on the CI (#761)
mmv08 May 28, 2024
499b17a
chore: fix typos (#763)
xiaoxianBoy Jun 11, 2024
46f7c60
Fix compilation issue with solidity versions >= 0.8.12 (#772)
akshay-ap Jun 26, 2024
13c0494
Create a pre call hook onBeforeExecTransaction (#776)
akshay-ap Jun 28, 2024
8f80a83
Add Safe to L2 Setup Contract (#759)
nlordell Jul 3, 2024
b6692f9
Generic migration contract (#793)
akshay-ap Jul 19, 2024
cfa4e33
Update factory data and latest version in README.md (#797)
mmv08 Jul 23, 2024
2556b94
`getSafeWithOwners` using types (#796)
remedcu Jul 23, 2024
eccba0d
Workflow Updated (#803)
remedcu Jul 29, 2024
9b2ff71
add some comment to `SENTINEL_OWNERS` (#804)
zhiqiangxu Aug 1, 2024
9ec11a1
Unifying function to get Safe implementation (#808)
remedcu Aug 8, 2024
af53bdf
Update Package Dependencies (#810)
nlordell Aug 19, 2024
a7928e8
Remove unused launch configuration for Truffle tests (#819)
mmv08 Aug 29, 2024
c266ffc
Lint: add a rule for order import sorting (#818)
mmv08 Aug 29, 2024
5c1e50e
Feature: add zksync support to v1.5.0 (#742)
mmv08 Sep 5, 2024
2787247
Update CHANGELOG.md (#816)
akshay-ap Sep 6, 2024
f9a4d2e
Remove reference to inexisting 'deploy' variable in SafeToL2Setup dep…
mmv08 Sep 6, 2024
786dadc
Audit Changes for `v1.4.1-2` cherry picked from `release/v1.4.1-2` (#…
remedcu Sep 9, 2024
9229531
`v1.4.1` Audit Report and Deployment Address (#828)
remedcu Sep 12, 2024
fddfd14
Migration Contract FV (#832)
remedcu Sep 16, 2024
7ccf6e0
Docs: Update README (#831)
Olexandr88 Sep 18, 2024
70673bb
Update `SafeMigration` tests for zkSync (#833)
mmv08 Sep 19, 2024
1cec0e7
Add zkSync support to `SafeToL2Migration` tests (#834)
mmv08 Sep 20, 2024
73b1778
fix: remove deprecated `husky install` command (#835)
toolabi Sep 26, 2024
0796a37
Tests job updated in Workflow (#836)
remedcu Sep 27, 2024
3e2ee89
Remove unused mock contracts from SafeToL2Migration tests (#837)
mmv08 Sep 27, 2024
0142ec8
Error propagation for internal TX (#839)
remedcu Sep 30, 2024
95c0ce1
fix: remove invalid documentation on execTransactionFromModule (#843)
devanoneth Oct 9, 2024
a0a1d42
Better variable naming of the SafeTx struct hash in EIP-712 hashing (…
mmv08 Oct 18, 2024
6fde75d
Bump secp256k1 from 4.0.3 to 4.0.4 (#848)
dependabot[bot] Oct 22, 2024
b0514b8
Emit Event for `initializer` and `saltNonce` data (#849)
remedcu Oct 28, 2024
b55fd8f
optimize `getTransactionHash` by implementing it in assembly (#847)
mmv08 Oct 28, 2024
76ea23d
Extensible Fallback Handler (#851)
remedcu Oct 29, 2024
3bd2d4b
Updating `CHANGELOG` for `v1.5.0` (#854)
remedcu Oct 31, 2024
0029c71
Update `CHANGELOG` to Note Removal of `encodeTransactionData` (#855)
pcaversaccio Nov 4, 2024
b98f81a
Typos Rectified (#856)
remedcu Nov 5, 2024
129f02c
New addresses and small typo rectified (#857)
remedcu Nov 6, 2024
7f79aaf
Assembly Memory Safety (#859)
nlordell Nov 14, 2024
937af5f
Update Documented Latest Release (#861)
nlordell Dec 5, 2024
691aa4f
Disable zkSync Tests (#862)
nlordell Dec 5, 2024
febab5e
enable zksync tests again (#863)
mmv08 Dec 5, 2024
e9a75ac
Fix Migration Test Definitions (#865)
nlordell Dec 11, 2024
e9a58ce
Disable Pre-approved IsValidSignature (#866)
nlordell Dec 13, 2024
834e798
Fix Shift Amount in Proxy (#868)
nlordell Dec 14, 2024
489b2bc
Fix minor typos in documentation (#870)
yusufky63 Dec 15, 2024
4309776
Add a warning comment about potential dirty bits in `getTransactionHa…
mmv08 Dec 18, 2024
dcf20a6
Fix typos (#876)
chloefeal Jan 2, 2025
4121b41
fix: typos in documentation files (#874)
vtjl10 Jan 2, 2025
3e8aa81
fix: typos in comments (#878)
oliveredget Jan 2, 2025
721acb1
Fix typos (#880)
calciumbe Jan 2, 2025
77bab0d
fix: typos (#884)
dxsullivan Jan 5, 2025
2fd69b0
[Certora Audit] G-02. `OwnerManager.changeThreshold()` event update (…
remedcu Jan 9, 2025
ff36adb
Update comments in SignatureVerifierMuxer to reflect correct byte ran…
mmv08 Jan 9, 2025
c6cd4b9
docs: enhance fallback handler documentation in `Safe.sol` and `IFall…
mmv08 Jan 9, 2025
c92ddef
Enhance documentation in TokenCallbackHandler with ERC-1820 registrat…
mmv08 Jan 9, 2025
a192574
[Certora Audit] I-02. Some comments say `keccak` instead of `keccak25…
remedcu Jan 9, 2025
183a588
[Certora Audit] G-01. `OwnerManager.removeOwner()`: 1 SLOAD can be sa…
remedcu Jan 9, 2025
95f8cb9
[Certora Audit] G-03. `ERC165Handler.setSupportedInterface()`: Logic …
remedcu Jan 9, 2025
25365fc
[Certora Audit] G-04. `ExtensibleBase._setSafeMethod()`: storage acce…
remedcu Jan 9, 2025
0e061e2
[Certora Audit] G-05. Use `iszero` instead of `eq(*, 0)` (#892)
remedcu Jan 9, 2025
e35793d
[Certora Audit] G-06. `ExtensibleFallbackHandler._supportsInterface()…
remedcu Jan 9, 2025
b2c6087
[Certora Audit] G-09. Cache array length outside of loop (#896)
remedcu Jan 9, 2025
8aa4551
[Certora Audit] I-03. Inconsistency in formula for `performCreate` an…
remedcu Jan 9, 2025
19e1d63
Enhance Safe.sol with ECDSA malleability warning (#877)
mmv08 Jan 9, 2025
8137b68
[Certora Audit] G-10. ++i costs less gas compared to i++ or i+=1 (#897)
remedcu Jan 10, 2025
5c8c6c0
[Certora Audit] G07. Use a mask instead of shifting left and right (#…
remedcu Jan 10, 2025
7e760ef
[Certora Audit] G-08. Use shift right/left instead of division/multip…
remedcu Jan 10, 2025
70268e7
An attempt to fix flaky zksync test (#898)
mmv08 Jan 14, 2025
0372c8a
Fix broken link (#900)
piguagua Jan 15, 2025
8677f32
Formal Verification for Safe v1.5 Audit (#901)
derek-certora Jan 16, 2025
2a599c4
chore: fix typo in certora/specs/OwnerReach.spec (#902)
ericlehong Jan 16, 2025
8ebd505
Certora Workfile Updated (#904)
remedcu Jan 21, 2025
e9b7de9
Bump undici (#906)
dependabot[bot] Jan 22, 2025
1d12d35
chore: fix param typo (#907)
fanqiaojun Jan 22, 2025
1c8b24a
Adding Code Owners (#905)
remedcu Jan 23, 2025
88d77ad
New Safe `v1.5.0` addresses (#911)
remedcu Feb 14, 2025
a1e7f4a
`v1.5.0` Audit (#912)
remedcu Feb 18, 2025
34359e8
chore: fix param typo (#915)
comfsrt Feb 24, 2025
cf95a4b
fix links CHANGELOG.md (#917)
futreall Feb 26, 2025
2dd0763
correction comment (#916)
XxAlex74xX Feb 26, 2025
f9cc387
fix error Guards.spec (#921)
futreall Feb 28, 2025
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
add updates to checkSignatures
teryanarmen committed Aug 25, 2023
commit 414c04458cf3463b9cbd2ed1b6600c31521bca6c
13 changes: 12 additions & 1 deletion certora/harnesses/SafeHarness.sol
Original file line number Diff line number Diff line change
@@ -15,13 +15,24 @@ contract SafeHarness is Safe {
this.setup(_owners, _threshold, to, data, fallbackHandler, paymentToken, payment, paymentReceiver);
}

// harnessed functions


// harnessed functions
function signatureSplitPublic(bytes memory signatures, uint256 pos) public pure returns (uint8 v, bytes32 r, bytes32 s) {
require(signatures.length >= 65 * (pos + 1));
return signatureSplit(signatures, pos);
}

function getCurrentOwner(bytes32 dataHash, uint8 v, bytes32 r, bytes32 s) public pure returns (address currentOwner) {
if (v == 0 || v == 1) {
currentOwner = address(uint160(uint256(r)));
} else if (v > 30) {
currentOwner = ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", dataHash)), v - 4, r, s);
} else {
currentOwner = ecrecover(dataHash, v, r, s);
}
}

// harnessed getters
function getModule(address module) public view returns (address) {
return modules[module];
68 changes: 37 additions & 31 deletions certora/specs/Safe.spec
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ methods {
function getNativeTokenBalance() external returns (uint256) envfree;
function getOwnersCount() external returns (uint256) envfree;
function getOwnersCountFromArray() external returns (uint256) envfree;
function getCurrentOwner(bytes32, uint8, bytes32, bytes32) external returns (address) envfree;

// optional
function execTransactionFromModuleReturnData(address,uint256,bytes,Enum.Operation) external returns (bool, bytes memory);
@@ -217,41 +218,46 @@ rule nativeTokenBalanceSpending(method f) filtered {
rule checkSignatures() {
bytes32 dataHash;
bytes data;
address executor1; address executor2; address executor3;
address executorA; address executorB; address executor3;
env e;
bytes signatures12;
bytes signatures1;
bytes signatures2;
uint8 v1; bytes32 r1; bytes32 s1;
uint8 v2; bytes32 r2; bytes32 s2;
uint8 v121; bytes32 r121; bytes32 s121;
uint8 v122; bytes32 r122; bytes32 s122;
v1, r1, s1 = signatureSplitPublic(signatures1, 0);
v2, r2, s2 = signatureSplitPublic(signatures2, 0);
v121, r121, s121 = signatureSplitPublic(signatures12, 0);
v122, r122, s122 = signatureSplitPublic(signatures12, 1);
require to_mathint(signatures12.length) == signatures1.length + signatures2.length;

require v1 == v121 && r1 == r121 && s1 == s121;
require v2 == v122 && r2 == r122 && s2 == s122;
require v1 != 1 && v2 != 1;
bytes signaturesAB;
bytes signaturesA;
bytes signaturesB;
uint8 vA; bytes32 rA; bytes32 sA;
uint8 vB; bytes32 rB; bytes32 sB;
uint8 vAB1; bytes32 rAB1; bytes32 sAB1;
uint8 vAB2; bytes32 rAB2; bytes32 sAB2;
vA, rA, sA = signatureSplitPublic(signaturesA, 0);
vB, rB, sB = signatureSplitPublic(signaturesB, 0);
vAB1, rAB1, sAB1 = signatureSplitPublic(signaturesAB, 0);
vAB2, rAB2, sAB2 = signatureSplitPublic(signaturesAB, 1);
require to_mathint(signaturesAB.length) == signaturesA.length + signaturesB.length;

require vA == vAB1 && rA == rAB1 && sA == sAB1;
require vB == vAB2 && rB == rAB2 && sB == sAB2;
require vA != 1 && vB != 1;
require data.length < 1000;
require signatures1.length < 1000;
require signatures2.length < 1000;
require signatures12.length < 1000;
require signatures1.length >= 65;
require signatures2.length >= 65;
require signatures12.length >= 130;

checkNSignatures@withrevert(e, executor1, dataHash, data, signatures1, 1);
bool success1 = !lastReverted;
checkNSignatures@withrevert(e, executor2, dataHash, data, signatures2, 1);
bool success2 = !lastReverted;
require signaturesA.length < 1000;
require signaturesB.length < 1000;
require signaturesAB.length < 1000;
require signaturesA.length >= 65;
require signaturesB.length >= 65;
require signaturesAB.length >= 130;
requireInvariant safeOwnerCannotBeItself(e);
requireInvariant threholdShouldBeLessThanOwners();
require getCurrentOwner(dataHash, vA, rA, sA) < getCurrentOwner(dataHash, vB, rB, sB);

checkNSignatures@withrevert(e, executorA, dataHash, data, signaturesA, 1);
bool successA = !lastReverted;
checkNSignatures@withrevert(e, executorB, dataHash, data, signaturesB, 1);
bool successB = !lastReverted;

checkNSignatures@withrevert(e, executor3, dataHash, data, signatures12, 2);
bool success12 = !lastReverted;
checkNSignatures@withrevert(e, executor3, dataHash, data, signaturesAB, 2);
bool successA2 = !lastReverted;
address lastOwner = lastOwnerStore(e);
address currentOwner = currentOwnerStore(e);

assert (success1 && success2) == success12, "checkSignatures called must be equivalent to checkSignatures called twice";
assert (successA && successB) == successA2, "checkSignatures called must be equivalent to checkSignatures called twice";
}

rule nativeTokenBalanceSpendingExecTransaction(