You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
2.1 KiB

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