redefine fraction as uint16
This commit is contained in:
@@ -260,8 +260,9 @@ async function placeOrder() {
|
|||||||
} else {
|
} else {
|
||||||
window = duration / n
|
window = duration / n
|
||||||
}
|
}
|
||||||
const ceil = 10n ** 18n % BigInt(n) ? 1n : 0n
|
const oneHundredPercent = 65535n // by contract definition of uint16 fraction
|
||||||
const amtPerTranche = 10n ** 18n / BigInt(n) + ceil
|
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
|
duration -= 15 // subtract 15 seconds so the last tranche completes before the deadline
|
||||||
for (let i = 0; i < n; i++) {
|
for (let i = 0; i < n; i++) {
|
||||||
const start = Math.floor(i * (duration / n))
|
const start = Math.floor(i * (duration / n))
|
||||||
|
|||||||
Reference in New Issue
Block a user