forked from ProjectOpenSea/seadrop
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDeployAndConfigureExampleToken.s.sol
66 lines (53 loc) · 2 KB
/
DeployAndConfigureExampleToken.s.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "forge-std/Script.sol";
import { ERC721RaribleDrop } from "../src/ERC721RaribleDrop.sol";
import { IRaribleDrop } from "../src/interfaces/IRaribleDrop.sol";
import { PublicDrop } from "../src/lib/RaribleDropStructs.sol";
contract DeployAndConfigureExampleToken is Script {
// Addresses
address raribleDrop = 0x00005EA00Ac477B1030CE78506496e8C2dE24bf5;
address creator = 0x5b04Bd4CF6ac8F976a1d578b7156206b781ca861;
address feeRecipient = 0x5b04Bd4CF6ac8F976a1d578b7156206b781ca861;
// Token config
uint256 maxSupply = 100;
// Drop config
uint16 feeBps = 500; // 5%
uint80 mintPrice = 0.0001 ether;
uint16 maxTotalMintableByWallet = 5;
function run() external {
vm.startBroadcast();
address[] memory allowedRaribledrop = new address[](1);
allowedRaribledrop[0] = raribleDrop;
// This example uses ERC721RaribleDrop. For separate Owner and
// Administrator privileges, use ERC721PartnerRaribleDrop.
ERC721RaribleDrop token = new ERC721RaribleDrop(
"My Example Token",
"ExTKN",
allowedRaribledrop
);
// Configure the token.
token.setMaxSupply(maxSupply);
// Configure the drop parameters.
token.updateCreatorPayoutAddress(raribleDrop, creator);
token.updateAllowedFeeRecipient(raribleDrop, feeRecipient, true);
token.updatePublicDrop(
raribleDrop,
PublicDrop(
mintPrice,
uint48(block.timestamp), // start time
uint48(block.timestamp) + 1000, // end time
maxTotalMintableByWallet,
feeBps,
true
)
);
// We are ready, let's mint the first 3 tokens!
IRaribleDrop(raribleDrop).mintPublic{ value: mintPrice * 3 }(
address(token),
feeRecipient,
address(0),
3 // quantity
);
}
}