-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0ec6e8
commit 5737e35
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { NFTPresaleCommon } from "../../launchpad/NFTPresaleCommon.sol"; | ||
import { ERC1155Common, SampleERC1155 } from "../SampleERC1155.sol"; | ||
|
||
contract SampleNFT1155Presale is SampleERC1155, NFTPresaleCommon { | ||
constructor( | ||
address admin, | ||
string memory name, | ||
string memory symbol, | ||
string memory uri | ||
) SampleERC1155(admin, name, symbol, uri) { } | ||
|
||
/// @dev Mint NFTs for the launchpad. | ||
function mintPresale( | ||
address to, | ||
uint256 quantity, | ||
bytes calldata /* extraData */ | ||
) external onlyRole(MINTER_ROLE) returns (uint256[] memory tokenIds, uint256[] memory amounts) { | ||
_mint(to, 3, quantity, ""); | ||
_mint(to, 4, 1, ""); | ||
|
||
tokenIds = new uint256[](2); | ||
amounts = new uint256[](2); | ||
tokenIds[0] = 3; | ||
tokenIds[1] = 4; | ||
|
||
amounts[0] = quantity; | ||
amounts[1] = 1; | ||
} | ||
|
||
function supportsInterface( | ||
bytes4 interfaceId | ||
) public view virtual override(ERC1155Common, NFTPresaleCommon) returns (bool) { | ||
return ERC1155Common.supportsInterface(interfaceId) || NFTPresaleCommon.supportsInterface(interfaceId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import { SampleERC721 } from "../SampleERC721.sol"; | ||
|
||
import { ERC721Common } from "../../ERC721Common.sol"; | ||
import { NFTPresaleCommon } from "../../launchpad/NFTPresaleCommon.sol"; | ||
import { SampleERC721 } from "../SampleERC721.sol"; | ||
|
||
contract SampleNFT721Presale is SampleERC721, NFTPresaleCommon { | ||
constructor(string memory name_, string memory symbol_, string memory uri_) SampleERC721(name_, symbol_, uri_) { } | ||
|
||
/// @dev Mint NFTs for the presale. | ||
function mintPresale( | ||
address to, | ||
uint256 quantity, | ||
bytes calldata /* extraData */ | ||
) external onlyRole(MINTER_ROLE) returns (uint256[] memory tokenIds, uint256[] memory amounts) { | ||
tokenIds = new uint256[](quantity); | ||
amounts = new uint256[](quantity); | ||
for (uint256 i; i < quantity; ++i) { | ||
tokenIds[i] = _mintFor(to); | ||
amounts[i] = 1; | ||
} | ||
} | ||
|
||
function supportsInterface( | ||
bytes4 interfaceId | ||
) public view virtual override(ERC721Common, NFTPresaleCommon) returns (bool) { | ||
return ERC721Common.supportsInterface(interfaceId) || NFTPresaleCommon.supportsInterface(interfaceId); | ||
} | ||
} |