diff --git a/.gitignore b/.gitignore index b37d3c2e1..203ec57ca 100644 --- a/.gitignore +++ b/.gitignore @@ -35,11 +35,12 @@ cache node_modules artifacts/ cache/ +cache_forge/ contracts_bzx/ tmp/ tmp /temp/ -/out/ +foundry/out/ abi types/ typechain/ diff --git a/.solhint.json b/.solhint.json index 751ef28f2..ab556387a 100644 --- a/.solhint.json +++ b/.solhint.json @@ -5,6 +5,7 @@ "prettier/prettier": "error", "max-line-length": ["warn", 140], "compiler-version": ["warn"], - "no-global-import": "warn" + "no-global-import": "off", + "no-console": "warn" } } diff --git a/hardhat/tasks/governance.js b/hardhat/tasks/governance.js index 488c5f990..c1589bb30 100644 --- a/hardhat/tasks/governance.js +++ b/hardhat/tasks/governance.js @@ -35,6 +35,10 @@ const getEthersLog = async (contract, filter) => { return parsedEvents; }; +async function getVestingsOf(hre, address) { + return await (await ethers.getContract("VestingRegistry")).getVestingsOf(address); +} + async function createVestings(hre, path, dryRun, multiplier) { /* * vested token sender script - takes addresses from the file by path @@ -84,9 +88,9 @@ async function createVestings(hre, path, dryRun, multiplier) { vestingCreationType = 3; } else if (teamVesting[3] === 26) { vestingCreationType = 1; - } else if (teamVesting[3] === 39) { - vestingCreationType = 0; - console.log("Make sure 4 year vesting is really expected!"); + } else if (teamVesting[3] === 39 || teamVesting[3] === 22) { + vestingCreationType = 5; + console.log("Make sure 3 year team 2 vesting split is really expected!"); } else { console.log("ALERT!!!! ZERO VESTING CREATION TYPE FALLBACK!!!"); } @@ -180,19 +184,19 @@ async function createVestings(hre, path, dryRun, multiplier) { console.log("Staking ..."); const vesting = await ethers.getContractAt("VestingLogic", vestingAddress, signer); await ( - await vesting.stakeTokens( - amount - // { - // gasLimit: 6800000, - // gasPrice: 65e6, - // } - ) + await vesting.stakeTokens(amount, { + gasLimit: 6800000, + gasPrice: 65e6, + }) ).wait(); } const stakes = await staking.getStakes(vestingAddress); console.log("Stakes:"); - console.log(stakes); + logger.warn( + stakes.stakes.map((stake) => stake.div(ethers.constants.WeiPerEther).toString()) + ); + logger.warn(stakes.dates.map((date) => new Date(date.toNumber() * 1000))); } console.log("======================================="); @@ -261,7 +265,7 @@ task("governance:createVestings", "Create vestings") }); const VestingType = { - TeamVesting: 0, + TeamVesting: 5, Vesting: 1, }; @@ -452,6 +456,12 @@ task("governance:createFourYearVestings", "Create vestings") await createFourYearVestings(hre, path, dryRun); }); +task("governance:getVestingsOf", "Get vesting contracts of an address") + .addParam("address", "The address to get vestings of") + .setAction(async ({ address }, hre) => { + logger.warn(await getVestingsOf(hre, address)); + }); + /*// Usage create4YUVestings().catch((error) => { console.error("Error:", error); diff --git a/scripts/contractInteraction/contract_interaction.py b/scripts/contractInteraction/contract_interaction.py index 8d629eafe..4f59dc9f4 100644 --- a/scripts/contractInteraction/contract_interaction.py +++ b/scripts/contractInteraction/contract_interaction.py @@ -84,8 +84,8 @@ def main(): #checkTxOnAny(17, conf.contracts["NewMultisigBF"]) #queueProposal(30) - confirmWithBFMS(36) # "BFmultisig" - checkTxOnBF(36) # "BFmultisig" + #confirmWithBFMS(36) # "BFmultisig" + #checkTxOnBF(36) # "BFmultisig" #confirmWithBFMS(32) diff --git a/scripts/contractInteraction/tasks/airdrop_distribution/airdrop_distribution.py b/scripts/contractInteraction/tasks/airdrop_distribution/airdrop_distribution.py index a5aa32f38..5cc02d436 100644 --- a/scripts/contractInteraction/tasks/airdrop_distribution/airdrop_distribution.py +++ b/scripts/contractInteraction/tasks/airdrop_distribution/airdrop_distribution.py @@ -101,11 +101,11 @@ def main(): # # - VESTED DISTRIBUTION - # ----------------------- - # print("SOV balance of exchequer multisig: \n", getBalance(conf.contracts['SOV'], conf.contracts['multisig'])/10**18) # check multisig is funded with SOV - # print("SOV balance of executing account: \n", getBalance(conf.contracts['SOV'], conf.acct)/10**18) # check that the script running address is funded + #print("SOV balance of exchequer multisig: \n", getBalance(conf.contracts['SOV'], conf.contracts['multisig'])/10**18) # check multisig is funded with SOV + #print("SOV balance of executing account: \n", getBalance(conf.contracts['SOV'], conf.acct)/10**18) # check that the script running address is funded ''' - vestedSOVAmount = 4823202 * 10**16 #48,232.02 + vestedSOVAmount = 58000000 * 10**16 #580,000.00 transferSOVtoAccount(conf.acct, vestedSOVAmount) # vesting SOV distribution ''' @@ -130,12 +130,12 @@ def main(): brownie run scripts/contractInteraction/tasks/airdrop_distribution/airdrop_distribution.py --network rsk-mainnet ''' - #''' - vestingDistributionPath = './scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-23-04.csv' + ''' + vestingDistributionPath = './scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-split.csv' dryRun = False # False to execute, True to verify the file structure multiplier = 10**16 # multiplier == 10**16 <- amounts must with 2 decimals createVestings(vestingDistributionPath, dryRun, multiplier) - #''' + ''' # # vestingRegistryProxyRemoveAdmin(receiver) # remove the script exexution from admins diff --git a/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-orig.csv b/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-orig.csv new file mode 100644 index 000000000..ff9f27cdd --- /dev/null +++ b/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-orig.csv @@ -0,0 +1,23 @@ +"60,000.00",NA,Contributor Bonus,0x49fB71E44a488e40c3c806fED8357cD0BD5C61a8,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0xbfe561678255D6b6dF9c470813a40De7E691cE39,36 months,6,39,MultisigVesting +"60,000.00",NA,Contributor Bonus,0xe11f8EF0C575f3D079bF56245B7505B2531dDc98,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0x56B00ca0a274fB53449fBF2DB0253B809E364975,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0xe2bfb2348b193fd1bf5fb438d423af69ec889196,36 months,6,39,MultisigVesting +"40,000.00",NA,Contributor Bonus,0x8A029533cF2a31Ccccc6b1D45B626716C4916F9d,36 months,6,39,MultisigVesting +"40,000.00",NA,Contributor Bonus,0x55Ed66E5E8371C66bc710A4feE4e8e7Bf2d825fd,36 months,6,39,MultisigVesting +"40,000.00",NA,Contributor Bonus,0x9a54e31807c6c8EaFDD012A412F1851e77FE7843,36 months,6,39,MultisigVesting +"40,000.00",NA,Contributor Bonus,0x4B8F6D4F086C19411311ADE997A66C083A2322c6,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0x2c777e30f5571f3e7704e28cdd5858076023e267,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0xA1DF92EB52aB13b8C0dAcF11b8a4844acE4ae3cb,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0x915BbAE90E860fF3248Ee8dFB3cdf9CD3A225D16,36 months,6,39,MultisigVesting +"60,000.00",NA,Contributor Bonus,0x611c50d4bb01af456ca419dbf76e244789d4f887,36 months,6,39,MultisigVesting +"60,000.00",NA,Contributor Bonus,0xaD69347E419ee8D87B89e76BbEd90B737F0dda64,36 months,6,39,MultisigVesting +"70,000.00",NA,Contributor Bonus,0x0792fC24dC0BcEca0a1d4FF03bf5c1ba132223a1,36 months,6,39,MultisigVesting +"40,000.00",NA,Contributor Bonus,0x2f87b2c6438ef61edad04e96bf908bc2b5e45592,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0x6e12404fB736e32b975154B9745d74fc312E7C80,36 months,6,39,MultisigVesting +"70,000.00",NA,Contributor Bonus,0x2D2e3B6be554dBc816469e0040b0378f4BF91E93,36 months,6,39,MultisigVesting +"70,000.00",NA,Contributor Bonus,0x07f340bb1fd8630b8f4c22bd9aad41cd2664c8d7,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0x95033E0027273B220fBA8E9514977b25204425FE,36 months,6,39,MultisigVesting +"40,000.00",NA,Contributor Bonus,0xf32E96c8C7Af61522ec2f5D19A38ecED963D3306,36 months,6,39,MultisigVesting +"100,000.00",NA,Contributor Bonus,0x67178e51f3ff18669515a1dfa4783ee7779a5a00,36 months,6,39,MultisigVesting +"300,000.00",NA,Contributor Bonus,0x8b131d7484e3F67616Bacc4fECd662f02E4da100,36 months,6,39,MultisigVesting \ No newline at end of file diff --git a/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-split.csv b/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-split.csv new file mode 100644 index 000000000..8c4dfb79e --- /dev/null +++ b/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-split.csv @@ -0,0 +1,46 @@ +"30,000.00",NA,Contributor Bonus,0x49fB71E44a488e40c3c806fED8357cD0BD5C61a8,36 months(1),6,22,MultisigVesting +"30,000.00",NA,Contributor Bonus,0x49fB71E44a488e40c3c806fED8357cD0BD5C61a8,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0xbfe561678255D6b6dF9c470813a40De7E691cE39,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0xbfe561678255D6b6dF9c470813a40De7E691cE39,36 months(2),23,39,MultisigVesting +"30,000.00",NA,Contributor Bonus,0xe11f8EF0C575f3D079bF56245B7505B2531dDc98,36 months(1),6,22,MultisigVesting +"30,000.00",NA,Contributor Bonus,0xe11f8EF0C575f3D079bF56245B7505B2531dDc98,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x56B00ca0a274fB53449fBF2DB0253B809E364975,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x56B00ca0a274fB53449fBF2DB0253B809E364975,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0xe2bfb2348b193fd1bf5fb438d423af69ec889196,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0xe2bfb2348b193fd1bf5fb438d423af69ec889196,36 months(2),23,39,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x8A029533cF2a31Ccccc6b1D45B626716C4916F9d,36 months(1),6,22,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x8A029533cF2a31Ccccc6b1D45B626716C4916F9d,36 months(2),23,39,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x55Ed66E5E8371C66bc710A4feE4e8e7Bf2d825fd,36 months(1),6,22,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x55Ed66E5E8371C66bc710A4feE4e8e7Bf2d825fd,36 months(2),23,39,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x9a54e31807c6c8EaFDD012A412F1851e77FE7843,36 months(1),6,22,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x9a54e31807c6c8EaFDD012A412F1851e77FE7843,36 months(2),23,39,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x4B8F6D4F086C19411311ADE997A66C083A2322c6,36 months(1),6,22,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x4B8F6D4F086C19411311ADE997A66C083A2322c6,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x2c777e30f5571f3e7704e28cdd5858076023e267,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x2c777e30f5571f3e7704e28cdd5858076023e267,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0xA1DF92EB52aB13b8C0dAcF11b8a4844acE4ae3cb,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0xA1DF92EB52aB13b8C0dAcF11b8a4844acE4ae3cb,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x915BbAE90E860fF3248Ee8dFB3cdf9CD3A225D16,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x915BbAE90E860fF3248Ee8dFB3cdf9CD3A225D16,36 months(2),23,39,MultisigVesting +"30,000.00",NA,Contributor Bonus,0x611c50d4bb01af456ca419dbf76e244789d4f887,36 months(1),6,22,MultisigVesting +"30,000.00",NA,Contributor Bonus,0x611c50d4bb01af456ca419dbf76e244789d4f887,36 months(2),23,39,MultisigVesting +"30,000.00",NA,Contributor Bonus,0xaD69347E419ee8D87B89e76BbEd90B737F0dda64,36 months(1),6,22,MultisigVesting +"30,000.00",NA,Contributor Bonus,0xaD69347E419ee8D87B89e76BbEd90B737F0dda64,36 months(2),23,39,MultisigVesting +"35,000.00",NA,Contributor Bonus,0x0792fC24dC0BcEca0a1d4FF03bf5c1ba132223a1,36 months(1),6,22,MultisigVesting +"35,000.00",NA,Contributor Bonus,0x0792fC24dC0BcEca0a1d4FF03bf5c1ba132223a1,36 months(2),23,39,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x2f87b2c6438ef61edad04e96bf908bc2b5e45592,36 months(1),6,22,MultisigVesting +"20,000.00",NA,Contributor Bonus,0x2f87b2c6438ef61edad04e96bf908bc2b5e45592,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x6e12404fB736e32b975154B9745d74fc312E7C80,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x6e12404fB736e32b975154B9745d74fc312E7C80,36 months(2),23,39,MultisigVesting +"35,000.00",NA,Contributor Bonus,0x2D2e3B6be554dBc816469e0040b0378f4BF91E93,36 months(1),6,22,MultisigVesting +"35,000.00",NA,Contributor Bonus,0x2D2e3B6be554dBc816469e0040b0378f4BF91E93,36 months(2),23,39,MultisigVesting +"35,000.00",NA,Contributor Bonus,0x07f340bb1fd8630b8f4c22bd9aad41cd2664c8d7,36 months(1),6,22,MultisigVesting +"35,000.00",NA,Contributor Bonus,0x07f340bb1fd8630b8f4c22bd9aad41cd2664c8d7,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x95033E0027273B220fBA8E9514977b25204425FE,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x95033E0027273B220fBA8E9514977b25204425FE,36 months(2),23,39,MultisigVesting +"20,000.00",NA,Contributor Bonus,0xf32E96c8C7Af61522ec2f5D19A38ecED963D3306,36 months(1),6,22,MultisigVesting +"20,000.00",NA,Contributor Bonus,0xf32E96c8C7Af61522ec2f5D19A38ecED963D3306,36 months(2),23,39,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x67178e51f3ff18669515a1dfa4783ee7779a5a00,36 months(1),6,22,MultisigVesting +"50,000.00",NA,Contributor Bonus,0x67178e51f3ff18669515a1dfa4783ee7779a5a00,36 months(2),23,39,MultisigVesting +"150,000.00",NA,Contributor Bonus,0x8b131d7484e3F67616Bacc4fECd662f02E4da100,36 months(1),6,22,MultisigVesting +"150,000.00",NA,Contributor Bonus,0x8b131d7484e3F67616Bacc4fECd662f02E4da100,36 months(2),23,39,MultisigVesting \ No newline at end of file diff --git a/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-test.csv b/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-test.csv new file mode 100644 index 000000000..309ae93be --- /dev/null +++ b/scripts/contractInteraction/tasks/airdrop_distribution/data/vestings-team-3y-23-06-test.csv @@ -0,0 +1,2 @@ +"50.00",NA,Contributor Bonus,0xeb771FF87FBd594c7647D593EfE9B9a10ed30361,(18+18) months(1),6,22,MultisigVesting +"50.00",NA,Contributor Bonus,0xeb771FF87FBd594c7647D593EfE9B9a10ed30361,(18+18) months(2),23,39,MultisigVesting \ No newline at end of file diff --git a/scripts/contractInteraction/tasks/airdrop_distribution/functions/create_vestings.py b/scripts/contractInteraction/tasks/airdrop_distribution/functions/create_vestings.py index 0f2beec84..9974a7e90 100644 --- a/scripts/contractInteraction/tasks/airdrop_distribution/functions/create_vestings.py +++ b/scripts/contractInteraction/tasks/airdrop_distribution/functions/create_vestings.py @@ -45,9 +45,9 @@ def createVestings(path, dryRun, multiplier): vestingCreationType = 3 elif teamVesting[3] == 26: # 2 year vestings vestingCreationType = 1 - elif teamVesting[3] == 39: # 3 year vestings. if cliff < 6 use FourYearVesting - vestingCreationType = 0 - print("Make sure 4 year vesting is really expected!") + elif teamVesting[3] == 39 or teamVesting[3] == 22: # 3 year vestings. if cliff < 6 use FourYearVesting + vestingCreationType = 5 #type 4 is reserved for 4 year vestings - a separate contract + print("Make sure 3 year vesting 2 contracts split is really expected!") else: vestingCreationType = 0 print("ALERT!!!! ZERO VESTING CREATION TYPE FALLBACK!!!")