From b699d7607392d50a88154e3b241ad1884b6564e9 Mon Sep 17 00:00:00 2001 From: Tim Olson <> Date: Fri, 13 Oct 2023 16:53:21 -0400 Subject: [PATCH] redefine fraction as uint16 --- src/components/TimedOrderEntry.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/TimedOrderEntry.vue b/src/components/TimedOrderEntry.vue index 5384a8e..3b499b9 100644 --- a/src/components/TimedOrderEntry.vue +++ b/src/components/TimedOrderEntry.vue @@ -260,8 +260,9 @@ async function placeOrder() { } else { window = duration / n } - const ceil = 10n ** 18n % BigInt(n) ? 1n : 0n - const amtPerTranche = 10n ** 18n / BigInt(n) + ceil + const oneHundredPercent = 65535n // by contract definition of uint16 fraction + const ceil = oneHundredPercent % BigInt(n) ? 1n : 0n + const amtPerTranche = oneHundredPercent / BigInt(n) + ceil duration -= 15 // subtract 15 seconds so the last tranche completes before the deadline for (let i = 0; i < n; i++) { const start = Math.floor(i * (duration / n))