-
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.
- Loading branch information
Showing
6 changed files
with
106 additions
and
4 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,5 +1,4 @@ | ||
{ | ||
"ERC20Airdrop": "0x290265ACd21816EE414E64eEC77dd490d8dd9f51", | ||
"MerkleRoot": "0xc7f7e6bb3d1bb31b0ef5e2e34383c12ec9ef8a301ffde9771bd9de7554c70b1d", | ||
"ERC20Token": "0xa9d23408b9ba935c230493c40c73824df71a0975" | ||
"ERC20Airdrop": "0x22356f350a13AE71e975003C206452B0e40F0790", | ||
"MerkleRoot": "0xbe8ec647626f95185f551887b3eee43ea9e8965c7baf558a9f8cb22b020597f0" | ||
} |
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,4 @@ | ||
{ | ||
"ERC20Airdrop": "0xd32365f71Ea0CEb3Bb51Ec095D669eB64a9640F3", | ||
"MerkleRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
} |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import { UtilsScript } from "./Utils.s.sol"; | ||
import { Script, console } from "forge-std/src/Script.sol"; | ||
import { Merkle } from "murky/Merkle.sol"; | ||
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import { TrailblazersBadges } from "../../contracts/trailblazers-badges/TrailblazersBadges.sol"; | ||
import { IMinimalBlacklist } from "@taiko/blacklist/IMinimalBlacklist.sol"; | ||
import { ERC20Airdrop } from "../../contracts/trailblazers-airdrop/ERC20Airdrop.sol"; | ||
import { ERC20Mock } from "../../test/util/MockTokens.sol"; | ||
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; | ||
import { MockBlacklist } from "../../test/util/Blacklist.sol"; | ||
|
||
contract DeployScript is Script { | ||
UtilsScript public utils; | ||
string public jsonLocation; | ||
uint256 public deployerPrivateKey; | ||
address public deployerAddress; | ||
|
||
// only used for production | ||
IMinimalBlacklist blacklist = IMinimalBlacklist(0xfA5EA6f9A13532cd64e805996a941F101CCaAc9a); | ||
|
||
ERC20Airdrop public airdrop; | ||
uint256 constant TOTAL_AVAILABLE_FUNDS = 1000 ether; | ||
|
||
// rewards token | ||
ERC20Upgradeable public erc20 = ERC20Upgradeable(0xA9d23408b9bA935c230493c40C73824Df71A0975); | ||
ERC20Mock public mockERC20; | ||
// start and end times for the claim | ||
uint64 constant CLAIM_DURATION = 30 days; | ||
// Blind deployment | ||
bytes32 public merkleRoot = 0x0; | ||
uint64 public CLAIM_START = 253370764861; // year 9999 | ||
uint64 public CLAIM_END = CLAIM_START + 1; | ||
|
||
function setUp() public { | ||
utils = new UtilsScript(); | ||
utils.setUp(); | ||
|
||
jsonLocation = utils.getS2ContractJsonLocation(); | ||
deployerPrivateKey = utils.getPrivateKey(); | ||
deployerAddress = utils.getAddress(); | ||
|
||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
if (block.chainid != 167_000) { | ||
// not mainnet, create mock contracts | ||
blacklist = new MockBlacklist(); | ||
mockERC20 = new ERC20Mock(); | ||
// mint the necessary funds | ||
erc20 = ERC20Upgradeable(address(mockERC20)); | ||
} | ||
|
||
vm.stopBroadcast(); | ||
} | ||
|
||
function run() public { | ||
string memory jsonRoot = "root"; | ||
|
||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
// deploy token with empty root | ||
address impl = address(new ERC20Airdrop()); | ||
address proxy = address( | ||
new ERC1967Proxy( | ||
impl, | ||
abi.encodeCall( | ||
ERC20Airdrop.init, | ||
(deployerAddress, CLAIM_START, CLAIM_END, merkleRoot, erc20, address(blacklist)) | ||
) | ||
) | ||
); | ||
|
||
airdrop = ERC20Airdrop(proxy); | ||
|
||
// mint the necessary funds on hekla | ||
if (block.chainid != 167_000) { | ||
mockERC20.mint(address(airdrop), TOTAL_AVAILABLE_FUNDS); | ||
} | ||
console.log("ERC20 Token:", address(erc20)); | ||
|
||
console.log("Deployed ERC20Airdrop to:", address(airdrop)); | ||
|
||
vm.serializeBytes32(jsonRoot, "MerkleRoot", merkleRoot); | ||
string memory finalJson = vm.serializeAddress(jsonRoot, "ERC20Airdrop", address(airdrop)); | ||
vm.writeJson(finalJson, jsonLocation); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
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