Skip to content

Commit

Permalink
SOV-2704-three-years-team-vestings (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcloa authored Jul 14, 2023
1 parent de773de commit 3aec382
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ cache
node_modules
artifacts/
cache/
cache_forge/
contracts_bzx/
tmp/
tmp
/temp/
/out/
foundry/out/
abi
types/
typechain/
Expand Down
3 changes: 2 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
34 changes: 22 additions & 12 deletions hardhat/tasks/governance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!!!");
}
Expand Down Expand Up @@ -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("=======================================");
Expand Down Expand Up @@ -261,7 +265,7 @@ task("governance:createVestings", "Create vestings")
});

const VestingType = {
TeamVesting: 0,
TeamVesting: 5,
Vesting: 1,
};

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions scripts/contractInteraction/contract_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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!!!")
Expand Down

0 comments on commit 3aec382

Please sign in to comment.