Skip to content

Commit

Permalink
Set Merkle root on Airdrop contract deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
matjazv committed Jun 7, 2024
1 parent 91b18c6 commit b39d5d0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions script/contracts/L2/L2Airdrop.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ contract L2AirdropScript is Script {
assert(l2AddressesConfig.L2VotingPower != address(0));
console2.log("L2 Voting Power address: %s", l2AddressesConfig.L2VotingPower);

// deploy L2Airdrop contract and transfer its ownership; new owner has to accept ownership to become the owner
// of the contract
// get Merkle root
Utils.MerkleRoot memory merkleRoot = utils.readMerkleRootFile("airdrop-merkle-root.json");
assert(merkleRoot.merkleRoot != bytes32(0));
console2.log("Merkle root: %s", vm.toString(merkleRoot.merkleRoot));

// deploy L2Airdrop contract, set Merkle root and transfer its ownership; new owner has to accept ownership to
// become the owner of the contract
vm.startBroadcast(deployerPrivateKey);
L2Airdrop l2Airdrop = new L2Airdrop(
l2AddressesConfig.L2LiskToken,
Expand All @@ -59,6 +64,7 @@ contract L2AirdropScript is Script {
l2AddressesConfig.L2VotingPower,
airdropWalletAddress
);
l2Airdrop.setMerkleRoot(merkleRoot.merkleRoot);
l2Airdrop.transferOwnership(newOwnerAddress);
vm.stopBroadcast();

Expand All @@ -68,7 +74,7 @@ contract L2AirdropScript is Script {
assert(l2Airdrop.l2LockingPositionAddress() == l2AddressesConfig.L2LockingPosition);
assert(l2Airdrop.l2VotingPowerAddress() == l2AddressesConfig.L2VotingPower);
assert(l2Airdrop.airdropWalletAddress() == airdropWalletAddress);
assert(l2Airdrop.merkleRoot() == bytes32(0));
assert(l2Airdrop.merkleRoot() == merkleRoot.merkleRoot);
assert(l2Airdrop.owner() == vm.addr(deployerPrivateKey));
assert(l2Airdrop.pendingOwner() == newOwnerAddress);

Expand Down

0 comments on commit b39d5d0

Please sign in to comment.