Skip to content

Commit d05aaf0

Browse files
fixes min max for real
1 parent 184e42a commit d05aaf0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mapping.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ let NORMAL_SUPPLY = BigInt.fromI32(5000000).times(BigInt.fromI32(10).pow(18)),
2424
MIN_SUPPLY_5 = BigInt.fromI32(2500000).times(BigInt.fromI32(10).pow(18)),
2525
MIN_SUPPLY_6 = BigInt.fromI32(1).times(BigInt.fromI32(10).pow(18))
2626

27-
function getMinSupply (dayStr: string): BigInt {
28-
let dayNum = parseInt(dayStr)
29-
switch (dayNum) {
27+
function getMinSupply (day: BigInt): BigInt {
28+
let dayVal = day.toI32()
29+
switch (dayVal) {
3030
case 8: case 10:
3131
return MIN_SUPPLY_1
3232
case 14: case 16: case 17:
@@ -153,7 +153,7 @@ export function handleWiseReservation(event: WiseReservation): void {
153153
if (gResDay == null) {
154154
gResDay = new GlobalReservationDay(gResDayID)
155155
gResDay.investmentDay = reservation.investmentDay
156-
gResDay.minSupply = getMinSupply(gResDay.investmentDay.toString())
156+
gResDay.minSupply = getMinSupply(gResDay.investmentDay)
157157
gResDay.maxSupply = MAX_SUPPLY.minus(gResDay.minSupply)
158158
gResDay.totalAmount = BigInt.fromI32(0)
159159
gResDay.totalRealAmount = BigInt.fromI32(0)

0 commit comments

Comments
 (0)