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 payed 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 the coordinator
8// according to the tx type (if the tx requires to create an account and register, only register or he account already esists)
9type RecommendedFee struct {
10 ExistingAccount float64
11 CreatesAccount float64
12 CreatesAccountAndRegister float64
13}
14
15// FeeSelector is used to select a percentage from the FeePlan. Max value is 16
16type FeeSelector uint8
17
18// FeePlan represents the fee model, a position in the array indicates the percentage of tokens paid in concept of fee for a transaction
19var FeePlan = [16]float64{
20 0,
21 .001,
22 .002,
23 .005,
24 .01,
25 .02,
26 .05,
27 .1,
28 .2,
29 .5,
30 1,
31 2,
32 5,
33 10,
34 20,
35 50,
36}