-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(taikoon): fix taikoon contract test dependency issues (#16862)
Co-authored-by: bearni95 <[email protected]>
- Loading branch information
Showing
11 changed files
with
78 additions
and
85 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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import { UUPSUpgradeable } from | ||
"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import { Ownable2StepUpgradeable } from | ||
"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; | ||
import { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; | ||
import { ContextUpgradeable } from | ||
"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; | ||
|
||
/// @title MerkleWhitelist | ||
/// @dev Merkle Tree Whitelist | ||
/// @custom:security-contact [email protected] | ||
contract MerkleWhitelist is ContextUpgradeable { | ||
contract MerkleWhitelist is ContextUpgradeable, UUPSUpgradeable, Ownable2StepUpgradeable { | ||
event RootUpdated(bytes32 _root); | ||
event MintConsumed(address _minter, uint256 _mintAmount); | ||
|
||
|
@@ -30,9 +34,8 @@ contract MerkleWhitelist is ContextUpgradeable { | |
|
||
/// @notice Contract initializer | ||
/// @param _root Merkle Tree root | ||
function initialize(bytes32 _root) external initializer { | ||
__Context_init(); | ||
root = _root; | ||
function initialize(address _owner, bytes32 _root) external initializer { | ||
__MerkleWhitelist_init(_owner, _root); | ||
} | ||
|
||
/// @notice Check if a wallet can free mint | ||
|
@@ -54,7 +57,8 @@ contract MerkleWhitelist is ContextUpgradeable { | |
|
||
/// @notice Internal initializer | ||
/// @param _root Merkle Tree root | ||
function __MerkleWhitelist_init(bytes32 _root) internal initializer { | ||
function __MerkleWhitelist_init(address _owner, bytes32 _root) internal initializer { | ||
_transferOwnership(_owner == address(0) ? msg.sender : _owner); | ||
__Context_init(); | ||
root = _root; | ||
} | ||
|
@@ -76,4 +80,7 @@ contract MerkleWhitelist is ContextUpgradeable { | |
minted[_leaf] = true; | ||
emit MintConsumed(_msgSender(), _maxMints); | ||
} | ||
|
||
/// @notice Internal method to authorize an upgrade | ||
function _authorizeUpgrade(address) internal virtual override onlyOwner { } | ||
} |
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 |
---|---|---|
|
@@ -2,24 +2,16 @@ | |
pragma solidity 0.8.24; | ||
|
||
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | ||
import { Ownable2StepUpgradeable } from | ||
"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; | ||
|
||
import { ERC721EnumerableUpgradeable } from | ||
"@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; | ||
import { UUPSUpgradeable } from | ||
"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
|
||
import { MerkleWhitelist } from "./MerkleWhitelist.sol"; | ||
|
||
/// @title TaikoonToken | ||
/// @dev The Taikoons ERC-721 token | ||
/// @custom:security-contact [email protected] | ||
contract TaikoonToken is | ||
ERC721EnumerableUpgradeable, | ||
UUPSUpgradeable, | ||
Ownable2StepUpgradeable, | ||
MerkleWhitelist | ||
{ | ||
contract TaikoonToken is ERC721EnumerableUpgradeable, MerkleWhitelist { | ||
/// @notice The current supply | ||
uint256 private _totalSupply; | ||
// Base URI required to interact with IPFS | ||
|
@@ -35,10 +27,16 @@ contract TaikoonToken is | |
/// @notice Contract initializer | ||
/// @param _rootURI Base URI for the token metadata | ||
/// @param _merkleRoot Merkle tree root for the whitelist | ||
function initialize(string memory _rootURI, bytes32 _merkleRoot) external initializer { | ||
function initialize( | ||
address _owner, | ||
string memory _rootURI, | ||
bytes32 _merkleRoot | ||
) | ||
external | ||
initializer | ||
{ | ||
__ERC721_init("Taikoon", "TKOON"); | ||
__Ownable_init(_msgSender()); | ||
__MerkleWhitelist_init(_merkleRoot); | ||
__MerkleWhitelist_init(_owner, _merkleRoot); | ||
_baseURIExtended = _rootURI; | ||
} | ||
|
||
|
@@ -99,9 +97,6 @@ contract TaikoonToken is | |
return _baseURIExtended; | ||
} | ||
|
||
/// @notice Internal method to authorize an upgrade | ||
function _authorizeUpgrade(address) internal virtual override onlyOwner { } | ||
|
||
/// @notice Internal method to batch mint tokens | ||
/// @param _to The address to mint to | ||
/// @param _amount The amount of tokens to mint | ||
|
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
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
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
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
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
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
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
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
Oops, something went wrong.