Search Apps Documentation Source Content File Folder Download Copy Actions Download

launchpad_protocol_fee.gno

0.53 Kb · 23 lines
 1package v1
 2
 3import (
 4	"gno.land/r/gnoswap/halt"
 5	gov_staker "gno.land/r/gnoswap/gov/staker"
 6)
 7
 8// CollectProtocolFee collects protocol fee from gov/staker for project recipient wallets.
 9// Only project recipients can call this function.
10func (lp *launchpadV1) CollectProtocolFee(_ int, rlm realm) {
11	if !rlm.IsCurrent() {
12		panic(errSpoofedRealm)
13	}
14
15	halt.AssertIsNotHaltedWithdraw()
16
17	previousRealm := rlm.Previous()
18
19	caller := previousRealm.Address()
20	lp.assertHasProject(caller)
21
22	gov_staker.CollectRewardFromLaunchPad(cross(rlm), caller)
23}