1
1
// SPDX-License-Identifier: MIT
2
2
pragma solidity ^ 0.8.4 ;
3
3
4
- import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol " ;
5
4
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol " ;
6
5
import "@openzeppelin/contracts/access/Ownable.sol " ;
7
6
8
7
error AlreadyClaimed ();
9
- error NoRestUnMint ();
8
+ error MintClosed ();
10
9
error ShouldBeMultisig ();
11
10
12
11
contract TTM is ERC1155 , Ownable {
13
12
14
- bytes32 public merkleRoot;
15
- uint8 public totalSupply = 166 ;
16
- uint8 public restUnMint;
13
+ bool public freemintSwitch;
17
14
mapping (address => bool ) public claimed;
18
15
address public multiSig;
19
16
20
- constructor (bytes32 _merkleRoot , address _multiSig )
21
- ERC1155 ("ipfs://QmetFMEgUtFmRxG3XWKRnzxpmJoJLiKvBrLn8LmojEdVh9/metadata .json " )
17
+ constructor (address _multiSig )
18
+ ERC1155 ("ipfs://QmVCnSaBd1jpkBMYRAMSj54QbC7QS6a9fx6iwAgWx7Urdt/{id} .json " )
22
19
{
23
- merkleRoot = _merkleRoot;
24
- restUnMint = totalSupply;
25
20
multiSig = _multiSig;
21
+ freemintSwitch = false ;
26
22
}
27
23
28
- function setURI ( string memory newuri ) public onlyOwner {
29
- _setURI (newuri) ;
24
+ function setMintSwitch ( bool _switch ) public onlyOwner{
25
+ freemintSwitch = _switch ;
30
26
}
31
27
32
- function setmerkleRoot ( bytes32 _merkleRoot ) public onlyOwner{
33
- merkleRoot = _merkleRoot ;
28
+ function setURI ( string memory newuri ) public onlyOwner {
29
+ _setURI (newuri) ;
34
30
}
35
31
36
- function mint (bytes32 [] calldata merkleProof )
32
+ function mint ()
37
33
public
38
34
{
39
35
if (claimed[msg .sender ] == true ) revert AlreadyClaimed ();
40
- if (restUnMint == 0 ) revert NoRestUnMint ();
41
- require (MerkleProof.verify (merkleProof, merkleRoot, keccak256 (abi.encodePacked (msg .sender ))), "invalid merkle proof " );
42
- _mint (msg .sender ,0 , 1 , "" );
36
+ if (freemintSwitch == false ) revert MintClosed ();
37
+ _mint (msg .sender ,1 , 1 , "" );
43
38
claimed[msg .sender ] = true ;
44
- restUnMint-- ;
45
39
}
46
40
47
- //We reserve 10 nfts for multisig, if someone did not mint for a long time, the multi-signature could mint all the remaining nfts
41
+ //The NFTs minted by multisig will be airdropped to our friends helped this project
48
42
function multiSigMint ()
49
43
public
50
44
{
51
45
if (msg .sender != multiSig) revert ShouldBeMultisig ();
52
- if (restUnMint == 0 ) revert NoRestUnMint ();
53
- _mint (msg .sender ,0 , restUnMint , "" );
54
- restUnMint = 0 ;
46
+ if (claimed[ msg . sender ] == true ) revert AlreadyClaimed ();
47
+ _mint (msg .sender ,0 , 126 , "" );
48
+ claimed[ msg . sender ] = true ;
55
49
}
56
50
57
- }
51
+ }
0 commit comments