Skip to content

Commit

Permalink
chore: setup Foundry tests for LSP2
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Jan 17, 2024
1 parent 71dc8a5 commit 622d248
Show file tree
Hide file tree
Showing 34 changed files with 3,530 additions and 10,433 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,6 @@ gas_benchmark.md

# Turborepo
.turbo

# Custom setup
foundry_artifacts/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion config/tsconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tsconfig",
"version": "0.0.0",
"private": true,
"license": "MIT",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import {
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// modules
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP10ReceivedVaults/LSP10Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP9} from "../LSP9Vault/LSP9Constants.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP1UniversalReceiver/LSP1Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ pragma solidity ^0.8.4;
import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {ILSP1UniversalReceiver as ILSP1} from "./ILSP1UniversalReceiver.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP5ReceivedAssets/LSP5Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP6KeyManager/LSP6Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
import {ILSP6KeyManager} from "./ILSP6KeyManager.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP7} from "./LSP7Constants.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP7} from "./LSP7Constants.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP8, _LSP8_TOKENID_FORMAT_KEY} from "./LSP8Constants.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP8, _LSP8_TOKENID_FORMAT_KEY} from "./LSP8Constants.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP9Vault/LSP9VaultCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// modules
import {ERC725XCore} from "@erc725/smart-contracts/contracts/ERC725XCore.sol";
Expand Down
6 changes: 6 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ gas_reports = ["LSP6ExecuteRestrictedController", "LSP6ExecuteUnrestrictedContro
cache_path = 'forge-cache'
test = 'tests/foundry'
solc_version = "0.8.17"

[fuzz]
runs = 10_000
max_test_rejects = 200_000

[profile.lsp2]
src = 'packages/LSP2ERC725YJSONSchema/contracts'
test = 'packages/LSP2ERC725YJSONSchema/foundry'
out = 'packages/LSP2ERC725YJSONSchema/contracts/foundry_artifacts'
Loading

0 comments on commit 622d248

Please sign in to comment.