From 61781424f83d70b1ff516ab26e118188986ddd29 Mon Sep 17 00:00:00 2001 From: bearni95 Date: Fri, 11 Oct 2024 01:06:43 +0200 Subject: [PATCH 1/4] tbz updated blacklist --- .../deployments/blacklist/hekla.json | 3 + .../deployments/blacklist/mainnet.json | 3 + packages/supplementary-contracts/package.json | 4 +- .../script/blacklist/Deploy.data.json | 155 +++++++++++++++++- .../script/blacklist/Deploy.sol | 72 ++++++-- 5 files changed, 222 insertions(+), 15 deletions(-) create mode 100644 packages/supplementary-contracts/deployments/blacklist/hekla.json create mode 100644 packages/supplementary-contracts/deployments/blacklist/mainnet.json diff --git a/packages/supplementary-contracts/deployments/blacklist/hekla.json b/packages/supplementary-contracts/deployments/blacklist/hekla.json new file mode 100644 index 00000000000..84a53c5c7c2 --- /dev/null +++ b/packages/supplementary-contracts/deployments/blacklist/hekla.json @@ -0,0 +1,3 @@ +{ + "Blacklist": "0xD10a2c799F61A89B8f6D8C695c48A4F38684ab30" +} diff --git a/packages/supplementary-contracts/deployments/blacklist/mainnet.json b/packages/supplementary-contracts/deployments/blacklist/mainnet.json new file mode 100644 index 00000000000..bcadc7ecfea --- /dev/null +++ b/packages/supplementary-contracts/deployments/blacklist/mainnet.json @@ -0,0 +1,3 @@ +{ + "Blacklist": "0x5e3052424E51a62c4FDFf4F1dD42300F59c9C57A" +} diff --git a/packages/supplementary-contracts/package.json b/packages/supplementary-contracts/package.json index db4335fa5e0..ba6c6f93d6e 100644 --- a/packages/supplementary-contracts/package.json +++ b/packages/supplementary-contracts/package.json @@ -9,7 +9,9 @@ "layout": "./deployments/gen-layouts.sh", "fmt:sol": "forge fmt", "lint:sol": "forge fmt && pnpm solhint 'contracts/**/*.sol'", - "test": "forge test -vvv --match-path test/*.t.sol" + "test": "forge test -vvv --match-path test/*.t.sol", + "deploy:blacklist:hekla": "forge script script/blacklist/Deploy.sol --rpc-url https://rpc.hekla.taiko.xyz --broadcast --gas-estimate-multiplier 200", + "deploy:blacklist:mainnet": "forge script script/blacklist/Deploy.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --gas-estimate-multiplier 100" }, "devDependencies": { "@types/node": "^20.11.30", diff --git a/packages/supplementary-contracts/script/blacklist/Deploy.data.json b/packages/supplementary-contracts/script/blacklist/Deploy.data.json index 415c666f0a7..f0f0137813c 100644 --- a/packages/supplementary-contracts/script/blacklist/Deploy.data.json +++ b/packages/supplementary-contracts/script/blacklist/Deploy.data.json @@ -1,6 +1,6 @@ { - "admin": "0xf8ff2AF0DC1D5BA4811f22aCb02936A1529fd2Be", - "updater": "0xf8ff2AF0DC1D5BA4811f22aCb02936A1529fd2Be", + "admin": "0x7d70236E2517f5B95247AF1d806A9E3C328a7860", + "updater": "0x7d70236E2517f5B95247AF1d806A9E3C328a7860", "blacklist": [ "0x098B716B8Aaf21512996dC57EB0615e2383E2f96", "0xa0e1c89Ef1a489c9C7dE96311eD5Ce5D32c20E4B", @@ -155,6 +155,155 @@ "0x175d44451403Edf28469dF03A9280c1197ADb92c", "0x21B8d56BDA776bbE68655A16895afd96F5534feD", "0xE950DC316b836e4EeFb8308bf32Bf7C72a1358FF", - "0x19F8f2B0915Daa12a3f5C9CF01dF9E24D53794F7" + "0x19F8f2B0915Daa12a3f5C9CF01dF9E24D53794F7", + "0xB9C144ee9Db3850BB5c1598f9b1B03CD68812e30", + "0x683279542eD04d7C60DC56E4EA230fe621eDD4Ca", + "0x29E866A8471DA4f89b4AFF3FD41c801d8027058b", + "0xa2C13a6913D1DF18ff4f5de2bc342023Cd683C38", + "0x5c913285DD9421EDc9d8f1000A35D9bbDF0DCb62", + "0x4ee49B318B785BC358f947BfdCec46dFA12b1Ac1", + "0x6d9999D1aC0027F1E3Dc1e3F154e3366726743b7", + "0x4342F35851fa88873496A49F55ECF79671042bF9", + "0xb226eFF9Be0F679CfB703626C911113513B63bd4", + "0x93ff385916cfcDDA8EB0858276B0074e061E98F4", + "0x29aC5D7972C8B672bF2Ae60eFbc1bEFf48F1F038", + "0xA241038Cb362BDAbd55fDa08233de6f75c764C63", + "0x3d96638B127463e136dAaD12d9bfEAeaFA5437De", + "0x60E9c48A50828c4DC4e36D28fc7EF1b25124e002", + "0xB4c9105B0bF3785C30676D13D210D698Dde84F11", + "0xa4426fA0F0e53Cd06dc41d4fEcF4Bf8783dC5a27", + "0x509BBc835912dF27Fb19837b604b92664A5B8FF1", + "0x08103076D7b1219c7135D89fC0a1c90D26FB307F", + "0x2Cfd96Fb65a990F1b5193992a47e0b6D918Df0Dc", + "0xB33e272E9B62409a53dA0171Eaf88eFef8eE4692", + "0x64FF010064656dF2FC55a3b7D99420Bc4A07c56A", + "0xcDc7306b3c9E0F2947a7B62A137eF90806901f37", + "0xAF5c672f943cd547B7938158A46D08b584c492E8", + "0xAd5e1B0Ed51b625519f81D43117b479DE7e9AbDC", + "0xF8f5811d342DdC2a6320C205856977CfE3289f29", + "0xdd8BD6CEDE3D9eD2D453216df394C5bC8b05046a", + "0x72a2B878e6A909192b0aD91AF976494Ba5143855", + "0xBa5613D19214eD93844AabD24F1102040aceae4f", + "0xaf00a8b4e83A005921D0f878d20006DE0cDA044C", + "0x1a903fe2f732F96bAa7292A05f4121766dD7e07a", + "0xB84F419FD6DC9C30cCAA6ecbF5d194Af065A33ff", + "0xb787c56Bd3c21FB6C18Ceb9a3E49637ab7cD4Dd9", + "0xE2189aa87c1Ad7654bE7Ee258f348d6484F68165", + "0xbdaD5D2d23c0d5D6B17E402a79658f787328ee08", + "0xA189b646c8983253De9eE06C815c51171F265f81", + "0x660888f021BB7da1004869C6a51059Ed97d9e7c0", + "0x1dCFB0dB0D1A774Da525F1200E2c549Bf8A9DC70", + "0x4BA67EC73A7aBF9E015eeFC1979053CE0E56B369", + "0xF46dC57a0d8B614a0e8571217316d24B840ED9BC", + "0x3099cE94b9dDB6715B1169F61Aa0e16ad818Ce89", + "0x24317cAB3C632E0B1eD0d21De1E0a009359B1296", + "0xb692c229A8622Ad1dB19b18065E69B2b6116b9ef", + "0xC478e784b91b19665470CeAaCfa39Ba17D0f6183", + "0xEF8F0d7684D4405B5c51AEF023675946D5992b29", + "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C", + "0x57B7F15C80461E83Ee56daE6a813A57f41E9b61d", + "0x05431cD62F011Cb44Ec803Fe4AC96FAC651CA494", + "0xcaFd650401708ca4f65a22340D07f78E18f8C332", + "0xbB7Cc747f5279Fde28b0878C928D92Eb6c90deBd", + "0x0f883a80a11Ba4057c265ad3a4C0c4e3869ac4c3", + "0xab2ECcf82a5b66396419da7a6e9fbF6630Bb7521", + "0xEc1C61c1c5cfEaA49141C24fB88815052D2fa6B1", + "0x7282aB49b58C7c493F49F2d5D1a723BdEd47C420", + "0x688c0a468ad7BE8Dc2e1cB92cc1b9b6fdca84d5A", + "0x5065d72003878656670f8C67498924704108C00C", + "0x8B59C939bE050814e56D69A68B7c8E485f79f9c3", + "0x38c104275141eaaE188dE0017eFf125FEb87F218", + "0xEe74356635A216A1fC89D4921495124c1533b0C8", + "0x394702830B44476C919389Cb7bA3726a1A885F3A", + "0xBA7770994a63d874127bC6eF8a0c78CCd5174E13", + "0x4edb34De5A54B42cDb88D7E535EC767AcdCa9Ce1", + "0x9c6F685403491272E6CF6258c32ccaA8E9A1ed21", + "0xdd7B2F2b821Ff20ee52A8787b3D9614b91A2b8B1", + "0xE86d78381c4cd7B4a67278e1194cA7bABc363Af9", + "0x873415F6633A0C42b8717bC898354638F52b13f3", + "0xB439b0844D0D9aF237FF37dc2379f07B6CD06171", + "0x796e3F689D8d475Dc82ce801440B184A76e68175", + "0xCe5CDb2Da5A7F30163126388Dd22a1e8084a9ad1", + "0x85204a5E932b69455822033F33E378DFF4Bb8960", + "0x588137e7c1Fce64a78e092611609B259bb524DaE", + "0x6De556d0d262BCC52fc5594abCcBc3b78524Ae17", + "0x52539Ea869f7162BC18f9c3C2dB595f2Cd69f63b", + "0xA706009f64b8eeDE2005546d18d2cbB87DDd95dF", + "0xD1799f7B0Bb7F48b0e997358eEEac349bA776c49", + "0x8fe67f559f6D6dED602E954d45897ebEE5F7FFec", + "0x464E1e588Bb3f49D039Ab8C4D5E33bB47fF8915C", + "0x9905d5753a005cd3e13D71bD030f0B6654703B81", + "0x4d7bF7e16fA37867b4Efcf7c05BD3d889ACB6ac9", + "0x026649F79905E4c5Fa26DafFbD905B3522d37e10", + "0x160EE9Bc0a0Fa051C6fEE189e9107669ed07DB0a", + "0x84a6b0C091c57313E3350B1C9d59472517f60D41", + "0x6d9807d18374F33213DE86917937544A7095e39e", + "0x9c9a2d9826b7c7e95D686e5714Fb0eF948EbC6B8", + "0x6aca843DD19AE4bfA43b6C53fC2e0c3a0bF6a002", + "0x381a0241a2A6e0217376A44C113707D5F9993e1b", + "0xC12B1050553c11993ed3A6aaB6818de7EC4DE4E2", + "0xc3F6b750Ab8b42D0455Cc90cac0E7B1F6bb6953a", + "0x07C35EF7A4AC953F5B8bBC79E6D497d114c38e6E", + "0x0395c16F061E8D2d79DFadF957fFcb97F2D765D3", + "0x6FFE37F348CCB189aC63BfB69ba6B4Aa0beDC3FB", + "0x7C22a14E676657Ebd573B7BE96AcFb21f09171dc", + "0xEC5568Bb595a311D2060506437D0f16Da8B8562D", + "0xea3D4D7f3484a683c39494D0b2A62C83cD52E8d4", + "0xDbd300Eba0F755Bb06DA769A4E1A84E4330068AF", + "0xE7eeb97861761e0AEE35F3e5dE42e1501C283495", + "0x0DC74caBcfB00ab5Fdeef60088685A71fef97003", + "0x45d993393f7B3Fe781935e1155118C7f830d4415", + "0x96BCa503a3ae8bEb794DaD2602202BB5ECD4AAE6", + "0x3Ad16031c0b29A2a6B7A3FBB5996649e39f4127b", + "0x8Cc38ceC2535DE89f2D573F6a50E74a717B45829", + "0x9fE7EDeDcd7DCF206cBe7F00bD23A6e70b398d74", + "0xa58b94936C196d5263b54232EB7D6C2B99A745b4", + "0xd8C860D789Ec1c6aE9631B680E6555F25Bc28331", + "0x6AEF558e7ebE574D692c2acd4C47232fd54e62b6", + "0xea99b1e741779a99646B7F9D57aF0F8264d94020", + "0x924eC99107E0F6fF59Ab33460ae6be9E8A6f5017", + "0x9a80ba749a649B2604d796e01D8A64Cc7B58ff78", + "0x904F40730023CC632c9dF65606dA0809D00D3B9a", + "0x9ECEc759D9F899Db97C6decDe38731f0A9DB449d", + "0xD6AFE7BA2E3c42C6A2729b861F33B54F8b2E6f2F", + "0xDE367Ba53E9EDC9381Ce00cDBba3DB01497E7974", + "0x37C4334EB5d24DCcCCfEBCC54680C433313EB040", + "0x87cCe15D359633EB901889E1B7CBa95c21053C19", + "0xE0B61B1EE0aa4Cb23d8667fda8F720F9f707c4B1", + "0x697F9Ab686b2834ACd86750B8A9Fd9f26b1f640e", + "0x6873a48E3A67E240D62E6Ec510900C0b9480cF8C", + "0x855980B2B60d8E3b60CFCf92413e3E3aF04AA101", + "0x435f6Fef6f7c1CadcD77CCB4ef1AD66C27FcFe79", + "0x735026cA2D9a0Cd24Da088eD3E1853EDe083Fc97", + "0x41ad8DD494057E87cE16dAeb20A06649E8ca2B50", + "0x87dFedBFD4FBBFDb8153fec55c82A983c299e5ad", + "0xEaA132575a13F88B715738562C7c1A545EC24300", + "0x3D3Aa68b54df9666CB6670A93aBE7A80CA01fbc3", + "0x7135603DAF6E50a76c3603582bdC2f33Fc558494", + "0x321186Ed48B0112Cc7Ed232e621d932c6EB84c61", + "0xc1B906579E383bE6Cb1B1Cc737DBA2e63CCEFa04", + "0x9471e8B1903Ef7f65f4002cFCE147b2646b6BB0f", + "0xc3fd682bdfb5ABab39Eb2c92E3411978e0b57E3f", + "0x477992B48247c889d50c9B0A87B2b2E34cbCA623", + "0x049dD5F736B851419cde65BB94DcE74d48324269", + "0xD9E6718b1C294CCe6EBC67eb6eBdbc02c343E489", + "0x830a02416Fc210C6F50A5afe65384F6c88132BE7", + "0x1b39f5ee1Fb4958F2E4049f69B53F78b75Bf1888", + "0x1742289017b61C48A5B4340666711AEd2Db72B4E", + "0x523c2937b6A1A0df143032033d6824dce499ddBF", + "0xB0a5eA798249fb30E9E1c81d475B051279962BB2", + "0xd2c7EeDBE8D68b045388A79b65915253dB582385", + "0xc1b44b014cD87d88BB04e176ba9324e086e9cd73", + "0x9D9854f6C9588bF5A56158a47090E0DFAC89d596", + "0x40eF5243c64BFa49301adF18b09A79A190CFa266", + "0xCF3c579061fB243aeFab480055B49e9038e6E488", + "0x0117Ce17Bc661d9bc331A328DC57C05d99B087D3", + "0xB2de33b99A59877d0780D4315690a600f47B5996", + "0xd50c9d01223F0EC1184A82eBEA3730Bdbc82238e", + "0x1F4a6756Da7592fc0f9a031D127d016ACc0BfcB2", + "0x63c9E4f81716dEBc57dB9Fbc60600106a44B9964", + "0xB7Cd2CEF367bf5536d7fdF6c491CE158D2651d97", + "0x1aa4a66Ef0cfA99cA9D39FdAD2B05489744C972a", + "0x3150BdCdA1b41E0F2A550955839F6b2C723aD0B7" ] } diff --git a/packages/supplementary-contracts/script/blacklist/Deploy.sol b/packages/supplementary-contracts/script/blacklist/Deploy.sol index f3ce0ced2c0..67ee1c65a2a 100644 --- a/packages/supplementary-contracts/script/blacklist/Deploy.sol +++ b/packages/supplementary-contracts/script/blacklist/Deploy.sol @@ -9,25 +9,75 @@ import "../../contracts/blacklist/Blacklist.sol"; contract DeployBlacklist is Script { using stdJson for string; - function setUp() public { } + uint256 public chainId; + + string public lowercaseNetworkKey; + string public uppercaseNetworkKey; + string public jsonLocation; + + uint256 public deployerPrivateKey; + address public deployerAddress; + + function getPrivateKey() public view returns (uint256) { + string memory lookupKey = string.concat(uppercaseNetworkKey, "_PRIVATE_KEY"); + return vm.envUint(lookupKey); + } + + function getContractJsonLocation() public view returns (string memory) { + string memory root = vm.projectRoot(); + return string.concat(root, "/deployments/blacklist/", lowercaseNetworkKey, ".json"); + } + + function setUp() public { + // load all network configs + chainId = block.chainid; + + if (chainId == 31_337) { + lowercaseNetworkKey = "localhost"; + uppercaseNetworkKey = "LOCALHOST"; + } else if (chainId == 17_000) { + lowercaseNetworkKey = "holesky"; + uppercaseNetworkKey = "HOLESKY"; + } else if (chainId == 167_001) { + lowercaseNetworkKey = "devnet"; + uppercaseNetworkKey = "DEVNET"; + } else if (chainId == 11_155_111) { + lowercaseNetworkKey = "sepolia"; + uppercaseNetworkKey = "SEPOLIA"; + } else if (chainId == 167_008) { + lowercaseNetworkKey = "katla"; + uppercaseNetworkKey = "KATLA"; + } else if (chainId == 167_000) { + lowercaseNetworkKey = "mainnet"; + uppercaseNetworkKey = "MAINNET"; + } else if (chainId == 167_009) { + lowercaseNetworkKey = "hekla"; + uppercaseNetworkKey = "HEKLA"; + } else { + revert("Unsupported chainId"); + } + + deployerPrivateKey = getPrivateKey(); + deployerAddress = vm.addr(deployerPrivateKey); + jsonLocation = getContractJsonLocation(); + } function run() external { string memory path = "/script/blacklist/Deploy.data.json"; string memory json = vm.readFile(string.concat(vm.projectRoot(), path)); - // get admin address - bytes memory rawPortion = json.parseRaw(".admin"); - address admin = abi.decode(rawPortion, (address)); - // get updater address - rawPortion = json.parseRaw(".updater"); - address updater = abi.decode(rawPortion, (address)); // get initial blacklist - rawPortion = json.parseRaw(".blacklist"); + bytes memory rawPortion = json.parseRaw(".blacklist"); address[] memory blacklist = abi.decode(rawPortion, (address[])); - vm.startBroadcast(); + vm.startBroadcast(deployerPrivateKey); + + Blacklist target = new Blacklist(deployerAddress, deployerAddress, blacklist); + console2.log("Blacklist deployed to ", address(target)); + + string memory finalJson = vm.serializeAddress("", "Blacklist", address(target)); + vm.writeJson(finalJson, jsonLocation); - Blacklist target = new Blacklist(admin, updater, blacklist); - console2.log("Deployed!\n", address(target)); + vm.stopBroadcast(); } } From 1e6be0a81b5e09a15262e1057a5952810a367977 Mon Sep 17 00:00:00 2001 From: bearni95 Date: Mon, 16 Dec 2024 10:56:50 +0100 Subject: [PATCH 2/4] production deployment --- .../trailblazers-airdrop/mainnet.json | 5 +- .../trailblazers-airdrop/s2/hekla.json | 4 + .../trailblazers-airdrop/s2/mainnet.json | 0 packages/nfts/package.json | 4 +- .../trailblazers-airdrop/DeployS2.s.sol | 91 +++++++++++++++++++ .../script/trailblazers-airdrop/Utils.s.sol | 6 ++ 6 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 packages/nfts/deployments/trailblazers-airdrop/s2/hekla.json create mode 100644 packages/nfts/deployments/trailblazers-airdrop/s2/mainnet.json create mode 100644 packages/nfts/script/trailblazers-airdrop/DeployS2.s.sol diff --git a/packages/nfts/deployments/trailblazers-airdrop/mainnet.json b/packages/nfts/deployments/trailblazers-airdrop/mainnet.json index d0f2601ab76..99c01a04916 100644 --- a/packages/nfts/deployments/trailblazers-airdrop/mainnet.json +++ b/packages/nfts/deployments/trailblazers-airdrop/mainnet.json @@ -1,5 +1,4 @@ { - "ERC20Airdrop": "0x290265ACd21816EE414E64eEC77dd490d8dd9f51", - "MerkleRoot": "0xc7f7e6bb3d1bb31b0ef5e2e34383c12ec9ef8a301ffde9771bd9de7554c70b1d", - "ERC20Token": "0xa9d23408b9ba935c230493c40c73824df71a0975" + "ERC20Airdrop": "0x22356f350a13AE71e975003C206452B0e40F0790", + "MerkleRoot": "0xbe8ec647626f95185f551887b3eee43ea9e8965c7baf558a9f8cb22b020597f0" } diff --git a/packages/nfts/deployments/trailblazers-airdrop/s2/hekla.json b/packages/nfts/deployments/trailblazers-airdrop/s2/hekla.json new file mode 100644 index 00000000000..db20ec393cb --- /dev/null +++ b/packages/nfts/deployments/trailblazers-airdrop/s2/hekla.json @@ -0,0 +1,4 @@ +{ + "ERC20Airdrop": "0xd32365f71Ea0CEb3Bb51Ec095D669eB64a9640F3", + "MerkleRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" +} diff --git a/packages/nfts/deployments/trailblazers-airdrop/s2/mainnet.json b/packages/nfts/deployments/trailblazers-airdrop/s2/mainnet.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/nfts/package.json b/packages/nfts/package.json index 41926afa56c..1a15149e7f0 100644 --- a/packages/nfts/package.json +++ b/packages/nfts/package.json @@ -41,7 +41,9 @@ "tbz:upgradeV3:hekla": "forge clean && pnpm compile && forge script script/trailblazers-badges/sol/UpgradeV3.s.sol --rpc-url https://rpc.hekla.taiko.xyz --broadcast --gas-estimate-multiplier 200", "tbz:upgradeV3:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-badges/sol/UpgradeV3.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --gas-estimate-multiplier 100", "tbz:upgradeV4:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-badges/UpgradeV4.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --gas-estimate-multiplier 100", - "tbz-s2:upgradeV2:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-season-2/UpgradeV2.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --gas-estimate-multiplier 100" + "tbz-s2:upgradeV2:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-season-2/UpgradeV2.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --gas-estimate-multiplier 100", + "tbz:airdrop-s2:hekla": "forge clean && pnpm compile && forge script script/trailblazers-airdrop/DeployS2.s.sol --rpc-url https://rpc.hekla.taiko.xyz --broadcast --gas-estimate-multiplier 200", + "tbz:airdrop-s2:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-airdrop/Deploy.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --verify --gas-estimate-multiplier 100" }, "devDependencies": { "@types/node": "^20.11.30", diff --git a/packages/nfts/script/trailblazers-airdrop/DeployS2.s.sol b/packages/nfts/script/trailblazers-airdrop/DeployS2.s.sol new file mode 100644 index 00000000000..d23df201584 --- /dev/null +++ b/packages/nfts/script/trailblazers-airdrop/DeployS2.s.sol @@ -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(); + } +} diff --git a/packages/nfts/script/trailblazers-airdrop/Utils.s.sol b/packages/nfts/script/trailblazers-airdrop/Utils.s.sol index cb9b6269d5f..58a2f424126 100644 --- a/packages/nfts/script/trailblazers-airdrop/Utils.s.sol +++ b/packages/nfts/script/trailblazers-airdrop/Utils.s.sol @@ -62,6 +62,12 @@ contract UtilsScript is Script { string.concat(root, "/deployments/trailblazers-airdrop/", lowercaseNetworkKey, ".json"); } + function getS2ContractJsonLocation() public view returns (string memory) { + string memory root = vm.projectRoot(); + return + string.concat(root, "/deployments/trailblazers-airdrop/s2/", lowercaseNetworkKey, ".json"); + } + function getBlacklist() public view returns (IMinimalBlacklist blacklistAddress) { if (block.chainid == 167_000) { // mainnet blacklist address From 09c3824e3947e6af00b1daa234ebbe74ea776342 Mon Sep 17 00:00:00 2001 From: bearni95 Date: Thu, 19 Dec 2024 11:27:31 +0100 Subject: [PATCH 3/4] mainnet deployment --- packages/nfts/deployments/trailblazers-airdrop/mainnet.json | 2 +- .../nfts/deployments/trailblazers-airdrop/s2/mainnet.json | 4 ++++ packages/nfts/package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nfts/deployments/trailblazers-airdrop/mainnet.json b/packages/nfts/deployments/trailblazers-airdrop/mainnet.json index 99c01a04916..3864972b905 100644 --- a/packages/nfts/deployments/trailblazers-airdrop/mainnet.json +++ b/packages/nfts/deployments/trailblazers-airdrop/mainnet.json @@ -1,4 +1,4 @@ { - "ERC20Airdrop": "0x22356f350a13AE71e975003C206452B0e40F0790", + "ERC20Airdrop": "0x0bdBc4E36442dAa51fe07b69EFc68750C8c391F5", "MerkleRoot": "0xbe8ec647626f95185f551887b3eee43ea9e8965c7baf558a9f8cb22b020597f0" } diff --git a/packages/nfts/deployments/trailblazers-airdrop/s2/mainnet.json b/packages/nfts/deployments/trailblazers-airdrop/s2/mainnet.json index e69de29bb2d..d4bb9ca0d99 100644 --- a/packages/nfts/deployments/trailblazers-airdrop/s2/mainnet.json +++ b/packages/nfts/deployments/trailblazers-airdrop/s2/mainnet.json @@ -0,0 +1,4 @@ +{ + "ERC20Airdrop": "0x95345D5A092623D79a56a016001f7878FA9Da3Ef", + "MerkleRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" +} diff --git a/packages/nfts/package.json b/packages/nfts/package.json index 1a15149e7f0..b6415f042b9 100644 --- a/packages/nfts/package.json +++ b/packages/nfts/package.json @@ -43,7 +43,7 @@ "tbz:upgradeV4:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-badges/UpgradeV4.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --gas-estimate-multiplier 100", "tbz-s2:upgradeV2:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-season-2/UpgradeV2.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --gas-estimate-multiplier 100", "tbz:airdrop-s2:hekla": "forge clean && pnpm compile && forge script script/trailblazers-airdrop/DeployS2.s.sol --rpc-url https://rpc.hekla.taiko.xyz --broadcast --gas-estimate-multiplier 200", - "tbz:airdrop-s2:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-airdrop/Deploy.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --verify --gas-estimate-multiplier 100" + "tbz:airdrop-s2:mainnet": "forge clean && pnpm compile && forge script script/trailblazers-airdrop/DeployS2.s.sol --rpc-url https://rpc.mainnet.taiko.xyz --broadcast --verify --gas-estimate-multiplier 100" }, "devDependencies": { "@types/node": "^20.11.30", From d7b1a335fa8693be5bee29cfa5668ee0b7413b33 Mon Sep 17 00:00:00 2001 From: bearni95 Date: Thu, 19 Dec 2024 11:28:50 +0100 Subject: [PATCH 4/4] reverted changes to s1 deployment data --- packages/nfts/deployments/trailblazers-airdrop/mainnet.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nfts/deployments/trailblazers-airdrop/mainnet.json b/packages/nfts/deployments/trailblazers-airdrop/mainnet.json index 3864972b905..d0f2601ab76 100644 --- a/packages/nfts/deployments/trailblazers-airdrop/mainnet.json +++ b/packages/nfts/deployments/trailblazers-airdrop/mainnet.json @@ -1,4 +1,5 @@ { - "ERC20Airdrop": "0x0bdBc4E36442dAa51fe07b69EFc68750C8c391F5", - "MerkleRoot": "0xbe8ec647626f95185f551887b3eee43ea9e8965c7baf558a9f8cb22b020597f0" + "ERC20Airdrop": "0x290265ACd21816EE414E64eEC77dd490d8dd9f51", + "MerkleRoot": "0xc7f7e6bb3d1bb31b0ef5e2e34383c12ec9ef8a301ffde9771bd9de7554c70b1d", + "ERC20Token": "0xa9d23408b9ba935c230493c40c73824df71a0975" }