PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/fee/v1

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v1
Namespace
g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt / bazaar / fee
Files
2 (gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/fee/v1
gno
0.9

Files (2)

  • gnomod.tomltoml
  • fee.gnogno
fee.gnogno
1package fee2
3const Denom int64 = 10000
4
5// ProtocolFee is (price * bps) / Denom without overflowing int64 on price*bps.
6func ProtocolFee(price, bps int64) int64 {
7 if price < 0 {
8 panic("fee: negative price")
9 }
10 if bps < 0 || bps > Denom {
11 panic("fee: bps")
12 }
13 q := price / Denom
14 r := price % Denom
15 return q*bps + r*bps/Denom
16}
17
18// SellerProceeds is the ugnot the seller receives after the protocol fee.
19func SellerProceeds(price, bps int64) int64 {
20 return price - ProtocolFee(price, bps)
21}
22

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.