diff --git a/contracts/src/migration/TLC_globalUnlockScheduleMigration.sol b/contracts/src/migration/TLC_globalUnlockScheduleMigration.sol index ccd1a784..afe88aa2 100644 --- a/contracts/src/migration/TLC_globalUnlockScheduleMigration.sol +++ b/contracts/src/migration/TLC_globalUnlockScheduleMigration.sol @@ -23,7 +23,7 @@ struct VestingScheduleMigration { bool ignoreGlobalUnlock; } -uint256 constant OCTOBER_16_2024 = 1729036800; +uint256 constant OCTOBER_31_2025 = 1761868800; contract TlcMigration { error CliffTooLong(uint256 i); @@ -31,13 +31,13 @@ contract TlcMigration { error WrongEnd(uint256 i); function migrate() external { - VestingScheduleMigration[] memory migrations = new VestingScheduleMigration[](30); + VestingScheduleMigration[] memory migrations = new VestingScheduleMigration[](60); // 0 -> 6 migrations[0] = VestingScheduleMigration({ scheduleCount: 7, newStart: 0, newEnd: 0, - newLockDuration: 75772800, + newLockDuration: 108604800, // 75772800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -48,7 +48,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 70329600, + newLockDuration: 103161600, // 70329600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -59,7 +59,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 65491200, + newLockDuration: 98323200, // 65491200 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -69,11 +69,11 @@ contract TlcMigration { migrations[3] = VestingScheduleMigration({ scheduleCount: 4, newStart: 0, - newEnd: 1656720000, - newLockDuration: 72403200, - setCliff: true, - setDuration: true, - setPeriodDuration: true, + newEnd: 0, + newLockDuration: 105235200, // 72403200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, ignoreGlobalUnlock: false }); // 13 @@ -81,7 +81,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 67046400, + newLockDuration: 99878400, // 67046400 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -92,7 +92,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 56505600, + newLockDuration: 89337600, // 56505600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -103,7 +103,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 58233600, + newLockDuration: 91065600, // 58233600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -114,7 +114,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 57974400, + newLockDuration: 90806400, // 57974400 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -125,7 +125,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 53740800, + newLockDuration: 86572800, // 53740800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -136,7 +136,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 75772800, + newLockDuration: 108604800, // 75772800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -147,7 +147,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 49474800, + newLockDuration: 82306800, // 49474800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -158,7 +158,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 75772800, + newLockDuration: 108604800, // 75772800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -169,7 +169,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 49474800, + newLockDuration: 82306800, // 49474800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -180,7 +180,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 75772800, + newLockDuration: 108604800, // 75772800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -191,7 +191,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 49474800, + newLockDuration: 82306800, // 49474800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -202,7 +202,7 @@ contract TlcMigration { scheduleCount: 3, newStart: 0, newEnd: 0, - newLockDuration: 75772800, + newLockDuration: 108604800, // 75772800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -213,7 +213,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 70329600, + newLockDuration: 103161600, // 70329600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -224,7 +224,7 @@ contract TlcMigration { scheduleCount: 2, newStart: 0, newEnd: 0, - newLockDuration: 50371200, + newLockDuration: 83203200, // 50371200 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -235,7 +235,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 50716800, + newLockDuration: 83548800, // 50716800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -246,7 +246,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 50803200, + newLockDuration: 83635200, // 50803200 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -257,7 +257,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 50889600, + newLockDuration: 83721600, // 50889600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -268,7 +268,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 50716800, + newLockDuration: 83548800, // 50716800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -279,7 +279,7 @@ contract TlcMigration { scheduleCount: 2, newStart: 0, newEnd: 0, - newLockDuration: 50889600, + newLockDuration: 83721600, // 50889600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -288,12 +288,12 @@ contract TlcMigration { // 36 -> 60 migrations[23] = VestingScheduleMigration({ scheduleCount: 25, - newStart: 1686175200, - newEnd: 1686261600, - newLockDuration: 42861600, + newStart: 0, + newEnd: 0, + newLockDuration: 75693600, // 42861600 setCliff: false, - setDuration: true, - setPeriodDuration: true, + setDuration: false, + setPeriodDuration: false, ignoreGlobalUnlock: false }); // 61 @@ -301,7 +301,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 40953600, + newLockDuration: 73785600, // 40953600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -312,7 +312,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 48729600, + newLockDuration: 81561600, // 48729600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -323,7 +323,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 41644800, + newLockDuration: 74476800, // 41644800 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -334,7 +334,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 47001600, + newLockDuration: 79833600, // 47001600 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -345,7 +345,7 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 45014400, + newLockDuration: 77846400, // 45014400 setCliff: false, setDuration: false, setPeriodDuration: false, @@ -356,12 +356,343 @@ contract TlcMigration { scheduleCount: 1, newStart: 0, newEnd: 0, - newLockDuration: 38188800, + newLockDuration: 71020800, // 38188800 setCliff: false, setDuration: false, setPeriodDuration: false, ignoreGlobalUnlock: true }); + // 67 -> 69 + migrations[30] = VestingScheduleMigration({ + scheduleCount: 3, + newStart: 0, + newEnd: 0, + newLockDuration: 75693600, // 42861600 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 70 + migrations[31] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 63763200, // 33004800 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 71 + migrations[32] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 64972800, // 34214400 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 72 + migrations[33] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 64713600, // 33955200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 73 + migrations[34] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 69811200, // 39052800 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: true + }); + // 74 + migrations[35] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 69897600, // 41731200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 75 + migrations[36] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 68688000, // 40521600 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 76 + migrations[37] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 67478400, // 39312900 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 77 + migrations[38] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 65059200, // 36892800 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 78 -> 79 + migrations[39] = VestingScheduleMigration({ + scheduleCount: 2, + newStart: 0, + newEnd: 0, + newLockDuration: 64454400, // 36288000 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 80 + migrations[40] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 59356800, // 33523200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 81 -> 82 + migrations[41] = VestingScheduleMigration({ + scheduleCount: 2, + newStart: 0, + newEnd: 0, + newLockDuration: 58924800, // 33091200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: true + }); + // 83 + migrations[42] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 57801600, // 38016000 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: true + }); + // 84 + migrations[43] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 57110400, // 37324800 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 85 + migrations[44] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 54086400, // 34300800 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 86 + migrations[45] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 57196800, // 39571200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 87 + migrations[46] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 55641600, // 38016000 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 88 + migrations[47] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 52963200, // 35337600 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 89 + migrations[48] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 55641600, // 38016000 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 90 -> 91 + migrations[49] = VestingScheduleMigration({ + scheduleCount: 2, + newStart: 0, + newEnd: 0, + newLockDuration: 83116800, // 65491200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 92 + migrations[50] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 54172800, // 36547200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 93 + migrations[51] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 55641600, // 38016000 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 94 + migrations[52] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 74131200, // 56505600 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 95 + migrations[53] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 49939200, // 35424000 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: true + }); + // 96 + migrations[54] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 49334400, // 34819200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 97 -> 98 + migrations[55] = VestingScheduleMigration({ + scheduleCount: 2, + newStart: 0, + newEnd: 0, + newLockDuration: 47952000, // 36547200 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 99 + migrations[56] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 43286400, // 33696000 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 100 + migrations[57] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 42076800, // 32486400 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 101 + migrations[58] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 46915200, // 37324800 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: false + }); + // 102 + migrations[59] = VestingScheduleMigration({ + scheduleCount: 1, + newStart: 0, + newEnd: 0, + newLockDuration: 36979200, // 32918400 + setCliff: false, + setDuration: false, + setPeriodDuration: false, + ignoreGlobalUnlock: true + }); + // All schedules covered uint256 index = 0; @@ -404,8 +735,8 @@ contract TlcMigration { if (!isRevoked && (sch.end != sch.start + sch.duration)) { revert WrongEnd(index); } - // check all the schedules are locked until unix : 1729036800 - if (sch.start + sch.lockDuration != OCTOBER_16_2024) { + // check all the schedules are locked until unix : 1761868800 + if (sch.start + sch.lockDuration != OCTOBER_31_2025) { revert WrongUnlockDate(index); } diff --git a/contracts/test/migration/TLC_globalUnlockScheduleMigration.t.sol b/contracts/test/migration/TLC_globalUnlockScheduleMigration.t.sol index 21ad182b..aab423f6 100644 --- a/contracts/test/migration/TLC_globalUnlockScheduleMigration.t.sol +++ b/contracts/test/migration/TLC_globalUnlockScheduleMigration.t.sol @@ -5,14 +5,124 @@ import "forge-std/Test.sol"; import "../../src/migration/TLC_globalUnlockScheduleMigration.sol"; import "../../src/TLC.1.sol"; +import {ERC20VestableVotesUpgradeableV1} from "contracts/src/components/ERC20VestableVotesUpgradeable.1.sol"; contract TlcMigrationTest is Test { TlcMigration migrationsContract; TLCV1 tlc; string rpc; + uint32[] newLockDuration = [ + 108604800, + 108604800, + 108604800, + 108604800, + 108604800, + 108604800, + 108604800, + 103161600, + 98323200, + 105235200, + 105235200, + 105235200, + 105235200, + 99878400, + 89337600, + 91065600, + 90806400, + 86572800, + 108604800, + 82306800, + 108604800, + 82306800, + 108604800, + 82306800, + 108604800, + 108604800, + 108604800, + 103161600, + 83203200, + 83203200, + 83548800, + 83635200, + 83721600, + 83548800, + 83721600, + 83721600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 75693600, + 73785600, + 81561600, + 74476800, + 79833600, + 77846400, + 71020800, + 75693600, + 75693600, + 75693600, + 63763200, + 64972800, + 64713600, + 69811200, + 69897600, + 68688000, + 67478400, + 65059200, + 64454400, + 64454400, + 59356800, + 58924800, + 58924800, + 57801600, + 57110400, + 54086400, + 57196800, + 55641600, + 52963200, + 55641600, + 83116800, + 83116800, + 54172800, + 55641600, + 74131200, + 49939200, + 49334400, + 47952000, + 47952000, + 43286400, + 42076800, + 46915200, + 36979200 + ]; + + bool[] isGlobalUnlockedScheduleIgnoredOld; + function setUp() public { rpc = vm.rpcUrl("mainnet"); + vm.createFork(rpc); } function testCreate() public { @@ -20,8 +130,7 @@ contract TlcMigrationTest is Test { } function testGas() public { - vm.createSelectFork(rpc, 18063740); - + vm.createSelectFork(rpc, 20934540); migrationsContract = new TlcMigration(); proxy tlcProxy = proxy(0xb5Fe6946836D687848B5aBd42dAbF531d5819632); vm.prank(0x0D1dE267015a75F5069fD1c9ed382210B3002cEb); @@ -30,14 +139,17 @@ contract TlcMigrationTest is Test { function testMigrate() public { // Significantly faster when cached locally, run a local fork for best perf (anvil recommended) - vm.createSelectFork(rpc, 18063740); + vm.createSelectFork(rpc, 20934540); proxy tlcProxy = proxy(0xb5Fe6946836D687848B5aBd42dAbF531d5819632); - assertEq(tlcProxy.getVestingScheduleCount(), 67); + assertEq(tlcProxy.getVestingScheduleCount(), 103); - VestingSchedulesV2.VestingSchedule[] memory schedulesBefore = new VestingSchedulesV2.VestingSchedule[](67); - for (uint256 i = 0; i < 67; i++) { + VestingSchedulesV2.VestingSchedule[] memory schedulesBefore = new VestingSchedulesV2.VestingSchedule[](103); + for (uint256 i = 0; i < 103; i++) { schedulesBefore[i] = TLCV1(address(tlcProxy)).getVestingSchedule(i); + isGlobalUnlockedScheduleIgnoredOld.push( + ERC20VestableVotesUpgradeableV1(address(tlcProxy)).isGlobalUnlockedScheduleIgnored(i) + ); //console.log("%s,%s,%s", i, schedulesBefore[i].start, schedulesBefore[i].end); } @@ -47,69 +159,33 @@ contract TlcMigrationTest is Test { tlc = new TLCV1(); vm.prank(0x0D1dE267015a75F5069fD1c9ed382210B3002cEb); - tlcProxy.upgradeTo(address(tlc)); + tlcProxy.upgradeTo(address(0xF8745c392feF5c91fa1cdB0202efF7Ca08dF55ce)); - assertEq(tlcProxy.getVestingScheduleCount(), 67); + assertEq(tlcProxy.getVestingScheduleCount(), 103); // Check that the all the values that shouldn't change didn't - for (uint256 i = 0; i < 67; i++) { + for (uint256 i = 0; i < tlcProxy.getVestingScheduleCount(); i++) { VestingSchedulesV2.VestingSchedule memory schedule = TLCV1(address(tlcProxy)).getVestingSchedule(i); + assertEq(schedule.start, schedulesBefore[i].start); + assertEq(schedule.end, schedulesBefore[i].end); + assertEq(schedule.cliffDuration, schedulesBefore[i].cliffDuration); + assertEq(schedule.duration, schedulesBefore[i].duration); + assertEq(schedule.periodDuration, schedulesBefore[i].periodDuration); assertEq(schedule.amount, schedulesBefore[i].amount); assertEq(schedule.creator, schedulesBefore[i].creator); assertEq(schedule.beneficiary, schedulesBefore[i].beneficiary); assertEq(schedule.revocable, schedulesBefore[i].revocable); assertEq(schedule.releasedAmount, schedulesBefore[i].releasedAmount); + assertEq( + isGlobalUnlockedScheduleIgnoredOld[i], + ERC20VestableVotesUpgradeableV1(address(tlcProxy)).isGlobalUnlockedScheduleIgnored(i) + ); } // Check that the value we should have changed did change - // Schedule 0 - VestingSchedulesV2.VestingSchedule memory schedule = TLCV1(address(tlcProxy)).getVestingSchedule(0); - assertEq(schedule.start, schedulesBefore[0].start); - assertEq(schedule.end, schedulesBefore[0].end); - assertEq(schedule.lockDuration, 75772800); - assertEq(schedule.cliffDuration, schedulesBefore[0].cliffDuration); - assertEq(schedule.duration, schedulesBefore[0].duration); - assertEq(schedule.periodDuration, schedulesBefore[0].periodDuration); - assertFalse(TLCV1(address(tlcProxy)).isGlobalUnlockedScheduleIgnored(0)); - - // Schedule 17 - schedule = TLCV1(address(tlcProxy)).getVestingSchedule(17); - assertEq(schedule.start, schedulesBefore[17].start); - assertEq(schedule.end, schedulesBefore[17].end); - assertEq(schedule.lockDuration, 53740800); - assertEq(schedule.cliffDuration, schedulesBefore[17].cliffDuration); - assertEq(schedule.duration, schedulesBefore[17].duration); - assertEq(schedule.periodDuration, schedulesBefore[17].periodDuration); - assertTrue(TLCV1(address(tlcProxy)).isGlobalUnlockedScheduleIgnored(17)); - - // Schedule 36 - schedule = TLCV1(address(tlcProxy)).getVestingSchedule(36); - assertEq(schedule.start, 1686175200); - assertEq(schedule.end, 1686261600); - assertEq(schedule.lockDuration, 42861600); - assertEq(schedule.cliffDuration, schedulesBefore[36].cliffDuration); - assertEq(schedule.duration, 86400); - assertEq(schedule.periodDuration, 86400); - assertFalse(TLCV1(address(tlcProxy)).isGlobalUnlockedScheduleIgnored(36)); - - // Schedule 60 - schedule = TLCV1(address(tlcProxy)).getVestingSchedule(60); - assertEq(schedule.start, 1686175200); - assertEq(schedule.end, 1686261600); - assertEq(schedule.lockDuration, 42861600); - assertEq(schedule.cliffDuration, schedulesBefore[60].cliffDuration); - assertEq(schedule.duration, 86400); - assertEq(schedule.periodDuration, 86400); - assertFalse(TLCV1(address(tlcProxy)).isGlobalUnlockedScheduleIgnored(60)); - - // Schedule 66 - schedule = TLCV1(address(tlcProxy)).getVestingSchedule(66); - assertEq(schedule.start, schedulesBefore[66].start); - assertEq(schedule.end, schedulesBefore[66].end); - assertEq(schedule.lockDuration, 38188800); - assertEq(schedule.cliffDuration, schedulesBefore[66].cliffDuration); - assertEq(schedule.duration, schedulesBefore[66].duration); - assertEq(schedule.periodDuration, schedulesBefore[66].periodDuration); - assertTrue(TLCV1(address(tlcProxy)).isGlobalUnlockedScheduleIgnored(66)); + for (uint256 i = 0; i < tlcProxy.getVestingScheduleCount(); i++) { + VestingSchedulesV2.VestingSchedule memory schedule = TLCV1(address(tlcProxy)).getVestingSchedule(i); + assertEq(schedule.lockDuration, newLockDuration[i]); + } } } diff --git a/deploy/mainnet/11_deploy_v1.0.1.ts b/deploy/mainnet/11_deploy_v1.0.1.ts index 91cad8e0..1b2cede8 100644 --- a/deploy/mainnet/11_deploy_v1.0.1.ts +++ b/deploy/mainnet/11_deploy_v1.0.1.ts @@ -3,7 +3,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { isDeployed, logStep, logStepEnd } from "../../ts-utils/helpers/index"; const func: DeployFunction = async function ({ deployments, network, getNamedAccounts }: HardhatRuntimeEnvironment) { - if (!["mainnet", "hardhat"].includes(network.name)) { + if (!["mainnet", "hardhat", "tenderly"].includes(network.name)) { throw new Error("Invalid network for mainnet deployment"); } diff --git a/deploy/mainnet/12_deploy_v1_1_0.ts b/deploy/mainnet/12_deploy_v1_1_0.ts index 9d5086ef..2e0f6d9f 100644 --- a/deploy/mainnet/12_deploy_v1_1_0.ts +++ b/deploy/mainnet/12_deploy_v1_1_0.ts @@ -3,7 +3,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { isDeployed, logStep, logStepEnd } from "../../ts-utils/helpers/index"; const func: DeployFunction = async function ({ deployments, network, getNamedAccounts }: HardhatRuntimeEnvironment) { - if (!["mainnet", "hardhat"].includes(network.name)) { + if (!["mainnet", "hardhat", "tenderly"].includes(network.name)) { throw new Error("Invalid network for mainnet deployment"); } diff --git a/deploy/mainnet/15_TLC_migration_2024.ts b/deploy/mainnet/15_TLC_migration_2024.ts new file mode 100644 index 00000000..585b5d6d --- /dev/null +++ b/deploy/mainnet/15_TLC_migration_2024.ts @@ -0,0 +1,42 @@ +import { DeployFunction } from "hardhat-deploy/dist/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { isDeployed, logStep, logStepEnd } from "../../ts-utils/helpers/index"; +import { upgradeTo, upgradeToAndCall, verify } from "../../scripts/helpers"; +import { ethers } from "hardhat"; + +const func: DeployFunction = async function ({ deployments, network, getNamedAccounts }: HardhatRuntimeEnvironment) { + if (!["mainnet", "hardhat", "tenderly"].includes(network.name)) { + throw new Error("Invalid network for mainnet deployment"); + } + + const { deployer, proxyAdministrator } = await getNamedAccounts(); + const tlc = await deployments.get("TLC"); + const tlcImplementation = await deployments.get("TLCV1_Implementation_1_1_0"); + const tlcProxyFirewall = await deployments.get("TLCProxyFirewall"); + + const tlcMigrationDeployment = await deployments.deploy("TLC_GlobalUnlockSchedule_Migration_2", { + contract: "TlcMigration", + from: deployer, + log: true, + }); + + await verify("TlcMigration", tlcMigrationDeployment.address, []); + // migration and upgrade steps + // 1. upgradeToAndCall TlcMigration + TlcMigration.migrate() + // 2. upgradeTo TLCV1_Implementation_1_1_0 + logStepEnd(__filename); +}; + +func.skip = async function ({ deployments, ethers }: HardhatRuntimeEnvironment): Promise { + logStep(__filename); + const shouldSkip = + (await isDeployed("TLCV1_Implementation_1_1_0", deployments, __filename)) && + (await isDeployed("TLC_GlobalUnlockSchedule_Migration_2", deployments, __filename)); + if (shouldSkip) { + console.log("Skipped"); + logStepEnd(__filename); + } + return shouldSkip; +}; + +export default func; diff --git a/deployments/mainnet/TLC_GlobalUnlockSchedule_Migration_2.json b/deployments/mainnet/TLC_GlobalUnlockSchedule_Migration_2.json new file mode 100644 index 00000000..78ffff66 --- /dev/null +++ b/deployments/mainnet/TLC_GlobalUnlockSchedule_Migration_2.json @@ -0,0 +1,108 @@ +{ + "address": "0x362C04E4001197c19cE63Aae825D14bB39Bb15c0", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "i", + "type": "uint256" + } + ], + "name": "CliffTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "VestingScheduleNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "i", + "type": "uint256" + } + ], + "name": "WrongEnd", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "i", + "type": "uint256" + } + ], + "name": "WrongUnlockDate", + "type": "error" + }, + { + "inputs": [], + "name": "migrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8c3015eb88b95c3f1e8686a8e47390c579e56000ff2c255243299b175dfe8b8f", + "receipt": { + "to": null, + "from": "0xBFa8549887E6ddef8Cdf83Cda1Ad24856496fd00", + "contractAddress": "0x362C04E4001197c19cE63Aae825D14bB39Bb15c0", + "transactionIndex": 11, + "gasUsed": "1637689", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5075c5974a5345a7ab7e3b42bd0550666cd281bf5880d3a8910fbaa304e1ffb0", + "transactionHash": "0x8c3015eb88b95c3f1e8686a8e47390c579e56000ff2c255243299b175dfe8b8f", + "logs": [], + "blockNumber": 20943653, + "cumulativeGasUsed": "3018254", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "37f3fc6b84869918de46b14efdfb3bb5", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"CliffTooLong\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"VestingScheduleNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"WrongEnd\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"WrongUnlockDate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"migrate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"VestingScheduleNotFound(uint256)\":[{\"params\":{\"index\":\"vesting schedule index\"}}]},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"errors\":{\"VestingScheduleNotFound(uint256)\":[{\"notice\":\"The VestingSchedule was not found\"}]},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/src/migration/TLC_globalUnlockScheduleMigration.sol\":\"TlcMigration\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[],\"viaIR\":true},\"sources\":{\"contracts/src/migration/TLC_globalUnlockScheduleMigration.sol\":{\"content\":\"//SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.20;\\n\\nimport \\\"../state/tlc/VestingSchedules.2.sol\\\";\\nimport \\\"../state/tlc/IgnoreGlobalUnlockSchedule.sol\\\";\\n\\nstruct VestingScheduleMigration {\\n // number of consecutive schedules to migrate with the same parameters\\n uint8 scheduleCount;\\n // The new lock duration\\n uint32 newLockDuration;\\n // if != 0, the new start value\\n uint64 newStart;\\n // if != 0, the new end value\\n uint64 newEnd;\\n // set cliff to 0 if true\\n bool setCliff;\\n // if true set vesting duration to 86400\\n bool setDuration;\\n // if true set vesting period duration to 86400\\n bool setPeriodDuration;\\n // if true schedule will not be subject to global unlock schedule\\n bool ignoreGlobalUnlock;\\n}\\n\\nuint256 constant OCTOBER_31_2025 = 1761868800;\\n\\ncontract TlcMigration {\\n error CliffTooLong(uint256 i);\\n error WrongUnlockDate(uint256 i);\\n error WrongEnd(uint256 i);\\n\\n function migrate() external {\\n VestingScheduleMigration[] memory migrations = new VestingScheduleMigration[](60);\\n // 0 -> 6\\n migrations[0] = VestingScheduleMigration({\\n scheduleCount: 7,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 108604800, // 75772800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 7\\n migrations[1] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 103161600, // 70329600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 8\\n migrations[2] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 98323200, // 65491200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 9 -> 12\\n migrations[3] = VestingScheduleMigration({\\n scheduleCount: 4,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 105235200, // 72403200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 13\\n migrations[4] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 99878400, // 67046400\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 14\\n migrations[5] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 89337600, // 56505600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 15\\n migrations[6] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 91065600, // 58233600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 16\\n migrations[7] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 90806400, // 57974400\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 17\\n migrations[8] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 86572800, // 53740800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 18\\n migrations[9] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 108604800, // 75772800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 19\\n migrations[10] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 82306800, // 49474800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 20\\n migrations[11] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 108604800, // 75772800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 21\\n migrations[12] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 82306800, // 49474800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 22\\n migrations[13] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 108604800, // 75772800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 23\\n migrations[14] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 82306800, // 49474800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 24 -> 26\\n migrations[15] = VestingScheduleMigration({\\n scheduleCount: 3,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 108604800, // 75772800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 27\\n migrations[16] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 103161600, // 70329600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 28 -> 29\\n migrations[17] = VestingScheduleMigration({\\n scheduleCount: 2,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 83203200, // 50371200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 30\\n migrations[18] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 83548800, // 50716800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 31\\n migrations[19] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 83635200, // 50803200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 32\\n migrations[20] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 83721600, // 50889600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 33\\n migrations[21] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 83548800, // 50716800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 34 -> 35\\n migrations[22] = VestingScheduleMigration({\\n scheduleCount: 2,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 83721600, // 50889600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 36 -> 60\\n migrations[23] = VestingScheduleMigration({\\n scheduleCount: 25,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 75693600, // 42861600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 61\\n migrations[24] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 73785600, // 40953600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 62\\n migrations[25] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 81561600, // 48729600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 63\\n migrations[26] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 74476800, // 41644800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 64\\n migrations[27] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 79833600, // 47001600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 65\\n migrations[28] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 77846400, // 45014400\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 66\\n migrations[29] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 71020800, // 38188800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 67 -> 69\\n migrations[30] = VestingScheduleMigration({\\n scheduleCount: 3,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 75693600, // 42861600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 70\\n migrations[31] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 63763200, // 33004800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 71\\n migrations[32] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 64972800, // 34214400\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 72\\n migrations[33] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 64713600, // 33955200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 73\\n migrations[34] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 69811200, // 39052800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 74\\n migrations[35] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 69897600, // 41731200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 75\\n migrations[36] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 68688000, // 40521600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 76\\n migrations[37] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 67478400, // 39312900\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 77\\n migrations[38] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 65059200, // 36892800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 78 -> 79\\n migrations[39] = VestingScheduleMigration({\\n scheduleCount: 2,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 64454400, // 36288000\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 80\\n migrations[40] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 59356800, // 33523200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 81 -> 82\\n migrations[41] = VestingScheduleMigration({\\n scheduleCount: 2,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 58924800, // 33091200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 83\\n migrations[42] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 57801600, // 38016000\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 84\\n migrations[43] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 57110400, // 37324800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 85\\n migrations[44] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 54086400, // 34300800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 86\\n migrations[45] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 57196800, // 39571200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 87\\n migrations[46] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 55641600, // 38016000\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 88\\n migrations[47] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 52963200, // 35337600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 89\\n migrations[48] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 55641600, // 38016000\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 90 -> 91\\n migrations[49] = VestingScheduleMigration({\\n scheduleCount: 2,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 83116800, // 65491200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 92\\n migrations[50] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 54172800, // 36547200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 93\\n migrations[51] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 55641600, // 38016000\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 94\\n migrations[52] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 74131200, // 56505600\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 95\\n migrations[53] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 49939200, // 35424000\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n // 96\\n migrations[54] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 49334400, // 34819200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 97 -> 98\\n migrations[55] = VestingScheduleMigration({\\n scheduleCount: 2,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 47952000, // 36547200\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 99\\n migrations[56] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 43286400, // 33696000\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 100\\n migrations[57] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 42076800, // 32486400\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 101\\n migrations[58] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 46915200, // 37324800\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: false\\n });\\n // 102\\n migrations[59] = VestingScheduleMigration({\\n scheduleCount: 1,\\n newStart: 0,\\n newEnd: 0,\\n newLockDuration: 36979200, // 32918400\\n setCliff: false,\\n setDuration: false,\\n setPeriodDuration: false,\\n ignoreGlobalUnlock: true\\n });\\n\\n // All schedules covered\\n\\n uint256 index = 0;\\n for (uint256 i = 0; i < migrations.length; i++) {\\n VestingScheduleMigration memory migration = migrations[i];\\n for (uint256 j = 0; j < migration.scheduleCount; j++) {\\n VestingSchedulesV2.VestingSchedule storage sch = VestingSchedulesV2.get(index);\\n\\n bool isRevoked = false;\\n if (sch.start + sch.duration != sch.end) {\\n isRevoked = true;\\n }\\n // Modifications\\n sch.lockDuration = migration.newLockDuration;\\n if (migration.newStart != 0) {\\n sch.start = migration.newStart;\\n }\\n if (migration.newEnd != 0) {\\n sch.end = migration.newEnd;\\n }\\n if (migration.setCliff) {\\n sch.cliffDuration = 0;\\n }\\n if (migration.setDuration) {\\n sch.duration = 86400;\\n }\\n if (migration.setPeriodDuration) {\\n sch.periodDuration = 86400;\\n }\\n if (migration.ignoreGlobalUnlock) {\\n IgnoreGlobalUnlockSchedule.set(index, true);\\n }\\n\\n // Post effects checks\\n // check cliff is not longer than duration\\n if (sch.cliffDuration > sch.duration) {\\n revert CliffTooLong(index);\\n }\\n // sanity checks on non revoked schedules\\n if (!isRevoked && (sch.end != sch.start + sch.duration)) {\\n revert WrongEnd(index);\\n }\\n // check all the schedules are locked until unix : 1761868800\\n if (sch.start + sch.lockDuration != OCTOBER_31_2025) {\\n revert WrongUnlockDate(index);\\n }\\n\\n index += 1;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x99b16d2e91cbd303505e9f8db642b011a41bed703bf686bb21aadf246370d314\",\"license\":\"BUSL-1.1\"},\"contracts/src/state/tlc/IgnoreGlobalUnlockSchedule.sol\":{\"content\":\"//SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.20;\\n\\n/// @title Global unlock schedule activation storage\\n/// @notice Utility to manage the global unlock schedule activation mapping in storage\\n/// @notice The global unlock schedule releases 1/24th of the total scheduled amount every month after the local lock end\\nlibrary IgnoreGlobalUnlockSchedule {\\n /// @notice Storage slot of the global unlock schedule activation mapping\\n bytes32 internal constant GLOBAL_UNLOCK_ACTIVATION_SLOT =\\n bytes32(uint256(keccak256(\\\"tlc.state.globalUnlockScheduleActivation\\\")) - 1);\\n\\n /// @notice Structure stored in storage slot\\n struct Slot {\\n /// @custom:attribute Mapping keeping track of activation per schedule\\n mapping(uint256 => bool) value;\\n }\\n\\n /// @notice Retrieve the global unlock schedule activation value of a schedule, true if the global lock should be ignored\\n /// @param _scheduleId The schedule id\\n /// @return The global unlock activation value\\n function get(uint256 _scheduleId) internal view returns (bool) {\\n bytes32 slot = GLOBAL_UNLOCK_ACTIVATION_SLOT;\\n\\n Slot storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n return r.value[_scheduleId];\\n }\\n\\n /// @notice Sets the global unlock schedule activation value of a schedule\\n /// @param _scheduleId The id of the schedule to modify\\n /// @param _ignoreGlobalUnlock The value to set, true if the global lock should be ignored\\n function set(uint256 _scheduleId, bool _ignoreGlobalUnlock) internal {\\n bytes32 slot = GLOBAL_UNLOCK_ACTIVATION_SLOT;\\n\\n Slot storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n r.value[_scheduleId] = _ignoreGlobalUnlock;\\n }\\n}\\n\",\"keccak256\":\"0x94d5b65afeef1b2049e041444bc4da411297964fd08955763b04a8bbc75d2dac\",\"license\":\"BUSL-1.1\"},\"contracts/src/state/tlc/VestingSchedules.1.sol\":{\"content\":\"//SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.20;\\n\\n/// @title VestingSchedulesV1 Storage\\n/// @notice Utility to manage VestingSchedulesV1 in storage\\nlibrary VestingSchedulesV1 {\\n /// @notice Storage slot of the Vesting Schedules\\n bytes32 internal constant VESTING_SCHEDULES_SLOT =\\n bytes32(uint256(keccak256(\\\"erc20VestableVotes.state.schedules\\\")) - 1);\\n\\n struct VestingSchedule {\\n // start time of the vesting period\\n uint64 start;\\n // date at which the vesting is ended\\n // initially it is equal to start+duration then to revoke date in case of revoke\\n uint64 end;\\n // duration before which first tokens gets ownable\\n uint32 cliffDuration;\\n // duration before tokens gets unlocked. can exceed the duration of the vesting chedule\\n uint32 lockDuration;\\n // duration of the entire vesting (sum of all vesting period durations)\\n uint32 duration;\\n // duration of a single period of vesting\\n uint32 periodDuration;\\n // amount of tokens granted by the vesting schedule\\n uint256 amount;\\n // creator of the token vesting\\n address creator;\\n // beneficiary of tokens after they are releaseVestingScheduled\\n address beneficiary;\\n // whether the schedule can be revoked\\n bool revocable;\\n }\\n\\n /// @notice The structure at the storage slot\\n struct SlotVestingSchedule {\\n /// @custom:attribute Array containing all the vesting schedules\\n VestingSchedule[] value;\\n }\\n\\n /// @notice The VestingSchedule was not found\\n /// @param index vesting schedule index\\n error VestingScheduleNotFound(uint256 index);\\n\\n /// @notice Retrieve the vesting schedule in storage\\n /// @param _index index of the vesting schedule\\n /// @return the vesting schedule\\n function get(uint256 _index) internal view returns (VestingSchedule storage) {\\n bytes32 slot = VESTING_SCHEDULES_SLOT;\\n\\n SlotVestingSchedule storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n if (r.value.length <= _index) {\\n revert VestingScheduleNotFound(_index);\\n }\\n\\n return r.value[_index];\\n }\\n\\n /// @notice Get vesting schedule count in storage\\n /// @return The count of vesting schedule in storage\\n function getCount() internal view returns (uint256) {\\n bytes32 slot = VESTING_SCHEDULES_SLOT;\\n\\n SlotVestingSchedule storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n return r.value.length;\\n }\\n\\n /// @notice Add a new vesting schedule in storage\\n /// @param _newSchedule new vesting schedule to create\\n /// @return The size of the vesting schedule array after the operation\\n function push(VestingSchedule memory _newSchedule) internal returns (uint256) {\\n bytes32 slot = VESTING_SCHEDULES_SLOT;\\n\\n SlotVestingSchedule storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n r.value.push(_newSchedule);\\n\\n return r.value.length;\\n }\\n}\\n\",\"keccak256\":\"0x5a92717d56fcf3294775e9c3c8437845c1a57359e87e67997f0375dfbdd7e68f\",\"license\":\"BUSL-1.1\"},\"contracts/src/state/tlc/VestingSchedules.2.sol\":{\"content\":\"//SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.20;\\n\\nimport \\\"./VestingSchedules.1.sol\\\";\\n\\n/// @title VestingSchedulesV2 Storage\\n/// @notice Utility to manage VestingSchedulesV2 in storage\\nlibrary VestingSchedulesV2 {\\n /// @notice Storage slot of the Vesting Schedules (note the slot is different from v1)\\n bytes32 internal constant VESTING_SCHEDULES_SLOT =\\n bytes32(uint256(keccak256(\\\"erc20VestableVotes.state.v2.schedules\\\")) - 1);\\n\\n struct VestingSchedule {\\n // start time of the vesting period\\n uint64 start;\\n // date at which the vesting is ended\\n // initially it is equal to start+duration then to revoke date in case of revoke\\n uint64 end;\\n // duration before which first tokens gets ownable\\n uint32 cliffDuration;\\n // duration before tokens gets unlocked. can exceed the duration of the vesting chedule\\n uint32 lockDuration;\\n // duration of the entire vesting (sum of all vesting period durations)\\n uint32 duration;\\n // duration of a single period of vesting\\n uint32 periodDuration;\\n // amount of tokens granted by the vesting schedule\\n uint256 amount;\\n // creator of the token vesting\\n address creator;\\n // beneficiary of tokens after they are releaseVestingScheduled\\n address beneficiary;\\n // whether the schedule can be revoked\\n bool revocable;\\n // amount of released tokens\\n uint256 releasedAmount;\\n }\\n\\n /// @notice The structure at the storage slot\\n struct SlotVestingSchedule {\\n /// @custom:attribute Array containing all the vesting schedules\\n VestingSchedule[] value;\\n }\\n\\n /// @notice The VestingSchedule was not found\\n /// @param index vesting schedule index\\n error VestingScheduleNotFound(uint256 index);\\n\\n /// @notice Retrieve the vesting schedule in storage\\n /// @param _index index of the vesting schedule\\n /// @return the vesting schedule\\n function get(uint256 _index) internal view returns (VestingSchedule storage) {\\n bytes32 slot = VESTING_SCHEDULES_SLOT;\\n\\n SlotVestingSchedule storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n if (r.value.length <= _index) {\\n revert VestingScheduleNotFound(_index);\\n }\\n\\n return r.value[_index];\\n }\\n\\n /// @notice Get vesting schedule count in storage\\n /// @return The count of vesting schedule in storage\\n function getCount() internal view returns (uint256) {\\n bytes32 slot = VESTING_SCHEDULES_SLOT;\\n\\n SlotVestingSchedule storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n return r.value.length;\\n }\\n\\n /// @notice Add a new vesting schedule in storage\\n /// @param _newSchedule new vesting schedule to create\\n /// @return The size of the vesting schedule array after the operation\\n function push(VestingSchedule memory _newSchedule) internal returns (uint256) {\\n bytes32 slot = VESTING_SCHEDULES_SLOT;\\n\\n SlotVestingSchedule storage r;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n r.slot := slot\\n }\\n\\n r.value.push(_newSchedule);\\n\\n return r.value.length;\\n }\\n\\n /// @notice Migrate a VestingSchedule from v1 to v2\\n /// @notice Takes a VestingSchedule in v1 format in stores it in v2 format\\n /// @param _index of the schedule in v1 to be migrated\\n /// @param _releasedAmount The released amount to keep in storage\\n /// @return The index of the created schedule in v2 format\\n function migrateVestingScheduleFromV1(uint256 _index, uint256 _releasedAmount) internal returns (uint256) {\\n VestingSchedulesV1.VestingSchedule memory scheduleV1 = VestingSchedulesV1.get(_index);\\n VestingSchedulesV2.VestingSchedule memory scheduleV2 = VestingSchedulesV2.VestingSchedule({\\n start: scheduleV1.start,\\n end: scheduleV1.end,\\n lockDuration: scheduleV1.lockDuration,\\n cliffDuration: scheduleV1.cliffDuration,\\n duration: scheduleV1.duration,\\n periodDuration: scheduleV1.periodDuration,\\n amount: scheduleV1.amount,\\n creator: scheduleV1.creator,\\n beneficiary: scheduleV1.beneficiary,\\n revocable: scheduleV1.revocable,\\n releasedAmount: _releasedAmount\\n });\\n\\n return push(scheduleV2) - 1;\\n }\\n}\\n\",\"keccak256\":\"0x032c50b761a4179c2e65c332509f453b9fc3a5936e58159745263313e36aedc0\",\"license\":\"BUSL-1.1\"}},\"version\":1}", + "bytecode": "0x6080806040523461001657611cb5908161001c8239f35b600080fdfe600436101561000d57600080fd5b60003560e01c638fd3ab801461002257600080fd5b3461183e57600036600319011261183e57610820604052603c60805260005b61078081106117dc57610052611843565b600781526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526100946080611863565b5261009f6080611863565b506100a8611843565b600181526306261f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526100ea6080611870565b526100f56080611870565b506100fe611843565b600181526305dc4b006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526101406080611880565b5261014b6080611880565b50610154611843565b60048152630645c3006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526101966080611890565b526101a16080611890565b506101aa611843565b600181526305f406006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526101ec60806118a0565b526101f760806118a0565b50610200611843565b600181526305532f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261024260806118b0565b5261024d60806118b0565b50610256611843565b6001815263056d8d006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261029860806118c0565b526102a360806118c0565b506102ac611843565b6001815263056998806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526102ee60806118d0565b526102f960806118d0565b50610302611843565b60018152630528ff006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e082015261034460806118e1565b5261034f60806118e1565b50610358611843565b600181526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261039a60806118f2565b526103a560806118f2565b506103ae611843565b600181526304e7e6f06020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526103f06080611903565b526103fb6080611903565b50610404611843565b600181526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526104466080611914565b526104516080611914565b5061045a611843565b600181526304e7e6f06020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261049c6080611925565b526104a76080611925565b506104b0611843565b600181526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526104f26080611936565b526104fd6080611936565b50610506611843565b600181526304e7e6f06020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526105486080611947565b526105536080611947565b5061055c611843565b600381526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261059e6080611958565b526105a96080611958565b506105b2611843565b600181526306261f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526105f46080611969565b526105ff6080611969565b50610608611843565b6002908181526304f594806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261064c608061197a565b52610657608061197a565b50610660611843565b600181526304fada8090816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526106a4608061198b565b526106af608061198b565b506106b8611843565b600181526304fc2c006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526106fa608061199c565b52610705608061199c565b5061070e611843565b90600182526304fd7d8091826020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e082015261075360806119ad565b5261075e60806119ad565b50610767611843565b90600182526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526107a560806119be565b526107b060806119be565b506107b9611843565b908282526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526107f660806119cf565b5261080160806119cf565b5061080a611843565b60198152630482fe2090816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261084e60806119e0565b5261085960806119e0565b50610862611843565b60018152630465e1006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526108a460806119f1565b526108af60806119f1565b506108b8611843565b600181526304dc88006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526108fa6080611a02565b526109056080611a02565b5061090e611843565b600181526304706d006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526109506080611a13565b5261095b6080611a13565b50610964611843565b600181526304c22a006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526109a66080611a24565b526109b16080611a24565b506109ba611843565b600181526304a3d7806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526109fc6080611a35565b52610a076080611a35565b50610a10611843565b6001815263043bb1006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610a526080611a46565b52610a5d6080611a46565b50610a66611843565b90600382526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610aa46080611a57565b52610aaf6080611a57565b50610ab8611843565b600181526303ccf3006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610afa6080611a68565b52610b056080611a68565b50610b0e611843565b600181526303df68006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610b506080611a79565b52610b5b6080611a79565b50610b64611843565b600181526303db73806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610ba66080611a8a565b52610bb16080611a8a565b50610bba611843565b600181526304293c006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610bfc6080611a9b565b52610c076080611a9b565b50610c10611843565b6001815263042a8d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610c526080611aac565b52610c5d6080611aac565b50610c66611843565b6001815263041818806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610ca86080611abd565b52610cb36080611abd565b50610cbc611843565b60018152630405a3806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610cfe6080611ace565b52610d096080611ace565b50610d12611843565b600181526303e0b9806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610d546080611adf565b52610d5f6080611adf565b50610d68611843565b8181526303d77f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610da96080611af0565b52610db46080611af0565b50610dbd611843565b60018152630389b6806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610dff6080611b01565b52610e0a6080611b01565b50610e13611843565b8181526303831f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610e546080611b12565b52610e5f6080611b12565b50610e68611843565b60018152630371fb806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610eaa6080611b23565b52610eb56080611b23565b50610ebe611843565b600181526303676f806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610f006080611b34565b52610f0b6080611b34565b50610f14611843565b600181526303394b006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610f566080611b45565b52610f616080611b45565b50610f6a611843565b60018152630368c1006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610fac6080611b56565b52610fb76080611b56565b50610fc0611843565b60018152630351060090816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526110046080611b67565b5261100f6080611b67565b50611018611843565b6001815263032827806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261105a6080611b78565b526110656080611b78565b5061106e611843565b60018152816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526110ac6080611b89565b526110b76080611b89565b506110c0611843565b8281526304f443006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111016080611b9a565b5261110c6080611b9a565b50611115611843565b6001815263033a9c806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111576080611bab565b526111626080611bab565b5061116b611843565b90600182526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111a96080611bbc565b526111b46080611bbc565b506111bd611843565b6001815263046b27006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111ff6080611bcd565b5261120a6080611bcd565b50611213611843565b600181526302fa03006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526112556080611bde565b526112606080611bde565b50611269611843565b600181526302f0c8806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526112ab6080611bef565b526112b66080611bef565b506112bf611843565b9081526302dbb0806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526113006080611c00565b5261130b6080611c00565b50611314611843565b600181526302947f806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526113566080611c11565b526113616080611c11565b5061136a611843565b600181526302820a806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526113ac6080611c22565b526113b76080611c22565b506113c0611843565b600181526302cbde806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526114026080611c33565b5261140d6080611c33565b50611416611843565b6001815263023442006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526114586080611c44565b526114636080611c44565b506000805b6080518110156117da5760a0600582901b01516000925b60ff8251168410156117c9577f64404627f9392c993df73912dbfb24528266190d015c31a2a5dcf19d4c62184c54818111156117b05781101561179a577f64404627f9392c993df73912dbfb24528266190d015c31a2a5dcf19d4c62184c60005260206000206000906005830281015461150b63ffffffff8260c01c166001600160401b038316611c64565b6001600160401b03808360401c16911603611791575b602085015163ffffffff60a01b60a09190911b1663ffffffff60a01b19821681176005860284015560408601516001600160401b0316918261176c575b50505060608401516001600160401b038116611737575b50608084015161171e575b60a08401516116fe575b60c08401516116df575b60e08401516116a2575b6005830201549063ffffffff8260c01c1663ffffffff8360801c1611611689571580611656575b61163d576001600160401b036115ec828263ffffffff636903fc009560a01c169116611c64565b16036116255760018101811161160f576001611609910193611c55565b9261147f565b634e487b7160e01b600052601160045260246000fd5b602490604051906379a8a49960e11b82526004820152fd5b604051631d86500b60e21b815260048101839052602490fd5b506001600160401b0361167463ffffffff8360c01c16828416611c64565b166001600160401b038260401c1614156115c5565b604051639ce1550560e01b815260048101849052602490fd5b826000527f423605f996078acc205f33a6458ae6ea5c4b6179bbe6f42712c6ca48e103aa316020526040600020600160ff1982541617905561159e565b60058302810180546001600160e01b03166102a360e71b179055611594565b600583028101805463ffffffff60c01b19166102a360c71b17905561158a565b600583028101805463ffffffff60801b19169055611580565b600584028201805467ffffffffffffffff60401b191660409290921b67ffffffffffffffff60401b1691909117905586611575565b67ffffffffffffffff63ffffffff60a01b01191617176005840282015586808061155e565b60019250611521565b634e487b7160e01b600052603260045260246000fd5b60405163ad7d6e0960e01b815260048101839052602490fd5b9250506117d590611c55565b611468565b005b6020906117e7611843565b6000815282600081830152600060408301526000606083015260006080830152600060a0830152600060c0830152600060e083015282608001015201610041565b634e487b7160e01b600052604160045260246000fd5b600080fd5b6040519061010082018281106001600160401b0382111761182857604052565b80511561179a5760200190565b80516001101561179a5760400190565b80516002101561179a5760600190565b80516003101561179a5760800190565b80516004101561179a5760a00190565b80516005101561179a5760c00190565b80516006101561179a5760e00190565b80516007101561179a576101000190565b80516008101561179a576101200190565b80516009101561179a576101400190565b8051600a101561179a576101600190565b8051600b101561179a576101800190565b8051600c101561179a576101a00190565b8051600d101561179a576101c00190565b8051600e101561179a576101e00190565b8051600f101561179a576102000190565b80516010101561179a576102200190565b80516011101561179a576102400190565b80516012101561179a576102600190565b80516013101561179a576102800190565b80516014101561179a576102a00190565b80516015101561179a576102c00190565b80516016101561179a576102e00190565b80516017101561179a576103000190565b80516018101561179a576103200190565b80516019101561179a576103400190565b8051601a101561179a576103600190565b8051601b101561179a576103800190565b8051601c101561179a576103a00190565b8051601d101561179a576103c00190565b8051601e101561179a576103e00190565b8051601f101561179a576104000190565b80516020101561179a576104200190565b80516021101561179a576104400190565b80516022101561179a576104600190565b80516023101561179a576104800190565b80516024101561179a576104a00190565b80516025101561179a576104c00190565b80516026101561179a576104e00190565b80516027101561179a576105000190565b80516028101561179a576105200190565b80516029101561179a576105400190565b8051602a101561179a576105600190565b8051602b101561179a576105800190565b8051602c101561179a576105a00190565b8051602d101561179a576105c00190565b8051602e101561179a576105e00190565b8051602f101561179a576106000190565b80516030101561179a576106200190565b80516031101561179a576106400190565b80516032101561179a576106600190565b80516033101561179a576106800190565b80516034101561179a576106a00190565b80516035101561179a576106c00190565b80516036101561179a576106e00190565b80516037101561179a576107000190565b80516038101561179a576107200190565b80516039101561179a576107400190565b8051603a101561179a576107600190565b8051603b101561179a576107800190565b600019811461160f5760010190565b9190916001600160401b038080941691160191821161160f5756fea26469706673582212206e07a109f21efc440a2157b32d0d2315c5673a90c3608013e34fed23e163cfc664736f6c63430008140033", + "deployedBytecode": "0x600436101561000d57600080fd5b60003560e01c638fd3ab801461002257600080fd5b3461183e57600036600319011261183e57610820604052603c60805260005b61078081106117dc57610052611843565b600781526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526100946080611863565b5261009f6080611863565b506100a8611843565b600181526306261f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526100ea6080611870565b526100f56080611870565b506100fe611843565b600181526305dc4b006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526101406080611880565b5261014b6080611880565b50610154611843565b60048152630645c3006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526101966080611890565b526101a16080611890565b506101aa611843565b600181526305f406006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526101ec60806118a0565b526101f760806118a0565b50610200611843565b600181526305532f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261024260806118b0565b5261024d60806118b0565b50610256611843565b6001815263056d8d006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261029860806118c0565b526102a360806118c0565b506102ac611843565b6001815263056998806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526102ee60806118d0565b526102f960806118d0565b50610302611843565b60018152630528ff006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e082015261034460806118e1565b5261034f60806118e1565b50610358611843565b600181526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261039a60806118f2565b526103a560806118f2565b506103ae611843565b600181526304e7e6f06020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526103f06080611903565b526103fb6080611903565b50610404611843565b600181526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526104466080611914565b526104516080611914565b5061045a611843565b600181526304e7e6f06020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261049c6080611925565b526104a76080611925565b506104b0611843565b600181526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526104f26080611936565b526104fd6080611936565b50610506611843565b600181526304e7e6f06020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526105486080611947565b526105536080611947565b5061055c611843565b600381526306792d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261059e6080611958565b526105a96080611958565b506105b2611843565b600181526306261f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526105f46080611969565b526105ff6080611969565b50610608611843565b6002908181526304f594806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261064c608061197a565b52610657608061197a565b50610660611843565b600181526304fada8090816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526106a4608061198b565b526106af608061198b565b506106b8611843565b600181526304fc2c006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526106fa608061199c565b52610705608061199c565b5061070e611843565b90600182526304fd7d8091826020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e082015261075360806119ad565b5261075e60806119ad565b50610767611843565b90600182526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526107a560806119be565b526107b060806119be565b506107b9611843565b908282526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526107f660806119cf565b5261080160806119cf565b5061080a611843565b60198152630482fe2090816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261084e60806119e0565b5261085960806119e0565b50610862611843565b60018152630465e1006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526108a460806119f1565b526108af60806119f1565b506108b8611843565b600181526304dc88006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526108fa6080611a02565b526109056080611a02565b5061090e611843565b600181526304706d006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526109506080611a13565b5261095b6080611a13565b50610964611843565b600181526304c22a006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526109a66080611a24565b526109b16080611a24565b506109ba611843565b600181526304a3d7806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526109fc6080611a35565b52610a076080611a35565b50610a10611843565b6001815263043bb1006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610a526080611a46565b52610a5d6080611a46565b50610a66611843565b90600382526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610aa46080611a57565b52610aaf6080611a57565b50610ab8611843565b600181526303ccf3006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610afa6080611a68565b52610b056080611a68565b50610b0e611843565b600181526303df68006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610b506080611a79565b52610b5b6080611a79565b50610b64611843565b600181526303db73806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610ba66080611a8a565b52610bb16080611a8a565b50610bba611843565b600181526304293c006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610bfc6080611a9b565b52610c076080611a9b565b50610c10611843565b6001815263042a8d806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610c526080611aac565b52610c5d6080611aac565b50610c66611843565b6001815263041818806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610ca86080611abd565b52610cb36080611abd565b50610cbc611843565b60018152630405a3806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610cfe6080611ace565b52610d096080611ace565b50610d12611843565b600181526303e0b9806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610d546080611adf565b52610d5f6080611adf565b50610d68611843565b8181526303d77f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610da96080611af0565b52610db46080611af0565b50610dbd611843565b60018152630389b6806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610dff6080611b01565b52610e0a6080611b01565b50610e13611843565b8181526303831f006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610e546080611b12565b52610e5f6080611b12565b50610e68611843565b60018152630371fb806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e0820152610eaa6080611b23565b52610eb56080611b23565b50610ebe611843565b600181526303676f806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610f006080611b34565b52610f0b6080611b34565b50610f14611843565b600181526303394b006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610f566080611b45565b52610f616080611b45565b50610f6a611843565b60018152630368c1006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e0820152610fac6080611b56565b52610fb76080611b56565b50610fc0611843565b60018152630351060090816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526110046080611b67565b5261100f6080611b67565b50611018611843565b6001815263032827806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015261105a6080611b78565b526110656080611b78565b5061106e611843565b60018152816020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526110ac6080611b89565b526110b76080611b89565b506110c0611843565b8281526304f443006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111016080611b9a565b5261110c6080611b9a565b50611115611843565b6001815263033a9c806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111576080611bab565b526111626080611bab565b5061116b611843565b90600182526020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111a96080611bbc565b526111b46080611bbc565b506111bd611843565b6001815263046b27006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526111ff6080611bcd565b5261120a6080611bcd565b50611213611843565b600181526302fa03006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526112556080611bde565b526112606080611bde565b50611269611843565b600181526302f0c8806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526112ab6080611bef565b526112b66080611bef565b506112bf611843565b9081526302dbb0806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526113006080611c00565b5261130b6080611c00565b50611314611843565b600181526302947f806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526113566080611c11565b526113616080611c11565b5061136a611843565b600181526302820a806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526113ac6080611c22565b526113b76080611c22565b506113c0611843565b600181526302cbde806020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526114026080611c33565b5261140d6080611c33565b50611416611843565b6001815263023442006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600160e08201526114586080611c44565b526114636080611c44565b506000805b6080518110156117da5760a0600582901b01516000925b60ff8251168410156117c9577f64404627f9392c993df73912dbfb24528266190d015c31a2a5dcf19d4c62184c54818111156117b05781101561179a577f64404627f9392c993df73912dbfb24528266190d015c31a2a5dcf19d4c62184c60005260206000206000906005830281015461150b63ffffffff8260c01c166001600160401b038316611c64565b6001600160401b03808360401c16911603611791575b602085015163ffffffff60a01b60a09190911b1663ffffffff60a01b19821681176005860284015560408601516001600160401b0316918261176c575b50505060608401516001600160401b038116611737575b50608084015161171e575b60a08401516116fe575b60c08401516116df575b60e08401516116a2575b6005830201549063ffffffff8260c01c1663ffffffff8360801c1611611689571580611656575b61163d576001600160401b036115ec828263ffffffff636903fc009560a01c169116611c64565b16036116255760018101811161160f576001611609910193611c55565b9261147f565b634e487b7160e01b600052601160045260246000fd5b602490604051906379a8a49960e11b82526004820152fd5b604051631d86500b60e21b815260048101839052602490fd5b506001600160401b0361167463ffffffff8360c01c16828416611c64565b166001600160401b038260401c1614156115c5565b604051639ce1550560e01b815260048101849052602490fd5b826000527f423605f996078acc205f33a6458ae6ea5c4b6179bbe6f42712c6ca48e103aa316020526040600020600160ff1982541617905561159e565b60058302810180546001600160e01b03166102a360e71b179055611594565b600583028101805463ffffffff60c01b19166102a360c71b17905561158a565b600583028101805463ffffffff60801b19169055611580565b600584028201805467ffffffffffffffff60401b191660409290921b67ffffffffffffffff60401b1691909117905586611575565b67ffffffffffffffff63ffffffff60a01b01191617176005840282015586808061155e565b60019250611521565b634e487b7160e01b600052603260045260246000fd5b60405163ad7d6e0960e01b815260048101839052602490fd5b9250506117d590611c55565b611468565b005b6020906117e7611843565b6000815282600081830152600060408301526000606083015260006080830152600060a0830152600060c0830152600060e083015282608001015201610041565b634e487b7160e01b600052604160045260246000fd5b600080fd5b6040519061010082018281106001600160401b0382111761182857604052565b80511561179a5760200190565b80516001101561179a5760400190565b80516002101561179a5760600190565b80516003101561179a5760800190565b80516004101561179a5760a00190565b80516005101561179a5760c00190565b80516006101561179a5760e00190565b80516007101561179a576101000190565b80516008101561179a576101200190565b80516009101561179a576101400190565b8051600a101561179a576101600190565b8051600b101561179a576101800190565b8051600c101561179a576101a00190565b8051600d101561179a576101c00190565b8051600e101561179a576101e00190565b8051600f101561179a576102000190565b80516010101561179a576102200190565b80516011101561179a576102400190565b80516012101561179a576102600190565b80516013101561179a576102800190565b80516014101561179a576102a00190565b80516015101561179a576102c00190565b80516016101561179a576102e00190565b80516017101561179a576103000190565b80516018101561179a576103200190565b80516019101561179a576103400190565b8051601a101561179a576103600190565b8051601b101561179a576103800190565b8051601c101561179a576103a00190565b8051601d101561179a576103c00190565b8051601e101561179a576103e00190565b8051601f101561179a576104000190565b80516020101561179a576104200190565b80516021101561179a576104400190565b80516022101561179a576104600190565b80516023101561179a576104800190565b80516024101561179a576104a00190565b80516025101561179a576104c00190565b80516026101561179a576104e00190565b80516027101561179a576105000190565b80516028101561179a576105200190565b80516029101561179a576105400190565b8051602a101561179a576105600190565b8051602b101561179a576105800190565b8051602c101561179a576105a00190565b8051602d101561179a576105c00190565b8051602e101561179a576105e00190565b8051602f101561179a576106000190565b80516030101561179a576106200190565b80516031101561179a576106400190565b80516032101561179a576106600190565b80516033101561179a576106800190565b80516034101561179a576106a00190565b80516035101561179a576106c00190565b80516036101561179a576106e00190565b80516037101561179a576107000190565b80516038101561179a576107200190565b80516039101561179a576107400190565b8051603a101561179a576107600190565b8051603b101561179a576107800190565b600019811461160f5760010190565b9190916001600160401b038080941691160191821161160f5756fea26469706673582212206e07a109f21efc440a2157b32d0d2315c5673a90c3608013e34fed23e163cfc664736f6c63430008140033", + "devdoc": { + "errors": { + "VestingScheduleNotFound(uint256)": [ + { + "params": { + "index": "vesting schedule index" + } + } + ] + }, + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "errors": { + "VestingScheduleNotFound(uint256)": [ + { + "notice": "The VestingSchedule was not found" + } + ] + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/mainnet/solcInputs/37f3fc6b84869918de46b14efdfb3bb5.json b/deployments/mainnet/solcInputs/37f3fc6b84869918de46b14efdfb3bb5.json new file mode 100644 index 00000000..bf25846b --- /dev/null +++ b/deployments/mainnet/solcInputs/37f3fc6b84869918de46b14efdfb3bb5.json @@ -0,0 +1,50 @@ +{ + "language": "Solidity", + "sources": { + "contracts/src/migration/TLC_globalUnlockScheduleMigration.sol": { + "content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.20;\n\nimport \"../state/tlc/VestingSchedules.2.sol\";\nimport \"../state/tlc/IgnoreGlobalUnlockSchedule.sol\";\n\nstruct VestingScheduleMigration {\n // number of consecutive schedules to migrate with the same parameters\n uint8 scheduleCount;\n // The new lock duration\n uint32 newLockDuration;\n // if != 0, the new start value\n uint64 newStart;\n // if != 0, the new end value\n uint64 newEnd;\n // set cliff to 0 if true\n bool setCliff;\n // if true set vesting duration to 86400\n bool setDuration;\n // if true set vesting period duration to 86400\n bool setPeriodDuration;\n // if true schedule will not be subject to global unlock schedule\n bool ignoreGlobalUnlock;\n}\n\nuint256 constant OCTOBER_31_2025 = 1761868800;\n\ncontract TlcMigration {\n error CliffTooLong(uint256 i);\n error WrongUnlockDate(uint256 i);\n error WrongEnd(uint256 i);\n\n function migrate() external {\n VestingScheduleMigration[] memory migrations = new VestingScheduleMigration[](60);\n // 0 -> 6\n migrations[0] = VestingScheduleMigration({\n scheduleCount: 7,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 108604800, // 75772800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 7\n migrations[1] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 103161600, // 70329600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 8\n migrations[2] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 98323200, // 65491200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 9 -> 12\n migrations[3] = VestingScheduleMigration({\n scheduleCount: 4,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 105235200, // 72403200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 13\n migrations[4] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 99878400, // 67046400\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 14\n migrations[5] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 89337600, // 56505600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 15\n migrations[6] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 91065600, // 58233600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 16\n migrations[7] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 90806400, // 57974400\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 17\n migrations[8] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 86572800, // 53740800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 18\n migrations[9] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 108604800, // 75772800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 19\n migrations[10] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 82306800, // 49474800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 20\n migrations[11] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 108604800, // 75772800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 21\n migrations[12] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 82306800, // 49474800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 22\n migrations[13] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 108604800, // 75772800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 23\n migrations[14] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 82306800, // 49474800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 24 -> 26\n migrations[15] = VestingScheduleMigration({\n scheduleCount: 3,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 108604800, // 75772800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 27\n migrations[16] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 103161600, // 70329600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 28 -> 29\n migrations[17] = VestingScheduleMigration({\n scheduleCount: 2,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 83203200, // 50371200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 30\n migrations[18] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 83548800, // 50716800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 31\n migrations[19] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 83635200, // 50803200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 32\n migrations[20] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 83721600, // 50889600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 33\n migrations[21] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 83548800, // 50716800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 34 -> 35\n migrations[22] = VestingScheduleMigration({\n scheduleCount: 2,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 83721600, // 50889600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 36 -> 60\n migrations[23] = VestingScheduleMigration({\n scheduleCount: 25,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 75693600, // 42861600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 61\n migrations[24] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 73785600, // 40953600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 62\n migrations[25] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 81561600, // 48729600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 63\n migrations[26] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 74476800, // 41644800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 64\n migrations[27] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 79833600, // 47001600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 65\n migrations[28] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 77846400, // 45014400\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 66\n migrations[29] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 71020800, // 38188800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 67 -> 69\n migrations[30] = VestingScheduleMigration({\n scheduleCount: 3,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 75693600, // 42861600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 70\n migrations[31] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 63763200, // 33004800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 71\n migrations[32] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 64972800, // 34214400\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 72\n migrations[33] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 64713600, // 33955200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 73\n migrations[34] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 69811200, // 39052800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 74\n migrations[35] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 69897600, // 41731200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 75\n migrations[36] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 68688000, // 40521600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 76\n migrations[37] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 67478400, // 39312900\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 77\n migrations[38] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 65059200, // 36892800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 78 -> 79\n migrations[39] = VestingScheduleMigration({\n scheduleCount: 2,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 64454400, // 36288000\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 80\n migrations[40] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 59356800, // 33523200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 81 -> 82\n migrations[41] = VestingScheduleMigration({\n scheduleCount: 2,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 58924800, // 33091200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 83\n migrations[42] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 57801600, // 38016000\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 84\n migrations[43] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 57110400, // 37324800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 85\n migrations[44] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 54086400, // 34300800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 86\n migrations[45] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 57196800, // 39571200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 87\n migrations[46] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 55641600, // 38016000\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 88\n migrations[47] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 52963200, // 35337600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 89\n migrations[48] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 55641600, // 38016000\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 90 -> 91\n migrations[49] = VestingScheduleMigration({\n scheduleCount: 2,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 83116800, // 65491200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 92\n migrations[50] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 54172800, // 36547200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 93\n migrations[51] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 55641600, // 38016000\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 94\n migrations[52] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 74131200, // 56505600\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 95\n migrations[53] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 49939200, // 35424000\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n // 96\n migrations[54] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 49334400, // 34819200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 97 -> 98\n migrations[55] = VestingScheduleMigration({\n scheduleCount: 2,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 47952000, // 36547200\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 99\n migrations[56] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 43286400, // 33696000\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 100\n migrations[57] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 42076800, // 32486400\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 101\n migrations[58] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 46915200, // 37324800\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: false\n });\n // 102\n migrations[59] = VestingScheduleMigration({\n scheduleCount: 1,\n newStart: 0,\n newEnd: 0,\n newLockDuration: 36979200, // 32918400\n setCliff: false,\n setDuration: false,\n setPeriodDuration: false,\n ignoreGlobalUnlock: true\n });\n\n // All schedules covered\n\n uint256 index = 0;\n for (uint256 i = 0; i < migrations.length; i++) {\n VestingScheduleMigration memory migration = migrations[i];\n for (uint256 j = 0; j < migration.scheduleCount; j++) {\n VestingSchedulesV2.VestingSchedule storage sch = VestingSchedulesV2.get(index);\n\n bool isRevoked = false;\n if (sch.start + sch.duration != sch.end) {\n isRevoked = true;\n }\n // Modifications\n sch.lockDuration = migration.newLockDuration;\n if (migration.newStart != 0) {\n sch.start = migration.newStart;\n }\n if (migration.newEnd != 0) {\n sch.end = migration.newEnd;\n }\n if (migration.setCliff) {\n sch.cliffDuration = 0;\n }\n if (migration.setDuration) {\n sch.duration = 86400;\n }\n if (migration.setPeriodDuration) {\n sch.periodDuration = 86400;\n }\n if (migration.ignoreGlobalUnlock) {\n IgnoreGlobalUnlockSchedule.set(index, true);\n }\n\n // Post effects checks\n // check cliff is not longer than duration\n if (sch.cliffDuration > sch.duration) {\n revert CliffTooLong(index);\n }\n // sanity checks on non revoked schedules\n if (!isRevoked && (sch.end != sch.start + sch.duration)) {\n revert WrongEnd(index);\n }\n // check all the schedules are locked until unix : 1761868800\n if (sch.start + sch.lockDuration != OCTOBER_31_2025) {\n revert WrongUnlockDate(index);\n }\n\n index += 1;\n }\n }\n }\n}\n" + }, + "contracts/src/state/tlc/IgnoreGlobalUnlockSchedule.sol": { + "content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.20;\n\n/// @title Global unlock schedule activation storage\n/// @notice Utility to manage the global unlock schedule activation mapping in storage\n/// @notice The global unlock schedule releases 1/24th of the total scheduled amount every month after the local lock end\nlibrary IgnoreGlobalUnlockSchedule {\n /// @notice Storage slot of the global unlock schedule activation mapping\n bytes32 internal constant GLOBAL_UNLOCK_ACTIVATION_SLOT =\n bytes32(uint256(keccak256(\"tlc.state.globalUnlockScheduleActivation\")) - 1);\n\n /// @notice Structure stored in storage slot\n struct Slot {\n /// @custom:attribute Mapping keeping track of activation per schedule\n mapping(uint256 => bool) value;\n }\n\n /// @notice Retrieve the global unlock schedule activation value of a schedule, true if the global lock should be ignored\n /// @param _scheduleId The schedule id\n /// @return The global unlock activation value\n function get(uint256 _scheduleId) internal view returns (bool) {\n bytes32 slot = GLOBAL_UNLOCK_ACTIVATION_SLOT;\n\n Slot storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n return r.value[_scheduleId];\n }\n\n /// @notice Sets the global unlock schedule activation value of a schedule\n /// @param _scheduleId The id of the schedule to modify\n /// @param _ignoreGlobalUnlock The value to set, true if the global lock should be ignored\n function set(uint256 _scheduleId, bool _ignoreGlobalUnlock) internal {\n bytes32 slot = GLOBAL_UNLOCK_ACTIVATION_SLOT;\n\n Slot storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n r.value[_scheduleId] = _ignoreGlobalUnlock;\n }\n}\n" + }, + "contracts/src/state/tlc/VestingSchedules.1.sol": { + "content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.20;\n\n/// @title VestingSchedulesV1 Storage\n/// @notice Utility to manage VestingSchedulesV1 in storage\nlibrary VestingSchedulesV1 {\n /// @notice Storage slot of the Vesting Schedules\n bytes32 internal constant VESTING_SCHEDULES_SLOT =\n bytes32(uint256(keccak256(\"erc20VestableVotes.state.schedules\")) - 1);\n\n struct VestingSchedule {\n // start time of the vesting period\n uint64 start;\n // date at which the vesting is ended\n // initially it is equal to start+duration then to revoke date in case of revoke\n uint64 end;\n // duration before which first tokens gets ownable\n uint32 cliffDuration;\n // duration before tokens gets unlocked. can exceed the duration of the vesting chedule\n uint32 lockDuration;\n // duration of the entire vesting (sum of all vesting period durations)\n uint32 duration;\n // duration of a single period of vesting\n uint32 periodDuration;\n // amount of tokens granted by the vesting schedule\n uint256 amount;\n // creator of the token vesting\n address creator;\n // beneficiary of tokens after they are releaseVestingScheduled\n address beneficiary;\n // whether the schedule can be revoked\n bool revocable;\n }\n\n /// @notice The structure at the storage slot\n struct SlotVestingSchedule {\n /// @custom:attribute Array containing all the vesting schedules\n VestingSchedule[] value;\n }\n\n /// @notice The VestingSchedule was not found\n /// @param index vesting schedule index\n error VestingScheduleNotFound(uint256 index);\n\n /// @notice Retrieve the vesting schedule in storage\n /// @param _index index of the vesting schedule\n /// @return the vesting schedule\n function get(uint256 _index) internal view returns (VestingSchedule storage) {\n bytes32 slot = VESTING_SCHEDULES_SLOT;\n\n SlotVestingSchedule storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n if (r.value.length <= _index) {\n revert VestingScheduleNotFound(_index);\n }\n\n return r.value[_index];\n }\n\n /// @notice Get vesting schedule count in storage\n /// @return The count of vesting schedule in storage\n function getCount() internal view returns (uint256) {\n bytes32 slot = VESTING_SCHEDULES_SLOT;\n\n SlotVestingSchedule storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n return r.value.length;\n }\n\n /// @notice Add a new vesting schedule in storage\n /// @param _newSchedule new vesting schedule to create\n /// @return The size of the vesting schedule array after the operation\n function push(VestingSchedule memory _newSchedule) internal returns (uint256) {\n bytes32 slot = VESTING_SCHEDULES_SLOT;\n\n SlotVestingSchedule storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n r.value.push(_newSchedule);\n\n return r.value.length;\n }\n}\n" + }, + "contracts/src/state/tlc/VestingSchedules.2.sol": { + "content": "//SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.20;\n\nimport \"./VestingSchedules.1.sol\";\n\n/// @title VestingSchedulesV2 Storage\n/// @notice Utility to manage VestingSchedulesV2 in storage\nlibrary VestingSchedulesV2 {\n /// @notice Storage slot of the Vesting Schedules (note the slot is different from v1)\n bytes32 internal constant VESTING_SCHEDULES_SLOT =\n bytes32(uint256(keccak256(\"erc20VestableVotes.state.v2.schedules\")) - 1);\n\n struct VestingSchedule {\n // start time of the vesting period\n uint64 start;\n // date at which the vesting is ended\n // initially it is equal to start+duration then to revoke date in case of revoke\n uint64 end;\n // duration before which first tokens gets ownable\n uint32 cliffDuration;\n // duration before tokens gets unlocked. can exceed the duration of the vesting chedule\n uint32 lockDuration;\n // duration of the entire vesting (sum of all vesting period durations)\n uint32 duration;\n // duration of a single period of vesting\n uint32 periodDuration;\n // amount of tokens granted by the vesting schedule\n uint256 amount;\n // creator of the token vesting\n address creator;\n // beneficiary of tokens after they are releaseVestingScheduled\n address beneficiary;\n // whether the schedule can be revoked\n bool revocable;\n // amount of released tokens\n uint256 releasedAmount;\n }\n\n /// @notice The structure at the storage slot\n struct SlotVestingSchedule {\n /// @custom:attribute Array containing all the vesting schedules\n VestingSchedule[] value;\n }\n\n /// @notice The VestingSchedule was not found\n /// @param index vesting schedule index\n error VestingScheduleNotFound(uint256 index);\n\n /// @notice Retrieve the vesting schedule in storage\n /// @param _index index of the vesting schedule\n /// @return the vesting schedule\n function get(uint256 _index) internal view returns (VestingSchedule storage) {\n bytes32 slot = VESTING_SCHEDULES_SLOT;\n\n SlotVestingSchedule storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n if (r.value.length <= _index) {\n revert VestingScheduleNotFound(_index);\n }\n\n return r.value[_index];\n }\n\n /// @notice Get vesting schedule count in storage\n /// @return The count of vesting schedule in storage\n function getCount() internal view returns (uint256) {\n bytes32 slot = VESTING_SCHEDULES_SLOT;\n\n SlotVestingSchedule storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n return r.value.length;\n }\n\n /// @notice Add a new vesting schedule in storage\n /// @param _newSchedule new vesting schedule to create\n /// @return The size of the vesting schedule array after the operation\n function push(VestingSchedule memory _newSchedule) internal returns (uint256) {\n bytes32 slot = VESTING_SCHEDULES_SLOT;\n\n SlotVestingSchedule storage r;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n r.slot := slot\n }\n\n r.value.push(_newSchedule);\n\n return r.value.length;\n }\n\n /// @notice Migrate a VestingSchedule from v1 to v2\n /// @notice Takes a VestingSchedule in v1 format in stores it in v2 format\n /// @param _index of the schedule in v1 to be migrated\n /// @param _releasedAmount The released amount to keep in storage\n /// @return The index of the created schedule in v2 format\n function migrateVestingScheduleFromV1(uint256 _index, uint256 _releasedAmount) internal returns (uint256) {\n VestingSchedulesV1.VestingSchedule memory scheduleV1 = VestingSchedulesV1.get(_index);\n VestingSchedulesV2.VestingSchedule memory scheduleV2 = VestingSchedulesV2.VestingSchedule({\n start: scheduleV1.start,\n end: scheduleV1.end,\n lockDuration: scheduleV1.lockDuration,\n cliffDuration: scheduleV1.cliffDuration,\n duration: scheduleV1.duration,\n periodDuration: scheduleV1.periodDuration,\n amount: scheduleV1.amount,\n creator: scheduleV1.creator,\n beneficiary: scheduleV1.beneficiary,\n revocable: scheduleV1.revocable,\n releasedAmount: _releasedAmount\n });\n\n return push(scheduleV2) - 1;\n }\n}\n" + } + }, + "settings": { + "viaIR": true, + "optimizer": { + "enabled": true, + "runs": 100 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates", + "devdoc", + "userdoc", + "devdoc", + "userdoc" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index 0c24836a..b1cb7ded 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -96,7 +96,7 @@ const config: HardhatUserConfig = { mainnet: "0x8EE3fC0Bcd7B57429203751C5bE5fdf1AB8409f3", holesky: "0x80Cf8bD4abf6C078C313f72588720AB86d45c5E6", devHolesky: "0x0FdEe4562D7e6dbA05A9f892D2Be04B83f3E7579", - tenderly: "0x0FdEe4562D7e6dbA05A9f892D2Be04B83f3E7579", + tenderly: "0x8EE3fC0Bcd7B57429203751C5bE5fdf1AB8409f3", }, collector: { default: 1, diff --git a/scripts/helpers.ts b/scripts/helpers.ts index 0ed2f533..37579c30 100644 --- a/scripts/helpers.ts +++ b/scripts/helpers.ts @@ -6,15 +6,17 @@ export const verify = async (name: string, contractAddress: string, args: any, l if (network.name == "localhost" || network.name == "local") return; else if (network.name == "tenderly") tenderlyVerify(name, contractAddress); else { - await hre.run("verify:verify", { - address: contractAddress, - constructorArguments: args, - libraries: { - ...libs, - }, - }).catch((e) => { - console.log(e.message); - }); + await hre + .run("verify:verify", { + address: contractAddress, + constructorArguments: args, + libraries: { + ...libs, + }, + }) + .catch((e) => { + console.log(e.message); + }); } }; @@ -26,3 +28,48 @@ const tenderlyVerify = async (name: string, contractAddress: string) => { }); } }; + +export async function upgradeToAndCall( + deployments, + ethers, + newImplementationAddress, + signer, + sendTo, + initData, + upgrading +) { + // Get the ABI for the TransparentUpgradeableProxy + const proxyTransparentArtifact = await deployments.getArtifact("ITransparentUpgradeableProxy"); + const proxyTransparentInterface = new ethers.utils.Interface(proxyTransparentArtifact.abi); + + const upgradeData = proxyTransparentInterface.encodeFunctionData("upgradeToAndCall", [ + newImplementationAddress, + initData, + ]); + + // Send the transaction + const txCount = await signer.getTransactionCount(); + const tx = await signer.sendTransaction({ + to: sendTo, + data: upgradeData, + nonce: txCount, + }); + await tx.wait(); + console.log("tx >> ", tx); + console.log(`${upgrading} proxy upgraded to ${newImplementationAddress} with initialization`); +} + +export async function upgradeTo(deployments, ethers, newImplementation, signer, sendTo, upgrading) { + const proxyTransparentArtifact = await deployments.getArtifact("ITransparentUpgradeableProxy"); + const proxyTransparentInterface = new ethers.utils.Interface(proxyTransparentArtifact.abi); + let upgradeData = proxyTransparentInterface.encodeFunctionData("upgradeTo", [newImplementation.address]); + let txCount = await signer.getTransactionCount(); + let tx = await signer.sendTransaction({ + to: sendTo, + data: upgradeData, + nonce: txCount, + }); + await tx.wait(); + console.log("tx >> ", tx); + console.log(`${upgrading} Proxy upgraded to ${newImplementation.address}`); +}