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

Feat/paymaster foundry tests #1

Merged
merged 45 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
55d967d
Setup nexus submodule and fix remappings for foundry test
ShivaanshK Jun 26, 2024
659b7e3
setup imports, accounts, and align versions
ShivaanshK Jun 27, 2024
967379c
Deployment test for BiconomySponsorshipPaymaster
ShivaanshK Jun 27, 2024
2e32ee2
basic state tests
ShivaanshK Jun 28, 2024
46d8c89
quick fix
ShivaanshK Jun 28, 2024
87c8c69
deposit tests
ShivaanshK Jun 28, 2024
6a85282
rename tests according to naming conventions
ShivaanshK Jun 28, 2024
0eb2f81
Check events being emitted
ShivaanshK Jun 28, 2024
502ee33
tests for withdrawing from paymaster
ShivaanshK Jun 28, 2024
d7efb30
tests for validating paymaster and postop
ShivaanshK Jul 1, 2024
03ff890
tests for receiving and withdrawing ether to/from paymaster
ShivaanshK Jul 1, 2024
404b493
commit unit tests
ShivaanshK Jul 1, 2024
4ba40d4
fuzz tests
ShivaanshK Jul 1, 2024
5868a5c
all fuzz tests
ShivaanshK Jul 1, 2024
2fd121c
get rid of nonfuzz test in fuzz file
ShivaanshK Jul 1, 2024
45c20eb
forge install: nexus
livingrockrises Jul 1, 2024
d01ace0
build dep fixes
livingrockrises Jul 2, 2024
d97036f
Merge pull request #2 from bcnmy/fix/project-build
ShivaanshK Jul 3, 2024
5da6fbe
add adam's requested changes
ShivaanshK Jul 3, 2024
b4276e4
fixed linting and changed visibility where applicable
ShivaanshK Jul 3, 2024
9e72f5c
yarn lint runs successfully
ShivaanshK Jul 3, 2024
c62faf2
Merge pull request #5 from bcnmy/feat/fix-linting
livingrockrises Jul 3, 2024
199d312
setPostOpCost tests
ShivaanshK Jul 4, 2024
58ebf22
merge
ShivaanshK Jul 4, 2024
de84d99
tests for withdrawErc20
ShivaanshK Jul 4, 2024
38f9891
fix forge build
livingrockrises Jul 4, 2024
3ac0568
add adam's requested changes
ShivaanshK Jul 3, 2024
de22654
setPostOpCost tests
ShivaanshK Jul 4, 2024
3972d14
fixed linting and changed visibility where applicable
ShivaanshK Jul 3, 2024
f4f341c
yarn lint runs successfully
ShivaanshK Jul 3, 2024
8326d90
tests for withdrawErc20
ShivaanshK Jul 4, 2024
1ee053e
fix forge build
livingrockrises Jul 4, 2024
e1ba22e
switched to custom errors and fixed postop gas calc
ShivaanshK Jul 4, 2024
10b3892
fixed a few things with gas calc and wrote tests
ShivaanshK Jul 6, 2024
2817e44
more tests for accounting for premiums
ShivaanshK Jul 7, 2024
1d96053
some cleanup
ShivaanshK Jul 7, 2024
40aed7e
make tests more modular
ShivaanshK Jul 8, 2024
81abba5
postop cost added back and more tests added
ShivaanshK Jul 9, 2024
4ba9a4b
Merge branch 'feat/paymaster-foundry-tests' of https://github.com/bcn…
livingrockrises Jul 9, 2024
abff5d2
fix postOpCost
livingrockrises Jul 9, 2024
f5acd1a
parse paymaster data test
ShivaanshK Jul 10, 2024
ebf05c1
comprehensive accounting tests
ShivaanshK Jul 10, 2024
36d854b
fix-lint
ShivaanshK Jul 10, 2024
d59cfd5
make UNACCOUNTED_GAS_LIMIT a constant
ShivaanshK Jul 10, 2024
358aeb1
added check for bundler balance change equal to paymaster EP balance …
ShivaanshK Jul 11, 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
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "lib/nexus"]
path = lib/nexus
url = https://github.com/bcnmy/nexus
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.24"],
"compiler-version": ["error", "^0.8.26"],
"func-visibility": ["warn", { "ignoreConstructors": true }],
"reentrancy": "error",
"state-visibility": "error",
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/BasePaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

/* solhint-disable reason-string */

Expand Down
2 changes: 1 addition & 1 deletion contracts/common/Errors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

contract BiconomySponsorshipPaymasterErrors {

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IBiconomySponsorshipPaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

interface IBiconomySponsorshipPaymaster {
event PostopCostChanged(uint256 indexed _oldValue, uint256 indexed _newValue);
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/Imports.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

/* solhint-disable reason-string */

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/MockValidator.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

import "@biconomy-devx/erc7579-msa/test/foundry/mocks/MockValidator.sol";
2 changes: 1 addition & 1 deletion contracts/references/SampleVerifyingPaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

/* solhint-disable reason-string */
/* solhint-disable no-inline-assembly */
Expand Down
2 changes: 1 addition & 1 deletion contracts/sponsorship/SponsorshipPaymasterWithPremium.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

/* solhint-disable reason-string */

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/Foo.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.24;
pragma solidity >=0.8.26;

/**
* @title Foo
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/Lock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

/**
* @title Lock
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/SoladyOwnable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
pragma solidity ^0.8.26;

import {Ownable} from "solady/src/auth/Ownable.sol";

Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
optimizer_runs = 1_000_000
out = "out"
script = "scripts"
solc = "0.8.24"
solc = "0.8.26"
src = "contracts"
test = "test"
cache_path = "cache_forge"
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "@bonadocs/docgen";

const config: HardhatUserConfig = {
solidity: {
version: "0.8.24",
version: "0.8.26",
settings: {
optimizer: {
enabled: true,
Expand Down
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at 8948d4
1 change: 1 addition & 0 deletions lib/nexus
Submodule nexus added at ab9616
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"chai": "^4.3.7",
"codecov": "^3.8.3",
"ethers": "^6.11.1",
"forge-std": "github:foundry-rs/forge-std#v1.7.6",
"hardhat-deploy": "^0.11.45",
"hardhat-deploy-ethers": "^0.4.1",
"hardhat-gas-reporter": "^1.0.10",
Expand Down
5 changes: 3 additions & 2 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@prb/test/=node_modules/@prb/test/
forge-std/=node_modules/forge-std/
nexus/=lib/nexus/
forge-std/=lib/forge-std/
account-abstraction=node_modules/account-abstraction/
modulekit/=node_modules/modulekit/src/
sentinellist/=node_modules/sentinellist/
solady/=node_modules/solady
solady/=node_modules/solady
49 changes: 0 additions & 49 deletions test/foundry/Lock.t.sol

This file was deleted.

Loading
Loading