Skip to content

Commit

Permalink
Merge branch 'release/v0.2.0' into feature/adapt-oz-v5
Browse files Browse the repository at this point in the history
  • Loading branch information
huyhuynh3103 committed Dec 29, 2024
2 parents d7924bd + fa02f31 commit 37b6069
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ on:
- dev
- "feature/*"
- "features/*"
- "feature/*"
- "features/*"
pull_request:
branches:
- main
- dev
- "feature/*"
- "features/*"
- "feature/*"
- "features/*"

env:
FOUNDRY_PROFILE: ci
Expand All @@ -24,6 +28,7 @@ jobs:

name: Foundry project
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
Expand Down
34 changes: 34 additions & 0 deletions test/foundry/SampleNFT1155Launchpad.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "forge-std/Test.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { SampleNFT1155Launchpad, SampleERC1155 } from "../../src/mock/launchpad/SampleNFT1155Launchpad.sol";
import { INFTLaunchpad } from "src/interfaces/launchpad/INFTLaunchpad.sol";
import { IERC1155Common, IAccessControlEnumerable, IERC1155 } from "src/interfaces/IERC1155Common.sol";

contract SampleERC1155LaunchpadTest is Test {
using Strings for uint256;

address admin = makeAddr("admin");
string public constant NAME = "SampleERC721";
string public constant SYMBOL = "NFT";
string public constant BASE_URI = "http://example.com/";

SampleNFT1155Launchpad internal _t;

function setUp() public virtual {
_t = new SampleNFT1155Launchpad(admin, NAME, SYMBOL, BASE_URI);
}

function testSupportsInterface() public {
assertEq(_token().supportsInterface(type(INFTLaunchpad).interfaceId), true);
assertEq(_token().supportsInterface(type(IERC1155Common).interfaceId), true);
assertEq(_token().supportsInterface(type(IAccessControlEnumerable).interfaceId), true);
assertEq(_token().supportsInterface(type(IERC1155).interfaceId), true);
}

function _token() internal view virtual returns (SampleNFT1155Launchpad) {
return _t;
}
}
31 changes: 31 additions & 0 deletions test/foundry/SampleNFT721Launchpad.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "forge-std/Test.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { SampleNFT721Launchpad } from "../../src/mock/launchpad/SampleNFT721Launchpad.sol";
import { INFTLaunchpad } from "src/interfaces/launchpad/INFTLaunchpad.sol";
import { IERC721Common } from "src/interfaces/IERC721Common.sol";

contract SampleNFT721LaunchpadTest is Test {
using Strings for uint256;

string public constant NAME = "SampleERC721";
string public constant SYMBOL = "NFT";
string public constant BASE_URI = "http://example.com/";

SampleNFT721Launchpad internal _t;

function setUp() public virtual {
_t = new SampleNFT721Launchpad(NAME, SYMBOL, BASE_URI);
}

function testSupportInterface() public {
assertEq(_token().supportsInterface(type(INFTLaunchpad).interfaceId), true);
assertEq(_token().supportsInterface(type(IERC721Common).interfaceId), true);
}

function _token() internal view virtual returns (SampleNFT721Launchpad) {
return _t;
}
}

0 comments on commit 37b6069

Please sign in to comment.