hermez-node/common/ethauction.go
common/ethauction.goRaw
1package common
2
3import (
4 "math/big"
5
6 ethCommon "github.com/ethereum/go-ethereum/common"
7)
8
9// AuctionConstants are the constants of the Rollup Smart Contract
10type AuctionConstants struct {
11 // Blocks per slot
12 BlocksPerSlot uint8 `json:"blocksPerSlot"`
13 // Minimum bid when no one has bid yet
14 InitialMinimalBidding *big.Int `json:"initialMinimalBidding"`
15 // First block where the first slot begins
16 GenesisBlockNum int64 `json:"genesisBlockNum"`
17 // ERC777 token with which the bids will be made
18 TokenHEZ ethCommon.Address `json:"tokenHEZ"`
19 // HermezRollup smartcontract address
20 HermezRollup ethCommon.Address `json:"hermezRollup"`
21 // Hermez Governanze Token smartcontract address who controls some parameters and collects HEZ fee
22 // Only for test
23 GovernanceAddress ethCommon.Address `json:"governanceAddress"`
24}
25
26// AuctionVariables are the variables of the Auction Smart Contract
27type AuctionVariables struct {
28 // Boot Coordinator Address
29 DonationAddress ethCommon.Address `json:"donationAddress" meddler:"donation_address"`
30 // Boot Coordinator Address
31 BootCoordinator ethCommon.Address `json:"bootCoordinator" meddler:"boot_coordinator"`
32 // The minimum bid value in a series of 6 slots
33 DefaultSlotSetBid [6]*big.Int `json:"defaultSlotSetBid" meddler:"default_slot_set_bid,json"`
34 // Distance (#slots) to the closest slot to which you can bid ( 2 Slots = 2 * 40 Blocks = 20 min )
35 ClosedAuctionSlots uint16 `json:"closedAuctionSlots" meddler:"closed_auction_slots"`
36 // Distance (#slots) to the farthest slot to which you can bid (30 days = 4320 slots )
37 OpenAuctionSlots uint16 `json:"openAuctionSlots" meddler:"open_auction_slots"`
38 // How the HEZ tokens deposited by the slot winner are distributed (Burn: 40% - Donation: 40% - HGT: 20%)
39 AllocationRatio [3]uint16 `json:"allocationRatio" meddler:"allocation_ratio,json"`
40 // Minimum outbid (percentage) over the previous one to consider it valid
41 Outbidding uint16 `json:"outbidding" meddler:"outbidding"`
42 // Number of blocks at the end of a slot in which any coordinator can forge if the winner has not forged one before
43 SlotDeadline uint8 `json:"slotDeadline" meddler:"slot_deadline"`
44}