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.

45 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. //nolint:lll
  26. type WDelayerVariables struct {
  27. EthBlockNum int64 `json:"ethereumBlockNum" meddler:"eth_block_num"`
  28. // HermezRollupAddress ethCommon.Address `json:"hermezRollupAddress" meddler:"rollup_address"`
  29. HermezGovernanceAddress ethCommon.Address `json:"hermezGovernanceAddress" meddler:"gov_address" validate:"required"`
  30. EmergencyCouncilAddress ethCommon.Address `json:"emergencyCouncilAddress" meddler:"emg_address" validate:"required"`
  31. WithdrawalDelay uint64 `json:"withdrawalDelay" meddler:"withdrawal_delay" validate:"required"`
  32. EmergencyModeStartingBlock int64 `json:"emergencyModeStartingBlock" meddler:"emergency_start_block"`
  33. EmergencyMode bool `json:"emergencyMode" meddler:"emergency_mode"`
  34. }
  35. // Copy returns a deep copy of the Variables
  36. func (v *WDelayerVariables) Copy() *WDelayerVariables {
  37. vCpy := *v
  38. return &vCpy
  39. }