diff --git a/contracts/Interfaces/IDistroModified.sol b/contracts/Interfaces/IDistroModified.sol index 0e14425..0776911 100644 --- a/contracts/Interfaces/IDistroModified.sol +++ b/contracts/Interfaces/IDistroModified.sol @@ -10,11 +10,19 @@ interface IDistro { /** * @dev Emitted when the DISTRIBUTOR allocate an amount to a grantee */ - event Allocate(address indexed distributor, address indexed grantee, uint256 amount); + event Allocate( + address indexed distributor, + address indexed grantee, + uint256 amount + ); /** * @dev Emitted when the DEFAULT_ADMIN assign an amount to a DISTRIBUTOR */ - event Assign(address indexed admin, address indexed distributor, uint256 amount); + event Assign( + address indexed admin, + address indexed distributor, + uint256 amount + ); /** * @dev Emitted when someone change their reception address */ @@ -59,7 +67,11 @@ interface IDistro { * @param amount allocated amount * @param claim whether claim after allocate */ - function allocate(address recipient, uint256 amount, bool claim) external; + function allocate( + address recipient, + uint256 amount, + bool claim + ) external; /** * Function that allows to the distributor address to allocate some amounts of tokens to specific recipients @@ -67,9 +79,11 @@ interface IDistro { * @param recipients of token allocation * @param amounts allocated amount */ - function allocateMany(address[] memory recipients, uint256[] memory amounts) external; + function allocateMany(address[] memory recipients, uint256[] memory amounts) + external; - function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) external; + function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) + external; /** * Function that allows a recipient to change its address @@ -86,19 +100,29 @@ interface IDistro { /** * Function to get the total unlocked tokes at some moment */ - function globallyClaimableAt(uint256 timestamp) external view returns (uint256); + function globallyClaimableAt(uint256 timestamp) + external + view + returns (uint256); /** * Function to get the unlocked tokes at some moment for a specific address */ - function claimableAt(address recipient, uint256 timestamp) external view returns (uint256); + function claimableAt(address recipient, uint256 timestamp) + external + view + returns (uint256); /** * Function to get the unlocked tokens for a specific address. It uses the current timestamp */ function claimableNow(address recipient) external view returns (uint256); - function transferAllocation(address prevRecipient, address newRecipient) external; + function transferAllocation(address prevRecipient, address newRecipient) + external; - function sendPraiseRewards(address[] memory recipients, uint256[] memory amounts) external; + function sendPraiseRewards( + address[] memory recipients, + uint256[] memory amounts + ) external; } diff --git a/contracts/TokenDistro/ModifiedTokenDistro.sol b/contracts/TokenDistro/ModifiedTokenDistro.sol index daa7109..c987caa 100644 --- a/contracts/TokenDistro/ModifiedTokenDistro.sol +++ b/contracts/TokenDistro/ModifiedTokenDistro.sol @@ -12,11 +12,16 @@ import "../Interfaces/IDistroModified.sol"; * The distributor is in charge of releasing the corresponding amounts to its recipients. * This distributor is expected to be another smart contract, such as a merkledrop or the liquidity mining smart contract */ -contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgradeable { +contract TokenDistroV1 is + Initializable, + IDistro, + AccessControlEnumerableUpgradeable +{ using SafeERC20Upgradeable for IERC20Upgradeable; // bytes32 public constant DISTRIBUTOR_ROLE = keccak256("DISTRIBUTOR_ROLE"); - bytes32 public constant DISTRIBUTOR_ROLE = 0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c; + bytes32 public constant DISTRIBUTOR_ROLE = + 0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c; // Structure to of the accounting for each account struct accountStatus { @@ -52,9 +57,15 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade event DurationChanged(uint256 newDuration); modifier onlyDistributor() { - require(hasRole(DISTRIBUTOR_ROLE, msg.sender), 'TokenDistro::onlyDistributor: ONLY_DISTRIBUTOR_ROLE'); + require( + hasRole(DISTRIBUTOR_ROLE, msg.sender), + "TokenDistro::onlyDistributor: ONLY_DISTRIBUTOR_ROLE" + ); - require(balances[msg.sender].claimed == 0, 'TokenDistro::onlyDistributor: DISTRIBUTOR_CANNOT_CLAIM'); + require( + balances[msg.sender].claimed == 0, + "TokenDistro::onlyDistributor: DISTRIBUTOR_CANNOT_CLAIM" + ); _; } @@ -79,8 +90,14 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade IERC20Upgradeable _token, bool _cancelable ) public initializer { - require(_duration >= _cliffPeriod, 'TokenDistro::constructor: DURATION_LESS_THAN_CLIFF'); - require(_initialPercentage <= 10000, 'TokenDistro::constructor: INITIALPERCENTAGE_GREATER_THAN_100'); + require( + _duration >= _cliffPeriod, + "TokenDistro::constructor: DURATION_LESS_THAN_CLIFF" + ); + require( + _initialPercentage <= 10000, + "TokenDistro::constructor: INITIALPERCENTAGE_GREATER_THAN_100" + ); __AccessControlEnumerable_init(); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); @@ -105,10 +122,13 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * */ function setStartTime(uint256 newStartTime) external override { - require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), 'TokenDistro::setStartTime: ONLY_ADMIN_ROLE'); + require( + hasRole(DEFAULT_ADMIN_ROLE, msg.sender), + "TokenDistro::setStartTime: ONLY_ADMIN_ROLE" + ); require( startTime > getTimestamp() && newStartTime > getTimestamp(), - 'TokenDistro::setStartTime: IF_HAS_NOT_STARTED_YET' + "TokenDistro::setStartTime: IF_HAS_NOT_STARTED_YET" ); uint256 _cliffPeriod = cliffTime - startTime; @@ -128,11 +148,21 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * */ function assign(address distributor, uint256 amount) external override { - require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), 'TokenDistro::assign: ONLY_ADMIN_ROLE'); - require(hasRole(DISTRIBUTOR_ROLE, distributor), 'TokenDistro::assign: ONLY_TO_DISTRIBUTOR_ROLE'); + require( + hasRole(DEFAULT_ADMIN_ROLE, msg.sender), + "TokenDistro::assign: ONLY_ADMIN_ROLE" + ); + require( + hasRole(DISTRIBUTOR_ROLE, distributor), + "TokenDistro::assign: ONLY_TO_DISTRIBUTOR_ROLE" + ); - balances[address(this)].allocatedTokens = balances[address(this)].allocatedTokens - amount; - balances[distributor].allocatedTokens = balances[distributor].allocatedTokens + amount; + balances[address(this)].allocatedTokens = + balances[address(this)].allocatedTokens - + amount; + balances[distributor].allocatedTokens = + balances[distributor].allocatedTokens + + amount; emit Assign(msg.sender, distributor, amount); } @@ -169,11 +199,22 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * Emits a {Allocate} event. * */ - function _allocate(address recipient, uint256 amount, bool claim) internal { - require(!hasRole(DISTRIBUTOR_ROLE, recipient), 'TokenDistro::allocate: DISTRIBUTOR_NOT_VALID_RECIPIENT'); - balances[msg.sender].allocatedTokens = balances[msg.sender].allocatedTokens - amount; + function _allocate( + address recipient, + uint256 amount, + bool claim + ) internal { + require( + !hasRole(DISTRIBUTOR_ROLE, recipient), + "TokenDistro::allocate: DISTRIBUTOR_NOT_VALID_RECIPIENT" + ); + balances[msg.sender].allocatedTokens = + balances[msg.sender].allocatedTokens - + amount; - balances[recipient].allocatedTokens = balances[recipient].allocatedTokens + amount; + balances[recipient].allocatedTokens = + balances[recipient].allocatedTokens + + amount; if (claim && claimableNow(recipient) > 0) { _claim(recipient); @@ -182,7 +223,11 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade emit Allocate(msg.sender, recipient, amount); } - function allocate(address recipient, uint256 amount, bool claim) external override onlyDistributor { + function allocate( + address recipient, + uint256 amount, + bool claim + ) external override onlyDistributor { _allocate(recipient, amount, claim); } @@ -194,25 +239,40 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * * Unlike allocate method it doesn't claim recipients available balance */ - function _allocateMany(address[] memory recipients, uint256[] memory amounts) internal onlyDistributor { + function _allocateMany( + address[] memory recipients, + uint256[] memory amounts + ) internal onlyDistributor { uint256 length = recipients.length; - require(length == amounts.length, 'TokenDistro::allocateMany: INPUT_LENGTH_NOT_MATCH'); + require( + length == amounts.length, + "TokenDistro::allocateMany: INPUT_LENGTH_NOT_MATCH" + ); for (uint256 i = 0; i < length; i++) { _allocate(recipients[i], amounts[i], false); } } - function allocateMany(address[] memory recipients, uint256[] memory amounts) external override { + function allocateMany(address[] memory recipients, uint256[] memory amounts) + external + override + { _allocateMany(recipients, amounts); } - function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) external override { + function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) + external + override + { _allocateMany(recipients, amounts); emit GivBackPaid(msg.sender); } - function sendPraiseRewards(address[] memory recipients, uint256[] memory amounts) external override { + function sendPraiseRewards( + address[] memory recipients, + uint256[] memory amounts + ) external override { _allocateMany(recipients, amounts); emit PraiseRewardPaid(msg.sender); } @@ -241,7 +301,12 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * @param timestamp Unix time to check the number of tokens claimable * @return Number of tokens claimable at that timestamp */ - function globallyClaimableAt(uint256 timestamp) public view override returns (uint256) { + function globallyClaimableAt(uint256 timestamp) + public + view + override + returns (uint256) + { if (timestamp < startTime) return 0; if (timestamp < cliffTime) return initialAmount; if (timestamp > startTime + duration) return totalTokens; @@ -255,10 +320,22 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * @param recipient account to query * @param timestamp Instant of time in which the calculation is made */ - function claimableAt(address recipient, uint256 timestamp) public view override returns (uint256) { - require(!hasRole(DISTRIBUTOR_ROLE, recipient), 'TokenDistro::claimableAt: DISTRIBUTOR_ROLE_CANNOT_CLAIM'); - require(timestamp >= getTimestamp(), 'TokenDistro::claimableAt: NOT_VALID_PAST_TIMESTAMP'); - uint256 unlockedAmount = (globallyClaimableAt(timestamp) * balances[recipient].allocatedTokens) / totalTokens; + function claimableAt(address recipient, uint256 timestamp) + public + view + override + returns (uint256) + { + require( + !hasRole(DISTRIBUTOR_ROLE, recipient), + "TokenDistro::claimableAt: DISTRIBUTOR_ROLE_CANNOT_CLAIM" + ); + require( + timestamp >= getTimestamp(), + "TokenDistro::claimableAt: NOT_VALID_PAST_TIMESTAMP" + ); + uint256 unlockedAmount = (globallyClaimableAt(timestamp) * + balances[recipient].allocatedTokens) / totalTokens; return unlockedAmount - balances[recipient].claimed; } @@ -267,7 +344,12 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * Function to get the unlocked tokens for a specific address. It uses the current timestamp * @param recipient account to query */ - function claimableNow(address recipient) public view override returns (uint256) { + function claimableNow(address recipient) + public + view + override + returns (uint256) + { return claimableAt(recipient, getTimestamp()); } @@ -280,10 +362,16 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * * Formerly called cancelAllocation, this is an admin only function and should only be called manually */ - function transferAllocation(address prevRecipient, address newRecipient) external override { - require(cancelable, 'TokenDistro::transferAllocation: NOT_CANCELABLE'); + function transferAllocation(address prevRecipient, address newRecipient) + external + override + { + require(cancelable, "TokenDistro::transferAllocation: NOT_CANCELABLE"); - require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), 'TokenDistro::transferAllocation: ONLY_ADMIN_ROLE'); + require( + hasRole(DEFAULT_ADMIN_ROLE, msg.sender), + "TokenDistro::transferAllocation: ONLY_ADMIN_ROLE" + ); _transferAllocation(prevRecipient, newRecipient); } @@ -296,9 +384,14 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade function _claim(address recipient) private { uint256 remainingToClaim = claimableNow(recipient); - require(remainingToClaim > 0, 'TokenDistro::claim: NOT_ENOUGH_TOKENS_TO_CLAIM'); + require( + remainingToClaim > 0, + "TokenDistro::claim: NOT_ENOUGH_TOKENS_TO_CLAIM" + ); - balances[recipient].claimed = balances[recipient].claimed + remainingToClaim; + balances[recipient].claimed = + balances[recipient].claimed + + remainingToClaim; token.safeTransfer(recipient, remainingToClaim); @@ -309,29 +402,42 @@ contract TokenDistroV1 is Initializable, IDistro, AccessControlEnumerableUpgrade * Function to change the duration */ function setDuration(uint256 newDuration) public { - require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), 'TokenDistro::setDuration: ONLY_ADMIN_ROLE'); + require( + hasRole(DEFAULT_ADMIN_ROLE, msg.sender), + "TokenDistro::setDuration: ONLY_ADMIN_ROLE" + ); - require(startTime > getTimestamp(), 'TokenDistro::setDuration: IF_HAS_NOT_STARTED_YET'); + require( + startTime > getTimestamp(), + "TokenDistro::setDuration: IF_HAS_NOT_STARTED_YET" + ); duration = newDuration; emit DurationChanged(newDuration); } - function _transferAllocation(address prevRecipient, address newRecipient) internal { + function _transferAllocation(address prevRecipient, address newRecipient) + internal + { require( - balances[prevRecipient].allocatedTokens > 0, 'TokenDistro::transferAllocation: NO_ALLOCATION_TO_TRANSFER' + balances[prevRecipient].allocatedTokens > 0, + "TokenDistro::transferAllocation: NO_ALLOCATION_TO_TRANSFER" ); require( - !hasRole(DISTRIBUTOR_ROLE, prevRecipient) && !hasRole(DISTRIBUTOR_ROLE, newRecipient), - 'TokenDistro::transferAllocation: DISTRIBUTOR_ROLE_NOT_A_VALID_ADDRESS' + !hasRole(DISTRIBUTOR_ROLE, prevRecipient) && + !hasRole(DISTRIBUTOR_ROLE, newRecipient), + "TokenDistro::transferAllocation: DISTRIBUTOR_ROLE_NOT_A_VALID_ADDRESS" ); // balance adds instead of overwrites balances[newRecipient].allocatedTokens = - balances[prevRecipient].allocatedTokens + balances[newRecipient].allocatedTokens; + balances[prevRecipient].allocatedTokens + + balances[newRecipient].allocatedTokens; balances[prevRecipient].allocatedTokens = 0; - balances[newRecipient].claimed = balances[prevRecipient].claimed + balances[newRecipient].claimed; + balances[newRecipient].claimed = + balances[prevRecipient].claimed + + balances[newRecipient].claimed; balances[prevRecipient].claimed = 0; diff --git a/deployments/notifyRewardAmount/optimism/givpower_distribute_extended_apr_2024.js b/deployments/notifyRewardAmount/optimism/givpower_distribute_extended_apr_2024.js new file mode 100644 index 0000000..0bd0819 --- /dev/null +++ b/deployments/notifyRewardAmount/optimism/givpower_distribute_extended_apr_2024.js @@ -0,0 +1,82 @@ +/* eslint-disable no-use-before-define */ +const hre = require("hardhat"); +const { sendReportEmail } = require("../../mailService/mailService"); +const { ethers } = hre; + +const pools = [ + { + address: "0x301C739CF6bfb6B47A74878BdEB13f92F13Ae5E7", + + // https://github.com/Giveth/giveth-dapps-v2/issues/4057 + amount: "4250000", + }, // Garden Unipool +]; + +// Two decimals of precision -> 615 = 6.15 +const distro = [ + 665, 673, 680, 688, 695, 702, 711, 718, 726, 733, 741, 748, 756, 764, +]; + +const initTime = 1715709600; // Timestamp of first round in seconds: Tuesday, MAY 14, 2024 18:00:00 GMT + +let UnipoolTokenDistributor, currentTime, nonce; +async function main() { + console.log("Trying to call notifyRewardAmount...", { + date: new Date().toString(), + }); + currentTime = Math.floor(Date.now() / 1000); + const [signer, ...addrs] = await ethers.getSigners(); + nonce = await signer.getTransactionCount(); + UnipoolTokenDistributor = await ethers.getContractFactory( + "UnipoolTokenDistributor", + ); + await notifyRewardAmount(pools[0]); +} + +async function notifyRewardAmount(pool) { + const unipoolTokenDistributor = await UnipoolTokenDistributor.attach( + pool.address, + ); + const periodFinish = await unipoolTokenDistributor.periodFinish(); + const duration = await unipoolTokenDistributor.duration(); + + // 10 minutes of precision + if (periodFinish < currentTime + 60 * 10) { + const pos = Math.floor((currentTime - initTime) / duration); + console.log("pos:", pos); + if (pos < 0) return; + if (distro[pos] === 0) return; + const amount = ethers.utils + .parseEther(pool.amount) + .mul(distro[pos]) + .div(10000); + console.log( + "UnipoolTokenDistributor - notifyRewardAmount:", + pool.address, + "->", + ethers.utils.formatEther(amount.toString()), + ); + const tx = await ( + await unipoolTokenDistributor.notifyRewardAmount(amount, { nonce }) + ).wait(); + nonce += 1; + console.log("tx:", tx); + await sendReportEmail({ + farm: "Giv power", + network: "Optimisim mainnet", + pool: pool.address, + round: pos + 1, + script: "givpower_distribute_extended.js", + transactionHash: tx.transactionHash, + amount, + }); + } else { + console.log( + "UnipoolTokenDistributor - notifyRewardAmount:", + pool.address, + "already set", + ); + } +} + +main(); diff --git a/package.json b/package.json index c75bf39..d28dbab 100644 --- a/package.json +++ b/package.json @@ -1,94 +1,95 @@ { - "name": "hardhat-project", - "scripts": { - "prettier:sol": "prettier --write 'contracts/**/*.sol'", - "compile": "hardhat compile", - "clear-cache": "rm -rf artifacts/ cache/ typechain-types/ .openzeppelin/", - "clear-proxy-contract-cache": "rm -rf .openzeppelin/", - "test": "hardhat test", - "csv2json": "ts-node scripts/csv2json.ts ./files/GIV_tokens_-_AIRDROP_TEST_LIST.csv ./files/merkle_distributor_xdai.json", - "generate-merkle-root": "ts-node scripts/generate-merkle-root.ts --input ./files/merkle_distributor_xdai.json --output ./files/merkle_distributor_xdai_result.json", - "deploy:local": "yarn clear-proxy-contract-cache && ts-node deployments/xDAI/1_tokenDistro_merkleDistro_Unipool.js 1628935200 0x6F45aFf8c1e50DB099DAb43292C28240be2b7485 920000000 0xb3c4538b9413522c25e18ba1095f43ca780813f2 1200000 0x8fb2d187eba62970c13d0037304260b9fef721c5 250000 500000", - "deploy:rinkeby": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=rinkeby ts-node deployments/xDAI/1_tokenDistro_merkleDistro_Unipool.js 1632830400 0x6F45aFf8c1e50DB099DAb43292C28240be2b7485 920000000 0xb3c4538b9413522c25e18ba1095f43ca780813f2 1200000 0x8fb2d187eba62970c13d0037304260b9fef721c5 250000 500000", - "deploy:xDAI": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=xDAI ts-node deployments/xDAI/1_tokenDistro_merkleDistro_Unipool.js 1640361600 0x4f4F9b8D5B4d0Dc10506e5551B0513B61fD59e75 2000000000 0x08ea9f608656A4a775EF73f5B187a2F1AE2ae10e 10000000 0x55FF0cef43F0DF88226E9D87D09fA036017F5586 2500000 0x24f2d06446af8d6e89febc205e7936a602a87b60 7500000", - "deploy:regenFarms:xdai": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=xDAI ts-node deployments/regenFarms/1_regenFarm.ts", - "deploy:regenFarms:kovan": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=kovan ts-node deployments/regenFarms/1_regenFarm.ts", - "deploy:regenFarms:mainnet": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=mainnet ts-node deployments/regenFarms/1_regenFarm.ts", - "deploy:local:2": "yarn clear-proxy-contract-cache && ts-node deployments/mainnet/2_tokenDistro_Unipools.js 1628935200 0x86B94D365c94De153d6023f243c2b6e6c6c7626C 80000000 0x8A094453df88D5D6B27162F949898e2d95462f80 1100000 0x632045A9CFa9d232d0dd46702033C850D0E06f0F 200000 200000", - "deploy:kovan": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=kovan ts-node deployments/mainnet/2_tokenDistro_Unipools.js 1640272200 0x29434A25abd94AE882aA883eea81585Aaa5b078D 2000000000 0x3c2455a3ee0d824941c9329c01a66b86078c3e82 10000000 0x8a6b25e33b12d1bb6929a8793961076bd1f9d3eb 2500000 2500000", - "deploy:mainnet": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=mainnet ts-node deployments/mainnet/2_tokenDistro_Unipools.js 1640361600 0x900db999074d9277c5da2a43f252d74366230da0 2000000000 0xc763b6b3d0f75167db95daa6a0a0d75dd467c4e1 10000000 0x7819f1532c49388106f7762328c51ee70edd134c 2500000 2500000", - "distributor:rinkeby": "HARDHAT_NETWORK=rinkeby ts-node deployments/notifyRewardAmount/xDAI/distributor.js", - "distributor:xDAI": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/distributor.js", - "distributor:mainnet": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/distributor.js", - "distributor:kovan": "HARDHAT_NETWORK=kovan ts-node deployments/notifyRewardAmount/mainnet/distributor.js", - "distributor:xDAI:extended": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/distributor_extended.js", - "distributor:xDAI:extended2": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/distributor_extended2.js", - "distributor:xDAI:givPower": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/givpower_distribute.js", - "distributor:xDAI:givPower:extended": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/givpower_distribute_extended.js", - "distributor:xDAI:givPower:extended:oct2023": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/givpower_distribute_extended_oct_2023.js", - "distributor:optimismMainnet:givPower:extended": "HARDHAT_NETWORK=optimismMainnet ts-node deployments/notifyRewardAmount/optimism/givpower_distribute_extended.js", - "distributor:optimismMainnet:givPower:extended:oct2023": "HARDHAT_NETWORK=optimismMainnet ts-node deployments/notifyRewardAmount/optimism/givpower_distribute_extended_oct_2023.js", - "distributor:mainnet:extended": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/distributor_extended.js", - "distributor:mainnet:extended2": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/distributor_extended2.js", - "distributor:kovan:extended": "HARDHAT_NETWORK=kovan ts-node deployments/notifyRewardAmount/mainnet/distributor_extended.js", - "distributor:kovan:angelVault": "HARDHAT_NETWORK=kovan ts-node deployments/notifyRewardAmount/mainnet/giveth_angel_vault_distributor.js", - "distributor:mainnet:angelVault": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/giveth_angel_vault_distributor.js", - "deploy:GardenUnipool:xDAI": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=xDAI ts-node scripts/deployGardenUnipool.js", - "upgrade:GardenUnipool:xDAI": "HARDHAT_NETWORK=xDAI ts-node scripts/upgradeGardenUnipool.js", - "deploy:unipool:kovan": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=kovan ts-node scripts/deployUnipool.js 0x2C84Ab41b53C52959a794830fe296Fd717c33337 0x6D5481911052a42c109F1f56354BEB07Ec430b85 750000", - "deploy:unipool:mainnet": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=mainnet ts-node scripts/deployUnipool.js 0x87dE995F6744B75bBe0255A973081142aDb61f4d 0xbeba1666c62c65e58770376de332891b09461eeb 750000", - "upgrade:TokenDistro:xDAI": "HARDHAT_NETWORK=xDAI ts-node scripts/upgradeTokenDistro.js", - "distributor:xDAI:regen_fox": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/fox_regen_distribute.js", - "distributor:xDAI:regen_fox_dai": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/fox_dai_regen_distribute.js", - "distributor:xDAI:regen_fox_dai:extended": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/fox_dai_regen_distribute_extended.js", - "distributor:mainnet:regen_cult": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/cult_regen_distribute.js" - }, - "pre-commit": [ - "prettier:sol" - ], - "devDependencies": { - "@nomiclabs/hardhat-ethers": "^2.0.2", - "@nomiclabs/hardhat-etherscan": "^2.1.3", - "@nomiclabs/hardhat-waffle": "^2.0.1", - "@openzeppelin/contracts": "3.4.1-solc-0.7-2", - "@openzeppelin/hardhat-upgrades": "^1.9.0", - "@typechain/ethers-v5": "^8.0.2", - "@typechain/hardhat": "^3.0.0", - "@types/chai": "^4.2.22", - "@types/ethereumjs-util": "^6.1.0", - "@types/mocha": "^5.2.7", - "@types/node": "^16.11.7", - "@typescript-eslint/eslint-plugin": "^5.3.1", - "@typescript-eslint/parser": "^5.3.1", - "@uniswap/v3-core": "1.0.0", - "@uniswap/v3-periphery": "1.0.1", - "chai": "^4.2.0", - "commander": "^8.0.0", - "console-log-level": "^1.4.1", - "dotenv": "^8.2.0", - "eslint": "^7.28.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.24.2", - "eslint-plugin-prettier": "^4.0.0", - "ethereum-waffle": "^3.3.0", - "ethereumjs-util": "^7.1.0", - "ethers": "^5.4.1", - "hardhat": "^2.4.1", - "hardhat-gas-reporter": "^1.0.4", - "mocha-chai-jest-snapshot": "^1.1.3", - "openzeppelin-contracts-upgradable-v4": "npm:@openzeppelin/contracts-upgradeable@^4.1.0", - "openzeppelin-contracts-v4": "npm:@openzeppelin/contracts@^4.0.0", - "prettier": "^2.4.1", - "prettier-plugin-solidity": "^1.0.0-beta.18", - "solidity-coverage": "^0.7.16", - "ts-node": "^8.5.4", - "typechain": "^6.0.2", - "typescript": "^4.4.4" - }, - "license": "GPL-3.0", - "dependencies": { - "axios": "^1.0.0", - "moment": "^2.29.4" - } + "name": "hardhat-project", + "scripts": { + "prettier:sol": "prettier --write 'contracts/**/*.sol'", + "compile": "hardhat compile", + "clear-cache": "rm -rf artifacts/ cache/ typechain-types/ .openzeppelin/", + "clear-proxy-contract-cache": "rm -rf .openzeppelin/", + "test": "hardhat test", + "csv2json": "ts-node scripts/csv2json.ts ./files/GIV_tokens_-_AIRDROP_TEST_LIST.csv ./files/merkle_distributor_xdai.json", + "generate-merkle-root": "ts-node scripts/generate-merkle-root.ts --input ./files/merkle_distributor_xdai.json --output ./files/merkle_distributor_xdai_result.json", + "deploy:local": "yarn clear-proxy-contract-cache && ts-node deployments/xDAI/1_tokenDistro_merkleDistro_Unipool.js 1628935200 0x6F45aFf8c1e50DB099DAb43292C28240be2b7485 920000000 0xb3c4538b9413522c25e18ba1095f43ca780813f2 1200000 0x8fb2d187eba62970c13d0037304260b9fef721c5 250000 500000", + "deploy:rinkeby": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=rinkeby ts-node deployments/xDAI/1_tokenDistro_merkleDistro_Unipool.js 1632830400 0x6F45aFf8c1e50DB099DAb43292C28240be2b7485 920000000 0xb3c4538b9413522c25e18ba1095f43ca780813f2 1200000 0x8fb2d187eba62970c13d0037304260b9fef721c5 250000 500000", + "deploy:xDAI": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=xDAI ts-node deployments/xDAI/1_tokenDistro_merkleDistro_Unipool.js 1640361600 0x4f4F9b8D5B4d0Dc10506e5551B0513B61fD59e75 2000000000 0x08ea9f608656A4a775EF73f5B187a2F1AE2ae10e 10000000 0x55FF0cef43F0DF88226E9D87D09fA036017F5586 2500000 0x24f2d06446af8d6e89febc205e7936a602a87b60 7500000", + "deploy:regenFarms:xdai": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=xDAI ts-node deployments/regenFarms/1_regenFarm.ts", + "deploy:regenFarms:kovan": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=kovan ts-node deployments/regenFarms/1_regenFarm.ts", + "deploy:regenFarms:mainnet": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=mainnet ts-node deployments/regenFarms/1_regenFarm.ts", + "deploy:local:2": "yarn clear-proxy-contract-cache && ts-node deployments/mainnet/2_tokenDistro_Unipools.js 1628935200 0x86B94D365c94De153d6023f243c2b6e6c6c7626C 80000000 0x8A094453df88D5D6B27162F949898e2d95462f80 1100000 0x632045A9CFa9d232d0dd46702033C850D0E06f0F 200000 200000", + "deploy:kovan": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=kovan ts-node deployments/mainnet/2_tokenDistro_Unipools.js 1640272200 0x29434A25abd94AE882aA883eea81585Aaa5b078D 2000000000 0x3c2455a3ee0d824941c9329c01a66b86078c3e82 10000000 0x8a6b25e33b12d1bb6929a8793961076bd1f9d3eb 2500000 2500000", + "deploy:mainnet": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=mainnet ts-node deployments/mainnet/2_tokenDistro_Unipools.js 1640361600 0x900db999074d9277c5da2a43f252d74366230da0 2000000000 0xc763b6b3d0f75167db95daa6a0a0d75dd467c4e1 10000000 0x7819f1532c49388106f7762328c51ee70edd134c 2500000 2500000", + "distributor:rinkeby": "HARDHAT_NETWORK=rinkeby ts-node deployments/notifyRewardAmount/xDAI/distributor.js", + "distributor:xDAI": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/distributor.js", + "distributor:mainnet": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/distributor.js", + "distributor:kovan": "HARDHAT_NETWORK=kovan ts-node deployments/notifyRewardAmount/mainnet/distributor.js", + "distributor:xDAI:extended": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/distributor_extended.js", + "distributor:xDAI:extended2": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/distributor_extended2.js", + "distributor:xDAI:givPower": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/givpower_distribute.js", + "distributor:xDAI:givPower:extended": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/givpower_distribute_extended.js", + "distributor:xDAI:givPower:extended:oct2023": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/givpower_distribute_extended_oct_2023.js", + "distributor:optimismMainnet:givPower:extended": "HARDHAT_NETWORK=optimismMainnet ts-node deployments/notifyRewardAmount/optimism/givpower_distribute_extended.js", + "distributor:optimismMainnet:givPower:extended:oct2023": "HARDHAT_NETWORK=optimismMainnet ts-node deployments/notifyRewardAmount/optimism/givpower_distribute_extended_oct_2023.js", + "distributor:optimismMainnet:givPower:extended:apr2024": "HARDHAT_NETWORK=optimismMainnet ts-node deployments/notifyRewardAmount/optimism/givpower_distribute_extended_apr_2024.js", + "distributor:mainnet:extended": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/distributor_extended.js", + "distributor:mainnet:extended2": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/distributor_extended2.js", + "distributor:kovan:extended": "HARDHAT_NETWORK=kovan ts-node deployments/notifyRewardAmount/mainnet/distributor_extended.js", + "distributor:kovan:angelVault": "HARDHAT_NETWORK=kovan ts-node deployments/notifyRewardAmount/mainnet/giveth_angel_vault_distributor.js", + "distributor:mainnet:angelVault": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/giveth_angel_vault_distributor.js", + "deploy:GardenUnipool:xDAI": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=xDAI ts-node scripts/deployGardenUnipool.js", + "upgrade:GardenUnipool:xDAI": "HARDHAT_NETWORK=xDAI ts-node scripts/upgradeGardenUnipool.js", + "deploy:unipool:kovan": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=kovan ts-node scripts/deployUnipool.js 0x2C84Ab41b53C52959a794830fe296Fd717c33337 0x6D5481911052a42c109F1f56354BEB07Ec430b85 750000", + "deploy:unipool:mainnet": "yarn clear-proxy-contract-cache && HARDHAT_NETWORK=mainnet ts-node scripts/deployUnipool.js 0x87dE995F6744B75bBe0255A973081142aDb61f4d 0xbeba1666c62c65e58770376de332891b09461eeb 750000", + "upgrade:TokenDistro:xDAI": "HARDHAT_NETWORK=xDAI ts-node scripts/upgradeTokenDistro.js", + "distributor:xDAI:regen_fox": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/fox_regen_distribute.js", + "distributor:xDAI:regen_fox_dai": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/fox_dai_regen_distribute.js", + "distributor:xDAI:regen_fox_dai:extended": "HARDHAT_NETWORK=xDAI ts-node deployments/notifyRewardAmount/xDAI/fox_dai_regen_distribute_extended.js", + "distributor:mainnet:regen_cult": "HARDHAT_NETWORK=mainnet ts-node deployments/notifyRewardAmount/mainnet/cult_regen_distribute.js" + }, + "pre-commit": [ + "prettier:sol" + ], + "devDependencies": { + "@nomiclabs/hardhat-ethers": "^2.0.2", + "@nomiclabs/hardhat-etherscan": "^2.1.3", + "@nomiclabs/hardhat-waffle": "^2.0.1", + "@openzeppelin/contracts": "3.4.1-solc-0.7-2", + "@openzeppelin/hardhat-upgrades": "^1.9.0", + "@typechain/ethers-v5": "^8.0.2", + "@typechain/hardhat": "^3.0.0", + "@types/chai": "^4.2.22", + "@types/ethereumjs-util": "^6.1.0", + "@types/mocha": "^5.2.7", + "@types/node": "^16.11.7", + "@typescript-eslint/eslint-plugin": "^5.3.1", + "@typescript-eslint/parser": "^5.3.1", + "@uniswap/v3-core": "1.0.0", + "@uniswap/v3-periphery": "1.0.1", + "chai": "^4.2.0", + "commander": "^8.0.0", + "console-log-level": "^1.4.1", + "dotenv": "^8.2.0", + "eslint": "^7.28.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-import": "^2.24.2", + "eslint-plugin-prettier": "^4.0.0", + "ethereum-waffle": "^3.3.0", + "ethereumjs-util": "^7.1.0", + "ethers": "^5.4.1", + "hardhat": "^2.4.1", + "hardhat-gas-reporter": "^1.0.4", + "mocha-chai-jest-snapshot": "^1.1.3", + "openzeppelin-contracts-upgradable-v4": "npm:@openzeppelin/contracts-upgradeable@^4.1.0", + "openzeppelin-contracts-v4": "npm:@openzeppelin/contracts@^4.0.0", + "prettier": "^2.4.1", + "prettier-plugin-solidity": "^1.0.0-beta.18", + "solidity-coverage": "^0.7.16", + "ts-node": "^8.5.4", + "typechain": "^6.0.2", + "typescript": "^4.4.4" + }, + "license": "GPL-3.0", + "dependencies": { + "axios": "^1.0.0", + "moment": "^2.29.4" + } }