Skip to content

Instantly share code, notes, and snippets.

@nanexcool
Last active January 12, 2020 23:50
Show Gist options
  • Save nanexcool/a411003b0bdd087ef0898c87d6e87b28 to your computer and use it in GitHub Desktop.
Save nanexcool/a411003b0bdd087ef0898c87d6e87b28 to your computer and use it in GitHub Desktop.
// put this in the ethers-airdrop root dir and run with `node failing.js`
// 3rd account has a proof with an `undefined`
var AirDrop = require('./index.js')
let a = new AirDrop({
"0x7b14ff3a4b7f1585860d8e7b5935697ae2a1fb2a": "0x392d2e2bda9c0000",
"0xe5c646116d310bac2b21c8cf989b0f955606d011": "0x58d15e17628000",
"0xf430775da1df51693ecc1fe6c4934d9339613b4d": "0x00",
})
Object.keys(a.balances).forEach((account, index) => {
console.log(`${index} - ${account}`)
console.log(a.getMerkleProof(index))
})
/*
Output
0 - 0x7b14ff3a4b7f1585860d8e7b5935697ae2a1fb2a
[
'0xfc5d524ac19366b4597a17b90be6bdbf01349b4e6d1b2bb7f2ee77516ebba0ff',
'0x23a091012b37d625af4ac04fa31cae8e40c833e219b23e1d1df23475b9d09873'
]
1 - 0xe5c646116d310bac2b21c8cf989b0f955606d011
[
'0xd4744dc1f9d42039ff90cdbc7a65f104e33c08795d753d35fe66c4473bdfd322',
'0x23a091012b37d625af4ac04fa31cae8e40c833e219b23e1d1df23475b9d09873'
]
2 - 0xf430775da1df51693ecc1fe6c4934d9339613b4d
[
undefined,
'0xa74e9fe2d08028c4afbf84b54a053dc3ec891e2872657ff8bfb67cff7f1925ba'
]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment