Skip to content

Commit

Permalink
choose ramdomly (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo authored Apr 3, 2024
1 parent e918c44 commit 03d4fbb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions frontend/claim_sdk/treasury.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ export const funders = [
]

export function getClaimPayers(claimInfo: ClaimInfo): [PublicKey, PublicKey] {
const buffer = claimInfo.toBuffer()
const toHex = buffer.toString('hex')
const toNumber = parseInt(toHex, 16)
const funderIndex = toNumber % funders.length

const treasuryIndex = toNumber % treasuries.length

return [funders[funderIndex], treasuries[treasuryIndex]]
// just choose ramdomly
const index = Math.floor(Math.random() * treasuries.length)
return [funders[index], treasuries[index]]
}

0 comments on commit 03d4fbb

Please sign in to comment.