redefine fraction as uint16
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user