AddToProtocolFee
AddToProtocolFee pulls an approved fee amount from an authorized protocol caller into protocol-fee accounting. Authorized callers are pool, position, router, and staker realms; direct transfers to this address do not register a fee.
Parameters:
- cur: Current realm context; callers use cross(cur) when crossing into this realm.
- tokenPath: token contract path whose fee is being collected
- amount: non-negative fee amount in the token's base units; zero performs no transfer
Returns:
- err: nil on success; errSpoofedRealm for a spoofed-realm call; errProtocolFeeHalted when protocol-fee collection is halted
Halt check: returns errProtocolFeeHalted without transferring while the ProtocolFee halt scope is active.
Command
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/protocol_fee" -func "AddToProtocolFee" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "http://127.0.0.1:26657" ADDRESSgnokey query -remote "http://127.0.0.1:26657" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/protocol_fee" -func "AddToProtocolFee" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "http://127.0.0.1:26657" call.tx