const stakers = require("../data/stakers.json"); const fs = require("fs"); BigInt.prototype.toJSON = function () { return this.toString(); }; const airdropAmount = 1000000n * 10n ** 18n; const stakeAmount = stakers.reduce((acc, staker) => acc + BigInt(staker.balance), 0n); const ratioConstant = 10n ** 18n; const airdropCoefficient = (airdropAmount * ratioConstant) / stakeAmount; const airdropRecipients = stakers.map((staker) => ({ addr: staker.address, initialLockedBalance: staker.balance, deposit: (BigInt(staker.balance) * airdropCoefficient) / ratioConstant, })); fs.writeFileSync("data/airdropRecipients.json", JSON.stringify(airdropRecipients, null, 4), { encoding: "utf-8" });