arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
hermez-node/common/fee.go
common/fee.goRaw
 1package common
 2
 3// Fee is a type that represents the percentage of tokens that will be paid in a transaction
 4// to incentivaise the materialization of it
 5type Fee float64
 6
 7// RecommendedFee is the recommended fee to pay in USD per transaction set by
 8// the coordinator according to the tx type (if the tx requires to create an
 9// account and register, only register or he account already esists)
10type RecommendedFee struct {
11	ExistingAccount           float64
12	CreatesAccount            float64
13	CreatesAccountAndRegister float64
14}
15
16// FeeSelector is used to select a percentage from the FeePlan.
17type FeeSelector uint8
18
19// MAXFEEPLAN is the maximum value of the FeePlan
20const MAXFEEPLAN = 256
21
22// FeePlan represents the fee model, a position in the array indicates the
23// percentage of tokens paid in concept of fee for a transaction
24var FeePlan = [MAXFEEPLAN]float64{}