Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[automations] Vesting Scheduler V2 ergonomic improvements #1904

Merged
merged 26 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e3a1013
allow creation and execution of the vesting schedule in the current b…
kasparkallas Mar 19, 2024
2a4f363
add createVestingSchedule function which works with totalAmount and t…
kasparkallas Mar 21, 2024
552a3df
add overloads without ctx
kasparkallas Mar 21, 2024
ad7ce58
add more overloads with fewer parameters
kasparkallas Mar 21, 2024
b9ee878
reorganize the functions
kasparkallas Mar 22, 2024
89a173a
add create and execute schedule mvp
kasparkallas Mar 22, 2024
b9464fb
remove try-catch from early end
kasparkallas Mar 26, 2024
648c5bf
add dust amount fix (wip)
kasparkallas Mar 26, 2024
adb07a5
Merge remote-tracking branch 'origin/dev' into vesting-scheduler-1_2
kasparkallas Mar 26, 2024
59832dc
rename from dustFixAmount to remainderAmount
kasparkallas Mar 26, 2024
96d06fa
fix test issues
kasparkallas Mar 27, 2024
9cce7cf
tiny comment rename
kasparkallas Mar 27, 2024
d5cdaca
Merge remote-tracking branch 'origin/dev' into vesting-scheduler-1_2
kasparkallas Apr 1, 2024
3c3c09c
remove functions create and execute functions with cliff period
kasparkallas Apr 1, 2024
78dc300
add a comprehensive fuzzed test for createScheduleFromAmountAndDuration
kasparkallas Apr 2, 2024
cd264e5
slightly change end compensation & remainder handling
kasparkallas Apr 3, 2024
4af5726
Merge branch 'dev' into vesting-scheduler-1_2
kasparkallas Apr 8, 2024
5997eed
Merge branch 'dev' into vesting-scheduler-1_2
kasparkallas Apr 10, 2024
bd008a2
keep V1 contract, separate V2 explicitly
kasparkallas Apr 10, 2024
5c75550
update deploy script for v2
kasparkallas Apr 10, 2024
a5239ce
Merge remote-tracking branch 'origin/dev' into vesting-scheduler-1_2
kasparkallas Apr 29, 2024
bfbefa1
unify deploy scripts
kasparkallas Apr 29, 2024
2bdd112
use newer host.registerApp & unify deploy scripts
kasparkallas Apr 30, 2024
cb84d33
clean-up
kasparkallas May 16, 2024
c1f97dc
add diff generation script & completely revert VestingScheduler.sol
kasparkallas May 17, 2024
40e0e39
merge dev
kasparkallas May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions packages/automation-contracts/autowrap/.env-example

This file was deleted.

11 changes: 11 additions & 0 deletions packages/automation-contracts/autowrap/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# .env-example

PRIVATE_KEY=

MUMBAI_URL=
POLYGON_URL=
BSC_URL=
OPSEPOLIA_URL=
BASE_URL=https://mainnet.base.org

ETHERSCAN_API_KEY=
46 changes: 41 additions & 5 deletions packages/automation-contracts/autowrap/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = {
optimizer: {
enabled: true,
runs: 200,
}
}
},
},
},
networks: {
localhost: {
Expand All @@ -29,21 +29,57 @@ module.exports = {
polygon: {
url: process.env.POLYGON_URL || "",
accounts:
process.env.POLYGON_PRIVATE_KEY !== undefined ? [process.env.POLYGON_PRIVATE_KEY] : [],
process.env.PRIVATE_KEY !== undefined
? [process.env.PRIVATE_KEY]
: [],
},
bsc: {
url: process.env.BSC_URL || "",
accounts:
process.env.BSC_PRIVATE_KEY !== undefined ? [process.env.BSC_PRIVATE_KEY] : [],
process.env.PRIVATE_KEY !== undefined
? [process.env.PRIVATE_KEY]
: [],
},
opsepolia: {
url: process.env.OPSEPOLIA_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined
? [process.env.PRIVATE_KEY]
: [],
},
"base-mainnet": {
url: process.env.BASE_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined
? [process.env.PRIVATE_KEY]
: [],
gasPrice: 1000000000
},
},

namedAccounts: {
deployer: {
default: 0,
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [
{
network: "opsepolia",
chainId: 11155420,
urls: {
apiURL: "https://api-sepolia-optimistic.etherscan.io/api",
browserURL: "https://sepolia-optimism.etherscan.io/",
},
},
{
network: "base-mainnet",
chainId: 8453,
urls: {
apiURL: "https://api.basescan.org/api",
browserURL: "https://basescan.org/",
},
},
],
},
};
1 change: 1 addition & 0 deletions packages/automation-contracts/autowrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"test": "forge test",
"build": "forge build",
"deploy": "npx hardhat deploy --network",
"lint": "run-s lint:*",
"lint:sol": "solhint -w 0 contracts/*.sol contracts/*/*.sol && echo '✔ Your .sol files look good.'",
"pre-commit": "if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi",
Expand Down
9 changes: 0 additions & 9 deletions packages/automation-contracts/scheduler/.env-example

This file was deleted.

15 changes: 15 additions & 0 deletions packages/automation-contracts/scheduler/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# .env-example

PRIVATE_KEY=

MUMBAI_URL=
POLYGON_URL=
BSC_URL=
OPSEPOLIA_URL=
BASE_URL=https://mainnet.base.org

ETHERSCAN_API_KEY=

DEPLOY_FLOW_SCHEDULER=
DEPLOY_VESTING_SCHEDULER=
DEPLOY_VESTING_SCHEDULER_V2=
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

git diff -U9999 --no-index --minimal --ignore-cr-at-eol --ignore-space-at-eol ./../contracts/interface/IVestingScheduler.sol ./../contracts/interface/IVestingSchedulerV2.sol > diff_IVestingScheduler_vs_IVestingSchedulerV2.txt
git diff -U9999 --no-index --minimal --ignore-cr-at-eol --ignore-space-at-eol ./../contracts/VestingScheduler.sol ./../contracts/VestingSchedulerV2.sol > diff_VestingScheduler_vs_VestingSchedulerV2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract FlowScheduler is IFlowScheduler, SuperAppBase {
using CFAv1Library for CFAv1Library.InitData;
CFAv1Library.InitData public cfaV1; //initialize cfaV1 variable

constructor(ISuperfluid host, string memory registrationKey) {
constructor(ISuperfluid host) {
// Initialize CFA Library
cfaV1 = CFAv1Library.InitData(
host,
Expand All @@ -40,7 +40,7 @@ contract FlowScheduler is IFlowScheduler, SuperAppBase {
SuperAppDefinitions.AFTER_AGREEMENT_UPDATED_NOOP |
SuperAppDefinitions.BEFORE_AGREEMENT_TERMINATED_NOOP |
SuperAppDefinitions.AFTER_AGREEMENT_TERMINATED_NOOP;
host.registerAppWithKey(configWord, registrationKey);
host.registerApp(configWord);
}

/// @dev IFlowScheduler.createFlowSchedule implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ contract VestingScheduler is IVestingScheduler, SuperAppBase {
(,int96 flowRate,,) = cfaV1.cfa.getFlow(superToken, sender, receiver);
return flowRate != 0;
}
}
}
Loading
Loading