Skip to content

Commit

Permalink
feat: update goerli (5) redistribution address and phase boundaries, f…
Browse files Browse the repository at this point in the history
…ixes #6
  • Loading branch information
ldeffenb authored and mfw78 committed Oct 29, 2022
1 parent 17b6ea3 commit 78c9237
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ export const chainConfig: Configs = {
game: {
blocksPerRound: 152,
commitPhaseBlocks: 152 / 4,
revealPhaseBlocks: 152 / 4 + 1,
revealPhaseBlocks: 152 / 4,
},
contracts: {
redistribution: '0xF4963031E8b9f9659CB6ed35E53c031D76480EAD',
// redistribution: '0xF4963031E8b9f9659CB6ed35E53c031D76480EAD', // Pre 2022/10/28 10.0.0 rc1
redistribution: '0x2e4ccEb9a88bcfbC7779Fa693714783A345c1343',
stakeRegistry: '0x18391158435582D5bE5ac1640ab5E2825F68d3a4',
bzzToken: '0x2aC3c1d3e24b45c6C310534Bc2Dd84B5ed576335',
postageStamp: '0x7aAC0f092F7b961145900839Ed6d54b1980F200c',
Expand All @@ -50,7 +51,7 @@ export const chainConfig: Configs = {
game: {
blocksPerRound: 152,
commitPhaseBlocks: 152 / 4,
revealPhaseBlocks: 152 / 4 + 1,
revealPhaseBlocks: 152 / 4,
},
contracts: {
redistribution: '0xF4963031E8b9f9659CB6ed35E53c031D76480EAD', // wrong
Expand Down
8 changes: 4 additions & 4 deletions src/types/entities/schelling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ export class SchellingGame {
phase = 'commit'
length = blocksPerRound / 4
elapsed = offset + 1
} else if (offset <= blocksPerRound / 2) {
} else if (offset < blocksPerRound / 2) {
phase = 'reveal'
length = blocksPerRound / 4 + 1
length = blocksPerRound / 4
elapsed = offset - blocksPerRound / 4 + 1
} else {
phase = 'claim'
length = blocksPerRound / 2 - 1
elapsed = offset - blocksPerRound / 2
length = blocksPerRound / 2
elapsed = offset - blocksPerRound / 2 + 1
}
const remaining = length - elapsed
const percent = Math.floor((elapsed * 100) / length)
Expand Down

0 comments on commit 78c9237

Please sign in to comment.