You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on the number of courts returned on the first query (array.length), we will use .map() to create that number of CourtCards, passing as parameters each court in which the user is staked, the total stake they have in that court, and how much stake is locked
in v2 subgraph, we have degreeOfCoherency, so we could fetch this from the subgraph, then we can compute the average of degreeOfCoherency for all the rounds in which the user has participated
some hardcoded values, I have looked through all the "kleros-v2/web" files (and all its subfolders) and I've encountered these:
correct links, respectively:
https://forum.kleros.io/
https://snapshot.org/#/kleros.eth/
https://kleros.io/coop/
https://t.me/kleros
https://discord.com/invite/cAvWk8B23f
https://t.me/kleros
https://slack.kleros.io/
hmm, this wasn't a hardcode, in this file there should be declared all the supported chains
instead of hardcoding the chainId and arbitrableAddress on the "arbitrable" const, pass these values as parameters
on useEvidenceGroup, like this:
and then create the arbitrable const like this:
then depending on the chain who is calling it, the parameters will change.
exactly the same solution as the above in useEvidenceGroup()
create a .env and place this provider there, as:
then create a .env.example and place it without the private key:
instead of hardcoding the string "View profile on Proof of Humanity" use a general solution like the one in Court V1 https://github.com/kleros/court/blob/a837a3a798795c00d4d5c04a3c7b4eb4434632ac/src/components/case-details-card.js#L654
and instead of hardcoding the URL of the interface (proof of humanity profile) use a general solution like the one in Court V1 https://github.com/kleros/court/blob/master/src/components/case-details-card.js#L348
you can do this subgraph query, passing as parameter the desired courtId (ex: "1"):
It's requesting two fields for this court:
then you can get the juror odds with a formula, ex:
(jurorBalance?.staked / totalStaked in that court) * 100
We can solve this problem with queries to the subgraph:
Make a query to thegraph and see in which courts the user is staked, we are interested specifically in the "id" and "name" of these courts:
Now, we need to make more queries with each court id received earlier, to know how much PNK is staked and how much is locked in each court:
Depending on the number of courts returned on the first query (array.length), we will use .map() to create that number of CourtCards, passing as parameters each court in which the user is staked, the total stake they have in that court, and how much stake is locked
in v2 subgraph, we have degreeOfCoherency, so we could fetch this from the subgraph, then we can compute the average of degreeOfCoherency for all the rounds in which the user has participated
for this, maybe we could do a subgraph query, and request the "shifts" field from the user, something like this:
looking at how Court V1 does it,
for getting the Unclaimed PNK amount: https://github.com/kleros/court/blob/4c27719ee3eb5f039efd4470f18bec5d07e2c202/src/components/claim-modal.js#L198
for getting the APY %: https://github.com/kleros/court/blob/master/src/components/claim-modal.js#L139
for getting the tokens rewarded: https://github.com/kleros/court/blob/4c27719ee3eb5f039efd4470f18bec5d07e2c202/src/components/claim-modal.js#L212
Min Stake, Vote Stake, PNK Staked, ETH paid to Jurors, PNK redistributed at pages/Courts/CourtDetails/Stats.tsx #659
PNK staked, ETH Paid to jurors, PNK redistributed at pages/Home/CourtOverview/Stats.tsx #660
value of a year in seconds at pages/Home/index.tsx #661
More on the Cases page
Hardcoded values: Total, In Progress, Closed number of cases #1084
The text was updated successfully, but these errors were encountered: