Skip to content

Instantly share code, notes, and snippets.

@naps62
Created July 3, 2023 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naps62/3063f1cc1158c2e8d3cb29f369e15da5 to your computer and use it in GitHub Desktop.
Save naps62/3063f1cc1158c2e8d3cb29f369e15da5 to your computer and use it in GitHub Desktop.
Diva Airdrop Claim
pragma solidity ^0.8.18;
import "forge-std/Script.sol";
interface DivaClaim {
function claimAndDelegate(
uint256 _index,
address _account,
uint256 _amount,
bytes32[] calldata _merkleProof,
bytes32 _acceptanceHash
) external;
}
interface DivaToken {
function transfer(address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
contract Claim is Script {
DivaClaim claim = DivaClaim(0x777E2B2Cc7980A6bAC92910B95269895EEf0d2E8);
DivaToken token = DivaToken(0xBFAbdE619ed5C4311811cF422562709710DB587d);
address addr = 0x47b4B0a64ED3873F437C5aAD8a6D3C03570Ab184;
address hot = 0x1B2f066126475d61bb7a24261Ac30EAB00d84c40;
function run() public {
// proof taken from https://github.com/divastaking/claim/blob/main/files/claims.json
bytes32[] memory proof = new bytes32[](14);
proof[0] = bytes32(0x3833dad944df4421a25b94f4f1423c94544d82a96adfa6e767b43b64818953c0);
proof[1] = bytes32(0x3e4710dbe318b9c3cd8a55acf7551111e1f1707a8698c90a3eb055986a043c33);
proof[2] = bytes32(0x77e6909d50e87c538c57c4d4bb082a3e703e608ec497172afad3bafd5b72255b);
proof[3] = bytes32(0x5368f4f946fa099f3f4efc4360524e458d664fbfc5e47b4ca18210d288630d5b);
proof[4] = bytes32(0x8a89c9dabb7321cfe513a94e082222dfcce0c78e065687ce2bf0957a0fe61e39);
proof[5] = bytes32(0x696ed4402b267e1903cf75176bfb75fe7c4b685f3d965a0982859959c482a203);
proof[6] = bytes32(0xb1d3572d0622a7d02453e1fefbc5ae40ed49bbfa61bff1146ecf25b9b9da404c);
proof[7] = bytes32(0xb545a08552b4c8ab6635f88688cec712c296a0617f39f65b43cd595928401a0d);
proof[8] = bytes32(0x1ed306aaa621a9cb942bab4e8675e74769752c5270bf02bc71a947950a8aad5b);
proof[9] = bytes32(0x377ac2ddf4779130940508e40f1e1b89b080336affb5b8921b7fa04e5e455f8b);
proof[10] = bytes32(0x2abbdbd0aaaf15b820a36b66fdbf928233a6ed832d17162aebe813f2286fb09f);
proof[11] = bytes32(0xae6a306014edf4eac60a770bbf6aced75137258f64ac24043b3647906353a1a3);
proof[12] = bytes32(0x8c6e974c639fe7cddd681bfc3c0b358e5917198bbfedd19e6f6775203a85417f);
proof[13] = bytes32(0x4ad22e9f811cc0904ce4eca469c48b6aa2163e6ad4825872b8b7f2d39862d008);
// other params taken from my hot wallet claim
// https://etherscan.io/tx/0x6c6e3a82a688c71c0a1fa75e37dc0aacc2a466c1826ee4c439b89e673e02bbb1
vm.broadcast(addr);
claim.claimAndDelegate(
4329, addr, 12000 ether, proof, 0x3ad9409f26bbaad530dc91737f4d8c348e658391b754681c65e69f4a4687c1df
);
// diva transfers still paused. can't do this right now
// token.transfer(hot, token.balanceOf(addr));
}
}
#!/bin/bash
# git clone git@github.com/foundry-rs/forge-std lib/forge-std
forge script claim.s.sol \
--rpc-url https://eth.llamarpc.com \
-vvvv \
--keystore ~/.rocketpool/data/wallet \
--password-file ~/.rocketpool/data/password \
--broadcast

Claiming the airdrop for Diva

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment