Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merkle root for Airdrop contract is set inside deployment script #161

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading