diff --git a/package.json b/package.json index 92a83a50..d18fb1c8 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "npx hardhat node --network hardhat", "test": "npx hardhat test --network hardhat", - "deploy": "ts-node --files scripts/test/deploy-test-contracts.ts && ts-node --files scripts/core/deploy-core.ts && ts-node --files scripts/linkStaking/deploy-link-staking-pool.ts && ts-node --files scripts/governance/deploy-governance-controller.ts && ts-node --files scripts/airdrop/deploy-merkle-distributor.ts && ts-node --files scripts/liquidSDIndex/deploy-ixETH-index-pool.ts && ts-node --files scripts/governance/deploy-stakedotlink-council.ts", + "deploy": "ts-node --files scripts/test/deploy/deploy.ts", "geth-dev-fund": "ts-node --files scripts/test/geth-dev-fund.ts", "start-test-env": "node scripts/test/start-test-envs.js", "setup-test-env": "ts-node --files scripts/test/setup-test-env.ts", diff --git a/scripts/core/deploy-core.ts b/scripts/core/deploy-core.ts deleted file mode 100644 index 8bb8aa52..00000000 --- a/scripts/core/deploy-core.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { ERC677 } from '../../typechain-types' -import { updateDeployments, deploy, getContract, deployUpgradeable } from '../utils/deployment' - -// SDL Token -const StakingAllowance = { - name: 'stake.link', // SDL token name - symbol: 'SDL', // SDL token symbol -} -// Delegator Pool (deprecated) -const DelegatorPool = { - derivativeTokenName: 'Staked SDL', // SDL staking derivative token name - derivativeTokenSymbol: 'stSDL', // SDL staking derivative token symbol -} -// Linear Boost Controller -const LinearBoostController = { - maxLockingDuration: 4 * 365 * 86400, // maximum locking duration - maxBoost: 8, // maximum boost amount -} -// SDL Pool -const SDLPool = { - derivativeTokenName: 'Reward Escrowed SDL', // SDL staking derivative token name - derivativeTokenSymbol: 'reSDL', // SDL staking derivative token symbol -} - -async function main() { - const lplToken = (await getContract('LPLToken')) as ERC677 - - const sdlToken = await deploy('StakingAllowance', [ - StakingAllowance.name, - StakingAllowance.symbol, - ]) - console.log('SDLToken deployed: ', sdlToken.address) - - const lplMigration = await deploy('LPLMigration', [lplToken.address, sdlToken.address]) - console.log('LPLMigration deployed: ', lplMigration.address) - - const delegatorPool = await deployUpgradeable('DelegatorPool', [ - sdlToken.address, - DelegatorPool.derivativeTokenName, - DelegatorPool.derivativeTokenSymbol, - [], - ]) - console.log('DelegatorPool deployed: ', delegatorPool.address) - - const lbc = await deploy('LinearBoostController', [ - LinearBoostController.maxLockingDuration, - LinearBoostController.maxBoost, - ]) - console.log('LinearBoostController deployed: ', lbc.address) - - const sdlPool = await deployUpgradeable('SDLPool', [ - SDLPool.derivativeTokenName, - SDLPool.derivativeTokenSymbol, - sdlToken.address, - lbc.address, - delegatorPool.address, - ]) - console.log('SDLPool deployed: ', sdlPool.address) - - updateDeployments( - { - SDLToken: sdlToken.address, - LPLMigration: lplMigration.address, - DelegatorPool: delegatorPool.address, - LinearBoostController: lbc.address, - SDLPool: sdlPool.address, - }, - { SDLToken: 'StakingAllowance' } - ) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/core/upgrade-contract.ts b/scripts/core/upgrade-contract.ts deleted file mode 100644 index e50ba22b..00000000 --- a/scripts/core/upgrade-contract.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { program } from 'commander' -import { getContract, upgradeProxy } from '../utils/deployment' - -async function main() { - program - .version('0.0.0') - .requiredOption('--deployment ', 'input name of deployment') - .requiredOption( - '--implementation ', - 'input name of new implementation contract' - ) - - program.parse(process.argv) - const opts = program.opts() - - const contract = await getContract(opts.deployment) - await upgradeProxy(contract.address, opts.implementation) - - console.log(opts.deployment, 'upgraded to current version of', opts.implementation) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/governance/deploy-governance-controller.ts b/scripts/governance/deploy-governance-controller.ts deleted file mode 100644 index d355433b..00000000 --- a/scripts/governance/deploy-governance-controller.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { updateDeployments, deploy } from '../utils/deployment' - -async function main() { - const governanceController = await deploy('GovernanceController') - console.log('GovernanceController deployed: ', governanceController.address) - - updateDeployments({ - GovernanceController: governanceController.address, - }) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/governance/setup-governance-controller.ts b/scripts/governance/setup-governance-controller.ts deleted file mode 100644 index 39414a2b..00000000 --- a/scripts/governance/setup-governance-controller.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { Interface } from 'ethers/lib/utils' -import { GovernanceController } from '../../typechain-types' -import { getContract } from '../utils/deployment' - -const feeFunctions = ['addFee(address,uint256)', 'updateFee(uint256,address,uint256)'] -const upgradeFunctions = ['upgradeTo(address)', 'upgradeToAndCall(address,bytes)'] -const ownableFunctions = ['transferOwnership(address)'] -const vcsFunctions = [ - 'migrateVaults(uint256,uint256,bytes)', - 'upgradeVaults(uint256,uint256,bytes)', - 'setMinDepositThreshold(uint256)', - 'setVaultImplementation(address)', - ...upgradeFunctions, - ...ownableFunctions, - ...feeFunctions, -] - -export const roles = [ - { - name: 'DAO', - members: ['0xB351EC0FEaF4B99FdFD36b484d9EC90D0422493D'], - contractNames: [ - 'SDLToken', - 'DelegatorPool', - 'FlatFee', - 'PoolRouter', - 'LINK_StakingPool', - 'LINK_OperatorVCS', - 'LINK_CommunityVCS', - ], - functions: [ - [ - 'mint(address,uint256)', - 'mintToContract(address,address,uint256,bytes)', - ...ownableFunctions, - ], - [ - 'addToken(address,address)', - 'removeToken(address)', - 'setFeeCurve(address)', - ...upgradeFunctions, - ...ownableFunctions, - ], - ['setFeeBasisPoints(uint256)', ...ownableFunctions], - [ - 'addPool(address,address,uint8,bool)', - 'removePool(address,uint16)', - 'setPoolStatus(address,uint16,uint8)', - 'setPoolStatusClosed(address,uint16)', - 'setReservedModeActive(address,uint16,bool)', - 'setReservedSpaceMultiplier(uint256)', - ...upgradeFunctions, - ...ownableFunctions, - ], - [ - 'strategyDeposit(uint256,uint256)', - 'strategyWithdraw(uint256,uint256)', - 'addStrategy(address)', - 'removeStrategy(uint256)', - 'reorderStrategies(uint256[])', - 'setLiquidityBuffer(uint256)', - ...upgradeFunctions, - ...ownableFunctions, - ...feeFunctions, - ], - ['addVault(address)', 'setOperator(uint256,address)', ...vcsFunctions], - ['setMaxDeposits(uint256)', 'setMaxVaultDeployments(uint256)', ...vcsFunctions], - ], - }, - { - name: 'LinkPool', - members: ['0x6879826450e576B401c4dDeff2B7755B1e85d97c'], - contractNames: ['PoolRouter'], - functions: [['setPoolStatus(address,uint16,uint8)', 'setWrappedETH(address)']], - }, -] - -async function main() { - const governanceController = (await getContract('GovernanceController')) as GovernanceController - - for (let i = 0; i < roles.length; i++) { - const role = roles[i] - const contracts = [] - const selectors: any = [] - - for (let j = 0; j < role.contractNames.length; j++) { - const functions = role.functions[j] - const contract = await getContract(role.contractNames[j]) - const iface = contract.interface as Interface - contracts.push(contract.address) - selectors.push([]) - - for (let k = 0; k < functions.length; k++) { - selectors[j].push(iface.getSighash(functions[k])) - } - } - - let tx = await governanceController.addRole(role.name, role.members, contracts, selectors) - await tx.wait() - console.log(role.name, 'role added') - } - - const contractNames = roles[0].contractNames - for (let i = 0; i < contractNames.length; i++) { - const contract = await getContract(contractNames[i]) - let tx = await contract.transferOwnership(governanceController.address) - await tx.wait() - } - console.log('Ownership transferred to GovernanceController for all contracts') -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/linkStaking/deploy-community-vcs.ts b/scripts/linkStaking/deploy-community-vcs.ts deleted file mode 100644 index ba2715f5..00000000 --- a/scripts/linkStaking/deploy-community-vcs.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { ERC677, StakingPool } from '../../typechain-types' -import { - deployUpgradeable, - deployImplementation, - getContract, - updateDeployments, -} from '../utils/deployment' - -// Community Vault Controller Strategy -const stakeController = '0x3feB1e09b4bb0E7f0387CeE092a52e85797ab889' // address of Chainlink staking contract -const minDepositThreshold = 1000 // minimum deposits required to initiate a deposit -const fees: any = [] // fee receivers & percentage amounts in basis points -const maxDeposits = 5000000 // maximum amount of deposits that can be deposited into this contract -const maxVaultDeployments = 10 // maximum number of vaults that can be deployed at once - -async function main() { - const linkToken = (await getContract('LINKToken')) as ERC677 - const stakingPool = (await getContract('LINK_StakingPool')) as StakingPool - - const vaultImpAddress = await deployImplementation('CommunityVault') - console.log('CommunityVault implementation deployed: ', vaultImpAddress) - - const communityVCS = await deployUpgradeable('CommunityVCS', [ - linkToken.address, - stakingPool.address, - stakeController, - vaultImpAddress, - minDepositThreshold, - fees, - maxDeposits, - maxVaultDeployments, - ]) - console.log('CommunityVCS deployed: ', communityVCS.address) - - let tx = await stakingPool.addStrategy(communityVCS.address) - await tx.wait() - console.log('CommunityVCS added to StakingPool') - - updateDeployments( - { LINK_CommunityVCS: communityVCS.address }, - { LINK_CommunityVCS: 'CommunityVCS' } - ) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/linkStaking/deploy-link-staking-pool.ts b/scripts/linkStaking/deploy-link-staking-pool.ts deleted file mode 100644 index 8f9809c4..00000000 --- a/scripts/linkStaking/deploy-link-staking-pool.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { ERC677, SDLPool } from '../../typechain-types' -import { updateDeployments, deploy, getContract, deployUpgradeable } from '../utils/deployment' -import { toEther } from '../utils/helpers' - -// LINK Wrapped Staking Derivative Token -const LINK_WrappedSDToken = { - name: 'Wrapped stLINK', // wrapped staking derivative token name - symbol: 'wstLINK', // wrapped staking derivative token symbol -} -// LINK Staking Pool -const LINK_StakingPool = { - derivativeTokenName: 'Staked LINK', // LINK staking derivative token name - derivativeTokenSymbol: 'stLINK', // LINK staking derivative token symbol - fees: [['0x6879826450e576B401c4dDeff2B7755B1e85d97c', 300]], // fee receivers & percentage amounts in basis points -} -// LINK Priority Pool -const LINK_PriorityPool = { - queueDepositMin: toEther(1000), // min amount of tokens neede to execute deposit - queueDepositMax: toEther(200000), // max amount of tokens in a single deposit tx} -} - -async function main() { - const linkToken = (await getContract('LINKToken')) as ERC677 - const sdlPool = (await getContract('SDLPool')) as SDLPool - - const stakingPool = await deployUpgradeable('StakingPool', [ - linkToken.address, - LINK_StakingPool.derivativeTokenName, - LINK_StakingPool.derivativeTokenSymbol, - LINK_StakingPool.fees, - ]) - console.log('LINK_StakingPool deployed: ', stakingPool.address) - - const priorityPool = await deployUpgradeable('PriorityPool', [ - linkToken.address, - stakingPool.address, - sdlPool.address, - LINK_PriorityPool.queueDepositMin, - LINK_PriorityPool.queueDepositMax, - ]) - console.log('LINK_PriorityPool deployed: ', priorityPool.address) - - const wsdToken = await deploy('WrappedSDToken', [ - stakingPool.address, - LINK_WrappedSDToken.name, - LINK_WrappedSDToken.symbol, - ]) - console.log('LINK_WrappedSDToken token deployed: ', wsdToken.address) - - const stLinkSDLRewardsPool = await deploy('RewardsPoolWSD', [ - sdlPool.address, - stakingPool.address, - wsdToken.address, - ]) - console.log('stLINK_SDLRewardsPool deployed: ', stLinkSDLRewardsPool.address) - - let tx = await sdlPool.addToken(stakingPool.address, stLinkSDLRewardsPool.address) - await tx.wait() - tx = await stakingPool.setPriorityPool(priorityPool.address) - await tx.wait() - - updateDeployments( - { - LINK_StakingPool: stakingPool.address, - LINK_PriorityPool: priorityPool.address, - LINK_WrappedSDToken: wsdToken.address, - stLINK_SDLRewardsPool: stLinkSDLRewardsPool.address, - }, - { - LINK_StakingPool: 'StakingPool', - LINK_PriorityPool: 'PriorityPool', - LINK_WrappedSDToken: 'WrappedSDToken', - stLINK_SDLRewardsPool: 'RewardsPoolWSD', - } - ) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/linkStaking/deploy-operator-vcs.ts b/scripts/linkStaking/deploy-operator-vcs.ts deleted file mode 100644 index 3295237e..00000000 --- a/scripts/linkStaking/deploy-operator-vcs.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { ethers } from 'hardhat' -import { ERC677, OperatorVCS, StakingPool } from '../../typechain-types' -import { - deployUpgradeable, - deployImplementation, - getContract, - updateDeployments, -} from '../utils/deployment' - -// Operator Vault Controller Strategy -const stakeController = '0x3feB1e09b4bb0E7f0387CeE092a52e85797ab889' // address of Chainlink staking contract -const minDepositThreshold = 1000 // minimum deposits required to initiate a deposit -const fees: any = [] // fee receivers & percentage amounts in basis points -const vaultOperatorAddresses = [ - ethers.constants.AddressZero, - '0xb621221D9850a93C67557F0B24b2483CAc4ce4b1', - '0x03384EbdBA3d5D5672e8e26fa0F13DaFBCE5DaBA', - '0x41fD547a85B1297062bcD53382D8aa65Df70be13', - ethers.constants.AddressZero, - '0x1f0C1Bf875dD8aA8A5241f146158ec9eBa9194B1', - '0x58489C36ec720545af7D00F66BB78e26Da2B437D', - '0x98DD2dC401738c956bfFeB4aB8F917B57ec950b6', - '0xf3E40Cc653AdAB93529E889eB9395E3AA83DBfF6', - '0xE0DC1892943346b17E17a851CF6b9081f8c60070', - '0x8895CBD81761B8f2379347d020D42A729F334747', - '0x3065cb429E9ABbaF0186343720fEd2991B2ee23E', - ethers.constants.AddressZero, - '0x4fbefaf1bff0130945c61603b97d38dd6e21f5cf', - '0x575c93EC9990bb87B9716e5CFf7d446a0A789817', -] // list of operator addresses that correspond to each vault - -async function main() { - const linkToken = (await getContract('LINKToken')) as ERC677 - const stakingPool = (await getContract('LINK_StakingPool')) as StakingPool - - const vaultImpAddress = (await deployImplementation('OperatorVault')) as string - - console.log('OperatorVault implementation deployed: ', vaultImpAddress) - - const operatorVCS = (await deployUpgradeable('OperatorVCS', [ - linkToken.address, - stakingPool.address, - stakeController, - vaultImpAddress, - minDepositThreshold, - fees, - [], - ])) as OperatorVCS - console.log('OperatorVCS deployed: ', operatorVCS.address) - updateDeployments({ LINK_OperatorVCS: operatorVCS.address }, { LINK_OperatorVCS: 'OperatorVCS' }) - - let tx = await stakingPool.addStrategy(operatorVCS.address) - await tx.wait() - console.log('OperatorVCS added to StakingPool') - - for (let i = 0; i < vaultOperatorAddresses.length; i++) { - tx = await operatorVCS.addVault(vaultOperatorAddresses[i]) - await tx.wait() - console.log('Vault with operator address', vaultOperatorAddresses[i], 'created') - } -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/linkStaking/deposit-operator-vcs.ts b/scripts/linkStaking/deposit-operator-vcs.ts deleted file mode 100644 index eba54582..00000000 --- a/scripts/linkStaking/deposit-operator-vcs.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { OperatorVCS } from '../../typechain-types' -import { getContract } from '../utils/deployment' - -async function main() { - const operatorVCS = (await getContract('LINK_OperatorVCS')) as OperatorVCS - - let checkUpkeep = await operatorVCS.checkUpkeep('0x') - - let tx = await operatorVCS.depositBufferedTokens(checkUpkeep[1]) - await tx.wait() -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/liquidSDIndex/deploy-cbETH-sfrxETH-adapters.ts b/scripts/liquidSDIndex/deploy-cbETH-sfrxETH-adapters.ts deleted file mode 100644 index a0f186f8..00000000 --- a/scripts/liquidSDIndex/deploy-cbETH-sfrxETH-adapters.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { ERC20, LiquidSDIndexPool } from '../../typechain-types' -import { deployUpgradeable, getContract, updateDeployments } from '../utils/deployment' - -const compositionTargetsCBETH = [5200, 1800, 3000] // basis point index composition targets [stETH,rETH, cbETH] -const compositionTargetsSFRXETH = [4600, 1600, 2700, 1100] // basis point index composition targets [stETH,rETH, cbETH, sfrxETH] - -async function main() { - const ixETHIndexPool = (await getContract('ETH_LiquidSDIndexPool')) as LiquidSDIndexPool - const cbETHToken = (await getContract('cbETHToken')) as ERC20 - const sfrxETHToken = (await getContract('sfrxETHToken')) as ERC20 - - const coinbaseAdapter = await deployUpgradeable('CoinbaseLSDIndexAdapter', [ - cbETHToken.address, - ixETHIndexPool.address, - ]) - console.log('ixETH_CoinbaseLSDIndexAdapter deployed: ', coinbaseAdapter.address) - - const fraxPoolAdapter = await deployUpgradeable('FraxLSDIndexAdapter', [ - sfrxETHToken.address, - ixETHIndexPool.address, - ]) - console.log('ixETH_FraxLSDIndexAdapter deployed: ', fraxPoolAdapter.address) - - let tx = await ixETHIndexPool.addLSDToken( - cbETHToken.address, - coinbaseAdapter.address, - compositionTargetsCBETH - ) - await tx.wait() - console.log('CoinbaseLSDIndexAdapter added to ETH_LiquidSDIndexPool') - - tx = await ixETHIndexPool.addLSDToken( - sfrxETHToken.address, - fraxPoolAdapter.address, - compositionTargetsSFRXETH - ) - await tx.wait() - console.log('FraxLSDIndexAdapter added to ETH_LiquidSDIndexPool') - - updateDeployments( - { - ixETH_CoinbaseLSDIndexAdapter: coinbaseAdapter.address, - ixETH_FraxLSDIndexAdapter: fraxPoolAdapter.address, - }, - { - ixETH_CoinbaseLSDIndexAdapter: 'CoinbaseLSDIndexAdapter', - ixETH_FraxLSDIndexAdapter: 'FraxLSDIndexAdapter', - } - ) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/liquidSDIndex/deploy-ixETH-adapters.ts b/scripts/liquidSDIndex/deploy-ixETH-adapters.ts deleted file mode 100644 index 445d95cf..00000000 --- a/scripts/liquidSDIndex/deploy-ixETH-adapters.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { ERC20, LiquidSDIndexPool } from '../../typechain-types' -import { deployUpgradeable, getContract, updateDeployments } from '../utils/deployment' - -const compositionTargets = [7500, 2500] // basis point index composition targets [stETH,rETH] - -async function main() { - const ixETHIndexPool = (await getContract('ETH_LiquidSDIndexPool')) as LiquidSDIndexPool - const stETHToken = (await getContract('stETHToken')) as ERC20 - const rETHToken = (await getContract('rETHToken')) as ERC20 - - const lidoAdapter = await deployUpgradeable('LidoLSDIndexAdapter', [ - stETHToken.address, - ixETHIndexPool.address, - ]) - console.log('ixETH_LidoLSDIndexAdapter deployed: ', lidoAdapter.address) - - const rocketPoolAdapter = await deployUpgradeable('RocketPoolLSDIndexAdapter', [ - rETHToken.address, - ixETHIndexPool.address, - ]) - console.log('ixETH_RocketPoolLSDIndexAdapter deployed: ', rocketPoolAdapter.address) - - let tx = await ixETHIndexPool.addLSDToken(stETHToken.address, lidoAdapter.address, [10000]) - await tx.wait() - console.log('LidoLSDIndexAdapter added to ETH_LiquidSDIndexPool') - - tx = await ixETHIndexPool.addLSDToken( - rETHToken.address, - rocketPoolAdapter.address, - compositionTargets - ) - await tx.wait() - console.log('RocketPoolLSDIndexAdapter added to ETH_LiquidSDIndexPool') - - updateDeployments( - { - ixETH_LidoLSDIndexAdapter: lidoAdapter.address, - ixETH_RocketPoolLSDIndexAdapter: rocketPoolAdapter.address, - }, - { - ixETH_LidoLSDIndexAdapter: 'LidoLSDIndexAdapter', - ixETH_RocketPoolLSDIndexAdapter: 'RocketPoolLSDIndexAdapter', - } - ) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/liquidSDIndex/deploy-ixETH-index-pool.ts b/scripts/liquidSDIndex/deploy-ixETH-index-pool.ts deleted file mode 100644 index f43ad6d2..00000000 --- a/scripts/liquidSDIndex/deploy-ixETH-index-pool.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { updateDeployments, deployUpgradeable, deploy } from '../utils/deployment' -import { toEther } from '../utils/helpers' -import { LiquidSDIndexPool } from '../../typechain-types' - -// ETH LSD Index (ixETH) -const ETH_LSDIndexPool = { - name: 'Staked ETH Index', // index token name - symbol: 'ixETH', // index token symbol - compositionTolerance: 5000, // percentage swing that any lsd can have from its composition target in either direction - compositionEnforcementThreshold: 500, // total amount of deposits required for composition targets to be enforced - fees: [['0xB351EC0FEaF4B99FdFD36b484d9EC90D0422493D', 25]], // fee receivers & percentage amounts in basis points - withdrawalFee: 100, // withdrawal fee that goes to ixETH holders -} -// Wrapped ixETH -const ixETH_WrappedSDToken = { - derivativeTokenName: 'Wrapped ixETH', // Wrapped ixETH token name - derivativeTokenSymbol: 'wixETH', // Wrapped ixETH token symbol -} - -async function main() { - const indexPool = (await deployUpgradeable('LiquidSDIndexPool', [ - ETH_LSDIndexPool.name, - ETH_LSDIndexPool.symbol, - ETH_LSDIndexPool.compositionTolerance, - toEther(ETH_LSDIndexPool.compositionEnforcementThreshold), - ETH_LSDIndexPool.fees, - ETH_LSDIndexPool.withdrawalFee, - ])) as LiquidSDIndexPool - console.log('ETH_LiquidSDIndexPool deployed: ', indexPool.address) - - const wsdToken = await deploy('WrappedSDToken', [ - indexPool.address, - ixETH_WrappedSDToken.derivativeTokenName, - ixETH_WrappedSDToken.derivativeTokenSymbol, - ]) - console.log('ixETH_WrappedSDToken token deployed: ', wsdToken.address) - - updateDeployments( - { - ixETH_WrappedSDToken: wsdToken.address, - ETH_LiquidSDIndexPool: indexPool.address, - }, - { - ixETH_WrappedSDToken: 'WrappedSDToken', - ETH_LiquidSDIndexPool: 'LiquidSDIndexPool', - } - ) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/governance/deploy-stakedotlink-council.ts b/scripts/prod/deploy-stakedotlink-council.ts similarity index 100% rename from scripts/governance/deploy-stakedotlink-council.ts rename to scripts/prod/deploy-stakedotlink-council.ts diff --git a/scripts/test/deploy/deploy.ts b/scripts/test/deploy/deploy.ts new file mode 100644 index 00000000..b4130411 --- /dev/null +++ b/scripts/test/deploy/deploy.ts @@ -0,0 +1,23 @@ +import fs from 'fs' +import { deployCore } from './modules/deploy-core' +import { deployLINKStaking } from './modules/deploy-link-staking' +import { deployTestContracts } from './modules/deploy-test-contracts' + +const path = './deployments/localhost.json' + +async function main() { + if (fs.existsSync(path)) { + fs.unlinkSync(path) + } + + await deployTestContracts() + await deployCore() + await deployLINKStaking() +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error) + process.exit(1) + }) diff --git a/scripts/test/deploy/modules/deploy-core.ts b/scripts/test/deploy/modules/deploy-core.ts new file mode 100644 index 00000000..884d5550 --- /dev/null +++ b/scripts/test/deploy/modules/deploy-core.ts @@ -0,0 +1,59 @@ +import { ERC677 } from '../../../../typechain-types' +import { + updateDeployments, + deploy, + getContract, + deployUpgradeable, +} from '../../../utils/deployment' + +// SDL Token +const SDLTokenArgs = { + name: 'stake.link', // SDL token name + symbol: 'SDL', // SDL token symbol +} +// Linear Boost Controller +const LinearBoostControllerArgs = { + minLockingDuration: 86400, // minimum locking duration + maxLockingDuration: 4 * 365 * 86400, // maximum locking duration + maxBoost: 8, // maximum boost amount +} +// SDL Pool Primary +const SDLPoolPrimaryArgs = { + derivativeTokenName: 'Reward Escrowed SDL', // SDL staking derivative token name + derivativeTokenSymbol: 'reSDL', // SDL staking derivative token symbol +} + +export async function deployCore() { + const lplToken = (await getContract('LPLToken')) as ERC677 + + const sdlToken = await deploy('StakingAllowance', [SDLTokenArgs.name, SDLTokenArgs.symbol]) + console.log('SDLToken deployed: ', sdlToken.address) + + const lplMigration = await deploy('LPLMigration', [lplToken.address, sdlToken.address]) + console.log('LPLMigration deployed: ', lplMigration.address) + + const lbc = await deploy('LinearBoostController', [ + LinearBoostControllerArgs.minLockingDuration, + LinearBoostControllerArgs.maxLockingDuration, + LinearBoostControllerArgs.maxBoost, + ]) + console.log('LinearBoostController deployed: ', lbc.address) + + const sdlPoolPrimary = await deployUpgradeable('SDLPoolPrimary', [ + SDLPoolPrimaryArgs.derivativeTokenName, + SDLPoolPrimaryArgs.derivativeTokenSymbol, + sdlToken.address, + lbc.address, + ]) + console.log('SDLPoolPrimary deployed: ', sdlPoolPrimary.address) + + updateDeployments( + { + SDLToken: sdlToken.address, + LPLMigration: lplMigration.address, + LinearBoostController: lbc.address, + SDLPoolPrimary: sdlPoolPrimary.address, + }, + { SDLToken: 'StakingAllowance' } + ) +} diff --git a/scripts/test/deploy/modules/deploy-link-staking.ts b/scripts/test/deploy/modules/deploy-link-staking.ts new file mode 100644 index 00000000..f516c40c --- /dev/null +++ b/scripts/test/deploy/modules/deploy-link-staking.ts @@ -0,0 +1,190 @@ +import { ethers } from 'hardhat' +import { + ERC677, + OperatorVCS, + PriorityPool, + SDLPoolPrimary, + StakingPool, +} from '../../../../typechain-types' +import { + updateDeployments, + deploy, + getContract, + deployUpgradeable, + deployImplementation, +} from '../../../utils/deployment' +import { getAccounts, toEther } from '../../../utils/helpers' + +// Operator Vault Controller Strategy +const OperatorVCSArgs = { + maxDepositSizeBP: 9000, //basis point amount of the remaing deposit room in the Chainlink staking contract that can be deposited at once + operatorRewardPercentage: 1000, // basis point amount of an operator's earned rewards that they receive + fees: [], // fee receivers & percentage amounts in basis points +} + +async function deployOperatorVCS() { + const { accounts } = await getAccounts() + const linkToken = (await getContract('LINKToken')) as ERC677 + const stakingPool = (await getContract('LINK_StakingPool')) as StakingPool + + const stakingRewardsMock = await deploy('StakingRewardsMock', [linkToken.address]) + const stakingMock = await deploy('StakingMock', [ + linkToken.address, + stakingRewardsMock.address, + toEther(1000), + toEther(75000), + toEther(10000000), + ]) + const pfAlertsControllerMock = await deploy('PFAlertsControllerMock', [linkToken.address]) + + const vaultImpAddress = (await deployImplementation('OperatorVault')) as string + console.log('OperatorVault implementation deployed: ', vaultImpAddress) + + const operatorVCS = (await deployUpgradeable('OperatorVCS', [ + linkToken.address, + stakingPool.address, + stakingMock.address, + vaultImpAddress, + OperatorVCSArgs.fees, + OperatorVCSArgs.maxDepositSizeBP, + OperatorVCSArgs.operatorRewardPercentage, + ])) as OperatorVCS + console.log('OperatorVCS deployed: ', operatorVCS.address) + + await (await linkToken.transfer(stakingRewardsMock.address, toEther(100000))).wait() + await (await linkToken.transfer(pfAlertsControllerMock.address, toEther(10000))).wait() + await (await stakingPool.addStrategy(operatorVCS.address)).wait() + + for (let i = 0; i < 3; i++) { + await ( + await operatorVCS.addVault( + ethers.constants.AddressZero, + accounts[0], + pfAlertsControllerMock.address + ) + ).wait() + } + + updateDeployments({ LINK_OperatorVCS: operatorVCS.address }, { LINK_OperatorVCS: 'OperatorVCS' }) +} + +// Community Vault Controller Strategy +const CommunityVCSArgs = { + maxDepositSizeBP: 9000, //basis point amount of the remaing deposit room in the Chainlink staking contract that can be deposited at once + vaultDeploymentThreshold: 10, // the min number of non-full vaults before a new batch is deployed + vaultDeploymentAmount: 10, // amount of vaults to deploy when threshold is met + fees: [], // fee receivers & percentage amounts in basis points +} + +async function deployCommunityVCS() { + const linkToken = (await getContract('LINKToken')) as ERC677 + const stakingPool = (await getContract('LINK_StakingPool')) as StakingPool + + const stakingRewardsMock = await deploy('StakingRewardsMock', [linkToken.address]) + const stakingMock = await deploy('StakingMock', [ + linkToken.address, + stakingRewardsMock.address, + toEther(1000), + toEther(15000), + toEther(10000000), + ]) + + const vaultImpAddress = await deployImplementation('CommunityVault') + console.log('CommunityVault implementation deployed: ', vaultImpAddress) + + const communityVCS = await deployUpgradeable('CommunityVCS', [ + linkToken.address, + stakingPool.address, + stakingMock.address, + vaultImpAddress, + CommunityVCSArgs.fees, + CommunityVCSArgs.maxDepositSizeBP, + CommunityVCSArgs.vaultDeploymentThreshold, + CommunityVCSArgs.vaultDeploymentAmount, + ]) + console.log('CommunityVCS deployed: ', communityVCS.address) + + await (await linkToken.transfer(stakingRewardsMock.address, toEther(100000))).wait() + await (await stakingPool.addStrategy(communityVCS.address)).wait() + + updateDeployments( + { LINK_CommunityVCS: communityVCS.address }, + { LINK_CommunityVCS: 'CommunityVCS' } + ) +} + +// Wrapped stLINK +const WrappedSDTokenArgs = { + name: 'Wrapped stLINK', // wrapped token name + symbol: 'wstLINK', // wrapped token symbol +} +// LINK Staking Pool +const StakingPoolArgs = { + derivativeTokenName: 'Staked LINK', // LINK staking derivative token name + derivativeTokenSymbol: 'stLINK', // LINK staking derivative token symbol + fees: [['0x6879826450e576B401c4dDeff2B7755B1e85d97c', 300]], // fee receivers & percentage amounts in basis points +} +// LINK Priority Pool +const PriorityPoolArgs = { + queueDepositMin: toEther(1000), // min amount of tokens neede to execute deposit + queueDepositMax: toEther(200000), // max amount of tokens in a single deposit tx} +} + +export async function deployLINKStaking() { + const { accounts } = await getAccounts() + const linkToken = (await getContract('LINKToken')) as ERC677 + const sdlPoolPrimary = (await getContract('SDLPoolPrimary')) as SDLPoolPrimary + + const stakingPool = (await deployUpgradeable('StakingPool', [ + linkToken.address, + StakingPoolArgs.derivativeTokenName, + StakingPoolArgs.derivativeTokenSymbol, + StakingPoolArgs.fees, + ])) as StakingPool + console.log('LINK_StakingPool deployed: ', stakingPool.address) + + const priorityPool = (await deployUpgradeable('PriorityPool', [ + linkToken.address, + stakingPool.address, + sdlPoolPrimary.address, + PriorityPoolArgs.queueDepositMin, + PriorityPoolArgs.queueDepositMax, + ])) as PriorityPool + console.log('LINK_PriorityPool deployed: ', priorityPool.address) + + const wsdToken = await deploy('WrappedSDToken', [ + stakingPool.address, + WrappedSDTokenArgs.name, + WrappedSDTokenArgs.symbol, + ]) + console.log('LINK_WrappedSDToken token deployed: ', wsdToken.address) + + const stLinkSDLRewardsPool = await deploy('RewardsPoolWSD', [ + sdlPoolPrimary.address, + stakingPool.address, + wsdToken.address, + ]) + console.log('stLINK_SDLRewardsPool deployed: ', stLinkSDLRewardsPool.address) + + await (await sdlPoolPrimary.addToken(stakingPool.address, stLinkSDLRewardsPool.address)).wait() + await (await stakingPool.setPriorityPool(priorityPool.address)).wait() + await (await priorityPool.setDistributionOracle(accounts[0])).wait() + + updateDeployments( + { + LINK_StakingPool: stakingPool.address, + LINK_PriorityPool: priorityPool.address, + LINK_WrappedSDToken: wsdToken.address, + stLINK_SDLRewardsPool: stLinkSDLRewardsPool.address, + }, + { + LINK_StakingPool: 'StakingPool', + LINK_PriorityPool: 'PriorityPool', + LINK_WrappedSDToken: 'WrappedSDToken', + stLINK_SDLRewardsPool: 'RewardsPoolWSD', + } + ) + + await deployOperatorVCS() + await deployCommunityVCS() +} diff --git a/scripts/test/deploy-test-contracts.ts b/scripts/test/deploy/modules/deploy-test-contracts.ts similarity index 58% rename from scripts/test/deploy-test-contracts.ts rename to scripts/test/deploy/modules/deploy-test-contracts.ts index 0e22007c..4dd943c3 100644 --- a/scripts/test/deploy-test-contracts.ts +++ b/scripts/test/deploy/modules/deploy-test-contracts.ts @@ -1,11 +1,6 @@ -import { network } from 'hardhat' -import { updateDeployments, deploy } from '../utils/deployment' - -async function main() { - if (network.name != 'localhost' && network.name != 'testnet') { - throw Error('Test contracts can only be deployed on test networks') - } +import { updateDeployments, deploy } from '../../../utils/deployment' +export async function deployTestContracts() { const lplToken = await deploy('contracts/core/tokens/base/ERC677.sol:ERC677', [ 'LinkPool', 'LPL', @@ -48,27 +43,6 @@ async function main() { ) await tx.wait() - const stETHToken = await deploy('contracts/core/tokens/base/ERC677.sol:ERC677', [ - 'Lido stETH', - 'stETH', - 1000000000, - ]) - const rETHToken = await deploy('contracts/core/tokens/base/ERC677.sol:ERC677', [ - 'RocketPool rETH', - 'rETH', - 1000000000, - ]) - const cbETHToken = await deploy('contracts/core/tokens/base/ERC677.sol:ERC677', [ - 'Coinbase cbETH', - 'cbETH', - 1000000000, - ]) - const sfrxETHToken = await deploy('contracts/core/tokens/base/ERC677.sol:ERC677', [ - 'Frax sfrxETH', - 'sfrxETH', - 1000000000, - ]) - updateDeployments( { LPLToken: lplToken.address, @@ -77,26 +51,11 @@ async function main() { LINK_OwnersRewardsPoolV1: ownersRewardsPoolV1.address, PoolAllowanceV1: poolAllowance.address, Multicall3: multicall.address, - stETHToken: stETHToken.address, - rETHToken: rETHToken.address, - cbETHToken: cbETHToken.address, - sfrxETHToken: sfrxETHToken.address, }, { LPLToken: 'contracts/core/tokens/base/ERC677.sol:ERC677', LINKToken: 'contracts/core/tokens/base/ERC677.sol:ERC677', LINK_OwnersRewardsPoolV1: 'OwnersRewardsPoolV1', - stETHToken: 'ERC20', - rETHToken: 'ERC20', - cbETHToken: 'ERC20', - sfrxETHToken: 'ERC20', } ) } - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/test/setup-testnet.ts b/scripts/test/setup-testnet.ts deleted file mode 100644 index d8473e23..00000000 --- a/scripts/test/setup-testnet.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { updateDeployments, deploy, deployUpgradeable } from '../utils/deployment' -import { getAccounts, toEther } from '../utils/helpers' - -// SDL Token -const StakingAllowance = { - name: 'stake.link', // SDL token name - symbol: 'SDL', // SDL token symbol -} -// Linear Boost Controller -const LinearBoostController = { - maxLockingDuration: 4 * 365 * 86400, // maximum locking duration - maxBoost: 8, // maximum boost amount -} -// SDL Pool -const SDLPool = { - derivativeTokenName: 'Reward Escrowed SDL', // SDL staking derivative token name - derivativeTokenSymbol: 'reSDL', // SDL staking derivative token symbol -} -// LINK Staking Pool -const LINK_StakingPool = { - derivativeTokenName: 'Staked LINK', // LINK staking derivative token name - derivativeTokenSymbol: 'stLINK', // LINK staking derivative token symbol - fees: [['0x6879826450e576B401c4dDeff2B7755B1e85d97c', 300]], // fee receivers & percentage amounts in basis points -} -// LINK Priority Pool -const LINK_PriorityPool = { - queueDepositMin: toEther(1000), // min amount of tokens neede to execute deposit - queueDepositMax: toEther(200000), // max amount of tokens in a single deposit tx -} -// LINK Wrapped Staking Derivative Token -const LINK_WrappedSDToken = { - name: 'Wrapped stLINK', // wrapped staking derivative token name - symbol: 'wstLINK', // wrapped staking derivative token symbol -} - -async function main() { - const { accounts } = await getAccounts() - - const sdlToken = await deploy('StakingAllowance', [ - StakingAllowance.name, - StakingAllowance.symbol, - ]) - console.log('SDLToken deployed: ', sdlToken.address) - - await (await sdlToken.mint(accounts[0], toEther(100000000))).wait() - - const lbc = await deploy('LinearBoostController', [ - LinearBoostController.maxLockingDuration, - LinearBoostController.maxBoost, - ]) - console.log('LinearBoostController deployed: ', lbc.address) - - const sdlPool = await deployUpgradeable('SDLPool', [ - SDLPool.derivativeTokenName, - SDLPool.derivativeTokenSymbol, - sdlToken.address, - lbc.address, - accounts[0], - ]) - console.log('SDLPool deployed: ', sdlPool.address) - - const linkToken = await deploy('contracts/core/tokens/base/ERC677.sol:ERC677', [ - 'Chainlink-Test', - 'LINK-TEST', - 200000000, - ]) - console.log('LINKToken-TEST deployed: ', linkToken.address) - - const stakingPool = await deployUpgradeable('StakingPool', [ - linkToken.address, - LINK_StakingPool.derivativeTokenName, - LINK_StakingPool.derivativeTokenSymbol, - LINK_StakingPool.fees, - ]) - console.log('LINK_StakingPool deployed: ', stakingPool.address) - - const priorityPool = await deployUpgradeable('PriorityPool', [ - linkToken.address, - stakingPool.address, - sdlPool.address, - LINK_PriorityPool.queueDepositMin, - LINK_PriorityPool.queueDepositMax, - ]) - console.log('LINK_PriorityPool deployed: ', priorityPool.address) - - await (await stakingPool.setPriorityPool(priorityPool.address)).wait() - - const strategy = await deployUpgradeable('StrategyMock', [ - linkToken.address, - stakingPool.address, - toEther(1000000), - toEther(1000000), - ]) - - await (await stakingPool.addStrategy(strategy.address)).wait() - - const wsdToken = await deploy('WrappedSDToken', [ - stakingPool.address, - LINK_WrappedSDToken.name, - LINK_WrappedSDToken.symbol, - ]) - console.log('LINK_WrappedSDToken token deployed: ', wsdToken.address) - - const stLinkSDLRewardsPool = await deploy('RewardsPoolWSD', [ - sdlPool.address, - stakingPool.address, - wsdToken.address, - ]) - console.log('stLINK_SDLRewardsPool deployed: ', stLinkSDLRewardsPool.address) - - await (await sdlPool.addToken(stakingPool.address, stLinkSDLRewardsPool.address)).wait() - - updateDeployments( - { - SDLToken: sdlToken.address, - LinearBoostController: lbc.address, - SDLPool: sdlPool.address, - LINKToken: linkToken.address, - LINK_StakingPool: stakingPool.address, - LINK_PriorityPool: priorityPool.address, - LINK_WrappedSDToken: wsdToken.address, - stLINK_SDLRewardsPool: stLinkSDLRewardsPool.address, - }, - { - SDLToken: 'StakingAllowance', - LINKToken: 'contracts/core/tokens/base/ERC677.sol:ERC677', - LINK_StakingPool: 'StakingPool', - LINK_PriorityPool: 'PriorityPool', - LINK_WrappedSDToken: 'WrappedSDToken', - stLINK_SDLRewardsPool: 'RewardsPoolWSD', - } - ) -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/test/testnet-data.ts b/scripts/test/testnet-data.ts deleted file mode 100644 index 6271295e..00000000 --- a/scripts/test/testnet-data.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { toEther, getAccounts } from '../utils/helpers' //deployUpgradeable, getAccounts, -import { ethers } from 'hardhat' - -// Testnet LPL filler -// npx hardhat run --network testnet scripts/testnet-data.ts - -const wallets = [ - { - address: '0xE4Eeea0393E0b0d1e097a238DefD0e8ee799312c', - privateKey: '0x5f68dac9e41b539e5c555dc5554e9a305c88ec06f3b990468396c82059ca9712', - }, - { - address: '0x0b61D3a0fEc3311Fa4B301cb17F860afF7CA80d1', - privateKey: '0xd3b68b6fea9d1be0720374b7956e120a4e018ec62d66b11a0e82020fcdac4b6e', - }, - { - address: '0x23A758bBD7D6330596C11651F222ea02C4Cc634b', - privateKey: '0x2f88fe4f3297c9e211948342827861e357312537898328b3a1388dd798b275a0', - }, - { - address: '0xc41C64fa8360AF65e979c6f20B7d51635fDa9AE0', - privateKey: '0x56637f73bb73685c72d37abb6ce283dbe62d7d10cd26927397b0b1fb878e6c4a', - }, - { - address: '0x775A0B356f736A327c75f4016B5496B2466745F0', - privateKey: '0xd21109f83d2462380cfc04cf30ab8dbde69d015d5d8b45cb47daf3d0dbacb61d', - }, - { - address: '0x427f7a3cD31C5f17C0B10000A8D827bd39995FE3', - privateKey: '0x9cfb6412af721e7a6c267fe85db3c2b163ee9370507cf609bab81a779e0465e7', - }, - { - address: '0xB204655d377C8DD53539EE6785882A5bFeF8E6cE', - privateKey: '0xe4340cf299dfc21473058559ecaa79ef2ab0ad3f6036120f0e7fa264e07d1352', - }, - { - address: '0xe2A449CeaD45dbEAf1C0a8fA043C9d993818b2e6', - privateKey: '0x93c2038e51745251843a5f571ca61c3d486292a9abe69d5e9160f983e3288822', - }, - { - address: '0xc0B3eEabc79EfE603e497c647e57Ed9821c37166', - privateKey: '0xe2f2a3a9f5689d55a5013e4b9ab53eaba96908c19dc907b504bc37c8f1cc8955', - }, - { - address: '0x8CA69d88C5cB3442074Ba03b5ebc0a7865e167E4', - privateKey: '0xe02795be0058d763a04ed87f2294599be9ae03becf7478f0fc00eb8395e5e4b4', - }, - { - address: '0xa22e847d9b400eB3e7ADcAdE54A3e8eA4B5f5D6B', - privateKey: '0xf6e48c2e3e8fe34d17a2f6f39cba305b49f80796df9aea412fe11b90d516e117', - }, - { - address: '0xD180078aB0E584449e7c74F53Ed05f046657f54d', - privateKey: '0xbb070c0b217a7c69fec2ee988d7f7e14765fd4a37f65fc8a73a32435a0b2c673', - }, - { - address: '0xeB16c783669F1A76561Dad6318BAdc8c750804B9', - privateKey: '0x8c87992c350a70e1558a7ec40f21560387e65874ef24917126464d5b248cb8af', - }, - { - address: '0x77814A2Fc416a0224C9794686ed335CA78BD5bc3', - privateKey: '0xafbe98f01460d18c482a2021ee3421ec1d4a6190cfc472cad524acdde5166a31', - }, - { - address: '0x4098363f0cBF1bC935D23caFae5924572cF601d8', - privateKey: '0xc631bf5ba085f9796aeac0576837062fcf9a61caa75f59a6234c25d6f7d380bc', - }, - { - address: '0x3542D7a5101385dFc0D8b9cF7aDF2768F34e55CE', - privateKey: '0x3b2826a764a3bdbc1ecaaa3cf65b819e38ad0d781fca8c2a33613599e3641564', - }, - { - address: '0x63886410ACA8950c4c92F67C1e8d10732090A0F5', - privateKey: '0xf557f94f7bb96608509933d8620b0356bc5c0f04716d93c69ef1d496c5668cc7', - }, - { - address: '0xC7Ae4ec7bC91f3C38CeDD51bB95189e5Ce9Aa1c7', - privateKey: '0xc502f7b90aa03830fbfe15de6b497d6804aab1ed3f1fcd12ee0db8363de2f5ae', - }, - { - address: '0xddA84Aa1BfC2577D69CFa78A49217b98553f6D32', - privateKey: '0x4a176d20b52c6c3d3451126f78a0bfc6b6f291394397daa706adfd615aef73b6', - }, -] - -const getSigner = ({ privateKey }: any) => { - const wallet = new ethers.Wallet(privateKey) - return wallet.connect(ethers.provider) -} - -async function main() { - const { signers } = await getAccounts() - - const ownersToken = (await ethers.getContract('OwnersToken')) as any - const poolOwnersV1 = (await ethers.getContract('PoolOwnersV1')) as any - const linkToken = (await ethers.getContract('LinkToken')) as any - const ownersRewardsPoolV1 = (await ethers.getContract('OwnersRewardsPoolV1')) as any - - for (let i = 0; i < wallets.length; i++) { - await signers[0].sendTransaction({ - to: wallets[i].address, - value: toEther(1), - }) - await ownersToken.transfer(wallets[i].address, toEther(100000)) - await ownersToken - .connect(getSigner({ privateKey: wallets[i].privateKey })) - .transferAndCall(poolOwnersV1.address, toEther(10000), '0x00') - } - await linkToken.transfer(ownersRewardsPoolV1.address, toEther(10000)) - await ownersRewardsPoolV1.distributeRewards() -} - -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error) - process.exit(1) - }) diff --git a/scripts/utils/helpers.ts b/scripts/utils/helpers.ts index 13580793..574d8d06 100644 --- a/scripts/utils/helpers.ts +++ b/scripts/utils/helpers.ts @@ -1,5 +1,5 @@ import { ethers } from 'hardhat' -import { BigNumber, Signer } from 'ethers' +import { BigNumber } from 'ethers' import { ERC677 } from '../../typechain-types' export const toEther = (amount: string | number) => {