Search Apps Documentation Source Content File Folder Download Copy Actions Download

launchpad_protocol_fee.gno

0.57 Kb ยท 24 lines
 1package v1
 2
 3import (
 4	"chain/runtime"
 5
 6	"gno.land/r/gnoswap/access"
 7	"gno.land/r/gnoswap/halt"
 8	gov_staker "gno.land/r/gnoswap/gov/staker"
 9)
10
11// CollectProtocolFee collects protocol fee from gov/staker for project recipient wallets.
12// Only users can call this function.
13func (lp *launchpadV1) CollectProtocolFee() {
14	halt.AssertIsNotHaltedLaunchpad()
15	halt.AssertIsNotHaltedWithdraw()
16
17	previousRealm := runtime.PreviousRealm()
18	access.AssertIsUser(previousRealm)
19
20	caller := previousRealm.Address()
21	lp.assertHasProject(caller)
22
23	gov_staker.CollectRewardFromLaunchPad(cross, caller)
24}