{"id":18484358,"url":"https://github.com/giveth/giv-token-contracts","last_synced_at":"2025-04-08T18:33:20.148Z","repository":{"id":37014398,"uuid":"375063509","full_name":"Giveth/giv-token-contracts","owner":"Giveth","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-26T18:41:42.000Z","size":10256,"stargazers_count":27,"open_issues_count":7,"forks_count":9,"subscribers_count":16,"default_branch":"develop","last_synced_at":"2025-03-23T17:22:40.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Giveth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-08T15:45:17.000Z","updated_at":"2024-10-16T16:54:21.000Z","dependencies_parsed_at":"2023-01-17T13:15:17.957Z","dependency_job_id":"e889e2dd-ff15-4b1a-b590-b83afbd519f7","html_url":"https://github.com/Giveth/giv-token-contracts","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiv-token-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiv-token-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiv-token-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giveth%2Fgiv-token-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Giveth","download_url":"https://codeload.github.com/Giveth/giv-token-contracts/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247902843,"owners_count":21015533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T12:39:28.877Z","updated_at":"2025-04-08T18:33:17.060Z","avatar_url":"https://github.com/Giveth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Install pre-requisites\n\n```\n$ npm i\n```\n\n## Compile\n```\n$ npm run compile\n```\n\n## Test\n```\n$ npm run compile\n```\n\n## Generate merkle tree files\n* Pre-process csv\n```\n$ npm run csv2json\n\n\u003e hardhat-project@ csv2json /Users/edu/Development/GivethContracts\n\u003e ts-node scripts/csv2json.ts ./files/GIV_tokens_-_AIRDROP_TEST_LIST.csv ./files/merkle_distributor_xdai.json\n\nTotal distributed tokens: ./files/merkle_distributor_xdai.json amount: 14886637.0\n```\n* Generate merkle_distributor_result.json\n```\n$ npm run generate-merkle-root\n\n\u003e generate-merkle-root\n\u003e ts-node scripts/csv2json.ts ./files/GIV_tokens_-_AIRDROP_TEST_LIST.csv ./files/merkle_distributor.json\n\nTotal distributed tokens: 14430863000000000000000000\n```\n* Get merkletree root \n```\n$ cat ./files/merkle_distributor_xdai_result.json  | jq '.merkleRoot'\n\"0x05176bac832b5a9cd000091d231638fe0e854801c447aae625ed2f710c026196\"\n```\n\n## Deploy\n**To select the gasPrice you need to edit the hardhat.config.ts**\n\n### xDAI \n```\n/Users/amin/.nvm/versions/node/v14.17.5/bin/node /Users/amin/.nvm/versions/node/v14.17.5/lib/node_modules/npm/bin/npm-cli.js run deploy:xDAI --scripts-prepend-node-path=auto\n\n\u003e hardhat-project@ deploy:xDAI /Users/amin/Work/giveth/giv-token-contracts\n\u003e HARDHAT_NETWORK=xDAI node deployments/xDAI/1_tokenDistro_merkleDistro_Unipool.js 1635007800 0x5d32A9BaF31A793dBA7275F77856A47A0F5d09b3 0xc81c327f43eC566E14C64AedE5DCf5d9c120D5eb 10000000 0x9Eb16810488760580232fBdd8D3f41994AB0e51D 2500000 7500000 729500000\n\n\n#######################\n##### Deployments #####\n#######################\nDeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntotalTokens: 920000000.0\nstartTime: 1635007800\ncliffPeriod: 0\nduration: 11262857\ninitialPercentage: 1000\ntokenAddress: 0x5d32A9BaF31A793dBA7275F77856A47A0F5d09b3\nLMDuration: 86400\ncancelable: true\nmerkletree_file: ./files/merkle_distributor_xdai_result.json\nmerkleTokens: 170500000.0\n\n#######################\n##### TokenDistro #####\n#######################\n\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntotalTokens: 920000000.0\nstartTime: 1635007800\ncliffPeriod: 0\nduration: 11262857\ninitialPercentage: 1000\ntokenAddress: 0x5d32A9BaF31A793dBA7275F77856A47A0F5d09b3\ncancelable: true\n########################\n\nTokenDistro deployed to: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\n\n#######################\n#####    Check    #####\n#######################\nTokenDistro - totalTokens: 920000000.0\nTokenDistro - startTime: 1635007800\nTokenDistro - cliffPeriod: 1635007800\nTokenDistro - duration: 11262857\nTokenDistro - initialAmount: 92000000000000000000000000\nTokenDistro - token: 0x5d32A9BaF31A793dBA7275F77856A47A0F5d09b3\nTokenDistro - cancelable: true\nThis smartcontract needs:  920000000.0 Tokens\ntoken.mint(\"0xf11aC05c97F8845f6b974e9e327129d36683cC90\",\"920000000000000000000000000\")\n\n########################\n##### MerkleDistro #####\n########################\n\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ndistroAddress: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\nmerkletree_file: ./files/merkle_distributor_xdai_result.json\n#######################\n\nMerkleDistro deployed to: 0x8ECebE69d45d357e5aa2719999B69d7c65003932\n\n#######################\n\nTokenDistro - assign: MerkleDistro 170500000000000000000000000\n\n#######################\n#####    Check    #####\n#######################\nMerkleDistro - _tokenDistro: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\nMerkleDistro - _merkleRoot: 0x4fa0be3b7be950dc2a3ad7c9b53d4cc4977255359e7b70ae2f652bc162d2fb0f\n\n\n######################################################\n####### 50GIV/HNY - honeyswap - xDai 10000000 #######\n######################################################\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntokenDistribution: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\nuni: 0xc81c327f43eC566E14C64AedE5DCf5d9c120D5eb\nduration: 86400\n##############################################\n\nGIVHNY_XDAI deployed to: 0x491f1Cc76d619061b833287F493136A2D52BB18e\n\n##############################################\n\nTokenDistro - assign: givhny_xdai 10000000\n\n#######################\n#####    Check    #####\n#######################\ngivhny_xdai(tokenDistro,duration,periodFinish,uni):\ngivhny_xdai - tokenDistro: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\ngivhny_xdai - duration: 86400\ngivhny_xdai - periodFinish: 0\ngivhny_xdai - uni: 0xc81c327f43eC566E14C64AedE5DCf5d9c120D5eb\n\n\n######################################################\n####### 50GIV/WETH - honeyswap - xDai 2500000  #######\n######################################################\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntokenDistribution: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\nuni: 0x9Eb16810488760580232fBdd8D3f41994AB0e51D\nduration: 86400\n##############################################\n\nGIVHNY_XDAI deployed to: 0x00e97BCf2E9A5F6ECF006f89B094255263B16686\n\n##############################################\n\nTokenDistro - assign: givhny_xdai 2500000\n\n#######################\n#####    Check    #####\n#######################\ngivweth_xdai(tokenDistro,duration,periodFinish,uni):\ngivweth_xdai - tokenDistro: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\ngivweth_xdai - duration: 86400\ngivweth_xdai - periodFinish: 0\ngivweth_xdai - uni: 0x9Eb16810488760580232fBdd8D3f41994AB0e51D\n\n\n######################################################\n#######     GIVstaking xDai - xDai - 7500000   #######\n######################################################\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntokenDistribution: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\nuni: 0x5d32A9BaF31A793dBA7275F77856A47A0F5d09b3\nduration: 86400\n##############################################\n\nUNIGIV deployed to: 0x4358c99abFe7A9983B6c96785b8870b5412C5B4B\n\n##############################################\n\nTokenDistro - assign: givhny_xdai 7500000\n\n#######################\n#####    Check    #####\n#######################\nunigiv(tokenDistro,duration,periodFinish,uni):\nunigiv - tokenDistro: 0xf11aC05c97F8845f6b974e9e327129d36683cC90\nunigiv - duration: 86400\nunigiv - periodFinish: 0\nunigiv - uni: 0x5d32A9BaF31A793dBA7275F77856A47A0F5d09b3\n\n\n#######################\n#####  Final checks ###\n#######################\ntokenDistro.balances(tokenDistro.address) allocated: 729500000.0 claimed: 0.0\ntokenDistro.balances(merkleDistro.address) allocated: 170500000.0 claimed: 0.0\ntokenDistro.balances(givhny_xdai.address) allocated: 10000000.0 claimed: 0.0\ntokenDistro.balances(givweth_xdai.address) allocated: 2500000.0 claimed: 0.0\ntokenDistro.balances(unigiv.address) allocated: 7500000.0 claimed: 0.0\ntokenDistro.hasRole(tokenDistro.DISTRIBUTOR_ROLE(),merkleDistro.address) true\ntokenDistro.hasRole(tokenDistro.DISTRIBUTOR_ROLE(),givhny_xdai.address) true\ntokenDistro.hasRole(tokenDistro.DISTRIBUTOR_ROLE(),givweth_xdai.address) true\ntokenDistro.hasRole(tokenDistro.DISTRIBUTOR_ROLE(),unigiv.address) true\n```\n\n### Mainnet (Kovan)\n```\n/Users/amin/.nvm/versions/node/v14.17.5/bin/node /Users/amin/.nvm/versions/node/v14.17.5/lib/node_modules/npm/bin/npm-cli.js run deploy:kovan --scripts-prepend-node-path=auto\n\n\u003e hardhat-project@ deploy:kovan /Users/amin/Work/giveth/giv-token-contracts\n\u003e HARDHAT_NETWORK=kovan node deployments/mainnet/2_tokenDistro_Unipools.js 1635007800 0x03472537CB64652Aa1224E4aaF6f33a34e73E877 0x487195072fB88ddE7DDA2Ef1A688C6380b995478 10000000 0x1ee71e1ed744ae6d4058f5c7797c2e583dbfb095 2500000 2500000\n\n\n#######################\n##### Deployments #####\n#######################\nDeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntotalTokens: 15000000.0\nstartTime: 1635007800\ncliffPeriod: 0\nduration: 11262857\ninitialPercentage: 1000\ntokenAddress: 0x03472537CB64652Aa1224E4aaF6f33a34e73E877\nLMDuration: 43200\ncancelable: false\n\n#######################\n##### TokenDistro #####\n#######################\n\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntotalTokens: 15000000.0\nstartTime: 1635007800\ncliffPeriod: 0\nduration: 11262857\ninitialPercentage: 1000\ntokenAddress: 0x03472537CB64652Aa1224E4aaF6f33a34e73E877\ncancelable: false\n########################\n\nTokenDistro deployed to: 0x60A936F085403160864653B7d0d2c3bc133d18D0\n\n#######################\n#####    Check    #####\n#######################\nTokenDistro - totalTokens: 15000000.0\nTokenDistro - startTime: 1635007800\nTokenDistro - cliffPeriod: 1635007800\nTokenDistro - duration: 11262857\nTokenDistro - initialAmount: 1500000000000000000000000\nTokenDistro - token: 0x03472537CB64652Aa1224E4aaF6f33a34e73E877\nTokenDistro - cancelable:\nfalse This smart-contract needs:  15000000.0 Tokens\ntoken.mint(\"0x60A936F085403160864653B7d0d2c3bc133d18D0\",\"15000000000000000000000000\")\n\n######################################################\n#######   50GIV/ETH - Uni  Mainnet 10000000   #######\n######################################################\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntokenDistribution: 0x60A936F085403160864653B7d0d2c3bc133d18D0\nuni staker: 0x1f98407aaB862CdDeF78Ed252D6f557aA5b0f00d\nduration: 43200\n##############################################\n\nGIVETH_UNI_REWARD deployed to: 0x6b66368EddB78E61179523cf21049af40f797F4E\n\n##############################################\n\nUniswapV3RewardToken - mint: GIVETH_UNI_STAKER 10000000\nTokenDistro - assign: giveth_uni_reward 10000000\nThe new incentiveId will be 0x550595f7254e7d91d5e063bf0a09cabe6632ab716e56bc9962905ca659e6c1f2\nChecking if deployer (0x5f672d71399d8cDbA64f596394b4f4381247E025) has enough rewards token balance...\nBalance 10000000.0 (10000000000000000000000000) is sufficient.\nChecking if deployer (0x5f672d71399d8cDbA64f596394b4f4381247E025) has approved staker contract to spend the reward...\nMissing 10000000000000000000000000 allowance. Setting up allowance...\nCreating approve() tx 0x02dcfc046e3e496f22ecf7bc36fe8888c8d3543eef3d1c75a8bf4d71e7ae2308...\nTx 0x02dcfc046e3e496f22ecf7bc36fe8888c8d3543eef3d1c75a8bf4d71e7ae2308 confirmed!\n\n\nKey:  {\n  startTime: '1635007800',\n  endTime: '1646270657',\n  pool: '0x487195072fB88ddE7DDA2Ef1A688C6380b995478',\n  rewardToken: '0x6b66368EddB78E61179523cf21049af40f797F4E',\n  refundee: '0x5f672d71399d8cDbA64f596394b4f4381247E025'\n}\n\n\n\nCreating incentive in tx 0xc6dbc2bd743dce7b86e297b218ad843818b3373e79e4bae8df00d7690a899421...\n\n#######################\n#####    Check    #####\n#######################\ngiveth_uni_reward(tokenDistro,duration,periodFinish,uni):\ngiveth_uni_reward - tokenDistro: 0x60A936F085403160864653B7d0d2c3bc133d18D0\n\nuniswap v3 staker - balance of giveth_uni_reward: 10000000.0\n\n\n######################################################\n####### 80GIV/ETH - Bal   Mainnet   2500000  #######\n######################################################\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntokenDistribution: 0x60A936F085403160864653B7d0d2c3bc133d18D0\nuni: 0x1eE71e1Ed744AE6D4058F5c7797C2e583DbfB095\nduration: 43200\n##############################################\n\nGIVETH_BAL deployed to: 0x087Cbc387b8746A73E3EbA9A31782F5ee7B6cC45\n\n##############################################\n\nTokenDistro - assign: giveth_uni_reward 2500000\n\n#######################\n#####    Check    #####\n#######################\ngiveth_bal(tokenDistro,duration,periodFinish,uni):\ngiveth_bal - tokenDistro: 0x60A936F085403160864653B7d0d2c3bc133d18D0\ngiveth_bal - duration: 43200\ngiveth_bal - periodFinish: 0\ngiveth_bal - uni: 0x1eE71e1Ed744AE6D4058F5c7797C2e583DbfB095\n\n\n######################################################\n#######   GIVstaking ETH    Mainnet    2500000   #######\n######################################################\ndeployer: 0x5f672d71399d8cDbA64f596394b4f4381247E025\ntokenDistribution: 0x60A936F085403160864653B7d0d2c3bc133d18D0\nuni: 0x03472537CB64652Aa1224E4aaF6f33a34e73E877\nduration: 43200\n##############################################\n\nUNIGIV deployed to: 0x8d74ee0C611fA62210B66e051f31A0c103b6eDD6\n\n##############################################\n\nTokenDistro - assign: giveth_uni_reward 2500000\n\n#######################\n#####    Check    #####\n#######################\nunigiv(tokenDistro,duration,periodFinish,uni):\nunigiv - tokenDistro: 0x60A936F085403160864653B7d0d2c3bc133d18D0\nunigiv - duration: 43200\nunigiv - periodFinish: 0\nunigiv - uni: 0x03472537CB64652Aa1224E4aaF6f33a34e73E877\n\n\n#######################\n#####  Final checks ###\n#######################\ntokenDistro.balances(tokenDistro.address) allocated: 0.0 claimed: 0.0\ntokenDistro.balances(giveth_uni_reward.address) allocated: 10000000.0 claimed: 0.0\ntokenDistro.balances(giveth_bal.address) allocated: 2500000.0 claimed: 0.0\ntokenDistro.balances(unigiv.address) allocated: 2500000.0 claimed: 0.0\ntokenDistro.hasRole(tokenDistro.DISTRIBUTOR_ROLE(),giveth_uni_reward.address) true\ntokenDistro.hasRole(tokenDistro.DISTRIBUTOR_ROLE(),giveth_bal.address) true\ntokenDistro.hasRole(tokenDistro.DISTRIBUTOR_ROLE(),unigiv.address) true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiveth%2Fgiv-token-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiveth%2Fgiv-token-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiveth%2Fgiv-token-contracts/lists"}