Skip to content

Commit

Permalink
[AUTOMATIONS] Vesting Scheduler - add claimable schedule feature (#1944)
Browse files Browse the repository at this point in the history
* added claimable vesting feature

* add check on `_executeCliffAndFlow` for claimable schedules

* updated time window condition on schedule claim

* fix typo

* add some unit tests for claiming schedules

* increased test coverage

* added claimValidityDate feature

* updated tests

* add claimValidityDate param to createSchedules function

* updated unit tests

* refactor internal function params (stack too deep) + add claimValidityDate to schedule creation event

* removed `isClaimable` boolean from VestingSchedule data structure

* remove internal function creating dupplication

* updated claim validity date check logic

* refactor: re-order the claimValidityDate in the event

- keep it as one of the last for backwards compatibility

* refactor: rename error

CannotClaimFlowOnBehalf to CannotClaimScheduleOnBehalf

* fix: remove merge issues from hardhat configs

* fix: remove duplication from hardhat config

* fix: moved & rename params struct into VestingSchedulerV2 contract

---------

Co-authored-by: Kaspar Kallas <[email protected]>
Co-authored-by: Kaspar Kallas <[email protected]>
  • Loading branch information
3 people authored Jun 10, 2024
1 parent d416f90 commit 8012606
Show file tree
Hide file tree
Showing 7 changed files with 1,235 additions and 227 deletions.
2 changes: 1 addition & 1 deletion packages/automation-contracts/autowrap/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
process.env.PRIVATE_KEY !== undefined
? [process.env.PRIVATE_KEY]
: [],
gasPrice: 1000000000
gasPrice: 1000000000,
},
},
namedAccounts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract VestingScheduler is IVestingScheduler, SuperAppBase {
uint32 public constant START_DATE_VALID_AFTER = 3 days;
uint32 public constant END_DATE_VALID_BEFORE = 1 days;

constructor(ISuperfluid host, string memory registrationKey) {
constructor(ISuperfluid host) {
cfaV1 = CFAv1Library.InitData(
host,
IConstantFlowAgreementV1(
Expand All @@ -37,7 +37,7 @@ contract VestingScheduler is IVestingScheduler, SuperAppBase {
SuperAppDefinitions.AFTER_AGREEMENT_UPDATED_NOOP |
SuperAppDefinitions.BEFORE_AGREEMENT_TERMINATED_NOOP |
SuperAppDefinitions.AFTER_AGREEMENT_TERMINATED_NOOP;
host.registerAppWithKey(configWord, registrationKey);
host.registerApp(configWord);
}

/// @dev IVestingScheduler.createVestingSchedule implementation.
Expand Down
Loading

0 comments on commit 8012606

Please sign in to comment.