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
1.9 KiB

  1. package common
  2. import (
  3. "math/big"
  4. ethCommon "github.com/ethereum/go-ethereum/common"
  5. )
  6. // WDelayerConstants are the constants of the Withdrawal Delayer Smart Contract
  7. type WDelayerConstants struct {
  8. // Max Withdrawal Delay
  9. MaxWithdrawalDelay uint64 `json:"maxWithdrawalDelay"`
  10. // Max Emergency mode time
  11. MaxEmergencyModeTime uint64 `json:"maxEmergencyModeTime"`
  12. // HermezRollup smartcontract address
  13. HermezRollup ethCommon.Address `json:"hermezRollup"`
  14. }
  15. // WDelayerEscapeHatchWithdrawal is an escape hatch withdrawal of the
  16. // Withdrawal Delayer Smart Contract
  17. type WDelayerEscapeHatchWithdrawal struct {
  18. EthBlockNum int64 `json:"ethereumBlockNum" meddler:"eth_block_num"`
  19. Who ethCommon.Address `json:"who" meddler:"who_addr"`
  20. To ethCommon.Address `json:"to" meddler:"to_addr"`
  21. TokenAddr ethCommon.Address `json:"tokenAddr" meddler:"token_addr"`
  22. Amount *big.Int `json:"amount" meddler:"amount,bigint"`
  23. }
  24. // WDelayerVariables are the variables of the Withdrawal Delayer Smart Contract
  25. type WDelayerVariables struct {
  26. EthBlockNum int64 `json:"ethereumBlockNum" meddler:"eth_block_num"`
  27. // HermezRollupAddress ethCommon.Address `json:"hermezRollupAddress" meddler:"rollup_address"`
  28. HermezGovernanceAddress ethCommon.Address `json:"hermezGovernanceAddress" meddler:"gov_address" validate:"required"`
  29. EmergencyCouncilAddress ethCommon.Address `json:"emergencyCouncilAddress" meddler:"emg_address" validate:"required"`
  30. WithdrawalDelay uint64 `json:"withdrawalDelay" meddler:"withdrawal_delay" validate:"required"`
  31. EmergencyModeStartingTime uint64 `json:"emergencyModeStartingTime" meddler:"emergency_start_time"`
  32. EmergencyMode bool `json:"emergencyMode" meddler:"emergency_mode"`
  33. }
  34. // Copy returns a deep copy of the Variables
  35. func (v *WDelayerVariables) Copy() *WDelayerVariables {
  36. vCpy := *v
  37. return &vCpy
  38. }