Skip to content

Commit

Permalink
momiji-referrals (#332)
Browse files Browse the repository at this point in the history
* momiji-referrals

* Use 1e18 for amounts

* Use 1e18 for amounts

* top 25 momiji distribution

* Fix log statement in multi-send-kinto script by changing single quotes to double quotes for consistency.
  • Loading branch information
ylv-io authored Dec 23, 2024
1 parent 20d6a0d commit 98e9a96
Show file tree
Hide file tree
Showing 11 changed files with 11,459 additions and 6 deletions.
3,393 changes: 3,393 additions & 0 deletions broadcast/multi-send-kinto.s.sol/7887/run-1734970425.json

Large diffs are not rendered by default.

3,393 changes: 3,393 additions & 0 deletions broadcast/multi-send-kinto.s.sol/7887/run-1734972288.json

Large diffs are not rendered by default.

3,393 changes: 3,393 additions & 0 deletions broadcast/multi-send-kinto.s.sol/7887/run-1734972568.json

Large diffs are not rendered by default.

510 changes: 510 additions & 0 deletions broadcast/multi-send-kinto.s.sol/7887/run-1734983469.json

Large diffs are not rendered by default.

510 changes: 510 additions & 0 deletions broadcast/multi-send-kinto.s.sol/7887/run-latest.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ remappings = [

'@alto/=node_modules/alto/contracts/',

'permit2/=node_modules/permit2/'
'permit2/=node_modules/permit2/',
'@dk1a/solidity-stringutils/=node_modules/@dk1a/solidity-stringutils/'
]


Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"homepage": "https://github.com/KintoXYZ/kinto-core.git#readme",
"version": "0.1.0",
"devDependencies": {
"@dk1a/solidity-stringutils": "^0.3.3",
"@openzeppelin/merkle-tree": "^1.0.6",
"csv-parse": "^5.5.6",
"dotenv": "^16.4.5",
Expand Down
28 changes: 23 additions & 5 deletions script/actions/multi-send-kinto.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
pragma solidity ^0.8.18;

import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {StrSlice, toSlice} from "@dk1a/solidity-stringutils/src/StrSlice.sol";

using {toSlice} for string;

import "@kinto-core-test/helpers/ArrayHelpers.sol";
import {BridgedKinto} from "@kinto-core/tokens/bridged/BridgedKinto.sol";
Expand All @@ -19,28 +22,39 @@ contract MintBatchKintoScript is MigrationHelper {

address[] users;
uint256[] amounts;
uint256[] usersBalancesBefore;

function run() public override {
super.run();

BridgedKinto kintoToken = BridgedKinto(_getChainDeployment("KINTO"));

string memory userFile = vm.envString("USERS_FILE");
uint256 amount = 1e18;
uint256 totalAmount;

while (true) {
string memory addrStr = vm.readLine(userFile);
string memory addrAndAmountStr = vm.readLine(userFile);
// if empty string then end of the file
if (addrStr.equal("")) {
if (addrAndAmountStr.equal("")) {
break;
}
address addr = vm.parseAddress(addrStr);
(bool found, StrSlice addrStr, StrSlice amountStr) = addrAndAmountStr.toSlice().splitOnce(toSlice(","));
if (!found) revert("Data file is broken.");

address addr = vm.parseAddress(addrStr.toString());
console2.log("addr:", addr);
users.push(addr);

uint256 amount = vm.parseUint(amountStr.toString()) * 1e18;
// amounts are in 1e18
console2.log("amount:", amount);
amounts.push(amount);
totalAmount += amount;

usersBalancesBefore.push(kintoToken.balanceOf(addr));
}

BridgedKinto kintoToken = BridgedKinto(_getChainDeployment("KINTO"));
console2.log("totalAmount:", totalAmount);

uint256 totalSupplyBefore = kintoToken.totalSupply();
// Burn tokens from RD
Expand Down Expand Up @@ -81,5 +95,9 @@ contract MintBatchKintoScript is MigrationHelper {

// Check that tokens are minted
assertEq(totalSupplyBefore, kintoToken.totalSupply());

for (uint256 index = 0; index < usersBalancesBefore.length; index++) {
assertEq(usersBalancesBefore[index] + amounts[index], kintoToken.balanceOf(users[index]));
}
}
}
23 changes: 23 additions & 0 deletions script/data/momiji-referrals-top25.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
0x033A6DF807c204697daE4EAa9CDC0880Fc4dDF02,1171
0x85bD43dBb99A2290E4cD930fc6B952D903f83fFb,809
0xED31BeCD06fBFC54E9d4294059e473254265eAb2,358
0xc7dA9B99627163d0aFc06e5AdA323DDfaDA8FaDE,151
0x934cC16F2c7dfc0816e087d1C1A0647C9AB0694c,92
0x337B9727E78C18b8D5111f787A9ae5Fdc7E54897,73
0x998c1e902ac23696F6fBA069a688487A89Ec3843,44
0x2690e0b5830Cd4c39083fa0c43EdA583d9f4B2D1,36
0x4f2204D3c9965F031f9147B0558D01D6b56ce442,27
0x75E934ebfe57B08C9B0686f5AaAd72699c28c1C2,26
0x4e3B22B00EedeDb66C1F62eedfceAE453Cea70f3,26
0x74046392a33a6aCeD83C1b37E69FDb155e567ff9,22
0x9dB44fb2f2d4B645443fada48Cea0899CA1B6640,20
0x04321E7E28769e77B46dDAF97713A364a1893584,19
0x6234805771Cf57590158B65e7731C6DC7e88d2Ff,19
0x2a9d61E86f11FA11CAfcB084a4102E21bD87ccA6,18
0x902402569DFdBd2E7Ca3D48a6447d7ED200E6d39,16
0xAA38e3658D2544c523602aaF76e5C708fC35c183,14
0xadB7D5838d4D3bD5F42a6A5d2d60b5Be01fFb3B1,12
0xA38fA3dD33Ab59Ec465AF92dfCb0D164eA3Be735,11
0xa47d862092ea26e1Cf7a054a23f06EEa45Da2ACA,10
0x84Ef8eA33A39Da66839d7532bF11794355277634,10
0x90A549fa595fDF7d1EcC7ee3897f65DE91ceDC34,10
206 changes: 206 additions & 0 deletions script/data/momiji-referrals.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
0x497c2154Af7eeFa48943840DdFB7E3CFBb16549A,126
0xD79E57AcB2F8dBcc03644D453475f6Cf516AF1B3,49
0xED60cD4bAA6Ed709BA156Df915cbd5Cb0E507540,21
0x32f5b0ac50ba5c383FD59789745E8Fb339c633d8,19
0x9a8B86D0151556E62CFb322F901cB5bf15119ec4,17
0xD805FB2B22935656Aab6033F8f311DA9D2cAc233,17
0x0f567998648a4f6b533Fa40f6ca529Cb5fdd70Ac,14
0x50A3153A47e645Ac00cbaf35719C42568825F5F7,8
0xEacCa573DA47180C83476F2E6b72716355b4AE50,8
0x2366a4e6f32425216e9D47b76535D0D0D78C3073,8
0xB08634D28ece6d6D416FFAa705F1757512b00510,6
0x4B40f67F9b64baB859E2C7Ac88f2DdC1b6916722,6
0xD59D482c51438c5c60089D1D5973e0739232d30e,6
0x22E0CDEd21cBcB59dcB28E358315C055b673424e,5
0x15e732db9BC707c5D02b47eB1231b373Ad2edd08,5
0x3699C7Ae5578D1Fe1D3Abf82cC71645024D12b17,4
0x293C2504c91465f484A33B153897AEF055354020,4
0x7ec359cc0179289da807abDdbF0f4c0989e1D3a1,4
0x009B26482095A71dDD75e9697d7e013eC1e5e9D5,4
0x61E1E9767e5D19AC0242D42d86A6Fb815FDAcff0,4
0xaed2937B1D9655ef90e8fB2c0e1c485569d97317,4
0x3Ec6Be919b04e62132312077A3bb88f54DB2Dc2d,4
0x9e6CE7C04240322E2988a18AA2345723Ee93C7f6,3
0x65712dcE6b1f9D0eD72ba61F6dd4e0f21F662CB1,3
0x1f133C5997Db6A0C6CE7C163FD41cCc32E93e93f,3
0x5Bb5BC185ff4604953A16e655Afab70D79c194c0,3
0xDA5889d6e8c02E722E25fBE6C0cb9F487eC6AeC8,3
0x94Fd28206c7c4E4901184276398f8d8919846DBb,3
0x3C6386e7ED61c5e0AFCA304CC8a6eD0F349F7EEF,2
0xE07dAE62455571d11E88ba83C2Bc934e8cd9BD51,2
0xA4eD545994c9F6Aa5c6f4Ef8FE29dF7CF5d6eC8c,2
0xEB7Cf358D7aCe856980F365e7B007aA681526fb8,2
0x573fb6050Ad4A05796A18Ff3ca3Aa3eA6065Ba97,2
0xa0Bf2095fDb0e5B608068B5899eABdB6aC23bD74,2
0xd3eec80e3Eb6dce2e01D96c93fc2553E61c3e52F,2
0x6Ec0600B6CC4a598Ac053B6EE534470fB4C22A26,2
0x883D1058cF3050968659090676Dc6177651d38eb,2
0x028eB74268B84A513491eA26E8e804FFF5B6B909,2
0xd09Ff4A3D9eC809E31E12E06e56Be2105B425C4c,2
0x53d891b56aA1B2D90c28472AEc47f65a1a876439,2
0x8B7C1cB872576dD0472389259d147e2182F11f3e,2
0x6c17C70B70cb1DF5F9ede725F5500091f557d665,2
0x1F06d04cf57f8DeFFe6F63BBe58555C1cf0524f4,2
0x19916776258E40D000a768dF9A316AaFa8235643,2
0x074d5D3A4f39e28f57CCD1eE2c74344654156A6d,2
0xF7420ba1D44F08E2947BC1eEfD6d8a2CC7304959,2
0x15d68b28532f42632F091F2ef8e816E52A9c5624,2
0x2C898BDEb1367839525BBDFdf2aE13a914EB0bf9,2
0xDDdCaC5eA2d4619B9f39CC461D312351062508A1,1
0xFf315aC96ACf2638946d011371A7EBcf0C8850c4,1
0x7Cbe6522b42162E069Ac921Ea4a6A8e07800bb72,1
0x7b2cA4E9eFa729B474DEE7cB3bd90F1bb9ad330A,1
0x7854758F5f8c205c2BDf9A5253b56883d32ba84D,1
0x512bF8C80c7bEF18d53a33b496bbC5e700cAC1C7,1
0x123FbBE03D3201A979eC5BC150D2A0658aaBd856,1
0x83dFc05b56534a37E83BFb6bafAa57816abBf600,1
0xb922346d18f5B0600B422dEA282F951a02840DF4,1
0x77b9d298adC110b0121ECaf668ef2ac4c0b83034,1
0xB2A7E6191d6175b21D702E3E8Cc04F323E485E26,1
0x6Ad739d504606a9D785Ba58CE4A5a1DA1dD181C1,1
0xbB93C0Ee19C251e0b3eBbB2AcD2A47157Bbd3C31,1
0xb83912AecDE1e2B86423d44072923483088a42fC,1
0x333355b935B9f449f84F28B1ED07679752E30A12,1
0x00b1158044950657aed1Ef02B11a9f1177C7D0EC,1
0x44aC3ccc7f3Ca6cca156DB1c3CB6D040E116B197,1
0x33C8867d07176Ed49723e4e7A87Ce6eF8CD09197,1
0x68e71b9b607dB3C85c24A60E7bf5D0dD7e08b5b0,1
0x5f12387631294966Da2159eB7276bfF0f59D7eE9,1
0x0f4D95a031811fDfbade779B5031d230c39cB232,1
0xf0480894025Af29f86EBe3719D5b9417ea1E1676,1
0xe963f4540421Da61120aCD507eD9dE7E17CE2d80,1
0x32106b50c6CdAEb14262c70d1F672FD0acCD06f5,1
0x59a90Ab72769dF6e0cb9D56DCA318c8147900CF0,1
0x015521159cd5AFBbaCedc4fC3B6527e40bf78274,1
0xae81A4dC44497DcF61c110328648455F0062ab4d,1
0xD94a9BA9569D5045988c3c92D83291D0266993D1,1
0xbfC8AAB2E5Db67435F2De261D617E7c6bDae33Be,1
0x23f1595450E380A9fd5E6f454dA57963fe358d6B,1
0x947Bbc5D76f17460c38a440EA73B9d4CB1797983,1
0xd2B6Fe81C52E04DfD5C5AFE1B96F0a87FbE43E0c,1
0x183980615874a9a81F040F33F13597cfF495c0d0,1
0x283857762082c2aBBdc98FEA57e9cD7981ef9481,1
0xc9436CdED28D9C5f6D534dDD2803b9FA8985fD4E,1
0x013EF6201DB5E2db331432Beb1D12E1e7Cad0B0c,1
0xB1d23EA83884d497d97C3ef174Aacfc0543f3fBb,1
0x889c7B24D1f2c2CFCD6b49A1Aa6b4F6363FA7Cd8,1
0x7Eb8B8888AFdf8518347be0C084DfcbE1e194271,1
0x28DEA534FcFd158758ca13D39Ac0e924193F8fc1,1
0x9bE444863eC1004778D8beA9B24b4e4f5b6e44DE,1
0x9E83aA00741077F42710d006777c4aC8e7EcCd9c,1
0xc57f4464d7bB5E2C5cEa3F3522027885B4E7d383,1
0xA183F2484F036203a9DaA6cdE887856c59AE210A,1
0x6308920314B7bD8A3DA7eDC65D9Ae81a3B15Ca03,1
0xb8e890BD0B162465787fFe35577f1DEcb0567E28,1
0x93Dd1BA6F5D54105e5151De62dEE760Db05251Ed,1
0xcEa9dAB6dA79638F5Aee1a08b45E6Ca8eC825b67,1
0xa809C32F9F80beDC1565CCA5a8320F0082cBE755,1
0x45e6265bF7C4935E1FA37b971324Be2AAb4Bf9AE,1
0x4026499b348F4538f2daAfe1186c2Af40B9C5075,1
0x58CBe718eFe881dFdB84065A2D24D30055B7Ef39,1
0xD888D795be68AaA3747790E23894224960168E52,1
0x16F7f9b9CF64a3538C8EDF9231061DBB7ea6Eb75,1
0x3f2510B2A1F2d9AfCD64D29dDB0b47Ee12545DD3,1
0x0Ab43B4D496f21C6121F012248c92037B0a73298,1
0xCb86a199f97838855Ff6c4150E3f4c7dA4B140f3,1
0x49382A8D1D6f3cBEb59CE4e089eb7e24F0fc8F1d,1
0x273532DCeAcbD11514d9245ebc0a046c9594eA7B,1
0x65f551a2BB5a5ba9DFB125bD583e7b400F8d02Df,1
0x70c5C47C25AB8Db8a89a8d9231ABE52AB3277080,1
0x49BC6a15838C32C2759db2994623aC36C25fB3A2,1
0x0d749BeFa03E04e33A86a6FC57dC0f6Dcf9Aa5E8,1
0x4a747302CfbDe8b73ca5e6f681aF261EFCcEC2f6,1
0x9D9b4E1444ad31Ae65B31117F5d1389d03BEa543,1
0x910a020813dfb2FFE7F54fF801E532d38edD3144,1
0xDc3D558783b77D483789E5266caEdef548393D8f,1
0x31334C8A318231B5128b22B1C11eE5cB460ab1Ed,1
0x01F9bBf289D176be5e0882059De81E71beAFDbFB,1
0x351beF276aB4b4864c7fB87aAec8d5819a788eD4,1
0xF623E94355e44A723AD0003a26609b78571d2b35,1
0x04E467c9005d7bC86ac80C4594d770136f139073,1
0x77086219f8886ba8641148e5e184980115Af28ec,1
0x14b8a38ada9a9058Af72ffAb3A69AE181E8BbEb4,1
0x54e322485Add4A9b4543949723f4f89DF7ae5d90,1
0x24A0c470882E6Ef688B68aE2BA9859b9A4A114A8,1
0xcfeDbd13Ea735D2e065aC302C5be51D950B10715,1
0xAE8d6B10A60beb138ec962daA19EB0cd211D03AB,1
0x776a4E822A6319FbfA4A7d3686bC974d34F57Fd3,1
0x02499ec157D3bB9c8a6da69Ea74953F05223f7f6,1
0x5b8996dE5Be7B7D6aF9968BAa6c015952864bbF6,1
0x1e95fcfd56634C6264D9BD1441Dc61279297a913,1
0xc8FA1C295305a0690CfDF5817514D9Dce5F05e88,1
0x3Df317E6b3B9d0a1000Be487E341DDF58a5D8869,1
0x96f0067A5E1CFfC6182aF4B9B37C53A5d20BFF08,1
0xa287e02f1e8a59FA25bAA0eC4BD0788821CAcda5,1
0xfa5777211D0f2C15B09FFe689AE6746328E068A8,1
0x5afC7FecDbC71F331d154d5783bB188A47EC1b7F,1
0x56f809D1DbE35f2065b30D9d6175a916F6Ee8fe5,1
0x7e645cA0a9DcC1C1bd63E9dE9e3AeDF052eaAC58,1
0x18e89c7E2124643C02Ebe71b7b84c72bD1a06872,1
0x81054ee286c0E4aF70a1713840Ed03cc0697795D,1
0x9526d3Fa74620358e3F714829dA8dfc36FF81F2C,1
0xB0edeEAfe4c918d73BC66AF0C2fC87050d7d2A3e,1
0x464Ab4886D46ebCa7cf0A8255dE934ADCc6fFF2A,1
0xb10e4b3B5014D68DD68037E4E1339EFE58c8bed4,1
0xb55ED39Ef373db99E4E2cC39bE0B92FFf255eAf1,1
0x272d840B9e83AeFDf28A8A91b5fdDC7AbDcf4102,1
0x74168381c8124d124621004d32786B00908a68e4,1
0xCEC03DE2be46B500c5c798C849F93bdd259A0640,1
0xC5F17131ca2aF653a659B1bbb6E65f8dC33b090A,1
0x321f2cAB82e6569754D0454f59a8AB21fa8F1b80,1
0xbCebbfD8e10fd091af6efA49F315bC14e32B0d8f,1
0x1187B0d93047e74Aa7E409d662B5Cd3a249Ccb16,1
0x36CdbbaFEAF6bfC03C32C31E9bA2E26f6D9218DF,1
0x15e58f8Bd1827B1f05D89AeC8cdB7330Fcb35dA8,1
0x8DdE2c811EbdC2f6Cb4E6A02E547712CCa1A8577,1
0xfb3A4d39fE6033CD1759590cd91ffB35Dad7602c,1
0xdb9E6038F9Eb3b1c80b33C0862cb00bc4dDB315B,1
0xEE69879105F5EcA104d5aAf94a032b3D4aFE2141,1
0x92d86CeCAf289651466E560322813130C5E4A224,1
0x4a2F511AB9dc4c7220d63239F63fABE4f6D65E04,1
0xE2E942A22816fAB52Fd877B453416FCF78BA4E9B,1
0xf97a37f90608a35647d59579437C748bCD308F5f,1
0x34d8BaD8b1e84287f9a99FD0162787C065F2422d,1
0x5A51dBDD67CE7A30A9494Ab58276992E51f09F1E,1
0x7a45E2c75EfF9eD03af666AACd7f12A40C833443,1
0x7A9e123908D20F3fB8115CCa830F4E67b5A05198,1
0x4Aa0d0C4c20a1C8B58fAc2514c9bbdB6d34766D5,1
0x8c8354A13eC87DFe76d2D291E3FaC46323f1F2F3,1
0x6a16803A386860f382c24a09DC961DDf1846002b,1
0xb56413EF1F109FBD972544A1a5748874DBA995D1,1
0xd13d6D5906B69e2dB70DefAE811CB710731f069E,1
0xA612cfE291af36EC778DC64C81c52536c78579f9,1
0x8a1837eb135699A780Db441a4A05029700b8bEBC,1
0xe6bDbca7C96c0434dD3c978F4794d1A8518E0a33,1
0xa41e03CAa773B4436746D6C4B02a108aBa0d998c,1
0x186433BFfd1c90E0779293eE51693473560efECE,1
0x0bfc5Fd57F1Fdbb08Aa3E483E163399Adf98853E,1
0x07F93Dd6409BC46c634c73eB621be73c61678662,1
0x9a79CDe769EFc81C84883981887d541e859dC201,1
0x15243eEFf9A550C6FAb6b2aC3318116C4a7675C3,1
0xd7E3707141461EB0D85c7B89941034E9507337e0,1
0x8dE431A49eA05777Fe97A1B5E27dB447429Ab3a0,1
0x0761C690c759855953b98Dfce499003245F97297,1
0xB11b41D3A8713A1Bf6b9729ac0554e62AdF15C4d,1
0xD92F8f4AD386147aBda71c390f9C4de510E5420d,1
0x3B517F89d9bF21f1b8c065a826187E3336875a94,1
0x703139D1c966C92723D8CbE5D87a95F3eB8a46F6,1
0xE385B09025ff7024EdfD36Fe172fBb319438ceBA,1
0xB2a2D60D045159640F37bE41A8B8f6146E4bC4dC,1
0x9c0adBfa42b8Bfc939daAf9De8882245eD008414,1
0x7972391B4355c28fBB3Ca51B1F4AbD42A0124dFC,1
0x691324566d895fB00Ec14E89A2F5b26763ccE6A0,1
0x2B73De52e7B77fBf332278624a8CF36267B1c24a,1
0xacFDE804b6969cEDf17919F706999c9b655CcB1e,1
0xab35BE3dA0f49Fc30Ab6d47F9f7bA59bC7632De3,1
0xD7e64375ce401ade1Fe327388a57f62c86e2AF38,1
0x6F837C207925400F246BcA336Eb64e0eD21EdCc2,1
0x54E894fC13df4A64dF61aA366d115C9644250C23,1
0xea8dAA2A1DFD4c6F3f7D787242a18C3C475D07CF,1
0x3900df4DbFDAe9053A3acC94eFB27322A3F34712,1
0x70ff345B598ddfa40711177182990be62BE12C0E,1
0xF2D67a80CA200dD60BC5cf65488a8D0d59934098,1
0x8c600b4c13F927FD4077C79Cdc82604D7D59bE78,1
0x9E9eb4e8eb04831C9b4eccD6197ff39b68aDF714,1
0x08131b12f9E4db0248a92EeC4D941601ff3a387f,1
0x9Ee1A57C2512d7ff07e64D93219C2935a5aD0546,1
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"@openzeppelin/contracts-upgradeable" "4.5.2"
patch-package "^6.4.7"

"@dk1a/solidity-stringutils@^0.3.3":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@dk1a/solidity-stringutils/-/solidity-stringutils-0.3.3.tgz#9d25b272c8015148d794f2f426b104ca2a0d1707"
integrity sha512-IQodjgcYtYudV1vXUl3f5B/cau0gSji1Izae6a9UiVP5VdJOk+D4QcmCrjy8Rzdb5i2vlPVtrBHhbYncW1+Kcg==

"@ethereumjs/rlp@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41"
Expand Down

0 comments on commit 98e9a96

Please sign in to comment.