Git Product home page Git Product logo

merkle-airdrop-starter's Introduction

Merkle Airdrop Starter

Quickly bootstrap an ERC20 token airdrop to a Merkle tree of recipients.

Steps:

  1. Generate Merkle tree of recipients by following README in generator/
  2. Setup and deploy MerkleClaimERC20 contracts by following README in contracts/
  3. Setup and deploy front-end by following README in frontend/

Similar work and credits

License

GNU Affero GPL v3.0

Disclaimer

These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions or loss of transmitted information. Anish Agnihotri is not liable for any of the foregoing. Users should proceed with caution and use at their own risk.

merkle-airdrop-starter's People

Contributors

anish-agnihotri avatar brockelmore avatar cupojoseph avatar devanoneth avatar transmissions11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

merkle-airdrop-starter's Issues

contracts module unit test failed

Two test failed in contract testing, it seems address(ALICE) doesn't give correct address. But if I hardcoded it to exact address, tokenBalance always returned 0.

> contracts % forge test --root .      
[⠢] Compiling...
[⠑] Compiling 4 files with 0.8.19
[⠘] Solc 0.8.19 finished in 433.60ms
Compiler run successful!

Running 6 tests for src/test/MerkleClaimERC20.t.sol:Tests
[FAIL. Reason: NotInMerkle()] testAliceClaim() (gas: 16464)
[FAIL. Reason: NotInMerkle()] testBobClaimForAlice() (gas: 21072)
[PASS] testFailAliceClaimInvalidAmount() (gas: 12869)
[PASS] testFailAliceClaimInvalidProof() (gas: 12827)
[PASS] testFailAliceClaimTwice() (gas: 12816)
[PASS] testFailBobClaim() (gas: 12815)
Test result: FAILED. 4 passed; 2 failed; finished in 611.83µs

Failing tests:
Encountered 2 failing tests in src/test/MerkleClaimERC20.t.sol:Tests
[FAIL. Reason: NotInMerkle()] testAliceClaim() (gas: 16464)
[FAIL. Reason: NotInMerkle()] testBobClaimForAlice() (gas: 21072)

Encountered a total of 2 failing tests, 4 tests succeeded

forge compile error

i try to compile and build but error

Logs :

[⠰] Compiling 374 files with 0.8.15
[⠔] Solc 0.8.15 finished in 121.59ms
Error: 
Compiler run failed
error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/token/ERC20/extensions/ERC20Votes.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/ERC20VotesHarness.sol:1:1:
  |
1 | import "../munged/token/ERC20/extensions/ERC20Votes.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/Governor.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardControlFirstPriority.sol:4:1:
  |
4 | import "../munged/governance/Governor.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorCountingSimple.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardControlFirstPriority.sol:5:1:
  |
5 | import "../munged/governance/extensions/GovernorCountingSimple.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorVotes.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardControlFirstPriority.sol:6:1:
  |
6 | import "../munged/governance/extensions/GovernorVotes.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorVotesQuorumFraction.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardControlFirstPriority.sol:7:1:
  |
7 | import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorTimelockControl.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardControlFirstPriority.sol:8:1:
  |
8 | import "../munged/governance/extensions/GovernorTimelockControl.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorProposalThreshold.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardControlFirstPriority.sol:9:1:
  |
9 | import "../munged/governance/extensions/GovernorProposalThreshold.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/Governor.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardFirstTry.sol:4:1:
  |
4 | import "../munged/governance/Governor.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorCountingSimple.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardFirstTry.sol:5:1:
  |
5 | import "../munged/governance/extensions/GovernorCountingSimple.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorVotes.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardFirstTry.sol:6:1:
  |
6 | import "../munged/governance/extensions/GovernorVotes.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorVotesQuorumFraction.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardFirstTry.sol:7:1:
  |
7 | import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "contracts/lib/openzeppelin-contracts/certora/munged/governance/extensions/GovernorTimelockCompound.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/certora/harnesses/WizardFirstTry.sol:8:1:
  |
8 | import "../munged/governance/extensions/GovernorTimelockCompound.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "erc4626-tests/ERC4626.test.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC4626.t.sol:4:1:
  |
4 | import "erc4626-tests/ERC4626.test.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "forge-std/Test.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/openzeppelin-contracts/test/utils/math/Math.t.sol:5:1:
  |
5 | import "forge-std/Test.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "ds-test/test.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/solmate/lib/weird-erc20/src/test.t.sol:6:1:
  |
6 | import {DSTest} from "ds-test/test.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "ds-test/test.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/lib/solmate/src/test/utils/DSTestPlus.sol:4:1:
  |
4 | import {DSTest} from "ds-test/test.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



error[6275]: ParserError: Source "ds-test/test.sol" not found: File not found. Searched the following locations: "/workspace/merkle-airdrop-starter".
 --> contracts/src/test/utils/MerkleClaimERC20Test.sol:6:1:
  |
6 | import { DSTest } from "ds-test/test.sol"; // DSTest
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Upgradable smart contract

Is it possible to have an upgradable version of the smart contract so that the whitelist can be updated after the initial smart contract is deployed?

We are planning to do an airdrop event but the whitelist may be changed along the way. Want to see if this can be handled by upgrading the smart contract.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.