Skip to content

Instantly share code, notes, and snippets.

@corbifex
Created August 31, 2020 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corbifex/efb7599dc58cbe0b58add7c5086d702f to your computer and use it in GitHub Desktop.
Save corbifex/efb7599dc58cbe0b58add7c5086d702f to your computer and use it in GitHub Desktop.
Calculate vote stake
public calculateVoteStake(investments: Array<Investment>): bigint {
let voteStake = BigInt(0);
investments.map(investment => {
if (investment.address === this.senderId) {
voteStake += BigInt(investment.amount);
}
});
return voteStake;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment