Skip to content

Commit a5165d8

Browse files
authored
staking: support index stake and subgraph allocation stake (#174)
* stlye: increase max line * tests: remove unused test * curation: refactor and natspec update * disputes: update reward calculation and natspec * tests: remove unused and add new defaults * staking: rewrite first version with stake+allocate * staking: add channel data * staking: fix test * staking: add thawing period * staking: add token locking for withdrawal * staking: - add "low-level" stake balance logic in a library - add and improve stake, unstake, allocate, slash functions - add withdraw unlocked tokens after thawing period - add support for thawing averaging when multiple unstake request - move slashingPercent settings and calculations to dispute contract * staking: add tests * staking: add more test * staking: add unstake weighted avg tests * tests: equal -> eq * staking: add more tests * curation: rename functions * staking: add channel multisig creation * staking: channel settlement according to incoming token address * staking: - use underscore for private methods as convention - actually create the conterfactual multisig channel - fix tests * staking: add rebate pool * staking: avoid distribution of curation fees if subgraph not curated * build: fix and improve deploy script (#175) * build: - deploy script using await/async - deploy missing new contracts - add a config file with desired deploy parameters * build: remove web3 dependency in config file * build: add tx hash when calling setters and better logging * staking: remove channel proxy channel creation in favor of tracking channels by index node signer address * staking: delete rebate pool when all settlements claimed * staking: add channelDisputePeriod * staking: - allow max settlement to be zero - add event for rebate claim - setter for curation * staking: allow to restake when claiming the rebate * staking: do not allow to slash more funds than staked * staking: add channel dispute period restriction to claim * staking: check condition to avoid unstaking more funds that exist at the moment of withdrawal * staking: remove unallocate public call (for now) as only way to unallocate from subgraph must be to settle * disputes: chain id (#176) * staking: add more comments * epochs: remove unused redundant block number data (#177) * build: add husky rules (#178) * build: add husky rule for push * build: add husky config file * build: husky lint-staged * build: setup husky in package.json * build: process un-prettyfied files * staking: add setter for curation fee percentage and more tests * staking: address review improvements * staking: remove unused import * staking: rename index node stake tokens to make it clearer * staking: remove totalTokens and totalFees unused state
1 parent 3fd43b5 commit a5165d8

32 files changed

+2782
-2346
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"generator-star-spacing": ["error", "before"],
2929
"indent": ["error", 2],
3030
"linebreak-style": ["error", "unix"],
31-
"max-len": ["warn", 120, 2],
31+
"max-len": ["warn", 100, 2],
3232
"no-debugger": "off",
3333
"no-dupe-args": "error",
3434
"no-dupe-keys": "error",

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"printWidth": 80,
2+
"printWidth": 100,
33
"useTabs": false,
44
"bracketSpacing": true,
55
"overrides": [

.soliumrc.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
"extends": "solium:recommended",
33
"plugins": ["security"],
44
"rules": {
5+
"no-experimental": ["off"],
56
"quotes": ["error", "double"],
67
"indentation": ["error", 4],
7-
"linebreak-style": ["error", "unix"]
8+
"linebreak-style": ["error", "unix"],
9+
"security/no-inline-assembly": ["off"],
10+
"security/no-low-level-calls": ["off"]
811
}
9-
}
12+
}

0 commit comments

Comments
 (0)