Skip to content

Commit

Permalink
Merge branch 'master' into fix-152-resolve-address-domains
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Mar 13, 2024
2 parents 1b6b836 + 7b37a7f commit 671aa1b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-gifts-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@snapshot-labs/sx": patch
---

change default decimals for remote-vp strategy to 18
2 changes: 1 addition & 1 deletion apps/ui/src/networks/offchain/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export function createActions(

return result.map((value: bigint, index: number) => {
const strategy = strategiesOrValidationParams[index];
const decimals = parseInt(strategy.params.decimals || 0);
const decimals = parseInt(strategy.params.decimals || 18);

return {
address: strategy.name,
Expand Down
4 changes: 2 additions & 2 deletions packages/sx.js/src/strategies/offchain/remote-vp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export default function createRemoteVpStrategy(): Strategy {

return result.vp_by_strategy.map((vp: number, i: number) => {
const strategy = params[i];
const decimals = parseInt(strategy.params.decimals || 0);
const decimals = parseInt(strategy.params.decimals || 18);

return BigInt(vp * 10 ** decimals);
return BigInt(Math.floor(vp * 10 ** decimals));
});
}
};
Expand Down

0 comments on commit 671aa1b

Please sign in to comment.