Skip to content

Commit

Permalink
giveStatus fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-converter committed Dec 18, 2020
1 parent ec856e7 commit ce79d2b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mapping-wiseToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ import {
} from "../generated/schema"

export function handleGiveStatus (call: GiveStatusCall): void {
let referrer = createUser(call.inputs._referrer.toHex())
let referrerID = call.inputs._referrer.toHex()
let referrer = User.load(referrerID)
if (referrer == null) {
referrer = createUser(referrerID)
}
if (referrer.cmStatus === false) {
referrer.cmStatus = true
referrer.cmStatusInLaunch = true
referrer.save()

let global = getOrCreateGlobal()
global.cmStatusCount = global.cmStatusCount.plus(ONE)
global.cmStatusInLaunchCount = global.cmStatusInLaunchCount.plus(ONE)
global.save()
}

referrer.save()
}

export function handleStakeStart (event: StakeStart): void {
Expand Down

0 comments on commit ce79d2b

Please sign in to comment.