Skip to content

Commit

Permalink
Very Basic Integration Test (storyprotocol#11)
Browse files Browse the repository at this point in the history
* feat: test integration & mod commits

* fix: remove deleted file

* fix: integration workflow

* feat: unit test coverages

* fix: nit file

* tmp: royalty & distributor
  • Loading branch information
jdubpark authored Jan 21, 2024
1 parent 4e6c5c7 commit 3a25b85
Show file tree
Hide file tree
Showing 34 changed files with 1,512 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
# - name: Code Coverage
# run:
# forge coverage --report lcov --report summary
# id: forge-code-coverage
# id: forge-code-coverage
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ node_modules/

.vscode
.DS_Store
pnpm-lock.yaml

coverage
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-include .env

.PHONY: all test clean
.PHONY: all test clean coverage

all: clean install build

# Clean the repo
forge-clean :; forge clean
clean :; npx hardhat clean
clean :; npx hardhat clean

# Remove modules
forge-remove :; rm -rf .gitmodules && rm -rf .git/modules/* && rm -rf lib && touch .gitmodules && git add . && git commit -m "modules"
Expand All @@ -27,6 +27,12 @@ slither :; slither ./contracts

format :; npx prettier --write contracts/**/*.sol && npx prettier --write contracts/*.sol

coverage:
mkdir -p coverage
forge coverage --report lcov --fork-url https://rpc.ankr.com/eth --fork-block-number 19042069
lcov --remove lcov.info -o lcov.info 'test/*'
genhtml lcov.info --output-dir coverage

# solhint should be installed globally
lint :; npx solhint contracts/**/*.sol && npx solhint contracts/*.sol

Expand Down
2 changes: 1 addition & 1 deletion contracts/IPAccountImpl.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IAccessController.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IAccessController {
/// @notice Sets the permission for a specific function call
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IIPAccount.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import { IERC1155Receiver } from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
Expand Down
3 changes: 3 additions & 0 deletions contracts/interfaces/licensing/IParamVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ pragma solidity ^0.8.20;

interface IParamVerifier {
function verifyMintingParam(address caller, uint256 mintAmount, bytes memory data) external returns (bool);

function verifyLinkParentParam(address caller, bytes memory data) external returns (bool);

function verifyActivationParam(address caller, bytes memory data) external returns (bool);

function json() external view returns (string memory);
}
2 changes: 1 addition & 1 deletion contracts/interfaces/modules/base/IModule.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IModule {
function name() external returns (string memory);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/registries/IIPAccountRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

/// @title Interface for IP Account Registry
/// @notice This interface manages the registration and tracking of IP Accounts
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/registries/IModuleRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

/// @title IModuleRegistry
/// @dev This interface defines the methods for a module registry in the Story Protocol.
Expand Down
2 changes: 1 addition & 1 deletion contracts/registries/IPAccountRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
// See https://github.com/storyprotocol/protocol-contracts/blob/main/StoryProtocol-AlphaTestingAgreement-17942166.3.pdf
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import { IIPAccountRegistry } from "contracts/interfaces/registries/IIPAccountRegistry.sol";
import { IERC6551Registry } from "lib/reference/src/interfaces/IERC6551Registry.sol";
Expand Down
6 changes: 6 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ gas_reports = ["*"]
optimizer = true
optimizer_runs = 20000
test = 'test'
solc = '0.8.23'

[rpc_endpoints]
# Comment out for local development (testing requires 0xSplit forks — will add Mock soon)
# pin fork by using --fork-block-number 19042069 to reduce wait time
mainnet = "https://rpc.ankr.com/eth"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
Loading

0 comments on commit 3a25b85

Please sign in to comment.