Skip to content

Commit

Permalink
Fix validator deposit gno (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsudmi authored Mar 28, 2022
1 parent f801ba0 commit 654d654
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions config/gnosis.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"contract_checker_deployment_block": "20759530",
"ethereum_validators_deposit_root_start_block": "20760606",
"oracles_update_period": "86400",
"validator_deposit_amount": "1000000000000000000",
"distributor_redirected_from": {}
}
1 change: 1 addition & 0 deletions config/goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"contract_checker_deployment_block": "5797179",
"ethereum_validators_deposit_root_start_block": "6060000",
"oracles_update_period": "3600",
"validator_deposit_amount": "32000000000000000000",
"distributor_redirected_from": {}
}
1 change: 1 addition & 0 deletions config/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"contract_checker_deployment_block": "13748882",
"ethereum_validators_deposit_root_start_block": "13848500",
"oracles_update_period": "86400",
"validator_deposit_amount": "32000000000000000000",
"distributor_redirected_from": {}
}
1 change: 1 addition & 0 deletions config/perm_goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"contract_checker_deployment_block": "6406068",
"ethereum_validators_deposit_root_start_block": "6413785",
"oracles_update_period": "86400",
"validator_deposit_amount": "32000000000000000000",
"distributor_redirected_from": {}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stakewise-subgraphs",
"version": "1.2.0",
"version": "1.2.1",
"description": "Subgraphs for the StakeWise Protocol",
"repository": "https://github.com/stakewise/subgraphs",
"license": "AGPL-3.0-only",
Expand Down
4 changes: 4 additions & 0 deletions packages/constants/createConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ export let ORACLES_UPDATE_PERIOD = BigInt.fromString(
"${parsedData.oracles_update_period || "0"}"
);
export let VALIDATOR_DEPOSIT_AMOUNT = BigInt.fromString(
"${parsedData.validator_deposit_amount || "0"}"
);
${_getDistributorRedirectedFrom(parsedData.distributor_redirected_from)}
`;

Expand Down
2 changes: 1 addition & 1 deletion packages/constants/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "const",
"version": "1.2.0",
"version": "1.2.1",
"license": "AGPL-3.0-only",
"main": "index.ts",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/ethereum/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum",
"version": "1.2.0",
"version": "1.2.1",
"license": "AGPL-3.0-only",
"scripts": {
"prepare:goerli": "mustache config/goerli.json subgraph.template.yaml > subgraph.yaml",
Expand All @@ -15,7 +15,7 @@
"deploy:perm_goerli": "yarn build:perm_goerli",
"deploy:gnosis": "yarn build:gnosis && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ stakewise/ethereum-gnosis",
"deploy:mainnet": "yarn build:mainnet && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ stakewise/ethereum-mainnet",
"deploy:local": "graph deploy --version-label 1.2.0 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/ethereum",
"deploy:local": "graph deploy --version-label 1.2.1 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/ethereum",
"create:local": "graph create --node $GRAPH_NODE_URL stakewise/ethereum"
}
}
4 changes: 2 additions & 2 deletions subgraphs/rari-fuse/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rari-fuse",
"version": "1.2.0",
"version": "1.2.1",
"license": "AGPL-3.0-only",
"scripts": {
"prepare:goerli": "true",
Expand All @@ -15,7 +15,7 @@
"deploy:perm_goerli": "yarn build:perm_goerli",
"deploy:gnosis": "yarn build:gnosis",
"deploy:mainnet": "yarn build:mainnet && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ stakewise/rari-fuse-mainnet",
"deploy:local": "graph deploy --version-label 1.2.0 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/rari-fuse",
"deploy:local": "graph deploy --version-label 1.2.1 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/rari-fuse",
"create:local": "graph create --node $GRAPH_NODE_URL stakewise/rari-fuse"
}
}
4 changes: 2 additions & 2 deletions subgraphs/stakewise/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stakewise",
"version": "1.2.0",
"version": "1.2.1",
"license": "AGPL-3.0-only",
"scripts": {
"prepare:goerli": "mustache config/goerli.json subgraph.template.yaml > subgraph.yaml",
Expand All @@ -15,7 +15,7 @@
"deploy:perm_goerli": "yarn build:perm_goerli && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ stakewise/stakewise-perm-goerli",
"deploy:gnosis": "yarn build:gnosis && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ stakewise/stakewise-gnosis",
"deploy:mainnet": "yarn build:mainnet && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ stakewise/stakewise-mainnet",
"deploy:local": "graph deploy --version-label 1.2.0 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/stakewise",
"deploy:local": "graph deploy --version-label 1.2.1 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/stakewise",
"create:local": "graph create --node $GRAPH_NODE_URL stakewise/stakewise"
}
}
8 changes: 3 additions & 5 deletions subgraphs/stakewise/src/mappings/pool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BigInt, log, store } from "@graphprotocol/graph-ts";
import { log, store } from "@graphprotocol/graph-ts";

import { BIG_INT_1E18, BIG_INT_ONE } from "const";
import { VALIDATOR_DEPOSIT_AMOUNT, BIG_INT_ONE } from "const";
import {
Activated,
ActivatedValidatorsUpdated,
Expand Down Expand Up @@ -175,9 +175,7 @@ export function handleValidatorRegistered(event: ValidatorRegistered): void {
let pool = createOrLoadPool();

pool.pendingValidators = pool.pendingValidators.plus(BIG_INT_ONE);
pool.balance = pool.balance.minus(
BigInt.fromString("32").times(BIG_INT_1E18)
);
pool.balance = pool.balance.minus(VALIDATOR_DEPOSIT_AMOUNT);
pool.save();

let allocation = createOrLoadOperatorAllocation(operator);
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/uniswap-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uniswap-v3",
"version": "1.2.0",
"version": "1.2.1",
"license": "AGPL-3.0-only",
"scripts": {
"prepare:goerli": "mustache config/goerli.json subgraph.template.yaml > subgraph.yaml",
Expand All @@ -15,7 +15,7 @@
"deploy:perm_goerli": "yarn build:perm_goerli",
"deploy:gnosis": "yarn build:gnosis",
"deploy:mainnet": "yarn build:mainnet && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ stakewise/uniswap-v3-mainnet",
"deploy:local": "graph deploy --version-label 1.2.0 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/uniswap-v3",
"deploy:local": "graph deploy --version-label 1.2.1 --node $GRAPH_NODE_URL --ipfs $IPFS_URL stakewise/uniswap-v3",
"create:local": "graph create --node $GRAPH_NODE_URL stakewise/uniswap-v3"
}
}

0 comments on commit 654d654

Please sign in to comment.