@keep-network/tbtc-v2 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/artifacts/BLS.json +1 -1
  2. package/artifacts/Bank.json +2 -2
  3. package/artifacts/BeaconAuthorization.json +8 -8
  4. package/artifacts/BeaconDkg.json +6 -6
  5. package/artifacts/BeaconDkgValidator.json +8 -8
  6. package/artifacts/BeaconInactivity.json +8 -8
  7. package/artifacts/BeaconSortitionPool.json +3 -3
  8. package/artifacts/Bridge.json +5 -5
  9. package/artifacts/BridgeGovernance.json +2 -2
  10. package/artifacts/BridgeGovernanceParameters.json +1 -1
  11. package/artifacts/Deposit.json +1 -1
  12. package/artifacts/DepositSweep.json +1 -1
  13. package/artifacts/DonationVault.json +1 -1
  14. package/artifacts/EcdsaDkgValidator.json +1 -1
  15. package/artifacts/EcdsaInactivity.json +1 -1
  16. package/artifacts/EcdsaSortitionPool.json +3 -3
  17. package/artifacts/Fraud.json +1 -1
  18. package/artifacts/LightRelay.json +2 -2
  19. package/artifacts/LightRelayMaintainerProxy.json +2 -2
  20. package/artifacts/MaintainerProxy.json +2 -2
  21. package/artifacts/MovingFunds.json +1 -1
  22. package/artifacts/NuCypherToken.json +2 -2
  23. package/artifacts/RandomBeacon.json +109 -109
  24. package/artifacts/RandomBeaconChaosnet.json +4 -4
  25. package/artifacts/RandomBeaconGovernance.json +59 -59
  26. package/artifacts/Redemption.json +1 -1
  27. package/artifacts/RedemptionWatchtower.json +5 -5
  28. package/artifacts/ReimbursementPool.json +13 -13
  29. package/artifacts/T.json +2 -2
  30. package/artifacts/TBTC.json +2 -2
  31. package/artifacts/TBTCToken.json +2 -2
  32. package/artifacts/TBTCVault.json +2 -2
  33. package/artifacts/Timelock.json +19 -19
  34. package/artifacts/TokenStaking.json +1 -1
  35. package/artifacts/TokenholderGovernor.json +9 -9
  36. package/artifacts/TokenholderTimelock.json +8 -8
  37. package/artifacts/VendingMachine.json +2 -2
  38. package/artifacts/VendingMachineNuCypher.json +1 -1
  39. package/artifacts/VendingMachineV2.json +2 -2
  40. package/artifacts/VendingMachineV3.json +2 -2
  41. package/artifacts/WalletProposalValidator.json +1 -1
  42. package/artifacts/WalletRegistry.json +5 -5
  43. package/artifacts/WalletRegistryGovernance.json +2 -2
  44. package/artifacts/Wallets.json +1 -1
  45. package/export/deploy/00_resolve_reimbursement_pool.js +1 -1
  46. package/export/deploy/00_resolve_tbtc_v1_token.js +1 -1
  47. package/export/deploy/00_resolve_wallet_registry.js +1 -1
  48. package/export/deploy/01_deploy_light_relay.js +1 -1
  49. package/export/deploy/02_deploy_tbtc_v2_token.js +1 -1
  50. package/export/deploy/03_deploy_vending_machine.js +1 -1
  51. package/export/deploy/04_transfer_vending_machine_roles.js +1 -1
  52. package/export/deploy/05_deploy_bank.js +1 -1
  53. package/export/deploy/06_deploy_bridge.js +1 -1
  54. package/export/deploy/07_deploy_tbtc_vault.js +1 -1
  55. package/export/deploy/08_deploy_donation_vault.js +1 -1
  56. package/export/deploy/09_deploy_bridge_governance.js +1 -1
  57. package/export/deploy/10_deploy_maintainer_proxy.js +1 -1
  58. package/export/deploy/11_bank_update_bridge.js +1 -1
  59. package/export/deploy/12_authorize_tbtc_vault_in_bridge.js +1 -1
  60. package/export/deploy/13_authorize_maintainer_proxy_in_bridge.js +1 -1
  61. package/export/deploy/14_set_deposit_parameters.js +1 -1
  62. package/export/deploy/15_set_wallet_parameters.js +1 -1
  63. package/export/deploy/16_disable_fraud_challenges.js +1 -1
  64. package/export/deploy/17_disable_redemptions.js +1 -1
  65. package/export/deploy/18_disable_moving_funds.js +1 -1
  66. package/export/deploy/19_authorize_spv_maintainer_in_bridge.js +1 -1
  67. package/export/deploy/20_transfer_bank_ownership.js +1 -1
  68. package/export/deploy/21_transfer_bridge_governance.js +1 -1
  69. package/export/deploy/22_transfer_bridge_governance_ownership.js +1 -1
  70. package/export/deploy/23_transfer_tbtc_vault_ownership.js +1 -1
  71. package/export/deploy/24_transfer_tbtc_ownership.js +1 -1
  72. package/export/deploy/25_transfer_maintainer_proxy_ownership.js +1 -1
  73. package/export/deploy/26_transfer_proxy_admin_ownership.js +1 -1
  74. package/export/deploy/27_authorize_maintainer_proxy_in_reimbursement_pool.js +1 -1
  75. package/export/deploy/28_authorize_bridge_in_reimbursement_pool.js +1 -1
  76. package/export/deploy/29_deploy_proxy_admin_with_deputy.js +1 -1
  77. package/export/deploy/30_deploy_vending_machine_v2.js +1 -1
  78. package/export/deploy/31_deploy_vending_machine_v3.js +1 -1
  79. package/export/deploy/32_transfer_vending_machine_v2_ownership.js +1 -1
  80. package/export/deploy/33_transfer_vending_machine_v3_ownership.js +1 -1
  81. package/export/deploy/34_deploy_light_relay_maintainer_proxy.js +1 -1
  82. package/export/deploy/35_authorize_maintainer_in_light_relay_maintainer_proxy.js +1 -1
  83. package/export/deploy/36_transfer_light_relay_maintainer_proxy_ownership.js +1 -1
  84. package/export/deploy/37_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.js +1 -1
  85. package/export/deploy/38_authorize_light_relay_maintainer_proxy_in_light_relay.js +1 -1
  86. package/export/deploy/39_deploy_wallet_proposal_validator.js +1 -1
  87. package/export/deploy/40_deploy_redemption_watchtower.js +1 -1
  88. package/export/deploy/41_transfer_redemption_watchtower_ownership.js +1 -1
  89. package/export/deploy/42_deploy_timelock.js +1 -1
  90. package/export/deploy/80_upgrade_bridge_v2.js +1 -1
  91. package/export/deploy/90_initialize_wallet_owner.js +1 -1
  92. package/export/deploy/91_genesis_relay.js +1 -1
  93. package/export/deploy/92_retarget_relay.js +1 -1
  94. package/export/deploy/93_authorize_relay_maintainer.js +1 -1
  95. package/export/deploy/94_transfer_relay_ownership.js +1 -1
  96. package/export/tasks/test-utils.js +1 -1
  97. package/export/test/integration/utils/ecdsa-wallet-registry.js +1 -1
  98. package/export/test/integration/utils/random-beacon.js +1 -1
  99. package/export/test/integration/utils/staking.js +1 -1
  100. package/export.json +16130 -0
  101. package/package.json +5 -5
@@ -2402,7 +2402,7 @@
2402
2402
  "type": "function"
2403
2403
  }
2404
2404
  ],
2405
- "transactionHash": "0xfbcbb28881563e2c6c877712d9b365562ddc068b886001740ed5d7765a325cad",
2405
+ "transactionHash": "0xb482522c1f59f9d6728725f23280b4edce6628ae454f035add0bd5ef06688d43",
2406
2406
  "receipt": {
2407
2407
  "to": null,
2408
2408
  "from": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
@@ -2410,13 +2410,13 @@
2410
2410
  "transactionIndex": 0,
2411
2411
  "gasUsed": "4293220",
2412
2412
  "logsBloom": "0x00000000000000000002000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000800020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000020000000000000000000000000000000000001000002000000000000000000000000",
2413
- "blockHash": "0xf684be4845069c15e21132c69e3d92d26583f8121c0da1f09c0a6d89a9734b5e",
2414
- "transactionHash": "0xfbcbb28881563e2c6c877712d9b365562ddc068b886001740ed5d7765a325cad",
2413
+ "blockHash": "0xc0e90ab26967dc33918f86841b9991a4c59051f752446da8fc11fc5f01caa90b",
2414
+ "transactionHash": "0xb482522c1f59f9d6728725f23280b4edce6628ae454f035add0bd5ef06688d43",
2415
2415
  "logs": [
2416
2416
  {
2417
2417
  "transactionIndex": 0,
2418
2418
  "blockNumber": 25,
2419
- "transactionHash": "0xfbcbb28881563e2c6c877712d9b365562ddc068b886001740ed5d7765a325cad",
2419
+ "transactionHash": "0xb482522c1f59f9d6728725f23280b4edce6628ae454f035add0bd5ef06688d43",
2420
2420
  "address": "0x1e2F4432bFeF9E9Ad39DA6d272F4aFf33629c770",
2421
2421
  "topics": [
2422
2422
  "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
@@ -2425,7 +2425,7 @@
2425
2425
  ],
2426
2426
  "data": "0x",
2427
2427
  "logIndex": 0,
2428
- "blockHash": "0xf684be4845069c15e21132c69e3d92d26583f8121c0da1f09c0a6d89a9734b5e"
2428
+ "blockHash": "0xc0e90ab26967dc33918f86841b9991a4c59051f752446da8fc11fc5f01caa90b"
2429
2429
  }
2430
2430
  ],
2431
2431
  "blockNumber": 25,
@@ -2438,9 +2438,9 @@
2438
2438
  604800
2439
2439
  ],
2440
2440
  "numDeployments": 1,
2441
- "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract RandomBeacon\",\"name\":\"_randomBeacon\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_governanceDelay\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseChangePeriod\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"AuthorizationDecreaseChangePeriodUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseChangePeriod\",\"type\":\"uint64\"}],\"name\":\"AuthorizationDecreaseChangePeriodUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseDelay\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"AuthorizationDecreaseDelayUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseDelay\",\"type\":\"uint64\"}],\"name\":\"AuthorizationDecreaseDelayUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callbackGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"CallbackGasLimitUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callbackGasLimit\",\"type\":\"uint256\"}],\"name\":\"CallbackGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgMaliciousResultNotificationRewardMultiplier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgMaliciousResultNotificationRewardMultiplierUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgMaliciousResultNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"DkgMaliciousResultNotificationRewardMultiplierUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultApprovalGasOffset\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultApprovalGasOffsetUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultApprovalGasOffset\",\"type\":\"uint256\"}],\"name\":\"DkgResultApprovalGasOffsetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengeExtraGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengeExtraGasUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengeExtraGas\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengeExtraGasUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengePeriodLength\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengePeriodLengthUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengePeriodLength\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengePeriodLengthUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionGasUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionGas\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionGasUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionTimeoutUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionTimeout\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"submitterPrecedencePeriodLength\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgSubmitterPrecedencePeriodLengthUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"submitterPrecedencePeriodLength\",\"type\":\"uint256\"}],\"name\":\"DkgSubmitterPrecedencePeriodLengthUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"governanceDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"GovernanceDelayUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"governanceDelay\",\"type\":\"uint256\"}],\"name\":\"GovernanceDelayUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupCreationFrequency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"GroupCreationFrequencyUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupCreationFrequency\",\"type\":\"uint256\"}],\"name\":\"GroupCreationFrequencyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupLifetime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"GroupLifetimeUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupLifetime\",\"type\":\"uint256\"}],\"name\":\"GroupLifetimeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"maliciousDkgResultSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"MaliciousDkgResultSlashingAmountUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"maliciousDkgResultSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"MaliciousDkgResultSlashingAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"minimumAuthorization\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"MinimumAuthorizationUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"minimumAuthorization\",\"type\":\"uint96\"}],\"name\":\"MinimumAuthorizationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"notifyOperatorInactivityGasOffset\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"NotifyOperatorInactivityGasOffsetUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"notifyOperatorInactivityGasOffset\",\"type\":\"uint256\"}],\"name\":\"NotifyOperatorInactivityGasOffsetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRandomBeaconGovernance\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RandomBeaconGovernanceTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRandomBeaconGovernance\",\"type\":\"address\"}],\"name\":\"RandomBeaconGovernanceTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryHardTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntryHardTimeoutUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryHardTimeout\",\"type\":\"uint256\"}],\"name\":\"RelayEntryHardTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySoftTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySoftTimeoutUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySoftTimeout\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySoftTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"relayEntrySubmissionFailureSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySubmissionFailureSlashingAmountUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"relayEntrySubmissionFailureSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"RelayEntrySubmissionFailureSlashingAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySubmissionGasOffset\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySubmissionGasOffsetUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySubmissionGasOffset\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySubmissionGasOffsetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntryTimeoutNotificationRewardMultiplierUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"RelayEntryTimeoutNotificationRewardMultiplierUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sortitionPoolRewardsBanDuration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SortitionPoolRewardsBanDurationUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sortitionPoolRewardsBanDuration\",\"type\":\"uint256\"}],\"name\":\"SortitionPoolRewardsBanDurationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unauthorizedSigningTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UnauthorizedSigningNotificationRewardMultiplierUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unauthorizedSigningTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"UnauthorizedSigningNotificationRewardMultiplierUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"unauthorizedSigningSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UnauthorizedSigningSlashingAmountUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"unauthorizedSigningSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"UnauthorizedSigningSlashingAmountUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"authorizationDecreaseChangePeriodChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"authorizationDecreaseDelayChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_newAuthorizationDecreaseChangePeriod\",\"type\":\"uint64\"}],\"name\":\"beginAuthorizationDecreaseChangePeriodUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_newAuthorizationDecreaseDelay\",\"type\":\"uint64\"}],\"name\":\"beginAuthorizationDecreaseDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newCallbackGasLimit\",\"type\":\"uint256\"}],\"name\":\"beginCallbackGasLimitUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgMaliciousResultNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"beginDkgMaliciousResultNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultApprovalGasOffset\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultApprovalGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultChallengeExtraGas\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultChallengeExtraGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultChallengePeriodLength\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultChallengePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultSubmissionGas\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultSubmissionGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultSubmissionTimeout\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultSubmissionTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgSubmitterPrecedencePeriodLength\",\"type\":\"uint256\"}],\"name\":\"beginDkgSubmitterPrecedencePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newGovernanceDelay\",\"type\":\"uint256\"}],\"name\":\"beginGovernanceDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newGroupCreationFrequency\",\"type\":\"uint256\"}],\"name\":\"beginGroupCreationFrequencyUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newGroupLifetime\",\"type\":\"uint256\"}],\"name\":\"beginGroupLifetimeUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newMaliciousDkgResultSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"beginMaliciousDkgResultSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newMinimumAuthorization\",\"type\":\"uint96\"}],\"name\":\"beginMinimumAuthorizationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNotifyOperatorInactivityGasOffset\",\"type\":\"uint256\"}],\"name\":\"beginNotifyOperatorInactivityGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newRandomBeaconGovernance\",\"type\":\"address\"}],\"name\":\"beginRandomBeaconGovernanceTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntryHardTimeout\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntryHardTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntrySoftTimeout\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntrySoftTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newRelayEntrySubmissionFailureSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"beginRelayEntrySubmissionFailureSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntrySubmissionGasOffset\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntrySubmissionGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntryTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntryTimeoutNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newSortitionPoolRewardsBanDuration\",\"type\":\"uint256\"}],\"name\":\"beginSortitionPoolRewardsBanDurationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newUnauthorizedSigningNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"beginUnauthorizedSigningNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newUnauthorizedSigningSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"beginUnauthorizedSigningSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"callbackGasLimitChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgMaliciousResultNotificationRewardMultiplierChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultApprovalGasOffsetChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultChallengeExtraGasChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultChallengePeriodLengthChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultSubmissionGasChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultSubmissionTimeoutChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgSubmitterPrecedencePeriodLengthChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeAuthorizationDecreaseChangePeriodUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeAuthorizationDecreaseDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeCallbackGasLimitUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultApprovalGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultChallengeExtraGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultChallengePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultSubmissionGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultSubmissionTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgSubmitterPrecedencePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeGovernanceDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeGroupCreationFrequencyUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeGroupLifetimeUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeMaliciousDkgResultSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeMinimumAuthorizationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeNotifyOperatorInactivityGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRandomBeaconGovernanceTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntryHardTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntrySoftTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntrySubmissionFailureSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntrySubmissionGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeSortitionPoolRewardsBanDurationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeUnauthorizedSigningSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingAuthorizationDecreaseChangePeriodUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingAuthorizationDecreaseDelayUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingCallbackGasLimitUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultApprovalGasOffsetUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultChallengeExtraGasUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultChallengePeriodLengthUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultSubmissionGasUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultSubmissionTimeoutUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingGovernanceDelayUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingGroupCreationFrequencyUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingGroupLifetimeUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingMaliciousDkgResultSlashingAmountUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingMimimumAuthorizationUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingNotifyOperatorInactivityGasOffsetUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRandomBeaconGovernanceTransferDelayTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntryHardTimeoutUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntrySoftTimeoutUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntrySubmissionGasOffsetUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingSortitionPoolRewardsBanDurationUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingUnauthorizedSigningSlashingAmountUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governanceDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governanceDelayChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"groupCreationFrequencyChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"groupLifetimeChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maliciousDkgResultSlashingAmountChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumAuthorizationChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newAuthorizationDecreaseChangePeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newAuthorizationDecreaseDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newCallbackGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgMaliciousResultNotificationRewardMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultApprovalGasOffset\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultChallengeExtraGas\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultChallengePeriodLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultSubmissionGas\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultSubmissionTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgSubmitterPrecedencePeriodLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newGovernanceDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newGroupCreationFrequency\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newGroupLifetime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newMaliciousDkgResultSlashingAmount\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newMinimumAuthorization\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newNotifyOperatorInactivityGasOffset\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRandomBeaconGovernance\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntryHardTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntrySoftTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntrySubmissionFailureSlashingAmount\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntrySubmissionGasOffset\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntryTimeoutNotificationRewardMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newSortitionPoolRewardsBanDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newUnauthorizedSigningNotificationRewardMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newUnauthorizedSigningSlashingAmount\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"notifyOperatorInactivityGasOffsetChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomBeacon\",\"outputs\":[{\"internalType\":\"contract RandomBeacon\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomBeaconGovernanceTransferInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntryHardTimeoutChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntrySoftTimeoutChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntrySubmissionFailureSlashingAmountChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntrySubmissionGasOffsetChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntryTimeoutNotificationRewardMultiplierChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isAuthorized\",\"type\":\"bool\"}],\"name\":\"setRequesterAuthorization\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionPoolRewardsBanDurationChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unauthorizedSigningNotificationRewardMultiplierChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unauthorizedSigningSlashingAmountChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdrawIneligibleRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"beginAuthorizationDecreaseChangePeriodUpdate(uint64)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newAuthorizationDecreaseChangePeriod\":\"New authorization decrease change period\"}},\"beginAuthorizationDecreaseDelayUpdate(uint64)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newAuthorizationDecreaseDelay\":\"New authorization decrease delay\"}},\"beginCallbackGasLimitUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newCallbackGasLimit\":\"New callback gas limit\"}},\"beginDkgMaliciousResultNotificationRewardMultiplierUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgMaliciousResultNotificationRewardMultiplier\":\"New DKG malicious result notification reward multiplier.\"}},\"beginDkgResultApprovalGasOffsetUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultApprovalGasOffset\":\"New DKG approval gas offset\"}},\"beginDkgResultChallengeExtraGasUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultChallengeExtraGas\":\"New DKG result challenge extra gas\"}},\"beginDkgResultChallengePeriodLengthUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultChallengePeriodLength\":\"New DKG result challenge period length in blocks\"}},\"beginDkgResultSubmissionGasUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultSubmissionGas\":\"New relay entry submission gas offset\"}},\"beginDkgResultSubmissionTimeoutUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultSubmissionTimeout\":\"New DKG result submission timeout in blocks\"}},\"beginDkgSubmitterPrecedencePeriodLengthUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgSubmitterPrecedencePeriodLength\":\"New DKG submitter precedence period length in blocks\"}},\"beginGovernanceDelayUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newGovernanceDelay\":\"New governance delay\"}},\"beginGroupCreationFrequencyUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newGroupCreationFrequency\":\"New group creation frequency\"}},\"beginGroupLifetimeUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newGroupLifetime\":\"New group lifetime in blocks\"}},\"beginMaliciousDkgResultSlashingAmountUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newMaliciousDkgResultSlashingAmount\":\"New malicious DKG result slashing amount\"}},\"beginMinimumAuthorizationUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newMinimumAuthorization\":\"New minimum authorization amount.\"}},\"beginNotifyOperatorInactivityGasOffsetUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newNotifyOperatorInactivityGasOffset\":\"New operator inactivity notification gas offset\"}},\"beginRandomBeaconGovernanceTransfer(address)\":{\"details\":\"Can be called only by the current contract governance.\"},\"beginRelayEntryHardTimeoutUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntryHardTimeout\":\"New relay entry hard timeout in blocks\"}},\"beginRelayEntrySoftTimeoutUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntrySoftTimeout\":\"New relay entry submission timeout in blocks\"}},\"beginRelayEntrySubmissionFailureSlashingAmountUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntrySubmissionFailureSlashingAmount\":\"New relay entry submission failure slashing amount\"}},\"beginRelayEntrySubmissionGasOffsetUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntrySubmissionGasOffset\":\"New relay entry submission gas offset\"}},\"beginRelayEntryTimeoutNotificationRewardMultiplierUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntryTimeoutNotificationRewardMultiplier\":\"New relay entry timeout notification reward multiplier.\"}},\"beginSortitionPoolRewardsBanDurationUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newSortitionPoolRewardsBanDuration\":\"New sortition pool rewards ban duration.\"}},\"beginUnauthorizedSigningNotificationRewardMultiplierUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newUnauthorizedSigningNotificationRewardMultiplier\":\"New unauthorized signing notification reward multiplier.\"}},\"beginUnauthorizedSigningSlashingAmountUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newUnauthorizedSigningSlashingAmount\":\"New unauthorized signing slashing amount\"}},\"finalizeAuthorizationDecreaseChangePeriodUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeAuthorizationDecreaseDelayUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeCallbackGasLimitUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultApprovalGasOffsetUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultChallengeExtraGasUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultChallengePeriodLengthUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultSubmissionGasUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultSubmissionTimeoutUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgSubmitterPrecedencePeriodLengthUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeGovernanceDelayUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeGroupCreationFrequencyUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeGroupLifetimeUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeMaliciousDkgResultSlashingAmountUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeMinimumAuthorizationUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeNotifyOperatorInactivityGasOffsetUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRandomBeaconGovernanceTransfer()\":{\"details\":\"Can be called only by the current contract governance, after the governance delay elapses.\"},\"finalizeRelayEntryHardTimeoutUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntrySoftTimeoutUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntrySubmissionFailureSlashingAmountUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntrySubmissionGasOffsetUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeSortitionPoolRewardsBanDurationUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeUnauthorizedSigningSlashingAmountUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"getRemainingAuthorizationDecreaseChangePeriodUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingAuthorizationDecreaseDelayUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingCallbackGasLimitUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultApprovalGasOffsetUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultChallengeExtraGasUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultChallengePeriodLengthUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultSubmissionGasUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultSubmissionTimeoutUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingGovernanceDelayUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingGroupCreationFrequencyUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingGroupLifetimeUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingMaliciousDkgResultSlashingAmountUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingMimimumAuthorizationUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingNotifyOperatorInactivityGasOffsetUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRandomBeaconGovernanceTransferDelayTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntryHardTimeoutUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntrySoftTimeoutUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntrySubmissionGasOffsetUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingSortitionPoolRewardsBanDurationUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingUnauthorizedSigningSlashingAmountUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setRequesterAuthorization(address,bool)\":{\"params\":{\"isAuthorized\":\"True or false\",\"requester\":\"Requester, can be a contract or EOA\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawIneligibleRewards(address)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"recipient\":\"Recipient of withdrawn rewards.\"}}},\"title\":\"Keep Random Beacon Governance\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"beginAuthorizationDecreaseChangePeriodUpdate(uint64)\":{\"notice\":\"Begins the authorization decrease change period update process.\"},\"beginAuthorizationDecreaseDelayUpdate(uint64)\":{\"notice\":\"Begins the authorization decrease delay update process.\"},\"beginCallbackGasLimitUpdate(uint256)\":{\"notice\":\"Begins the callback gas limit update process.\"},\"beginDkgMaliciousResultNotificationRewardMultiplierUpdate(uint256)\":{\"notice\":\"Begins the DKG malicious result notification reward multiplier update process.\"},\"beginDkgResultApprovalGasOffsetUpdate(uint256)\":{\"notice\":\"Begins the DKG result approval gas offset update process.\"},\"beginDkgResultChallengeExtraGasUpdate(uint256)\":{\"notice\":\"Begins the DKG result challenge extra gas update process.\"},\"beginDkgResultChallengePeriodLengthUpdate(uint256)\":{\"notice\":\"Begins the DKG result challenge period length update process.\"},\"beginDkgResultSubmissionGasUpdate(uint256)\":{\"notice\":\"Begins the DKG result submission gas update process.\"},\"beginDkgResultSubmissionTimeoutUpdate(uint256)\":{\"notice\":\"Begins the DKG result submission timeout update process.\"},\"beginDkgSubmitterPrecedencePeriodLengthUpdate(uint256)\":{\"notice\":\"Begins the DKG submitter precedence period length.\"},\"beginGovernanceDelayUpdate(uint256)\":{\"notice\":\"Begins the governance delay update process.\"},\"beginGroupCreationFrequencyUpdate(uint256)\":{\"notice\":\"Begins the group creation frequency update process.\"},\"beginGroupLifetimeUpdate(uint256)\":{\"notice\":\"Begins the group lifetime update process. Group lifetime needs to be shorter than the authorization decrease delay to ensure every active group is backed by enough stake. A new group lifetime value is in blocks and has to be calculated based on the average block time and authorization decrease delay which value is in seconds.\"},\"beginMaliciousDkgResultSlashingAmountUpdate(uint96)\":{\"notice\":\"Begins the malicious DKG result slashing amount update process.\"},\"beginMinimumAuthorizationUpdate(uint96)\":{\"notice\":\"Begins the minimum authorization amount update process.\"},\"beginNotifyOperatorInactivityGasOffsetUpdate(uint256)\":{\"notice\":\"Begins the notify operator inactivity gas offset update process.\"},\"beginRandomBeaconGovernanceTransfer(address)\":{\"notice\":\"Begins the random beacon governance transfer process.\"},\"beginRelayEntryHardTimeoutUpdate(uint256)\":{\"notice\":\"Begins the relay entry hard timeout update process.\"},\"beginRelayEntrySoftTimeoutUpdate(uint256)\":{\"notice\":\"Begins the relay entry soft timeout update process.\"},\"beginRelayEntrySubmissionFailureSlashingAmountUpdate(uint96)\":{\"notice\":\"Begins the relay entry submission failure slashing amount update process.\"},\"beginRelayEntrySubmissionGasOffsetUpdate(uint256)\":{\"notice\":\"Begins the relay entry submission gas offset update process.\"},\"beginRelayEntryTimeoutNotificationRewardMultiplierUpdate(uint256)\":{\"notice\":\"Begins the relay entry timeout notification reward multiplier update process.\"},\"beginSortitionPoolRewardsBanDurationUpdate(uint256)\":{\"notice\":\"Begins the sortition pool rewards ban duration update process.\"},\"beginUnauthorizedSigningNotificationRewardMultiplierUpdate(uint256)\":{\"notice\":\"Begins the unauthorized signing notification reward multiplier update process.\"},\"beginUnauthorizedSigningSlashingAmountUpdate(uint96)\":{\"notice\":\"Begins the unauthorized signing slashing amount update process.\"},\"finalizeAuthorizationDecreaseChangePeriodUpdate()\":{\"notice\":\"Finalizes the authorization decrease change period update process.\"},\"finalizeAuthorizationDecreaseDelayUpdate()\":{\"notice\":\"Finalizes the authorization decrease delay update process.\"},\"finalizeCallbackGasLimitUpdate()\":{\"notice\":\"Finalizes the callback gas limit update process.\"},\"finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate()\":{\"notice\":\"Finalizes the DKG malicious result notification reward multiplier update process.\"},\"finalizeDkgResultApprovalGasOffsetUpdate()\":{\"notice\":\"Finalizes the DKG result approval gas offset update process.\"},\"finalizeDkgResultChallengeExtraGasUpdate()\":{\"notice\":\"Finalizes the DKG result challenge extra gas update process.\"},\"finalizeDkgResultChallengePeriodLengthUpdate()\":{\"notice\":\"Finalizes the DKG result challenge period length update process.\"},\"finalizeDkgResultSubmissionGasUpdate()\":{\"notice\":\"Finalizes DKG result submission gas update process.\"},\"finalizeDkgResultSubmissionTimeoutUpdate()\":{\"notice\":\"Finalizes the DKG result submission timeout update process.\"},\"finalizeDkgSubmitterPrecedencePeriodLengthUpdate()\":{\"notice\":\"Finalizes the DKG submitter precedence period length.\"},\"finalizeGovernanceDelayUpdate()\":{\"notice\":\"Finalizes the governance delay update process.\"},\"finalizeGroupCreationFrequencyUpdate()\":{\"notice\":\"Finalizes the group creation frequency update process.\"},\"finalizeGroupLifetimeUpdate()\":{\"notice\":\"Finalizes the group creation frequency update process.\"},\"finalizeMaliciousDkgResultSlashingAmountUpdate()\":{\"notice\":\"Finalizes the malicious DKG result slashing amount update process.\"},\"finalizeMinimumAuthorizationUpdate()\":{\"notice\":\"Finalizes the minimum authorization amount update process.\"},\"finalizeNotifyOperatorInactivityGasOffsetUpdate()\":{\"notice\":\"Finalizes the notify operator inactivity gas offset update process.\"},\"finalizeRandomBeaconGovernanceTransfer()\":{\"notice\":\"Finalizes the random beacon governance transfer process.\"},\"finalizeRelayEntryHardTimeoutUpdate()\":{\"notice\":\"Finalizes the relay entry hard timeout update process.\"},\"finalizeRelayEntrySoftTimeoutUpdate()\":{\"notice\":\"Finalizes the relay entry soft timeout update process.\"},\"finalizeRelayEntrySubmissionFailureSlashingAmountUpdate()\":{\"notice\":\"Finalizes the relay entry submission failure slashing amount update process.\"},\"finalizeRelayEntrySubmissionGasOffsetUpdate()\":{\"notice\":\"Finalizes relay entry submission gas offset update process.\"},\"finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate()\":{\"notice\":\"Finalizes the relay entry timeout notification reward multiplier update process.\"},\"finalizeSortitionPoolRewardsBanDurationUpdate()\":{\"notice\":\"Finalizes the sortition pool rewards ban duration update process.\"},\"finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate()\":{\"notice\":\"Finalizes the unauthorized signing notification reward multiplier update process.\"},\"finalizeUnauthorizedSigningSlashingAmountUpdate()\":{\"notice\":\"Finalizes the unauthorized signing slashing amount update process.\"},\"getRemainingAuthorizationDecreaseChangePeriodUpdateTime()\":{\"notice\":\"Get the time remaining until the authorization decrease change period can be updated.\"},\"getRemainingAuthorizationDecreaseDelayUpdateTime()\":{\"notice\":\"Get the time remaining until the authorization decrease delay can be updated.\"},\"getRemainingCallbackGasLimitUpdateTime()\":{\"notice\":\"Get the time remaining until the callback gas limit can be updated.\"},\"getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG malicious result notification reward multiplier duration can be updated.\"},\"getRemainingDkgResultApprovalGasOffsetUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG approval gas offset duration can be updated.\"},\"getRemainingDkgResultChallengeExtraGasUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result challenge extra gas can be updated.\"},\"getRemainingDkgResultChallengePeriodLengthUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result challenge period length can be updated.\"},\"getRemainingDkgResultSubmissionGasUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result submission gas duration can be updated.\"},\"getRemainingDkgResultSubmissionTimeoutUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result submission timeout can be updated.\"},\"getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime()\":{\"notice\":\"Get the time remaining until the wallet owner can be updated.\"},\"getRemainingGovernanceDelayUpdateTime()\":{\"notice\":\"Get the time remaining until the governance delay can be updated.\"},\"getRemainingGroupCreationFrequencyUpdateTime()\":{\"notice\":\"Get the time remaining until the group creation frequency can be updated.\"},\"getRemainingGroupLifetimeUpdateTime()\":{\"notice\":\"Get the time remaining until the group lifetime can be updated.\"},\"getRemainingMaliciousDkgResultSlashingAmountUpdateTime()\":{\"notice\":\"Get the time remaining until the malicious DKG result slashing amount can be updated.\"},\"getRemainingMimimumAuthorizationUpdateTime()\":{\"notice\":\"Get the time remaining until the minimum authorization amount can be updated.\"},\"getRemainingNotifyOperatorInactivityGasOffsetUpdateTime()\":{\"notice\":\"Get the time remaining until the operator inactivity notification gas offset duration can be updated.\"},\"getRemainingRandomBeaconGovernanceTransferDelayTime()\":{\"notice\":\"Get the time remaining until the random beacon governance can be transferred.\"},\"getRemainingRelayEntryHardTimeoutUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry hard timeout can be updated.\"},\"getRemainingRelayEntrySoftTimeoutUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry submission soft timeout can be updated.\"},\"getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry submission failure slashing amount can be updated.\"},\"getRemainingRelayEntrySubmissionGasOffsetUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry submission gas offset duration can be updated.\"},\"getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry timeout notification reward multiplier duration can be updated.\"},\"getRemainingSortitionPoolRewardsBanDurationUpdateTime()\":{\"notice\":\"Get the time remaining until the sortition pool rewards ban duration can be updated.\"},\"getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime()\":{\"notice\":\"Get the time remaining until the unauthorized signing notification reward multiplier duration can be updated.\"},\"getRemainingUnauthorizedSigningSlashingAmountUpdateTime()\":{\"notice\":\"Get the time remaining until the unauthorized signing slashing amount can be updated.\"},\"setRequesterAuthorization(address,bool)\":{\"notice\":\"Set authorization for requesters that can request a relay entry. It can be done by the governance only.\"},\"withdrawIneligibleRewards(address)\":{\"notice\":\"Withdraws rewards belonging to operators marked as ineligible for sortition pool rewards.\"}},\"notice\":\"Owns the `RandomBeacon` contract and is responsible for updating its governable parameters in respect to governance delay individual for each parameter.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/RandomBeaconGovernance.sol\":\"RandomBeaconGovernance\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@keep-network/sortition-pools/contracts/Branch.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Constants.sol\\\";\\n\\n/// @notice The implicit 8-ary trees of the sortition pool\\n/// rely on packing 8 \\\"slots\\\" of 32-bit values into each uint256.\\n/// The Branch library permits efficient calculations on these slots.\\nlibrary Branch {\\n /// @notice Calculate the right shift required\\n /// to make the 32 least significant bits of an uint256\\n /// be the bits of the `position`th slot\\n /// when treating the uint256 as a uint32[8].\\n ///\\n /// @dev Not used for efficiency reasons,\\n /// but left to illustrate the meaning of a common pattern.\\n /// I wish solidity had macros, even C macros.\\n function slotShift(uint256 position) internal pure returns (uint256) {\\n unchecked {\\n return position * Constants.SLOT_WIDTH;\\n }\\n }\\n\\n /// @notice Return the `position`th slot of the `node`,\\n /// treating `node` as a uint32[32].\\n function getSlot(uint256 node, uint256 position)\\n internal\\n pure\\n returns (uint256)\\n {\\n unchecked {\\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\\n // Doing a bitwise AND with `SLOT_MAX`\\n // clears all but the 32 least significant bits.\\n // Because of the right shift by `slotShift(position)` bits,\\n // those 32 bits contain the 32 bits in the `position`th slot of `node`.\\n return (node >> shiftBits) & Constants.SLOT_MAX;\\n }\\n }\\n\\n /// @notice Return `node` with the `position`th slot set to zero.\\n function clearSlot(uint256 node, uint256 position)\\n internal\\n pure\\n returns (uint256)\\n {\\n unchecked {\\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\\n // Shifting `SLOT_MAX` left by `slotShift(position)` bits\\n // gives us a number where all bits of the `position`th slot are set,\\n // and all other bits are unset.\\n //\\n // Using a bitwise NOT on this number,\\n // we get a uint256 where all bits are set\\n // except for those of the `position`th slot.\\n //\\n // Bitwise ANDing the original `node` with this number\\n // sets the bits of `position`th slot to zero,\\n // leaving all other bits unchanged.\\n return node & ~(Constants.SLOT_MAX << shiftBits);\\n }\\n }\\n\\n /// @notice Return `node` with the `position`th slot set to `weight`.\\n ///\\n /// @param weight The weight of of the node.\\n /// Safely truncated to a 32-bit number,\\n /// but this should never be called with an overflowing weight regardless.\\n function setSlot(\\n uint256 node,\\n uint256 position,\\n uint256 weight\\n ) internal pure returns (uint256) {\\n unchecked {\\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\\n // Clear the `position`th slot like in `clearSlot()`.\\n uint256 clearedNode = node & ~(Constants.SLOT_MAX << shiftBits);\\n // Bitwise AND `weight` with `SLOT_MAX`\\n // to clear all but the 32 least significant bits.\\n //\\n // Shift this left by `slotShift(position)` bits\\n // to obtain a uint256 with all bits unset\\n // except in the `position`th slot\\n // which contains the 32-bit value of `weight`.\\n uint256 shiftedWeight = (weight & Constants.SLOT_MAX) << shiftBits;\\n // When we bitwise OR these together,\\n // all other slots except the `position`th one come from the left argument,\\n // and the `position`th gets filled with `weight` from the right argument.\\n return clearedNode | shiftedWeight;\\n }\\n }\\n\\n /// @notice Calculate the summed weight of all slots in the `node`.\\n function sumWeight(uint256 node) internal pure returns (uint256 sum) {\\n unchecked {\\n sum = node & Constants.SLOT_MAX;\\n // Iterate through each slot\\n // by shifting `node` right in increments of 32 bits,\\n // and adding the 32 least significant bits to the `sum`.\\n uint256 newNode = node >> Constants.SLOT_WIDTH;\\n while (newNode > 0) {\\n sum += (newNode & Constants.SLOT_MAX);\\n newNode = newNode >> Constants.SLOT_WIDTH;\\n }\\n return sum;\\n }\\n }\\n\\n /// @notice Pick a slot in `node` that corresponds to `index`.\\n /// Treats the node like an array of virtual stakers,\\n /// the number of virtual stakers in each slot corresponding to its weight,\\n /// and picks which slot contains the `index`th virtual staker.\\n ///\\n /// @dev Requires that `index` be lower than `sumWeight(node)`.\\n /// However, this is not enforced for performance reasons.\\n /// If `index` exceeds the permitted range,\\n /// `pickWeightedSlot()` returns the rightmost slot\\n /// and an excessively high `newIndex`.\\n ///\\n /// @return slot The slot of `node` containing the `index`th virtual staker.\\n ///\\n /// @return newIndex The index of the `index`th virtual staker of `node`\\n /// within the returned slot.\\n function pickWeightedSlot(uint256 node, uint256 index)\\n internal\\n pure\\n returns (uint256 slot, uint256 newIndex)\\n {\\n unchecked {\\n newIndex = index;\\n uint256 newNode = node;\\n uint256 currentSlotWeight = newNode & Constants.SLOT_MAX;\\n while (newIndex >= currentSlotWeight) {\\n newIndex -= currentSlotWeight;\\n slot++;\\n newNode = newNode >> Constants.SLOT_WIDTH;\\n currentSlotWeight = newNode & Constants.SLOT_MAX;\\n }\\n return (slot, newIndex);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa7fb1c9c9789f30493e9a40e24a24f46875dc5e7630b4f67478167759f6d1882\"},\"@keep-network/sortition-pools/contracts/Chaosnet.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\n/// @title Chaosnet\\n/// @notice This is a beta staker program for stakers willing to go the extra\\n/// mile with monitoring, share their logs with the dev team, and allow to more\\n/// carefully monitor the bootstrapping network. As the network matures, the\\n/// beta program will be ended.\\ncontract Chaosnet {\\n /// @notice Indicates if the chaosnet is active. The chaosnet is active\\n /// after the contract deployment and can be ended with a call to\\n /// `deactivateChaosnet()`. Once deactivated chaosnet can not be activated\\n /// again.\\n bool public isChaosnetActive;\\n\\n /// @notice Indicates if the given operator is a beta operator for chaosnet.\\n mapping(address => bool) public isBetaOperator;\\n\\n /// @notice Address controlling chaosnet status and beta operator addresses.\\n address public chaosnetOwner;\\n\\n event BetaOperatorsAdded(address[] operators);\\n\\n event ChaosnetOwnerRoleTransferred(\\n address oldChaosnetOwner,\\n address newChaosnetOwner\\n );\\n\\n event ChaosnetDeactivated();\\n\\n constructor() {\\n _transferChaosnetOwner(msg.sender);\\n isChaosnetActive = true;\\n }\\n\\n modifier onlyChaosnetOwner() {\\n require(msg.sender == chaosnetOwner, \\\"Not the chaosnet owner\\\");\\n _;\\n }\\n\\n modifier onlyOnChaosnet() {\\n require(isChaosnetActive, \\\"Chaosnet is not active\\\");\\n _;\\n }\\n\\n /// @notice Adds beta operator to chaosnet. Can be called only by the\\n /// chaosnet owner when the chaosnet is active. Once the operator is added\\n /// as a beta operator, it can not be removed.\\n function addBetaOperators(address[] calldata operators)\\n public\\n onlyOnChaosnet\\n onlyChaosnetOwner\\n {\\n for (uint256 i = 0; i < operators.length; i++) {\\n isBetaOperator[operators[i]] = true;\\n }\\n\\n emit BetaOperatorsAdded(operators);\\n }\\n\\n /// @notice Deactivates the chaosnet. Can be called only by the chaosnet\\n /// owner. Once deactivated chaosnet can not be activated again.\\n function deactivateChaosnet() public onlyOnChaosnet onlyChaosnetOwner {\\n isChaosnetActive = false;\\n emit ChaosnetDeactivated();\\n }\\n\\n /// @notice Transfers the chaosnet owner role to another non-zero address.\\n function transferChaosnetOwnerRole(address newChaosnetOwner)\\n public\\n onlyChaosnetOwner\\n {\\n require(\\n newChaosnetOwner != address(0),\\n \\\"New chaosnet owner must not be zero address\\\"\\n );\\n _transferChaosnetOwner(newChaosnetOwner);\\n }\\n\\n function _transferChaosnetOwner(address newChaosnetOwner) internal {\\n address oldChaosnetOwner = chaosnetOwner;\\n chaosnetOwner = newChaosnetOwner;\\n emit ChaosnetOwnerRoleTransferred(oldChaosnetOwner, newChaosnetOwner);\\n }\\n}\\n\",\"keccak256\":\"0xeaf7bdd5626f88c329793a012621039692ce1b6e1f13013997ddb13d7e3032df\"},\"@keep-network/sortition-pools/contracts/Constants.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nlibrary Constants {\\n ////////////////////////////////////////////////////////////////////////////\\n // Parameters for configuration\\n\\n // How many bits a position uses per level of the tree;\\n // each branch of the tree contains 2**SLOT_BITS slots.\\n uint256 constant SLOT_BITS = 3;\\n uint256 constant LEVELS = 7;\\n ////////////////////////////////////////////////////////////////////////////\\n\\n ////////////////////////////////////////////////////////////////////////////\\n // Derived constants, do not touch\\n uint256 constant SLOT_COUNT = 2**SLOT_BITS;\\n uint256 constant SLOT_WIDTH = 256 / SLOT_COUNT;\\n uint256 constant LAST_SLOT = SLOT_COUNT - 1;\\n uint256 constant SLOT_MAX = (2**SLOT_WIDTH) - 1;\\n uint256 constant POOL_CAPACITY = SLOT_COUNT**LEVELS;\\n\\n uint256 constant ID_WIDTH = SLOT_WIDTH;\\n uint256 constant ID_MAX = SLOT_MAX;\\n\\n uint256 constant BLOCKHEIGHT_WIDTH = 96 - ID_WIDTH;\\n uint256 constant BLOCKHEIGHT_MAX = (2**BLOCKHEIGHT_WIDTH) - 1;\\n\\n uint256 constant SLOT_POINTER_MAX = (2**SLOT_BITS) - 1;\\n uint256 constant LEAF_FLAG = 1 << 255;\\n\\n uint256 constant WEIGHT_WIDTH = 256 / SLOT_COUNT;\\n ////////////////////////////////////////////////////////////////////////////\\n}\\n\",\"keccak256\":\"0xaef690ced707935745ff1482b7bb9bd9eb77bf6a39c717465e64cf12db8a7d39\"},\"@keep-network/sortition-pools/contracts/Leaf.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Constants.sol\\\";\\n\\nlibrary Leaf {\\n function make(\\n address _operator,\\n uint256 _creationBlock,\\n uint256 _id\\n ) internal pure returns (uint256) {\\n assert(_creationBlock <= type(uint64).max);\\n assert(_id <= type(uint32).max);\\n // Converting a bytesX type into a larger type\\n // adds zero bytes on the right.\\n uint256 op = uint256(bytes32(bytes20(_operator)));\\n // Bitwise AND the id to erase\\n // all but the 32 least significant bits\\n uint256 uid = _id & Constants.ID_MAX;\\n // Erase all but the 64 least significant bits,\\n // then shift left by 32 bits to make room for the id\\n uint256 cb = (_creationBlock & Constants.BLOCKHEIGHT_MAX) <<\\n Constants.ID_WIDTH;\\n // Bitwise OR them all together to get\\n // [address operator || uint64 creationBlock || uint32 id]\\n return (op | cb | uid);\\n }\\n\\n function operator(uint256 leaf) internal pure returns (address) {\\n // Converting a bytesX type into a smaller type\\n // truncates it on the right.\\n return address(bytes20(bytes32(leaf)));\\n }\\n\\n /// @notice Return the block number the leaf was created in.\\n function creationBlock(uint256 leaf) internal pure returns (uint256) {\\n return ((leaf >> Constants.ID_WIDTH) & Constants.BLOCKHEIGHT_MAX);\\n }\\n\\n function id(uint256 leaf) internal pure returns (uint32) {\\n // Id is stored in the 32 least significant bits.\\n // Bitwise AND ensures that we only get the contents of those bits.\\n return uint32(leaf & Constants.ID_MAX);\\n }\\n}\\n\",\"keccak256\":\"0xbd107a1a43e48884885e5e966ffcbcd8fa5e89863715d717bb4006e9f89cdc2b\"},\"@keep-network/sortition-pools/contracts/Position.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Constants.sol\\\";\\n\\nlibrary Position {\\n // Return the last 3 bits of a position number,\\n // corresponding to its slot in its parent\\n function slot(uint256 a) internal pure returns (uint256) {\\n return a & Constants.SLOT_POINTER_MAX;\\n }\\n\\n // Return the parent of a position number\\n function parent(uint256 a) internal pure returns (uint256) {\\n return a >> Constants.SLOT_BITS;\\n }\\n\\n // Return the location of the child of a at the given slot\\n function child(uint256 a, uint256 s) internal pure returns (uint256) {\\n return (a << Constants.SLOT_BITS) | (s & Constants.SLOT_POINTER_MAX); // slot(s)\\n }\\n\\n // Return the uint p as a flagged position uint:\\n // the least significant 21 bits contain the position\\n // and the 22nd bit is set as a flag\\n // to distinguish the position 0x000000 from an empty field.\\n function setFlag(uint256 p) internal pure returns (uint256) {\\n return p | Constants.LEAF_FLAG;\\n }\\n\\n // Turn a flagged position into an unflagged position\\n // by removing the flag at the 22nd least significant bit.\\n //\\n // We shouldn't _actually_ need this\\n // as all position-manipulating code should ignore non-position bits anyway\\n // but it's cheap to call so might as well do it.\\n function unsetFlag(uint256 p) internal pure returns (uint256) {\\n return p & (~Constants.LEAF_FLAG);\\n }\\n}\\n\",\"keccak256\":\"0xd3a927908080ac21353a92a6bce3d69e94a5c30f6b51f16b271b6cc679f110e2\"},\"@keep-network/sortition-pools/contracts/RNG.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Leaf.sol\\\";\\nimport \\\"./Constants.sol\\\";\\n\\nlibrary RNG {\\n /// @notice Get an index in the range `[0 .. range-1]`\\n /// and the new state of the RNG,\\n /// using the provided `state` of the RNG.\\n ///\\n /// @param range The upper bound of the index, exclusive.\\n ///\\n /// @param state The previous state of the RNG.\\n /// The initial state needs to be obtained\\n /// from a trusted randomness oracle (the random beacon),\\n /// or from a chain of earlier calls to `RNG.getIndex()`\\n /// on an originally trusted seed.\\n ///\\n /// @dev Calculates the number of bits required for the desired range,\\n /// takes the least significant bits of `state`\\n /// and checks if the obtained index is within the desired range.\\n /// The original state is hashed with `keccak256` to get a new state.\\n /// If the index is outside the range,\\n /// the function retries until it gets a suitable index.\\n ///\\n /// @return index A random integer between `0` and `range - 1`, inclusive.\\n ///\\n /// @return newState The new state of the RNG.\\n /// When `getIndex()` is called one or more times,\\n /// care must be taken to always use the output `state`\\n /// of the most recent call as the input `state` of a subsequent call.\\n /// At the end of a transaction calling `RNG.getIndex()`,\\n /// the previous stored state must be overwritten with the latest output.\\n function getIndex(\\n uint256 range,\\n bytes32 state,\\n uint256 bits\\n ) internal view returns (uint256, bytes32) {\\n bool found = false;\\n uint256 index = 0;\\n bytes32 newState = state;\\n while (!found) {\\n index = truncate(bits, uint256(newState));\\n newState = keccak256(abi.encodePacked(newState, address(this)));\\n if (index < range) {\\n found = true;\\n }\\n }\\n return (index, newState);\\n }\\n\\n /// @notice Calculate how many bits are required\\n /// for an index in the range `[0 .. range-1]`.\\n ///\\n /// @param range The upper bound of the desired range, exclusive.\\n ///\\n /// @return uint The smallest number of bits\\n /// that can contain the number `range-1`.\\n function bitsRequired(uint256 range) internal pure returns (uint256) {\\n unchecked {\\n if (range == 1) {\\n return 0;\\n }\\n\\n uint256 bits = Constants.WEIGHT_WIDTH - 1;\\n\\n // Left shift by `bits`,\\n // so we have a 1 in the (bits + 1)th least significant bit\\n // and 0 in other bits.\\n // If this number is equal or greater than `range`,\\n // the range [0, range-1] fits in `bits` bits.\\n //\\n // Because we loop from high bits to low bits,\\n // we find the highest number of bits that doesn't fit the range,\\n // and return that number + 1.\\n while (1 << bits >= range) {\\n bits--;\\n }\\n\\n return bits + 1;\\n }\\n }\\n\\n /// @notice Truncate `input` to the `bits` least significant bits.\\n function truncate(uint256 bits, uint256 input)\\n internal\\n pure\\n returns (uint256)\\n {\\n unchecked {\\n return input & ((1 << bits) - 1);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67f87f589cd5123ffa32f883ea2f09b0e56258508bae82b8c655b3c27c71eb5e\"},\"@keep-network/sortition-pools/contracts/Rewards.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\n/// @title Rewards\\n/// @notice Rewards are allocated proportionally to operators\\n/// present in the pool at payout based on their weight in the pool.\\n///\\n/// To facilitate this, we use a global accumulator value\\n/// to track the total rewards one unit of weight would've earned\\n/// since the creation of the pool.\\n///\\n/// Whenever a reward is paid, the accumulator is increased\\n/// by the size of the reward divided by the total weight\\n/// of all eligible operators in the pool.\\n///\\n/// Each operator has an individual accumulator value,\\n/// set to equal the global accumulator when the operator joins the pool.\\n/// This accumulator reflects the amount of rewards\\n/// that have already been accounted for with that operator.\\n///\\n/// Whenever an operator's weight in the pool changes,\\n/// we can update the amount of rewards the operator has earned\\n/// by subtracting the operator's accumulator from the global accumulator.\\n/// This gives us the amount of rewards one unit of weight has earned\\n/// since the last time the operator's rewards have been updated.\\n/// Then we multiply that by the operator's previous (pre-change) weight\\n/// to determine how much rewards in total the operator has earned,\\n/// and add this to the operator's earned rewards.\\n/// Finally, we set the operator's accumulator to the global accumulator value.\\ncontract Rewards {\\n struct OperatorRewards {\\n // The state of the global accumulator\\n // when the operator's rewards were last updated\\n uint96 accumulated;\\n // The amount of rewards collected by the operator after the latest update.\\n // The amount the operator could withdraw may equal `available`\\n // or it may be greater, if more rewards have been paid in since then.\\n // To evaulate the most recent amount including rewards potentially paid\\n // since the last update, use `availableRewards` function.\\n uint96 available;\\n // If nonzero, the operator is ineligible for rewards\\n // and may only re-enable rewards after the specified timestamp.\\n // XXX: unsigned 32-bit integer unix seconds, will break around 2106\\n uint32 ineligibleUntil;\\n // Locally cached weight of the operator,\\n // used to reduce the cost of setting operators ineligible.\\n uint32 weight;\\n }\\n\\n // The global accumulator of how much rewards\\n // a hypothetical operator of weight 1 would have earned\\n // since the creation of the pool.\\n uint96 internal globalRewardAccumulator;\\n // If the amount of reward tokens paid in\\n // does not divide cleanly by pool weight,\\n // the difference is recorded as rounding dust\\n // and added to the next reward.\\n uint96 internal rewardRoundingDust;\\n\\n // The amount of rewards that would've been earned by ineligible operators\\n // had they not been ineligible.\\n uint96 public ineligibleEarnedRewards;\\n\\n // Ineligibility times are calculated from this offset,\\n // set at contract creation.\\n uint256 internal immutable ineligibleOffsetStart;\\n\\n mapping(uint32 => OperatorRewards) internal operatorRewards;\\n\\n constructor() {\\n // solhint-disable-next-line not-rely-on-time\\n ineligibleOffsetStart = block.timestamp;\\n }\\n\\n /// @notice Return whether the operator is eligible for rewards or not.\\n function isEligibleForRewards(uint32 operator) internal view returns (bool) {\\n return operatorRewards[operator].ineligibleUntil == 0;\\n }\\n\\n /// @notice Return the time the operator's reward eligibility can be restored.\\n function rewardsEligibilityRestorableAt(uint32 operator)\\n internal\\n view\\n returns (uint256)\\n {\\n uint32 until = operatorRewards[operator].ineligibleUntil;\\n require(until != 0, \\\"Operator already eligible\\\");\\n return (uint256(until) + ineligibleOffsetStart);\\n }\\n\\n /// @notice Return whether the operator is able to restore their eligibility\\n /// for rewards right away.\\n function canRestoreRewardEligibility(uint32 operator)\\n internal\\n view\\n returns (bool)\\n {\\n // solhint-disable-next-line not-rely-on-time\\n return rewardsEligibilityRestorableAt(operator) <= block.timestamp;\\n }\\n\\n /// @notice Internal function for updating the global state of rewards.\\n function addRewards(uint96 rewardAmount, uint32 currentPoolWeight) internal {\\n require(currentPoolWeight > 0, \\\"No recipients in pool\\\");\\n\\n uint96 totalAmount = rewardAmount + rewardRoundingDust;\\n uint96 perWeightReward = totalAmount / currentPoolWeight;\\n uint96 newRoundingDust = totalAmount % currentPoolWeight;\\n\\n globalRewardAccumulator += perWeightReward;\\n rewardRoundingDust = newRoundingDust;\\n }\\n\\n /// @notice Internal function for updating the operator's reward state.\\n function updateOperatorRewards(uint32 operator, uint32 newWeight) internal {\\n uint96 acc = globalRewardAccumulator;\\n OperatorRewards memory o = operatorRewards[operator];\\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\\n if (o.ineligibleUntil == 0) {\\n // If operator is not ineligible, update their earned rewards\\n o.available += accruedRewards;\\n } else {\\n // If ineligible, put the rewards into the ineligible pot\\n ineligibleEarnedRewards += accruedRewards;\\n }\\n // In any case, update their accumulator and weight\\n o.accumulated = acc;\\n o.weight = newWeight;\\n operatorRewards[operator] = o;\\n }\\n\\n /// @notice Set the amount of withdrawable tokens to zero\\n /// and return the previous withdrawable amount.\\n /// @dev Does not update the withdrawable amount,\\n /// but should usually be accompanied by an update.\\n function withdrawOperatorRewards(uint32 operator)\\n internal\\n returns (uint96 withdrawable)\\n {\\n OperatorRewards storage o = operatorRewards[operator];\\n withdrawable = o.available;\\n o.available = 0;\\n }\\n\\n /// @notice Set the amount of ineligible-earned tokens to zero\\n /// and return the previous amount.\\n function withdrawIneligibleRewards() internal returns (uint96 withdrawable) {\\n withdrawable = ineligibleEarnedRewards;\\n ineligibleEarnedRewards = 0;\\n }\\n\\n /// @notice Set the given operators as ineligible for rewards.\\n /// The operators can restore their eligibility at the given time.\\n function setIneligible(uint32[] memory operators, uint256 until) internal {\\n OperatorRewards memory o = OperatorRewards(0, 0, 0, 0);\\n uint96 globalAcc = globalRewardAccumulator;\\n uint96 accrued = 0;\\n // Record ineligibility as seconds after contract creation\\n uint32 _until = uint32(until - ineligibleOffsetStart);\\n\\n for (uint256 i = 0; i < operators.length; i++) {\\n uint32 operator = operators[i];\\n OperatorRewards storage r = operatorRewards[operator];\\n o.available = r.available;\\n o.accumulated = r.accumulated;\\n o.ineligibleUntil = r.ineligibleUntil;\\n o.weight = r.weight;\\n\\n if (o.ineligibleUntil != 0) {\\n // If operator is already ineligible,\\n // don't earn rewards or shorten its ineligibility\\n if (o.ineligibleUntil < _until) {\\n o.ineligibleUntil = _until;\\n }\\n } else {\\n // The operator becomes ineligible -> earn rewards\\n o.ineligibleUntil = _until;\\n accrued = (globalAcc - o.accumulated) * uint96(o.weight);\\n o.available += accrued;\\n }\\n o.accumulated = globalAcc;\\n\\n r.available = o.available;\\n r.accumulated = o.accumulated;\\n r.ineligibleUntil = o.ineligibleUntil;\\n r.weight = o.weight;\\n }\\n }\\n\\n /// @notice Restore the given operator's eligibility for rewards.\\n function restoreEligibility(uint32 operator) internal {\\n // solhint-disable-next-line not-rely-on-time\\n require(canRestoreRewardEligibility(operator), \\\"Operator still ineligible\\\");\\n uint96 acc = globalRewardAccumulator;\\n OperatorRewards memory o = operatorRewards[operator];\\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\\n ineligibleEarnedRewards += accruedRewards;\\n o.accumulated = acc;\\n o.ineligibleUntil = 0;\\n operatorRewards[operator] = o;\\n }\\n\\n /// @notice Returns the amount of rewards currently available for withdrawal\\n /// for the given operator.\\n function availableRewards(uint32 operator) internal view returns (uint96) {\\n uint96 acc = globalRewardAccumulator;\\n OperatorRewards memory o = operatorRewards[operator];\\n if (o.ineligibleUntil == 0) {\\n // If operator is not ineligible, calculate newly accrued rewards and add\\n // them to the available ones, calculated during the last update.\\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\\n return o.available + accruedRewards;\\n } else {\\n // If ineligible, return only the rewards calculated during the last\\n // update.\\n return o.available;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3a10abb408b44335a092387b2c7ee01db3b27997f1f2c888d9b7a2d92934c4e2\"},\"@keep-network/sortition-pools/contracts/SortitionPool.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"@thesis/solidity-contracts/contracts/token/IERC20WithPermit.sol\\\";\\nimport \\\"@thesis/solidity-contracts/contracts/token/IReceiveApproval.sol\\\";\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./RNG.sol\\\";\\nimport \\\"./SortitionTree.sol\\\";\\nimport \\\"./Rewards.sol\\\";\\nimport \\\"./Chaosnet.sol\\\";\\n\\n/// @title Sortition Pool\\n/// @notice A logarithmic data structure used to store the pool of eligible\\n/// operators weighted by their stakes. It allows to select a group of operators\\n/// based on the provided pseudo-random seed.\\ncontract SortitionPool is\\n SortitionTree,\\n Rewards,\\n Ownable,\\n Chaosnet,\\n IReceiveApproval\\n{\\n using Branch for uint256;\\n using Leaf for uint256;\\n using Position for uint256;\\n\\n IERC20WithPermit public immutable rewardToken;\\n\\n uint256 public immutable poolWeightDivisor;\\n\\n bool public isLocked;\\n\\n event IneligibleForRewards(uint32[] ids, uint256 until);\\n\\n event RewardEligibilityRestored(address indexed operator, uint32 indexed id);\\n\\n /// @notice Reverts if called while pool is locked.\\n modifier onlyUnlocked() {\\n require(!isLocked, \\\"Sortition pool locked\\\");\\n _;\\n }\\n\\n /// @notice Reverts if called while pool is unlocked.\\n modifier onlyLocked() {\\n require(isLocked, \\\"Sortition pool unlocked\\\");\\n _;\\n }\\n\\n constructor(IERC20WithPermit _rewardToken, uint256 _poolWeightDivisor) {\\n rewardToken = _rewardToken;\\n poolWeightDivisor = _poolWeightDivisor;\\n }\\n\\n function receiveApproval(\\n address sender,\\n uint256 amount,\\n address token,\\n bytes calldata\\n ) external override {\\n require(token == address(rewardToken), \\\"Unsupported token\\\");\\n rewardToken.transferFrom(sender, address(this), amount);\\n Rewards.addRewards(uint96(amount), uint32(root.sumWeight()));\\n }\\n\\n /// @notice Withdraws all available rewards for the given operator to the\\n /// given beneficiary.\\n /// @dev Can be called only be the owner. Does not validate if the provided\\n /// beneficiary is associated with the provided operator - this needs to\\n /// be done by the owner calling this function.\\n /// @return The amount of rewards withdrawn in this call.\\n function withdrawRewards(address operator, address beneficiary)\\n public\\n onlyOwner\\n returns (uint96)\\n {\\n uint32 id = getOperatorID(operator);\\n Rewards.updateOperatorRewards(id, uint32(getPoolWeight(operator)));\\n uint96 earned = Rewards.withdrawOperatorRewards(id);\\n rewardToken.transfer(beneficiary, uint256(earned));\\n return earned;\\n }\\n\\n /// @notice Withdraws rewards not allocated to operators marked as ineligible\\n /// to the given recipient address.\\n /// @dev Can be called only by the owner.\\n function withdrawIneligible(address recipient) public onlyOwner {\\n uint96 earned = Rewards.withdrawIneligibleRewards();\\n rewardToken.transfer(recipient, uint256(earned));\\n }\\n\\n /// @notice Locks the sortition pool. In locked state, members cannot be\\n /// inserted and removed from the pool. Members statuses cannot\\n /// be updated as well.\\n /// @dev Can be called only by the contract owner.\\n function lock() public onlyOwner {\\n isLocked = true;\\n }\\n\\n /// @notice Unlocks the sortition pool. Removes all restrictions set by\\n /// the `lock` method.\\n /// @dev Can be called only by the contract owner.\\n function unlock() public onlyOwner {\\n isLocked = false;\\n }\\n\\n /// @notice Inserts an operator to the pool. Reverts if the operator is\\n /// already present. Reverts if the operator is not eligible because of their\\n /// authorized stake. Reverts if the chaosnet is active and the operator is\\n /// not a beta operator.\\n /// @dev Can be called only by the contract owner.\\n /// @param operator Address of the inserted operator.\\n /// @param authorizedStake Inserted operator's authorized stake for the application.\\n function insertOperator(address operator, uint256 authorizedStake)\\n public\\n onlyOwner\\n onlyUnlocked\\n {\\n uint256 weight = getWeight(authorizedStake);\\n require(weight > 0, \\\"Operator not eligible\\\");\\n\\n if (isChaosnetActive) {\\n require(isBetaOperator[operator], \\\"Not beta operator for chaosnet\\\");\\n }\\n\\n _insertOperator(operator, weight);\\n uint32 id = getOperatorID(operator);\\n Rewards.updateOperatorRewards(id, uint32(weight));\\n }\\n\\n /// @notice Update the operator's weight if present and eligible,\\n /// or remove from the pool if present and ineligible.\\n /// @dev Can be called only by the contract owner.\\n /// @param operator Address of the updated operator.\\n /// @param authorizedStake Operator's authorized stake for the application.\\n function updateOperatorStatus(address operator, uint256 authorizedStake)\\n public\\n onlyOwner\\n onlyUnlocked\\n {\\n uint256 weight = getWeight(authorizedStake);\\n\\n uint32 id = getOperatorID(operator);\\n Rewards.updateOperatorRewards(id, uint32(weight));\\n\\n if (weight == 0) {\\n _removeOperator(operator);\\n } else {\\n updateOperator(operator, weight);\\n }\\n }\\n\\n /// @notice Set the given operators as ineligible for rewards.\\n /// The operators can restore their eligibility at the given time.\\n function setRewardIneligibility(uint32[] calldata operators, uint256 until)\\n public\\n onlyOwner\\n {\\n Rewards.setIneligible(operators, until);\\n emit IneligibleForRewards(operators, until);\\n }\\n\\n /// @notice Restores reward eligibility for the operator.\\n function restoreRewardEligibility(address operator) public {\\n uint32 id = getOperatorID(operator);\\n Rewards.restoreEligibility(id);\\n emit RewardEligibilityRestored(operator, id);\\n }\\n\\n /// @notice Returns whether the operator is eligible for rewards or not.\\n function isEligibleForRewards(address operator) public view returns (bool) {\\n uint32 id = getOperatorID(operator);\\n return Rewards.isEligibleForRewards(id);\\n }\\n\\n /// @notice Returns the time the operator's reward eligibility can be restored.\\n function rewardsEligibilityRestorableAt(address operator)\\n public\\n view\\n returns (uint256)\\n {\\n uint32 id = getOperatorID(operator);\\n return Rewards.rewardsEligibilityRestorableAt(id);\\n }\\n\\n /// @notice Returns whether the operator is able to restore their eligibility\\n /// for rewards right away.\\n function canRestoreRewardEligibility(address operator)\\n public\\n view\\n returns (bool)\\n {\\n uint32 id = getOperatorID(operator);\\n return Rewards.canRestoreRewardEligibility(id);\\n }\\n\\n /// @notice Returns the amount of rewards withdrawable for the given operator.\\n function getAvailableRewards(address operator) public view returns (uint96) {\\n uint32 id = getOperatorID(operator);\\n return availableRewards(id);\\n }\\n\\n /// @notice Return whether the operator is present in the pool.\\n function isOperatorInPool(address operator) public view returns (bool) {\\n return getFlaggedLeafPosition(operator) != 0;\\n }\\n\\n /// @notice Return whether the operator's weight in the pool\\n /// matches their eligible weight.\\n function isOperatorUpToDate(address operator, uint256 authorizedStake)\\n public\\n view\\n returns (bool)\\n {\\n return getWeight(authorizedStake) == getPoolWeight(operator);\\n }\\n\\n /// @notice Return the weight of the operator in the pool,\\n /// which may or may not be out of date.\\n function getPoolWeight(address operator) public view returns (uint256) {\\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\\n if (flaggedPosition == 0) {\\n return 0;\\n } else {\\n uint256 leafPosition = flaggedPosition.unsetFlag();\\n uint256 leafWeight = getLeafWeight(leafPosition);\\n return leafWeight;\\n }\\n }\\n\\n /// @notice Selects a new group of operators of the provided size based on\\n /// the provided pseudo-random seed. At least one operator has to be\\n /// registered in the pool, otherwise the function fails reverting the\\n /// transaction.\\n /// @param groupSize Size of the requested group\\n /// @param seed Pseudo-random number used to select operators to group\\n /// @return selected Members of the selected group\\n function selectGroup(uint256 groupSize, bytes32 seed)\\n public\\n view\\n onlyLocked\\n returns (uint32[] memory)\\n {\\n uint256 _root = root;\\n\\n bytes32 rngState = seed;\\n uint256 rngRange = _root.sumWeight();\\n require(rngRange > 0, \\\"Not enough operators in pool\\\");\\n uint256 currentIndex;\\n\\n uint256 bits = RNG.bitsRequired(rngRange);\\n\\n uint32[] memory selected = new uint32[](groupSize);\\n\\n for (uint256 i = 0; i < groupSize; i++) {\\n (currentIndex, rngState) = RNG.getIndex(rngRange, rngState, bits);\\n\\n uint256 leafPosition = pickWeightedLeaf(currentIndex, _root);\\n\\n uint256 leaf = leaves[leafPosition];\\n selected[i] = leaf.id();\\n }\\n return selected;\\n }\\n\\n function getWeight(uint256 authorization) internal view returns (uint256) {\\n return authorization / poolWeightDivisor;\\n }\\n}\\n\",\"keccak256\":\"0xab42e7c5b1828f42a73f699eb2dc96d4f793572a6323b8b1fbd7c5e0c065bda7\"},\"@keep-network/sortition-pools/contracts/SortitionTree.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Branch.sol\\\";\\nimport \\\"./Position.sol\\\";\\nimport \\\"./Leaf.sol\\\";\\nimport \\\"./Constants.sol\\\";\\n\\ncontract SortitionTree {\\n using Branch for uint256;\\n using Position for uint256;\\n using Leaf for uint256;\\n\\n // implicit tree\\n // root 8\\n // level2 64\\n // level3 512\\n // level4 4k\\n // level5 32k\\n // level6 256k\\n // level7 2M\\n uint256 internal root;\\n\\n // A 2-index mapping from layer => (index (0-index) => branch). For example,\\n // to access the 6th branch in the 2nd layer (right below the root node; the\\n // first branch layer), call branches[2][5]. Mappings are used in place of\\n // arrays for efficiency. The root is the first layer, the branches occupy\\n // layers 2 through 7, and layer 8 is for the leaves. Following this\\n // convention, the first index in `branches` is `2`, and the last index is\\n // `7`.\\n mapping(uint256 => mapping(uint256 => uint256)) internal branches;\\n\\n // A 0-index mapping from index => leaf, acting as an array. For example, to\\n // access the 42nd leaf, call leaves[41].\\n mapping(uint256 => uint256) internal leaves;\\n\\n // the flagged (see setFlag() and unsetFlag() in Position.sol) positions\\n // of all operators present in the pool\\n mapping(address => uint256) internal flaggedLeafPosition;\\n\\n // the leaf after the rightmost occupied leaf of each stack\\n uint256 internal rightmostLeaf;\\n\\n // the empty leaves in each stack\\n // between 0 and the rightmost occupied leaf\\n uint256[] internal emptyLeaves;\\n\\n // Each operator has an uint32 ID number\\n // which is allocated when they first join the pool\\n // and remains unchanged even if they leave and rejoin the pool.\\n mapping(address => uint32) internal operatorID;\\n\\n // The idAddress array records the address corresponding to each ID number.\\n // The ID number 0 is initialized with a zero address and is not used.\\n address[] internal idAddress;\\n\\n constructor() {\\n root = 0;\\n rightmostLeaf = 0;\\n idAddress.push();\\n }\\n\\n /// @notice Return the ID number of the given operator address. An ID number\\n /// of 0 means the operator has not been allocated an ID number yet.\\n /// @param operator Address of the operator.\\n /// @return the ID number of the given operator address\\n function getOperatorID(address operator) public view returns (uint32) {\\n return operatorID[operator];\\n }\\n\\n /// @notice Get the operator address corresponding to the given ID number. A\\n /// zero address means the ID number has not been allocated yet.\\n /// @param id ID of the operator\\n /// @return the address of the operator\\n function getIDOperator(uint32 id) public view returns (address) {\\n return idAddress.length > id ? idAddress[id] : address(0);\\n }\\n\\n /// @notice Gets the operator addresses corresponding to the given ID\\n /// numbers. A zero address means the ID number has not been allocated yet.\\n /// This function works just like getIDOperator except that it allows to fetch\\n /// operator addresses for multiple IDs in one call.\\n /// @param ids the array of the operator ids\\n /// @return an array of the associated operator addresses\\n function getIDOperators(uint32[] calldata ids)\\n public\\n view\\n returns (address[] memory)\\n {\\n uint256 idCount = idAddress.length;\\n\\n address[] memory operators = new address[](ids.length);\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint32 id = ids[i];\\n operators[i] = idCount > id ? idAddress[id] : address(0);\\n }\\n return operators;\\n }\\n\\n /// @notice Checks if operator is already registered in the pool.\\n /// @param operator the address of the operator\\n /// @return whether or not the operator is already registered in the pool\\n function isOperatorRegistered(address operator) public view returns (bool) {\\n return getFlaggedLeafPosition(operator) != 0;\\n }\\n\\n /// @notice Sum the number of operators in each trunk.\\n /// @return the number of operators in the pool\\n function operatorsInPool() public view returns (uint256) {\\n // Get the number of leaves that might be occupied;\\n // if `rightmostLeaf` equals `firstLeaf()` the tree must be empty,\\n // otherwise the difference between these numbers\\n // gives the number of leaves that may be occupied.\\n uint256 nPossiblyUsedLeaves = rightmostLeaf;\\n // Get the number of empty leaves\\n // not accounted for by the `rightmostLeaf`\\n uint256 nEmptyLeaves = emptyLeaves.length;\\n\\n return (nPossiblyUsedLeaves - nEmptyLeaves);\\n }\\n\\n /// @notice Convenience method to return the total weight of the pool\\n /// @return the total weight of the pool\\n function totalWeight() public view returns (uint256) {\\n return root.sumWeight();\\n }\\n\\n /// @notice Give the operator a new ID number.\\n /// Does not check if the operator already has an ID number.\\n /// @param operator the address of the operator\\n /// @return a new ID for that operator\\n function allocateOperatorID(address operator) internal returns (uint256) {\\n uint256 id = idAddress.length;\\n\\n require(id <= type(uint32).max, \\\"Pool capacity exceeded\\\");\\n\\n operatorID[operator] = uint32(id);\\n idAddress.push(operator);\\n return id;\\n }\\n\\n /// @notice Inserts an operator into the sortition pool\\n /// @param operator the address of an operator to insert\\n /// @param weight how much weight that operator has in the pool\\n function _insertOperator(address operator, uint256 weight) internal {\\n require(\\n !isOperatorRegistered(operator),\\n \\\"Operator is already registered in the pool\\\"\\n );\\n\\n // Fetch the operator's ID, and if they don't have one, allocate them one.\\n uint256 id = getOperatorID(operator);\\n if (id == 0) {\\n id = allocateOperatorID(operator);\\n }\\n\\n // Determine which leaf to insert them into\\n uint256 position = getEmptyLeafPosition();\\n // Record the block the operator was inserted in\\n uint256 theLeaf = Leaf.make(operator, block.number, id);\\n\\n // Update the leaf, and propagate the weight changes all the way up to the\\n // root.\\n root = setLeaf(position, theLeaf, weight, root);\\n\\n // Without position flags,\\n // the position 0x000000 would be treated as empty\\n flaggedLeafPosition[operator] = position.setFlag();\\n }\\n\\n /// @notice Remove an operator (and their weight) from the pool.\\n /// @param operator the address of the operator to remove\\n function _removeOperator(address operator) internal {\\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\\n require(flaggedPosition != 0, \\\"Operator is not registered in the pool\\\");\\n uint256 unflaggedPosition = flaggedPosition.unsetFlag();\\n\\n // Update the leaf, and propagate the weight changes all the way up to the\\n // root.\\n root = removeLeaf(unflaggedPosition, root);\\n removeLeafPositionRecord(operator);\\n }\\n\\n /// @notice Update an operator's weight in the pool.\\n /// @param operator the address of the operator to update\\n /// @param weight the new weight\\n function updateOperator(address operator, uint256 weight) internal {\\n require(\\n isOperatorRegistered(operator),\\n \\\"Operator is not registered in the pool\\\"\\n );\\n\\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\\n uint256 unflaggedPosition = flaggedPosition.unsetFlag();\\n root = updateLeaf(unflaggedPosition, weight, root);\\n }\\n\\n /// @notice Helper method to remove a leaf position record for an operator.\\n /// @param operator the address of the operator to remove the record for\\n function removeLeafPositionRecord(address operator) internal {\\n flaggedLeafPosition[operator] = 0;\\n }\\n\\n /// @notice Removes the data and weight from a particular leaf.\\n /// @param position the leaf index to remove\\n /// @param _root the root node containing the leaf\\n /// @return the updated root node\\n function removeLeaf(uint256 position, uint256 _root)\\n internal\\n returns (uint256)\\n {\\n uint256 rightmostSubOne = rightmostLeaf - 1;\\n bool isRightmost = position == rightmostSubOne;\\n\\n // Clears out the data in the leaf node, and then propagates the weight\\n // changes all the way up to the root.\\n uint256 newRoot = setLeaf(position, 0, 0, _root);\\n\\n // Infer if need to fall back on emptyLeaves yet\\n if (isRightmost) {\\n rightmostLeaf = rightmostSubOne;\\n } else {\\n emptyLeaves.push(position);\\n }\\n return newRoot;\\n }\\n\\n /// @notice Updates the tree to give a particular leaf a new weight.\\n /// @param position the index of the leaf to update\\n /// @param weight the new weight\\n /// @param _root the root node containing the leaf\\n /// @return the updated root node\\n function updateLeaf(\\n uint256 position,\\n uint256 weight,\\n uint256 _root\\n ) internal returns (uint256) {\\n if (getLeafWeight(position) != weight) {\\n return updateTree(position, weight, _root);\\n } else {\\n return _root;\\n }\\n }\\n\\n /// @notice Places a leaf into a particular position, with a given weight and\\n /// propagates that change.\\n /// @param position the index to place the leaf in\\n /// @param theLeaf the new leaf to place in the position\\n /// @param leafWeight the weight of the leaf\\n /// @param _root the root containing the new leaf\\n /// @return the updated root node\\n function setLeaf(\\n uint256 position,\\n uint256 theLeaf,\\n uint256 leafWeight,\\n uint256 _root\\n ) internal returns (uint256) {\\n // set leaf\\n leaves[position] = theLeaf;\\n\\n return (updateTree(position, leafWeight, _root));\\n }\\n\\n /// @notice Propagates a weight change at a position through the tree,\\n /// eventually returning the updated root.\\n /// @param position the index of leaf to update\\n /// @param weight the new weight of the leaf\\n /// @param _root the root node containing the leaf\\n /// @return the updated root node\\n function updateTree(\\n uint256 position,\\n uint256 weight,\\n uint256 _root\\n ) internal returns (uint256) {\\n uint256 childSlot;\\n uint256 treeNode;\\n uint256 newNode;\\n uint256 nodeWeight = weight;\\n\\n uint256 parent = position;\\n // set levels 7 to 2\\n for (uint256 level = Constants.LEVELS; level >= 2; level--) {\\n childSlot = parent.slot();\\n parent = parent.parent();\\n treeNode = branches[level][parent];\\n newNode = treeNode.setSlot(childSlot, nodeWeight);\\n branches[level][parent] = newNode;\\n nodeWeight = newNode.sumWeight();\\n }\\n\\n // set level Root\\n childSlot = parent.slot();\\n return _root.setSlot(childSlot, nodeWeight);\\n }\\n\\n /// @notice Retrieves the next available empty leaf position. Tries to fill\\n /// left to right first, ignoring leaf removals, and then fills\\n /// most-recent-removals first.\\n /// @return the position of the empty leaf\\n function getEmptyLeafPosition() internal returns (uint256) {\\n uint256 rLeaf = rightmostLeaf;\\n bool spaceOnRight = (rLeaf + 1) < Constants.POOL_CAPACITY;\\n if (spaceOnRight) {\\n rightmostLeaf = rLeaf + 1;\\n return rLeaf;\\n } else {\\n uint256 emptyLeafCount = emptyLeaves.length;\\n require(emptyLeafCount > 0, \\\"Pool is full\\\");\\n uint256 emptyLeaf = emptyLeaves[emptyLeafCount - 1];\\n emptyLeaves.pop();\\n return emptyLeaf;\\n }\\n }\\n\\n /// @notice Gets the flagged leaf position for an operator.\\n /// @param operator the address of the operator\\n /// @return the leaf position of that operator\\n function getFlaggedLeafPosition(address operator)\\n internal\\n view\\n returns (uint256)\\n {\\n return flaggedLeafPosition[operator];\\n }\\n\\n /// @notice Gets the weight of a leaf at a particular position.\\n /// @param position the index of the leaf\\n /// @return the weight of the leaf at that position\\n function getLeafWeight(uint256 position) internal view returns (uint256) {\\n uint256 slot = position.slot();\\n uint256 parent = position.parent();\\n\\n // A leaf's weight information is stored a 32-bit slot in the branch layer\\n // directly above the leaf layer. To access it, we calculate that slot and\\n // parent position, and always know the hard-coded layer index.\\n uint256 node = branches[Constants.LEVELS][parent];\\n return node.getSlot(slot);\\n }\\n\\n /// @notice Picks a leaf given a random index.\\n /// @param index a number in `[0, _root.totalWeight())` used to decide\\n /// between leaves\\n /// @param _root the root of the tree\\n function pickWeightedLeaf(uint256 index, uint256 _root)\\n internal\\n view\\n returns (uint256 leafPosition)\\n {\\n uint256 currentIndex = index;\\n uint256 currentNode = _root;\\n uint256 currentPosition = 0;\\n uint256 currentSlot;\\n\\n require(index < currentNode.sumWeight(), \\\"Index exceeds weight\\\");\\n\\n // get root slot\\n (currentSlot, currentIndex) = currentNode.pickWeightedSlot(currentIndex);\\n\\n // get slots from levels 2 to 7\\n for (uint256 level = 2; level <= Constants.LEVELS; level++) {\\n currentPosition = currentPosition.child(currentSlot);\\n currentNode = branches[level][currentPosition];\\n (currentSlot, currentIndex) = currentNode.pickWeightedSlot(currentIndex);\\n }\\n\\n // get leaf position\\n leafPosition = currentPosition.child(currentSlot);\\n }\\n}\\n\",\"keccak256\":\"0x51daeca62ef52be78a1a9de4d2a1c5900c873165f59eda14d5965d7d7da90a03\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x190dd6f8d592b7e4e930feb7f4313aeb8e1c4ad3154c27ce1cf6a512fc30d8cc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20Permit token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9b72f93be69ca894d8492c244259615c4a742afc8d63720dbc8bb81087d9b238\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xda898fa084aa1ddfdb346e6a40459e00a59d87071cce7c315a46d648dd71d0ba\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"@thesis/solidity-contracts/contracts/token/IApproveAndCall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.4;\\n\\n/// @notice An interface that should be implemented by tokens supporting\\n/// `approveAndCall`/`receiveApproval` pattern.\\ninterface IApproveAndCall {\\n /// @notice Executes `receiveApproval` function on spender as specified in\\n /// `IReceiveApproval` interface. Approves spender to withdraw from\\n /// the caller multiple times, up to the `amount`. If this\\n /// function is called again, it overwrites the current allowance\\n /// with `amount`. Reverts if the approval reverted or if\\n /// `receiveApproval` call on the spender reverted.\\n function approveAndCall(\\n address spender,\\n uint256 amount,\\n bytes memory extraData\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x393d18ef81a57dcc96fff4c340cc2945deaebb37b9796c322cf2bc96872c3df8\",\"license\":\"MIT\"},\"@thesis/solidity-contracts/contracts/token/IERC20WithPermit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\nimport \\\"./IApproveAndCall.sol\\\";\\n\\n/// @title IERC20WithPermit\\n/// @notice Burnable ERC20 token with EIP2612 permit functionality. User can\\n/// authorize a transfer of their token with a signature conforming\\n/// EIP712 standard instead of an on-chain transaction from their\\n/// address. Anyone can submit this signature on the user's behalf by\\n/// calling the permit function, as specified in EIP2612 standard,\\n/// paying gas fees, and possibly performing other actions in the same\\n/// transaction.\\ninterface IERC20WithPermit is IERC20, IERC20Metadata, IApproveAndCall {\\n /// @notice EIP2612 approval made with secp256k1 signature.\\n /// Users can authorize a transfer of their tokens with a signature\\n /// conforming EIP712 standard, rather than an on-chain transaction\\n /// from their address. Anyone can submit this signature on the\\n /// user's behalf by calling the permit function, paying gas fees,\\n /// and possibly performing other actions in the same transaction.\\n /// @dev The deadline argument can be set to `type(uint256).max to create\\n /// permits that effectively never expire.\\n function permit(\\n address owner,\\n address spender,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /// @notice Destroys `amount` tokens from the caller.\\n function burn(uint256 amount) external;\\n\\n /// @notice Destroys `amount` of tokens from `account`, deducting the amount\\n /// from caller's allowance.\\n function burnFrom(address account, uint256 amount) external;\\n\\n /// @notice Returns hash of EIP712 Domain struct with the token name as\\n /// a signing domain and token contract as a verifying contract.\\n /// Used to construct EIP2612 signature provided to `permit`\\n /// function.\\n /* solhint-disable-next-line func-name-mixedcase */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /// @notice Returns the current nonce for EIP2612 permission for the\\n /// provided token owner for a replay protection. Used to construct\\n /// EIP2612 signature provided to `permit` function.\\n function nonce(address owner) external view returns (uint256);\\n\\n /// @notice Returns EIP2612 Permit message hash. Used to construct EIP2612\\n /// signature provided to `permit` function.\\n /* solhint-disable-next-line func-name-mixedcase */\\n function PERMIT_TYPEHASH() external pure returns (bytes32);\\n}\\n\",\"keccak256\":\"0xdac9a5086c19a7128b505a7be1ab0ac1aa314f6989cb88d2417e9d7383f89fa9\",\"license\":\"MIT\"},\"@thesis/solidity-contracts/contracts/token/IReceiveApproval.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.4;\\n\\n/// @notice An interface that should be implemented by contracts supporting\\n/// `approveAndCall`/`receiveApproval` pattern.\\ninterface IReceiveApproval {\\n /// @notice Receives approval to spend tokens. Called as a result of\\n /// `approveAndCall` call on the token.\\n function receiveApproval(\\n address from,\\n uint256 amount,\\n address token,\\n bytes calldata extraData\\n ) external;\\n}\\n\",\"keccak256\":\"0x6a30d83ad230548b1e7839737affc8489a035314209de14b89dbef7fb0f66395\",\"license\":\"MIT\"},\"@threshold-network/solidity-contracts/contracts/staking/IApplication.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity ^0.8.9;\\n\\n/// @title Application interface for Threshold Network applications\\n/// @notice Generic interface for an application. Application is an external\\n/// smart contract or a set of smart contracts utilizing functionalities\\n/// offered by Threshold Network. Applications authorized for the given\\n/// staking provider are eligible to slash the stake delegated to that\\n/// staking provider.\\ninterface IApplication {\\n /// @dev Event emitted by `withdrawRewards` function.\\n event RewardsWithdrawn(address indexed stakingProvider, uint96 amount);\\n\\n /// @notice Withdraws application rewards for the given staking provider.\\n /// Rewards are withdrawn to the staking provider's beneficiary\\n /// address set in the staking contract.\\n /// @dev Emits `RewardsWithdrawn` event.\\n function withdrawRewards(address stakingProvider) external;\\n\\n /// @notice Used by T staking contract to inform the application that the\\n /// authorized amount for the given staking provider increased.\\n /// The application may do any necessary housekeeping. The\\n /// application must revert the transaction in case the\\n /// authorization is below the minimum required.\\n function authorizationIncreased(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external;\\n\\n /// @notice Used by T staking contract to inform the application that the\\n /// authorization decrease for the given staking provider has been\\n /// requested. The application should mark the authorization as\\n /// pending decrease and respond to the staking contract with\\n /// `approveAuthorizationDecrease` at its discretion. It may\\n /// happen right away but it also may happen several months later.\\n /// If there is already a pending authorization decrease request\\n /// for the application, and the application does not agree for\\n /// overwriting it, the function should revert.\\n function authorizationDecreaseRequested(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external;\\n\\n /// @notice Used by T staking contract to inform the application the\\n /// authorization has been decreased for the given staking provider\\n /// involuntarily, as a result of slashing. Lets the application to\\n /// do any housekeeping neccessary. Called with 250k gas limit and\\n /// does not revert the transaction if\\n /// `involuntaryAuthorizationDecrease` call failed.\\n function involuntaryAuthorizationDecrease(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external;\\n\\n /// @notice Returns the amount of application rewards available for\\n /// withdrawal for the given staking provider.\\n function availableRewards(address stakingProvider)\\n external\\n view\\n returns (uint96);\\n\\n /// @notice The minimum authorization amount required for the staking\\n /// provider so that they can participate in the application.\\n function minimumAuthorization() external view returns (uint96);\\n}\\n\",\"keccak256\":\"0x43d707dccc548bf48ad316d9652450cb297203234d251132cdc6b97508eb44c5\",\"license\":\"GPL-3.0-or-later\"},\"@threshold-network/solidity-contracts/contracts/staking/IStaking.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity ^0.8.9;\\n\\n/// @title Interface of Threshold Network staking contract\\n/// @notice The staking contract enables T owners to have their wallets offline\\n/// and their stake managed by staking providers on their behalf.\\n/// The staking contract does not define operator role. The operator\\n/// responsible for running off-chain client software is appointed by\\n/// the staking provider in the particular application utilizing the\\n/// staking contract. All off-chain client software should be able\\n/// to run without exposing operator's or staking provider\\u2019s private\\n/// key and should not require any owner\\u2019s keys at all. The stake\\n/// delegation optimizes the network throughput without compromising the\\n/// security of the owners\\u2019 stake.\\ninterface IStaking {\\n enum StakeType {\\n NU,\\n KEEP,\\n T\\n }\\n\\n //\\n //\\n // Delegating a stake\\n //\\n //\\n\\n /// @notice Creates a delegation with `msg.sender` owner with the given\\n /// staking provider, beneficiary, and authorizer. Transfers the\\n /// given amount of T to the staking contract.\\n /// @dev The owner of the delegation needs to have the amount approved to\\n /// transfer to the staking contract.\\n function stake(\\n address stakingProvider,\\n address payable beneficiary,\\n address authorizer,\\n uint96 amount\\n ) external;\\n\\n /// @notice Copies delegation from the legacy KEEP staking contract to T\\n /// staking contract. No tokens are transferred. Caches the active\\n /// stake amount from KEEP staking contract. Can be called by\\n /// anyone.\\n /// @dev The staking provider in T staking contract is the legacy KEEP\\n /// staking contract operator.\\n function stakeKeep(address stakingProvider) external;\\n\\n /// @notice Copies delegation from the legacy NU staking contract to T\\n /// staking contract, additionally appointing staking provider,\\n /// beneficiary and authorizer roles. Caches the amount staked in NU\\n /// staking contract. Can be called only by the original delegation\\n /// owner.\\n function stakeNu(\\n address stakingProvider,\\n address payable beneficiary,\\n address authorizer\\n ) external;\\n\\n /// @notice Allows the Governance to set the minimum required stake amount.\\n /// This amount is required to protect against griefing the staking\\n /// contract and individual applications are allowed to require\\n /// higher minimum stakes if necessary.\\n function setMinimumStakeAmount(uint96 amount) external;\\n\\n //\\n //\\n // Authorizing an application\\n //\\n //\\n\\n /// @notice Allows the Governance to approve the particular application\\n /// before individual stake authorizers are able to authorize it.\\n function approveApplication(address application) external;\\n\\n /// @notice Increases the authorization of the given staking provider for\\n /// the given application by the given amount. Can only be called by\\n /// the authorizer for that staking provider.\\n /// @dev Calls `authorizationIncreased(address stakingProvider, uint256 amount)`\\n /// on the given application to notify the application about\\n /// authorization change. See `IApplication`.\\n function increaseAuthorization(\\n address stakingProvider,\\n address application,\\n uint96 amount\\n ) external;\\n\\n /// @notice Requests decrease of the authorization for the given staking\\n /// provider on the given application by the provided amount.\\n /// It may not change the authorized amount immediatelly. When\\n /// it happens depends on the application. Can only be called by the\\n /// given staking provider\\u2019s authorizer. Overwrites pending\\n /// authorization decrease for the given staking provider and\\n /// application if the application agrees for that. If the\\n /// application does not agree for overwriting, the function\\n /// reverts.\\n /// @dev Calls `authorizationDecreaseRequested(address stakingProvider, uint256 amount)`\\n /// on the given application. See `IApplication`.\\n function requestAuthorizationDecrease(\\n address stakingProvider,\\n address application,\\n uint96 amount\\n ) external;\\n\\n /// @notice Requests decrease of all authorizations for the given staking\\n /// provider on all applications by all authorized amount.\\n /// It may not change the authorized amount immediatelly. When\\n /// it happens depends on the application. Can only be called by the\\n /// given staking provider\\u2019s authorizer. Overwrites pending\\n /// authorization decrease for the given staking provider and\\n /// application.\\n /// @dev Calls `authorizationDecreaseRequested(address stakingProvider, uint256 amount)`\\n /// for each authorized application. See `IApplication`.\\n function requestAuthorizationDecrease(address stakingProvider) external;\\n\\n /// @notice Called by the application at its discretion to approve the\\n /// previously requested authorization decrease request. Can only be\\n /// called by the application that was previously requested to\\n /// decrease the authorization for that staking provider.\\n /// Returns resulting authorized amount for the application.\\n function approveAuthorizationDecrease(address stakingProvider)\\n external\\n returns (uint96);\\n\\n /// @notice Decreases the authorization for the given `stakingProvider` on\\n /// the given disabled `application`, for all authorized amount.\\n /// Can be called by anyone.\\n function forceDecreaseAuthorization(\\n address stakingProvider,\\n address application\\n ) external;\\n\\n /// @notice Pauses the given application\\u2019s eligibility to slash stakes.\\n /// Besides that stakers can't change authorization to the application.\\n /// Can be called only by the Panic Button of the particular\\n /// application. The paused application can not slash stakes until\\n /// it is approved again by the Governance using `approveApplication`\\n /// function. Should be used only in case of an emergency.\\n function pauseApplication(address application) external;\\n\\n /// @notice Disables the given application. The disabled application can't\\n /// slash stakers. Also stakers can't increase authorization to that\\n /// application but can decrease without waiting by calling\\n /// `requestAuthorizationDecrease` at any moment. Can be called only\\n /// by the governance. The disabled application can't be approved\\n /// again. Should be used only in case of an emergency.\\n function disableApplication(address application) external;\\n\\n /// @notice Sets the Panic Button role for the given application to the\\n /// provided address. Can only be called by the Governance. If the\\n /// Panic Button for the given application should be disabled, the\\n /// role address should be set to 0x0 address.\\n function setPanicButton(address application, address panicButton) external;\\n\\n /// @notice Sets the maximum number of applications one staking provider can\\n /// have authorized. Used to protect against DoSing slashing queue.\\n /// Can only be called by the Governance.\\n function setAuthorizationCeiling(uint256 ceiling) external;\\n\\n //\\n //\\n // Stake top-up\\n //\\n //\\n\\n /// @notice Increases the amount of the stake for the given staking provider.\\n /// @dev The sender of this transaction needs to have the amount approved to\\n /// transfer to the staking contract.\\n function topUp(address stakingProvider, uint96 amount) external;\\n\\n /// @notice Propagates information about stake top-up from the legacy KEEP\\n /// staking contract to T staking contract. Can be called only by\\n /// the owner or the staking provider.\\n function topUpKeep(address stakingProvider) external;\\n\\n /// @notice Propagates information about stake top-up from the legacy NU\\n /// staking contract to T staking contract. Can be called only by\\n /// the owner or the staking provider.\\n function topUpNu(address stakingProvider) external;\\n\\n //\\n //\\n // Undelegating a stake (unstaking)\\n //\\n //\\n\\n /// @notice Reduces the liquid T stake amount by the provided amount and\\n /// withdraws T to the owner. Reverts if there is at least one\\n /// authorization higher than the sum of the legacy stake and\\n /// remaining liquid T stake or if the unstake amount is higher than\\n /// the liquid T stake amount. Can be called only by the delegation\\n /// owner or the staking provider.\\n function unstakeT(address stakingProvider, uint96 amount) external;\\n\\n /// @notice Sets the legacy KEEP staking contract active stake amount cached\\n /// in T staking contract to 0. Reverts if the amount of liquid T\\n /// staked in T staking contract is lower than the highest\\n /// application authorization. This function allows to unstake from\\n /// KEEP staking contract and still being able to operate in T\\n /// network and earning rewards based on the liquid T staked. Can be\\n /// called only by the delegation owner or the staking provider.\\n function unstakeKeep(address stakingProvider) external;\\n\\n /// @notice Reduces cached legacy NU stake amount by the provided amount.\\n /// Reverts if there is at least one authorization higher than the\\n /// sum of remaining legacy NU stake and liquid T stake for that\\n /// staking provider or if the untaked amount is higher than the\\n /// cached legacy stake amount. If succeeded, the legacy NU stake\\n /// can be partially or fully undelegated on the legacy staking\\n /// contract. This function allows to unstake from NU staking\\n /// contract and still being able to operate in T network and\\n /// earning rewards based on the liquid T staked. Can be called only\\n /// by the delegation owner or the staking provider.\\n function unstakeNu(address stakingProvider, uint96 amount) external;\\n\\n /// @notice Sets cached legacy stake amount to 0, sets the liquid T stake\\n /// amount to 0 and withdraws all liquid T from the stake to the\\n /// owner. Reverts if there is at least one non-zero authorization.\\n /// Can be called only by the delegation owner or the staking\\n /// provider.\\n function unstakeAll(address stakingProvider) external;\\n\\n //\\n //\\n // Keeping information in sync\\n //\\n //\\n\\n /// @notice Notifies about the discrepancy between legacy KEEP active stake\\n /// and the amount cached in T staking contract. Slashes the staking\\n /// provider in case the amount cached is higher than the actual\\n /// active stake amount in KEEP staking contract. Needs to update\\n /// authorizations of all affected applications and execute an\\n /// involuntary allocation decrease on all affected applications.\\n /// Can be called by anyone, notifier receives a reward.\\n function notifyKeepStakeDiscrepancy(address stakingProvider) external;\\n\\n /// @notice Notifies about the discrepancy between legacy NU active stake\\n /// and the amount cached in T staking contract. Slashes the\\n /// staking provider in case the amount cached is higher than the\\n /// actual active stake amount in NU staking contract. Needs to\\n /// update authorizations of all affected applications and execute\\n /// an involuntary allocation decrease on all affected applications.\\n /// Can be called by anyone, notifier receives a reward.\\n function notifyNuStakeDiscrepancy(address stakingProvider) external;\\n\\n /// @notice Sets the penalty amount for stake discrepancy and reward\\n /// multiplier for reporting it. The penalty is seized from the\\n /// delegated stake, and 5% of the penalty, scaled by the\\n /// multiplier, is given to the notifier. The rest of the tokens are\\n /// burned. Can only be called by the Governance. See `seize` function.\\n function setStakeDiscrepancyPenalty(\\n uint96 penalty,\\n uint256 rewardMultiplier\\n ) external;\\n\\n /// @notice Sets reward in T tokens for notification of misbehaviour\\n /// of one staking provider. Can only be called by the governance.\\n function setNotificationReward(uint96 reward) external;\\n\\n /// @notice Transfer some amount of T tokens as reward for notifications\\n /// of misbehaviour\\n function pushNotificationReward(uint96 reward) external;\\n\\n /// @notice Withdraw some amount of T tokens from notifiers treasury.\\n /// Can only be called by the governance.\\n function withdrawNotificationReward(address recipient, uint96 amount)\\n external;\\n\\n /// @notice Adds staking providers to the slashing queue along with the\\n /// amount that should be slashed from each one of them. Can only be\\n /// called by application authorized for all staking providers in\\n /// the array.\\n function slash(uint96 amount, address[] memory stakingProviders) external;\\n\\n /// @notice Adds staking providers to the slashing queue along with the\\n /// amount. The notifier will receive reward per each staking\\n /// provider from notifiers treasury. Can only be called by\\n /// application authorized for all staking providers in the array.\\n function seize(\\n uint96 amount,\\n uint256 rewardMultipier,\\n address notifier,\\n address[] memory stakingProviders\\n ) external;\\n\\n /// @notice Takes the given number of queued slashing operations and\\n /// processes them. Receives 5% of the slashed amount.\\n /// Executes `involuntaryAllocationDecrease` function on each\\n /// affected application.\\n function processSlashing(uint256 count) external;\\n\\n //\\n //\\n // Auxiliary functions\\n //\\n //\\n\\n /// @notice Returns the authorized stake amount of the staking provider for\\n /// the application.\\n function authorizedStake(address stakingProvider, address application)\\n external\\n view\\n returns (uint96);\\n\\n /// @notice Returns staked amount of T, Keep and Nu for the specified\\n /// staking provider.\\n /// @dev All values are in T denomination\\n function stakes(address stakingProvider)\\n external\\n view\\n returns (\\n uint96 tStake,\\n uint96 keepInTStake,\\n uint96 nuInTStake\\n );\\n\\n /// @notice Returns start staking timestamp.\\n /// @dev This value is set at most once.\\n function getStartStakingTimestamp(address stakingProvider)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Returns staked amount of NU for the specified staking provider.\\n function stakedNu(address stakingProvider) external view returns (uint256);\\n\\n /// @notice Gets the stake owner, the beneficiary and the authorizer\\n /// for the specified staking provider address.\\n /// @return owner Stake owner address.\\n /// @return beneficiary Beneficiary address.\\n /// @return authorizer Authorizer address.\\n function rolesOf(address stakingProvider)\\n external\\n view\\n returns (\\n address owner,\\n address payable beneficiary,\\n address authorizer\\n );\\n\\n /// @notice Returns length of application array\\n function getApplicationsLength() external view returns (uint256);\\n\\n /// @notice Returns length of slashing queue\\n function getSlashingQueueLength() external view returns (uint256);\\n\\n /// @notice Returns minimum possible stake for T, KEEP or NU in T\\n /// denomination.\\n /// @dev For example, suppose the given staking provider has 10 T, 20 T\\n /// worth of KEEP, and 30 T worth of NU all staked, and the maximum\\n /// application authorization is 40 T, then `getMinStaked` for\\n /// that staking provider returns:\\n /// * 0 T if KEEP stake type specified i.e.\\n /// min = 40 T max - (10 T + 30 T worth of NU) = 0 T\\n /// * 10 T if NU stake type specified i.e.\\n /// min = 40 T max - (10 T + 20 T worth of KEEP) = 10 T\\n /// * 0 T if T stake type specified i.e.\\n /// min = 40 T max - (20 T worth of KEEP + 30 T worth of NU) < 0 T\\n /// In other words, the minimum stake amount for the specified\\n /// stake type is the minimum amount of stake of the given type\\n /// needed to satisfy the maximum application authorization given the\\n /// staked amounts of the other stake types for that staking provider.\\n function getMinStaked(address stakingProvider, StakeType stakeTypes)\\n external\\n view\\n returns (uint96);\\n\\n /// @notice Returns available amount to authorize for the specified application\\n function getAvailableToAuthorize(\\n address stakingProvider,\\n address application\\n ) external view returns (uint96);\\n}\\n\",\"keccak256\":\"0x45c15ff4a9a47024ce413da249a6a77cc2f20a81909e7536d4c5198c92f3f148\",\"license\":\"GPL-3.0-or-later\"},\"contracts/BeaconDkgValidator.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"./libraries/BytesLib.sol\\\";\\nimport {BeaconDkg as DKG} from \\\"./libraries/BeaconDkg.sol\\\";\\n\\n/// @title DKG result validator\\n/// @notice DKGValidator allows performing a full validation of DKG result,\\n/// including checking the format of fields in the result, declared\\n/// selected group members, and signatures of operators supporting the\\n/// result. The operator submitting the result should perform the\\n/// validation using a free contract call before submitting the result\\n/// to ensure their result is valid and can not be challenged. All other\\n/// network operators should perform validation of the submitted result\\n/// using a free contract call and challenge the result if the\\n/// validation fails.\\ncontract BeaconDkgValidator {\\n using BytesLib for bytes;\\n using ECDSA for bytes32;\\n\\n /// @dev Size of a group in the threshold relay.\\n uint256 public constant groupSize = 64;\\n\\n /// @dev The minimum number of group members needed to interact according to\\n /// the protocol to produce a relay entry. The adversary can not learn\\n /// anything about the key as long as it does not break into\\n /// groupThreshold+1 of members.\\n uint256 public constant groupThreshold = 33;\\n\\n /// @dev The minimum number of active and properly behaving group members\\n /// during the DKG needed to accept the result. This number is higher\\n /// than `groupThreshold` to keep a safety margin for members becoming\\n /// inactive after DKG so that the group can still produce a relay\\n /// entry.\\n uint256 public constant activeThreshold = 58; // 90% of groupSize\\n\\n /// @dev Size in bytes of a single signature produced by operator supporting\\n /// DKG result.\\n uint256 public constant signatureByteSize = 65;\\n\\n SortitionPool public immutable sortitionPool;\\n\\n constructor(SortitionPool _sortitionPool) {\\n require(\\n address(_sortitionPool) != address(0),\\n \\\"Zero-address reference\\\"\\n );\\n\\n sortitionPool = _sortitionPool;\\n }\\n\\n /// @notice Performs a full validation of DKG result, including checking the\\n /// format of fields in the result, declared selected group members,\\n /// and signatures of operators supporting the result.\\n /// @param seed seed used to start the DKG and select group members\\n /// @param startBlock DKG start block\\n /// @return isValid true if the result is valid, false otherwise\\n /// @return errorMsg validation error message; empty for a valid result\\n function validate(\\n DKG.Result calldata result,\\n uint256 seed,\\n uint256 startBlock\\n ) external view returns (bool isValid, string memory errorMsg) {\\n (bool hasValidFields, string memory error) = validateFields(result);\\n if (!hasValidFields) {\\n return (false, error);\\n }\\n\\n if (!validateSignatures(result, startBlock)) {\\n return (false, \\\"Invalid signatures\\\");\\n }\\n\\n if (!validateGroupMembers(result, seed)) {\\n return (false, \\\"Invalid group members\\\");\\n }\\n\\n // At this point all group members and mishbehaved members were verified\\n if (!validateMembersHash(result)) {\\n return (false, \\\"Invalid members hash\\\");\\n }\\n\\n return (true, \\\"\\\");\\n }\\n\\n /// @notice Performs a static validation of DKG result fields: lengths,\\n /// ranges, and order of arrays.\\n /// @return isValid true if the result is valid, false otherwise\\n /// @return errorMsg validation error message; empty for a valid result\\n function validateFields(DKG.Result calldata result)\\n public\\n pure\\n returns (bool isValid, string memory errorMsg)\\n {\\n // Group public key needs to be 128 bytes long.\\n if (result.groupPubKey.length != 128) {\\n return (false, \\\"Malformed group public key\\\");\\n }\\n\\n // The number of misbehaved members can not exceed the threshold.\\n // Misbehaved member indices needs to be unique, between [1, groupSize],\\n // and sorted in ascending order.\\n uint8[] calldata misbehavedMembersIndices = result\\n .misbehavedMembersIndices;\\n if (groupSize - misbehavedMembersIndices.length < activeThreshold) {\\n return (false, \\\"Too many members misbehaving during DKG\\\");\\n }\\n if (misbehavedMembersIndices.length > 1) {\\n if (\\n misbehavedMembersIndices[0] < 1 ||\\n misbehavedMembersIndices[misbehavedMembersIndices.length - 1] >\\n groupSize\\n ) {\\n return (false, \\\"Corrupted misbehaved members indices\\\");\\n }\\n for (uint256 i = 1; i < misbehavedMembersIndices.length; i++) {\\n if (\\n misbehavedMembersIndices[i - 1] >=\\n misbehavedMembersIndices[i]\\n ) {\\n return (false, \\\"Corrupted misbehaved members indices\\\");\\n }\\n }\\n }\\n\\n // Each signature needs to have a correct length and signatures need to\\n // be provided.\\n uint256 signaturesCount = result.signatures.length / signatureByteSize;\\n if (result.signatures.length == 0) {\\n return (false, \\\"No signatures provided\\\");\\n }\\n if (result.signatures.length % signatureByteSize != 0) {\\n return (false, \\\"Malformed signatures array\\\");\\n }\\n\\n // We expect the same amount of signatures as the number of declared\\n // group member indices that signed the result.\\n uint256[] calldata signingMembersIndices = result.signingMembersIndices;\\n if (signaturesCount != signingMembersIndices.length) {\\n return (false, \\\"Unexpected signatures count\\\");\\n }\\n if (signaturesCount < groupThreshold) {\\n return (false, \\\"Too few signatures\\\");\\n }\\n if (signaturesCount > groupSize) {\\n return (false, \\\"Too many signatures\\\");\\n }\\n\\n // Signing member indices needs to be unique, between [1,groupSize],\\n // and sorted in ascending order.\\n if (\\n signingMembersIndices[0] < 1 ||\\n signingMembersIndices[signingMembersIndices.length - 1] > groupSize\\n ) {\\n return (false, \\\"Corrupted signing member indices\\\");\\n }\\n for (uint256 i = 1; i < signingMembersIndices.length; i++) {\\n if (signingMembersIndices[i - 1] >= signingMembersIndices[i]) {\\n return (false, \\\"Corrupted signing member indices\\\");\\n }\\n }\\n\\n return (true, \\\"\\\");\\n }\\n\\n /// @notice Performs validation of group members as declared in DKG\\n /// result against group members selected by the sortition pool.\\n /// @param seed seed used to start the DKG and select group members\\n /// @return true if group members matches; false otherwise\\n function validateGroupMembers(DKG.Result calldata result, uint256 seed)\\n public\\n view\\n returns (bool)\\n {\\n uint32[] calldata resultMembers = result.members;\\n uint32[] memory actualGroupMembers = sortitionPool.selectGroup(\\n groupSize,\\n bytes32(seed)\\n );\\n if (resultMembers.length != actualGroupMembers.length) {\\n return false;\\n }\\n for (uint256 i = 0; i < resultMembers.length; i++) {\\n if (resultMembers[i] != actualGroupMembers[i]) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Performs validation of signatures supplied in DKG result.\\n /// Note that this function does not check if addresses which\\n /// supplied signatures supporting the result are the ones selected\\n /// to the group by sortition pool. This function should be used\\n /// together with `validateGroupMembers`.\\n /// @param startBlock DKG start block\\n /// @return true if group members matches; false otherwise\\n function validateSignatures(DKG.Result calldata result, uint256 startBlock)\\n public\\n view\\n returns (bool)\\n {\\n bytes32 hash = keccak256(\\n abi.encode(\\n block.chainid,\\n result.groupPubKey,\\n result.misbehavedMembersIndices,\\n startBlock\\n )\\n ).toEthSignedMessageHash();\\n\\n uint256[] calldata signingMembersIndices = result.signingMembersIndices;\\n uint32[] memory signingMemberIds = new uint32[](\\n signingMembersIndices.length\\n );\\n for (uint256 i = 0; i < signingMembersIndices.length; i++) {\\n signingMemberIds[i] = result.members[signingMembersIndices[i] - 1];\\n }\\n\\n address[] memory signingMemberAddresses = sortitionPool.getIDOperators(\\n signingMemberIds\\n );\\n\\n bytes memory current; // Current signature to be checked.\\n\\n uint256 signaturesCount = result.signatures.length / signatureByteSize;\\n for (uint256 i = 0; i < signaturesCount; i++) {\\n current = result.signatures.slice(\\n signatureByteSize * i,\\n signatureByteSize\\n );\\n address recoveredAddress = hash.recover(current);\\n\\n if (signingMemberAddresses[i] != recoveredAddress) {\\n return false;\\n }\\n }\\n\\n return true;\\n }\\n\\n /// @notice Performs validation of hashed group members that actively took\\n /// part in DKG.\\n /// @param result DKG result\\n /// @return true if result's group members hash matches with the one that is\\n /// challenged.\\n function validateMembersHash(DKG.Result calldata result)\\n public\\n pure\\n returns (bool)\\n {\\n if (result.misbehavedMembersIndices.length > 0) {\\n // members that generated a group signing key\\n uint32[] memory groupMembers = new uint32[](\\n result.members.length - result.misbehavedMembersIndices.length\\n );\\n uint256 k = 0; // misbehaved members counter\\n uint256 j = 0; // group members counter\\n for (uint256 i = 0; i < result.members.length; i++) {\\n // misbehaved member indices start from 1, so we need to -1 on misbehaved\\n if (i != result.misbehavedMembersIndices[k] - 1) {\\n groupMembers[j] = result.members[i];\\n j++;\\n } else if (k < result.misbehavedMembersIndices.length - 1) {\\n k++;\\n }\\n }\\n\\n return keccak256(abi.encode(groupMembers)) == result.membersHash;\\n }\\n\\n return keccak256(abi.encode(result.members)) == result.membersHash;\\n }\\n}\\n\",\"keccak256\":\"0xaacb5961dc3181238036f1e747b3d1935f356ca5ff27bd9c9c1c0c22dee6630c\",\"license\":\"GPL-3.0-only\"},\"contracts/Governable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\n/// @notice Governable contract.\\n/// @dev A constructor is not defined, which makes the contract compatible with\\n/// upgradable proxies. This requires calling explicitly `_transferGovernance`\\n/// function in a child contract.\\nabstract contract Governable {\\n // Governance of the contract\\n // The variable should be initialized by the implementing contract.\\n // slither-disable-next-line uninitialized-state\\n address public governance;\\n\\n // Reserved storage space in case we need to add more variables,\\n // since there are upgradeable contracts that inherit from this one.\\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n // slither-disable-next-line unused-state\\n uint256[49] private __gap;\\n\\n event GovernanceTransferred(address oldGovernance, address newGovernance);\\n\\n modifier onlyGovernance() virtual {\\n require(governance == msg.sender, \\\"Caller is not the governance\\\");\\n _;\\n }\\n\\n /// @notice Transfers governance of the contract to `newGovernance`.\\n function transferGovernance(address newGovernance)\\n external\\n virtual\\n onlyGovernance\\n {\\n require(\\n newGovernance != address(0),\\n \\\"New governance is the zero address\\\"\\n );\\n _transferGovernance(newGovernance);\\n }\\n\\n function _transferGovernance(address newGovernance) internal virtual {\\n address oldGovernance = governance;\\n governance = newGovernance;\\n emit GovernanceTransferred(oldGovernance, newGovernance);\\n }\\n}\\n\",\"keccak256\":\"0xcc6a0fe8fdf05a805d2874dc7dd76dede1eb16e3ab77f2d0069dbb92272ab0a3\",\"license\":\"GPL-3.0-only\"},\"contracts/RandomBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./api/IRandomBeacon.sol\\\";\\nimport \\\"./libraries/Groups.sol\\\";\\nimport \\\"./libraries/Relay.sol\\\";\\nimport \\\"./libraries/Groups.sol\\\";\\nimport \\\"./libraries/Callback.sol\\\";\\nimport \\\"./Reimbursable.sol\\\";\\nimport \\\"./Governable.sol\\\";\\nimport {BeaconInactivity as Inactivity} from \\\"./libraries/BeaconInactivity.sol\\\";\\nimport {BeaconAuthorization as Authorization} from \\\"./libraries/BeaconAuthorization.sol\\\";\\nimport {BeaconDkg as DKG} from \\\"./libraries/BeaconDkg.sol\\\";\\nimport {BeaconDkgValidator as DKGValidator} from \\\"./BeaconDkgValidator.sol\\\";\\n\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"@threshold-network/solidity-contracts/contracts/staking/IApplication.sol\\\";\\nimport \\\"@threshold-network/solidity-contracts/contracts/staking/IStaking.sol\\\";\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\n/// @title Keep Random Beacon\\n/// @notice Keep Random Beacon contract. It lets to request a new\\n/// relay entry and validates the new relay entry provided by the\\n/// network. This contract is in charge of all other Random Beacon\\n/// activities such as group lifecycle or slashing.\\n/// @dev Should be owned by the governance contract controlling Random Beacon\\n/// parameters.\\ncontract RandomBeacon is IRandomBeacon, IApplication, Governable, Reimbursable {\\n using SafeERC20 for IERC20;\\n using Authorization for Authorization.Data;\\n using DKG for DKG.Data;\\n using Groups for Groups.Data;\\n using Relay for Relay.Data;\\n using Callback for Callback.Data;\\n\\n // Constant parameters\\n\\n /// @notice Seed value used for the genesis group selection.\\n /// https://www.wolframalpha.com/input/?i=pi+to+78+digits\\n uint256 internal constant genesisSeed =\\n 31415926535897932384626433832795028841971693993751058209749445923078164062862;\\n\\n // Governable parameters\\n\\n /// @notice Relay entry callback gas limit. This is the gas limit with which\\n /// callback function provided in the relay request transaction is\\n /// executed. The callback is executed with a new relay entry value\\n /// in the same transaction the relay entry is submitted.\\n uint256 internal _callbackGasLimit;\\n\\n /// @notice The frequency of new group creation. Groups are created with\\n /// a fixed frequency of relay requests.\\n uint256 internal _groupCreationFrequency;\\n\\n /// @notice Slashing amount for submitting a malicious DKG result. Every\\n /// DKG result submitted can be challenged for the time of\\n /// `dkg.ResultChallengePeriodLength`. If the DKG result submitted\\n /// is challenged and proven to be malicious, the operator who\\n /// submitted the malicious result is slashed for\\n /// `_maliciousDkgResultSlashingAmount`.\\n uint96 internal _maliciousDkgResultSlashingAmount;\\n\\n /// @notice Slashing amount when an unauthorized signing has been proved,\\n /// which means the private key leaked and all the group members\\n /// should be punished.\\n uint96 internal _unauthorizedSigningSlashingAmount;\\n\\n /// @notice Duration of the sortition pool rewards ban imposed on operators\\n /// who misbehaved during DKG by being inactive or disqualified and\\n /// for operators that were identified by the rest of group members\\n /// as inactive via `notifyOperatorInactivity`.\\n uint256 internal _sortitionPoolRewardsBanDuration;\\n\\n /// @notice Percentage of the staking contract malicious behavior\\n /// notification reward which will be transferred to the notifier\\n /// reporting about relay entry timeout. Notifiers are rewarded\\n /// from a notifiers treasury pool. For example, if\\n /// notification reward is 1000 and the value of the multiplier is\\n /// 5, the notifier will receive: 5% of 1000 = 50 per each\\n /// operator affected.\\n uint256 internal _relayEntryTimeoutNotificationRewardMultiplier;\\n\\n /// @notice Percentage of the staking contract malicious behavior\\n /// notification reward which will be transferred to the notifier\\n /// reporting about unauthorized signing. Notifiers are rewarded\\n /// from a notifiers treasury pool. For example, if a\\n /// notification reward is 1000 and the value of the multiplier is\\n /// 5, the notifier will receive: 5% of 1000 = 50 per each\\n /// operator affected.\\n uint256 internal _unauthorizedSigningNotificationRewardMultiplier;\\n\\n /// @notice Percentage of the staking contract malicious behavior\\n /// notification reward which will be transferred to the notifier\\n /// reporting about a malicious DKG result. Notifiers are rewarded\\n /// from a notifiers treasury pool. For example, if\\n /// notification reward is 1000 and the value of the multiplier is\\n /// 5, the notifier will receive: 5% of 1000 = 50 per each\\n /// operator affected.\\n uint256 internal _dkgMaliciousResultNotificationRewardMultiplier;\\n\\n /// @notice Calculated gas cost for submitting a DKG result. This will\\n /// be refunded as part of the DKG approval process. It is in the\\n /// submitter's interest to not skip his priority turn on the approval,\\n /// otherwise the refund of the DKG submission will be refunded to\\n /// another group member that will call the DKG approve function.\\n uint256 internal _dkgResultSubmissionGas;\\n\\n /// @notice Gas that is meant to balance the DKG result approval's overall\\n /// cost. Can be updated by the governance based on the current\\n /// market conditions.\\n uint256 internal _dkgResultApprovalGasOffset;\\n\\n /// @notice Gas that is meant to balance the operator inactivity notification\\n /// cost. Can be updated by the governance based on the current\\n /// market conditions.\\n uint256 internal _notifyOperatorInactivityGasOffset;\\n\\n /// @notice Gas that is meant to balance the relay entry submission cost.\\n /// Can be updated by the governance based on the current market\\n /// conditions.\\n uint256 internal _relayEntrySubmissionGasOffset;\\n\\n // Other parameters\\n\\n /// @notice Stores current operator inactivity claim nonce for given group.\\n /// Each claim is made with an unique nonce which protects\\n /// against claim replay.\\n mapping(uint64 => uint256) public inactivityClaimNonce; // groupId -> nonce\\n\\n /// @notice Authorized addresses that can request a relay entry.\\n mapping(address => bool) public authorizedRequesters;\\n\\n // External dependencies\\n\\n SortitionPool public sortitionPool;\\n IERC20 public tToken;\\n IStaking public staking;\\n\\n // Libraries data storages\\n\\n Authorization.Data internal authorization;\\n DKG.Data internal dkg;\\n Groups.Data internal groups;\\n Relay.Data internal relay;\\n Callback.Data internal callback;\\n\\n // Events\\n\\n event AuthorizationParametersUpdated(\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseDelay,\\n uint64 authorizationDecreaseChangePeriod\\n );\\n\\n event RelayEntryParametersUpdated(\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n );\\n\\n event GroupCreationParametersUpdated(\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgResultSubmitterPrecedencePeriodLength\\n );\\n\\n event RewardParametersUpdated(\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n );\\n\\n event SlashingParametersUpdated(\\n uint256 relayEntrySubmissionFailureSlashingAmount,\\n uint256 maliciousDkgResultSlashingAmount,\\n uint256 unauthorizedSigningSlashingAmount\\n );\\n\\n event GasParametersUpdated(\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n );\\n\\n event RequesterAuthorizationUpdated(\\n address indexed requester,\\n bool isAuthorized\\n );\\n\\n event DkgStarted(uint256 indexed seed);\\n\\n event DkgResultSubmitted(\\n bytes32 indexed resultHash,\\n uint256 indexed seed,\\n DKG.Result result\\n );\\n\\n event DkgTimedOut();\\n\\n event DkgResultApproved(\\n bytes32 indexed resultHash,\\n address indexed approver\\n );\\n\\n event DkgResultChallenged(\\n bytes32 indexed resultHash,\\n address indexed challenger,\\n string reason\\n );\\n\\n event DkgMaliciousResultSlashed(\\n bytes32 indexed resultHash,\\n uint256 slashingAmount,\\n address maliciousSubmitter\\n );\\n\\n event DkgMaliciousResultSlashingFailed(\\n bytes32 indexed resultHash,\\n uint256 slashingAmount,\\n address maliciousSubmitter\\n );\\n\\n event DkgStateLocked();\\n\\n event DkgSeedTimedOut();\\n\\n event GroupRegistered(uint64 indexed groupId, bytes indexed groupPubKey);\\n\\n event RelayEntryRequested(\\n uint256 indexed requestId,\\n uint64 groupId,\\n bytes previousEntry\\n );\\n\\n event RelayEntrySubmitted(\\n uint256 indexed requestId,\\n address submitter,\\n bytes entry\\n );\\n\\n event RelayEntryTimedOut(\\n uint256 indexed requestId,\\n uint64 terminatedGroupId\\n );\\n\\n event RelayEntryDelaySlashed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event RelayEntryDelaySlashingFailed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event RelayEntryTimeoutSlashed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event RelayEntryTimeoutSlashingFailed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event UnauthorizedSigningSlashed(\\n uint64 indexed groupId,\\n uint256 unauthorizedSigningSlashingAmount,\\n address[] groupMembers\\n );\\n\\n event UnauthorizedSigningSlashingFailed(\\n uint64 indexed groupId,\\n uint256 unauthorizedSigningSlashingAmount,\\n address[] groupMembers\\n );\\n\\n event CallbackFailed(uint256 entry, uint256 entrySubmittedBlock);\\n\\n event InactivityClaimed(\\n uint64 indexed groupId,\\n uint256 nonce,\\n address notifier\\n );\\n\\n event OperatorRegistered(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event AuthorizationIncreased(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event AuthorizationDecreaseRequested(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount,\\n uint64 decreasingAt\\n );\\n\\n event AuthorizationDecreaseApproved(address indexed stakingProvider);\\n\\n event InvoluntaryAuthorizationDecreaseFailed(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event OperatorJoinedSortitionPool(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event OperatorStatusUpdated(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n /// @dev Assigns initial values to parameters to make the beacon work\\n /// safely. These parameters are just proposed defaults and they might\\n /// be updated with `update*` functions after the contract deployment\\n /// and before transferring the ownership to the governance contract.\\n constructor(\\n SortitionPool _sortitionPool,\\n IERC20 _tToken,\\n IStaking _staking,\\n DKGValidator _dkgValidator,\\n ReimbursementPool _reimbursementPool\\n ) {\\n sortitionPool = _sortitionPool;\\n tToken = _tToken;\\n staking = _staking;\\n reimbursementPool = _reimbursementPool;\\n\\n require(\\n address(_sortitionPool) != address(0),\\n \\\"Zero-address reference\\\"\\n );\\n require(address(_tToken) != address(0), \\\"Zero-address reference\\\");\\n require(address(_staking) != address(0), \\\"Zero-address reference\\\");\\n require(address(_dkgValidator) != address(0), \\\"Zero-address reference\\\");\\n require(\\n address(_reimbursementPool) != address(0),\\n \\\"Zero-address reference\\\"\\n );\\n\\n dkg.init(_sortitionPool, _dkgValidator);\\n relay.initSeedEntry();\\n\\n _transferGovernance(msg.sender);\\n\\n //\\n // All parameters set in the constructor are initial ones, used at the\\n // moment contracts were deployed for the first time. Parameters are\\n // governable and values assigned in the constructor do not need to\\n // reflect the current ones.\\n //\\n\\n // Minimum authorization is 40k T.\\n //\\n // Authorization decrease delay is 45 days.\\n //\\n // Authorization decrease change period is 45 days. It means pending\\n // authorization decrease can be overwritten all the time.\\n authorization.setParameters(40_000e18, 3_888_000, 3_888_000);\\n\\n // Malicious DKG result slashing amount is set initially to 1% of the\\n // minimum authorization (400 T). This values needs to be increased\\n // significantly once the system is fully launched.\\n //\\n // Unauthorized signing slashing amount is set initially to 1% of the\\n // minimum authorization (400 T). This values needs to be increased\\n // significantly once the system is fully launched.\\n //\\n // Slashing amount for not providing relay entry on time is set\\n // initially to 1% of the minimum authorization (400 T). This values\\n // needs to be increased significantly once the system is fully launched.\\n //\\n // Inactive operators are set as ineligible for rewards for 2 weeks.\\n _maliciousDkgResultSlashingAmount = 400e18;\\n _unauthorizedSigningSlashingAmount = 400e18;\\n relay.setRelayEntrySubmissionFailureSlashingAmount(400e18);\\n\\n // Notifier of a malicious DKG result receives 100% of the notifier\\n // reward from the staking contract.\\n //\\n // Notifier of unauthorized signing receives 100% of the notifier\\n // reward from the staking contract.\\n //\\n // Notifier of relay entry timeout receives 100% of the notifier\\n // reward from the staking contract.\\n _dkgMaliciousResultNotificationRewardMultiplier = 100;\\n _unauthorizedSigningNotificationRewardMultiplier = 100;\\n _relayEntryTimeoutNotificationRewardMultiplier = 100;\\n\\n // Inactive operators are set as ineligible for rewards for 2 weeks.\\n _sortitionPoolRewardsBanDuration = 2 weeks;\\n\\n // DKG result challenge period length is set to 48h, assuming\\n // 15s block time.\\n //\\n // The extra gas required for DKG result challenge is 50k units.\\n //\\n // DKG result submission timeout, gives each member 20 blocks to submit\\n // the result. Assuming 15s block time, it is ~8h to submit the result\\n // in the pessimistic case.\\n //\\n // The original DKG result submitter has 20 blocks to approve it before\\n // anyone else can do that.\\n //\\n // With these parameters, the happy path takes no more than 56 hours.\\n // In practice, it should take about 48 hours (just the challenge time).\\n dkg.setParameters(11_520, 50_000, 1_280, 20);\\n\\n // Relay entry soft timeout gives each of 64 members 20 blocks to submit\\n // the result.\\n //\\n // Relay entry hard timeout is set to ~48h assuming 15s block time.\\n relay.setTimeouts(1_280, 5_760);\\n\\n // Callback gas limit is set to 56k units of gas. As of April 2022, it\\n // is enough to store new entry and block number on-chain.\\n // If the cost of EVM opcodes change over time, these parameters will\\n // have to be updated.\\n _callbackGasLimit = 64_000;\\n\\n // Group lifetime is set to 45 days assuming 15s block time.\\n //\\n // New group is created every 2 relay requests.\\n //\\n // This way, even if ECDSA WalletRegistry is the only consumer of the\\n // beacon initially, and relay request is executed every week, we should\\n // have 2 active groups in the system all the time.\\n groups.setGroupLifetime(259_200);\\n _groupCreationFrequency = 2;\\n\\n // Gas parameters were adjusted based on Ethereum state in April 2022.\\n // If the cost of EVM opcodes change over time, these parameters will\\n // have to be updated.\\n _dkgResultSubmissionGas = 237_650;\\n _dkgResultApprovalGasOffset = 41_500;\\n _notifyOperatorInactivityGasOffset = 54_500;\\n _relayEntrySubmissionGasOffset = 11_250;\\n }\\n\\n modifier onlyStakingContract() {\\n require(\\n msg.sender == address(staking),\\n \\\"Caller is not the staking contract\\\"\\n );\\n _;\\n }\\n\\n modifier onlyReimbursableAdmin() override {\\n require(governance == msg.sender, \\\"Caller is not the governance\\\");\\n _;\\n }\\n\\n /// @notice Updates the values of authorization parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param _minimumAuthorization New minimum authorization amount\\n /// @param _authorizationDecreaseDelay New authorization decrease delay in\\n /// seconds\\n /// @param _authorizationDecreaseChangePeriod New authorization decrease\\n /// change period in seconds\\n function updateAuthorizationParameters(\\n uint96 _minimumAuthorization,\\n uint64 _authorizationDecreaseDelay,\\n uint64 _authorizationDecreaseChangePeriod\\n ) external onlyGovernance {\\n authorization.setParameters(\\n _minimumAuthorization,\\n _authorizationDecreaseDelay,\\n _authorizationDecreaseChangePeriod\\n );\\n\\n emit AuthorizationParametersUpdated(\\n _minimumAuthorization,\\n _authorizationDecreaseDelay,\\n _authorizationDecreaseChangePeriod\\n );\\n }\\n\\n /// @notice Updates the values of relay entry parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param relayEntrySoftTimeout New relay entry submission soft timeout\\n /// @param relayEntryHardTimeout New relay entry hard timeout\\n /// @param callbackGasLimit New callback gas limit\\n function updateRelayEntryParameters(\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n ) external onlyGovernance {\\n _callbackGasLimit = callbackGasLimit;\\n relay.setTimeouts(relayEntrySoftTimeout, relayEntryHardTimeout);\\n\\n emit RelayEntryParametersUpdated(\\n relayEntrySoftTimeout,\\n relayEntryHardTimeout,\\n callbackGasLimit\\n );\\n }\\n\\n /// @notice Updates the values of group creation parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param groupCreationFrequency New group creation frequency\\n /// @param groupLifetime New group lifetime in blocks\\n /// @param dkgResultChallengePeriodLength New DKG result challenge period\\n /// length\\n /// @param dkgResultChallengeExtraGas New DKG result challenge extra gas\\n /// @param dkgResultSubmissionTimeout New DKG result submission timeout\\n /// @param dkgSubmitterPrecedencePeriodLength New DKG result submitter\\n /// precedence period length\\n function updateGroupCreationParameters(\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) external onlyGovernance {\\n _groupCreationFrequency = groupCreationFrequency;\\n groups.setGroupLifetime(groupLifetime);\\n dkg.setParameters(\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n\\n emit GroupCreationParametersUpdated(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n }\\n\\n /// @notice Updates the values of reward parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param sortitionPoolRewardsBanDuration New sortition pool rewards\\n /// ban duration in seconds.\\n /// @param relayEntryTimeoutNotificationRewardMultiplier New value of the\\n /// relay entry timeout notification reward multiplier\\n /// @param unauthorizedSigningNotificationRewardMultiplier New value of the\\n /// unauthorized signing notification reward multiplier\\n /// @param dkgMaliciousResultNotificationRewardMultiplier New value of the\\n /// DKG malicious result notification reward multiplier\\n function updateRewardParameters(\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) external onlyGovernance {\\n _sortitionPoolRewardsBanDuration = sortitionPoolRewardsBanDuration;\\n _relayEntryTimeoutNotificationRewardMultiplier = relayEntryTimeoutNotificationRewardMultiplier;\\n _unauthorizedSigningNotificationRewardMultiplier = unauthorizedSigningNotificationRewardMultiplier;\\n _dkgMaliciousResultNotificationRewardMultiplier = dkgMaliciousResultNotificationRewardMultiplier;\\n emit RewardParametersUpdated(\\n sortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n }\\n\\n /// @notice Updates the values of slashing parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param relayEntrySubmissionFailureSlashingAmount New relay entry\\n /// submission failure amount\\n /// @param maliciousDkgResultSlashingAmount New malicious DKG result\\n /// slashing amount\\n /// @param unauthorizedSigningSlashingAmount New unauthorized signing\\n /// slashing amount\\n function updateSlashingParameters(\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint96 maliciousDkgResultSlashingAmount,\\n uint96 unauthorizedSigningSlashingAmount\\n ) external onlyGovernance {\\n relay.setRelayEntrySubmissionFailureSlashingAmount(\\n relayEntrySubmissionFailureSlashingAmount\\n );\\n _maliciousDkgResultSlashingAmount = maliciousDkgResultSlashingAmount;\\n _unauthorizedSigningSlashingAmount = unauthorizedSigningSlashingAmount;\\n emit SlashingParametersUpdated(\\n relayEntrySubmissionFailureSlashingAmount,\\n maliciousDkgResultSlashingAmount,\\n unauthorizedSigningSlashingAmount\\n );\\n }\\n\\n /// @notice Updates the values of gas parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param dkgResultSubmissionGas New DKG result submission gas\\n /// @param dkgResultApprovalGasOffset New DKG result approval gas offset\\n /// @param notifyOperatorInactivityGasOffset New operator inactivity\\n /// notification gas offset\\n /// @param relayEntrySubmissionGasOffset New relay entry submission gas\\n /// offset\\n function updateGasParameters(\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n ) external onlyGovernance {\\n _dkgResultSubmissionGas = dkgResultSubmissionGas;\\n _dkgResultApprovalGasOffset = dkgResultApprovalGasOffset;\\n _notifyOperatorInactivityGasOffset = notifyOperatorInactivityGasOffset;\\n _relayEntrySubmissionGasOffset = relayEntrySubmissionGasOffset;\\n\\n emit GasParametersUpdated(\\n dkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n }\\n\\n /// @notice Set authorization for requesters that can request a relay\\n /// entry.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract.\\n /// @param requester Requester, can be a contract or EOA\\n /// @param isAuthorized True or false\\n function setRequesterAuthorization(address requester, bool isAuthorized)\\n external\\n onlyGovernance\\n {\\n authorizedRequesters[requester] = isAuthorized;\\n\\n emit RequesterAuthorizationUpdated(requester, isAuthorized);\\n }\\n\\n /// @notice Withdraws application rewards for the given staking provider.\\n /// Rewards are withdrawn to the staking provider's beneficiary\\n /// address set in the staking contract. Reverts if staking provider\\n /// has not registered the operator address.\\n /// @dev Emits `RewardsWithdrawn` event.\\n function withdrawRewards(address stakingProvider) external {\\n address operator = stakingProviderToOperator(stakingProvider);\\n require(operator != address(0), \\\"Unknown operator\\\");\\n (, address beneficiary, ) = staking.rolesOf(stakingProvider);\\n uint96 amount = sortitionPool.withdrawRewards(operator, beneficiary);\\n // slither-disable-next-line reentrancy-events\\n emit RewardsWithdrawn(stakingProvider, amount);\\n }\\n\\n /// @notice Withdraws rewards belonging to operators marked as ineligible\\n /// for sortition pool rewards.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract.\\n /// @param recipient Recipient of withdrawn rewards.\\n function withdrawIneligibleRewards(address recipient)\\n external\\n onlyGovernance\\n {\\n sortitionPool.withdrawIneligible(recipient);\\n }\\n\\n /// @notice Used by staking provider to set operator address that will\\n /// operate a node. The given staking provider can set operator\\n /// address only one time. The operator address can not be changed\\n /// and must be unique. Reverts if the operator is already set for\\n /// the staking provider or if the operator address is already in\\n /// use. Reverts if there is a pending authorization decrease for\\n /// the staking provider.\\n function registerOperator(address operator) external {\\n authorization.registerOperator(operator);\\n }\\n\\n /// @notice Lets the operator join the sortition pool. The operator address\\n /// must be known - before calling this function, it has to be\\n /// appointed by the staking provider by calling `registerOperator`.\\n /// Also, the operator must have the minimum authorization required\\n /// by the beacon. Function reverts if there is no minimum stake\\n /// authorized or if the operator is not known. If there was an\\n /// authorization decrease requested, it is activated by starting\\n /// the authorization decrease delay.\\n function joinSortitionPool() external {\\n authorization.joinSortitionPool(staking, sortitionPool);\\n }\\n\\n /// @notice Updates status of the operator in the sortition pool. If there\\n /// was an authorization decrease requested, it is activated by\\n /// starting the authorization decrease delay.\\n /// Function reverts if the operator is not known.\\n function updateOperatorStatus(address operator) external {\\n authorization.updateOperatorStatus(staking, sortitionPool, operator);\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorized stake amount for the given staking provider increased.\\n ///\\n /// Reverts if the authorization amount is below the minimum.\\n ///\\n /// The function is not updating the sortition pool. Sortition pool\\n /// state needs to be updated by the operator with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`.\\n ///\\n /// @dev Can only be called by T staking contract.\\n function authorizationIncreased(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external onlyStakingContract {\\n authorization.authorizationIncreased(\\n stakingProvider,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorization decrease for the given staking provider has been\\n /// requested.\\n ///\\n /// Reverts if the amount after deauthorization would be non-zero\\n /// and lower than the minimum authorization.\\n ///\\n /// Reverts if another authorization decrease request is pending for\\n /// the staking provider and not enough time passed since the\\n /// original request (see `authorizationDecreaseChangePeriod`).\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// it lets to `approveAuthorizationDecrease` immediately. If the\\n /// operator is known (`registerOperator` was called), the operator\\n /// needs to update state of the sortition pool with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`. After the\\n /// sortition pool state is in sync, authorization decrease delay\\n /// starts.\\n ///\\n /// After authorization decrease delay passes, authorization\\n /// decrease request needs to be approved with a call to\\n /// `approveAuthorizationDecrease` function.\\n ///\\n /// If there is a pending authorization decrease request, it is\\n /// overwritten, but only if enough time passed since the original\\n /// request. Otherwise, the function reverts.\\n ///\\n /// @dev Can only be called by T staking contract.\\n function authorizationDecreaseRequested(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external onlyStakingContract {\\n authorization.authorizationDecreaseRequested(\\n stakingProvider,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Approves the previously registered authorization decrease\\n /// request. Reverts if authorization decrease delay has not passed\\n /// yet or if the authorization decrease was not requested for the\\n /// given staking provider.\\n function approveAuthorizationDecrease(address stakingProvider) external {\\n authorization.approveAuthorizationDecrease(staking, stakingProvider);\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon the\\n /// authorization has been decreased for the given staking provider\\n /// involuntarily, as a result of slashing.\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// the function does nothing. The operator was never in a sortition\\n /// pool so there is nothing to update.\\n ///\\n /// If the operator is known, sortition pool is unlocked, and the\\n /// operator is in the sortition pool, the sortition pool state is\\n /// updated. If the sortition pool is locked, update needs to be\\n /// postponed. Every other staker is incentivized to call\\n /// `updateOperatorStatus` for the problematic operator to increase\\n /// their own rewards in the pool.\\n function involuntaryAuthorizationDecrease(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external onlyStakingContract {\\n authorization.involuntaryAuthorizationDecrease(\\n staking,\\n sortitionPool,\\n stakingProvider,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Triggers group selection if there are no active groups.\\n function genesis() external {\\n require(groups.numberOfActiveGroups() == 0, \\\"Not awaiting genesis\\\");\\n\\n dkg.lockState();\\n dkg.start(\\n uint256(keccak256(abi.encodePacked(genesisSeed, block.number)))\\n );\\n }\\n\\n /// @notice Submits result of DKG protocol. It is on-chain part of phase 14 of\\n /// the protocol. The DKG result consists of result submitting member\\n /// index, calculated group public key, bytes array of misbehaved\\n /// members, concatenation of signatures from group members,\\n /// indices of members corresponding to each signature and\\n /// the list of group members.\\n /// When the result is verified successfully it gets registered and\\n /// waits for an approval. A result can be challenged to verify the\\n /// members list corresponds to the expected set of members determined\\n /// by the sortition pool.\\n /// A candidate group is registered based on the submitted DKG result\\n /// details.\\n /// @dev The message to be signed by each member is keccak256 hash of the\\n /// chain ID, calculated group public key, misbehaved members as bytes\\n /// and DKG start block. The calculated hash should be prefixed with\\n // prefixed with\\n /// `\\\\x19Ethereum signed message:\\\\n` before signing, so the message to\\n /// sign is:\\n /// `\\\\x19Ethereum signed message:\\\\n${keccak256(chainID,groupPubKey,misbehaved,startBlock)}`\\n /// @param dkgResult DKG result.\\n function submitDkgResult(DKG.Result calldata dkgResult) external {\\n groups.validatePublicKey(dkgResult.groupPubKey);\\n dkg.submitResult(dkgResult);\\n }\\n\\n /// @notice Notifies about DKG timeout.\\n function notifyDkgTimeout() external refundable(msg.sender) {\\n dkg.notifyTimeout();\\n }\\n\\n /// @notice Approves DKG result. Can be called when the challenge period for\\n /// the submitted result is finished. Considers the submitted result\\n /// as valid, bans misbehaved group members from the sortition pool\\n /// rewards, and completes the group creation by activating the\\n /// candidate group. For the first `submitterPrecedencePeriodLength`\\n /// blocks after the end of the challenge period can be called only\\n /// by the DKG result submitter. After that time, can be called by\\n /// anyone.\\n /// @param dkgResult Result to approve. Must match the submitted result\\n /// stored during `submitDkgResult`.\\n function approveDkgResult(DKG.Result calldata dkgResult) external {\\n uint256 gasStart = gasleft();\\n\\n uint32[] memory misbehavedMembers = dkg.approveResult(dkgResult);\\n\\n if (misbehavedMembers.length > 0) {\\n sortitionPool.setRewardIneligibility(\\n misbehavedMembers,\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp + _sortitionPoolRewardsBanDuration\\n );\\n }\\n\\n groups.addGroup(dkgResult.groupPubKey, dkgResult.membersHash);\\n dkg.complete();\\n\\n // Refund msg.sender's ETH for DKG result submission and result approval\\n reimbursementPool.refund(\\n _dkgResultSubmissionGas +\\n (gasStart - gasleft()) +\\n _dkgResultApprovalGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice Challenges DKG result. If the submitted result is proved to be\\n /// invalid it reverts the DKG back to the result submission phase.\\n /// It removes a candidate group that was previously registered with\\n /// the DKG result submission.\\n /// @param dkgResult Result to challenge. Must match the submitted result\\n /// stored during `submitDkgResult`.\\n /// @dev Due to EIP-150 1/64 of the gas is not forwarded to the call, and\\n /// will be kept to execute the remaining operations in the function\\n /// after the call inside the try-catch. To eliminate a class of\\n /// attacks related to the gas limit manipulation, this function\\n /// requires an extra amount of gas to be left at the end of the\\n /// execution.\\n function challengeDkgResult(DKG.Result calldata dkgResult) external {\\n (bytes32 maliciousResultHash, uint32 maliciousSubmitter) = dkg\\n .challengeResult(dkgResult);\\n\\n uint96 slashingAmount = _maliciousDkgResultSlashingAmount;\\n address maliciousSubmitterAddresses = sortitionPool.getIDOperator(\\n maliciousSubmitter\\n );\\n\\n address[] memory stakingProviderWrapper = new address[](1);\\n stakingProviderWrapper[0] = operatorToStakingProvider(\\n maliciousSubmitterAddresses\\n );\\n try\\n staking.seize(\\n slashingAmount,\\n _dkgMaliciousResultNotificationRewardMultiplier,\\n msg.sender,\\n stakingProviderWrapper\\n )\\n {\\n // slither-disable-next-line reentrancy-events\\n emit DkgMaliciousResultSlashed(\\n maliciousResultHash,\\n slashingAmount,\\n maliciousSubmitterAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop the challenge\\n // to complete.\\n emit DkgMaliciousResultSlashingFailed(\\n maliciousResultHash,\\n slashingAmount,\\n maliciousSubmitterAddresses\\n );\\n }\\n\\n // Due to EIP-150, 1/64 of the gas is not forwarded to the call, and\\n // will be kept to execute the remaining operations in the function\\n // after the call inside the try-catch.\\n //\\n // To ensure there is no way for the caller to manipulate gas limit in\\n // such a way that the call inside try-catch fails with out-of-gas and\\n // the rest of the function is executed with the remaining 1/64 of gas,\\n // we require an extra gas amount to be left at the end of the call to\\n // `challengeDkgResult`.\\n dkg.requireChallengeExtraGas();\\n }\\n\\n /// @notice Check current group creation state.\\n function getGroupCreationState() external view returns (DKG.State) {\\n return dkg.currentState();\\n }\\n\\n /// @notice Checks if DKG timed out. The DKG timeout period includes time required\\n /// for off-chain protocol execution and time for the result publication\\n /// for all group members. After this time result cannot be submitted\\n /// and DKG can be notified about the timeout.\\n /// @return True if DKG timed out, false otherwise.\\n function hasDkgTimedOut() external view returns (bool) {\\n return dkg.hasDkgTimedOut();\\n }\\n\\n function getGroupsRegistry() external view returns (bytes32[] memory) {\\n return groups.groupsRegistry;\\n }\\n\\n function getGroup(uint64 groupId)\\n external\\n view\\n returns (Groups.Group memory)\\n {\\n return groups.getGroup(groupId);\\n }\\n\\n function getGroup(bytes memory groupPubKey)\\n external\\n view\\n returns (Groups.Group memory)\\n {\\n return groups.getGroup(groupPubKey);\\n }\\n\\n /// @notice Creates a request to generate a new relay entry, which will\\n /// include a random number (by signing the previous entry's\\n /// random number). Requester must be previously authorized by the\\n /// governance.\\n /// @param callbackContract Beacon consumer callback contract.\\n function requestRelayEntry(IRandomBeaconConsumer callbackContract)\\n external\\n {\\n require(\\n authorizedRequesters[msg.sender],\\n \\\"Requester must be authorized\\\"\\n );\\n\\n uint64 groupId = groups.selectGroup(\\n uint256(keccak256(AltBn128.g1Marshal(relay.previousEntry)))\\n );\\n\\n relay.requestEntry(groupId);\\n\\n callback.setCallbackContract(callbackContract);\\n\\n // If the current request should trigger group creation we need to lock\\n // DKG state (lock sortition pool) to prevent operators from changing\\n // its state before relay entry is known. That entry will be used as a\\n // group selection seed.\\n if (\\n relay.requestCount % _groupCreationFrequency == 0 &&\\n dkg.currentState() == DKG.State.IDLE\\n ) {\\n dkg.lockState();\\n }\\n }\\n\\n /// @notice Creates a new relay entry. Gas-optimized version that can be\\n /// called only before the soft timeout. This should be the majority\\n /// of cases.\\n /// @param entry Group BLS signature over the previous entry.\\n function submitRelayEntry(bytes calldata entry) external {\\n uint256 gasStart = gasleft();\\n\\n Groups.Group storage group = groups.getGroup(\\n relay.currentRequestGroupID\\n );\\n\\n relay.submitEntryBeforeSoftTimeout(entry, group.groupPubKey);\\n\\n // If DKG is awaiting a seed, that means the we should start the actual\\n // group creation process.\\n if (dkg.currentState() == DKG.State.AWAITING_SEED) {\\n dkg.start(uint256(keccak256(entry)));\\n }\\n\\n callback.executeCallback(uint256(keccak256(entry)), _callbackGasLimit);\\n\\n reimbursementPool.refund(\\n (gasStart - gasleft()) + _relayEntrySubmissionGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice Creates a new relay entry.\\n /// @param entry Group BLS signature over the previous entry.\\n /// @param groupMembers Identifiers of group members.\\n function submitRelayEntry(\\n bytes calldata entry,\\n uint32[] calldata groupMembers\\n ) external {\\n uint256 gasStart = gasleft();\\n uint256 currentRequestId = relay.currentRequestID;\\n\\n Groups.Group storage group = groups.getGroup(\\n relay.currentRequestGroupID\\n );\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n uint96 slashingAmount = relay.submitEntry(entry, group.groupPubKey);\\n\\n if (slashingAmount > 0) {\\n address[] memory groupMembersAddresses = sortitionPool\\n .getIDOperators(groupMembers);\\n\\n address[] memory stakingProvidersAddresses = new address[](\\n groupMembersAddresses.length\\n );\\n for (uint256 i = 0; i < groupMembersAddresses.length; i++) {\\n stakingProvidersAddresses[i] = operatorToStakingProvider(\\n groupMembersAddresses[i]\\n );\\n }\\n\\n try staking.slash(slashingAmount, stakingProvidersAddresses) {\\n // slither-disable-next-line reentrancy-events\\n emit RelayEntryDelaySlashed(\\n currentRequestId,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop group members\\n // from submitting a valid relay entry.\\n emit RelayEntryDelaySlashingFailed(\\n currentRequestId,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n }\\n }\\n\\n // If DKG is awaiting a seed, that means the we should start the actual\\n // group creation process.\\n if (dkg.currentState() == DKG.State.AWAITING_SEED) {\\n dkg.start(uint256(keccak256(entry)));\\n }\\n\\n callback.executeCallback(uint256(keccak256(entry)), _callbackGasLimit);\\n reimbursementPool.refund(\\n (gasStart - gasleft()) + _relayEntrySubmissionGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice Reports a relay entry timeout.\\n /// @param groupMembers Identifiers of group members.\\n function reportRelayEntryTimeout(uint32[] calldata groupMembers) external {\\n uint64 groupId = relay.currentRequestGroupID;\\n Groups.Group storage group = groups.getGroup(groupId);\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n uint96 slashingAmount = relay.relayEntrySubmissionFailureSlashingAmount;\\n address[] memory groupMembersAddresses = sortitionPool.getIDOperators(\\n groupMembers\\n );\\n\\n address[] memory stakingProvidersAddresses = new address[](\\n groupMembersAddresses.length\\n );\\n for (uint256 i = 0; i < groupMembersAddresses.length; i++) {\\n stakingProvidersAddresses[i] = operatorToStakingProvider(\\n groupMembersAddresses[i]\\n );\\n }\\n\\n try\\n staking.seize(\\n slashingAmount,\\n _relayEntryTimeoutNotificationRewardMultiplier,\\n msg.sender,\\n stakingProvidersAddresses\\n )\\n {\\n // slither-disable-next-line reentrancy-events\\n emit RelayEntryTimeoutSlashed(\\n relay.currentRequestID,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop the challenge\\n // to complete.\\n emit RelayEntryTimeoutSlashingFailed(\\n relay.currentRequestID,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n }\\n\\n groups.terminateGroup(groupId);\\n groups.expireOldGroups();\\n\\n if (groups.numberOfActiveGroups() > 0) {\\n groupId = groups.selectGroup(\\n uint256(keccak256(AltBn128.g1Marshal(relay.previousEntry)))\\n );\\n relay.retryOnEntryTimeout(groupId);\\n } else {\\n relay.cleanupOnEntryTimeout();\\n\\n // If DKG is awaiting a seed, we should notify about its timeout to\\n // avoid blocking the future group creation.\\n if (dkg.currentState() == DKG.State.AWAITING_SEED) {\\n dkg.notifySeedTimedOut();\\n }\\n }\\n }\\n\\n /// @notice Reports unauthorized groups signing. Must provide a valid signature\\n /// of the sender's address as a message. Successful signature\\n /// verification means the private key has been leaked and all group\\n /// members should be punished by slashing their tokens. Group has\\n /// to be active or expired. Unauthorized signing cannot be reported\\n /// for a terminated group. In case of reporting unauthorized\\n /// signing for a terminated group, or when the signature is invalid,\\n /// function reverts.\\n /// @param signedMsgSender Signature of the sender's address as a message.\\n /// @param groupId Group that is being reported for leaking a private key.\\n /// @param groupMembers Identifiers of group members.\\n function reportUnauthorizedSigning(\\n bytes memory signedMsgSender,\\n uint64 groupId,\\n uint32[] calldata groupMembers\\n ) external {\\n Groups.Group memory group = groups.getGroup(groupId);\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n require(!group.terminated, \\\"Group cannot be terminated\\\");\\n\\n require(\\n BLS.verifyBytes(\\n group.groupPubKey,\\n abi.encodePacked(msg.sender),\\n signedMsgSender\\n ),\\n \\\"Invalid signature\\\"\\n );\\n\\n groups.terminateGroup(groupId);\\n\\n address[] memory groupMembersAddresses = sortitionPool.getIDOperators(\\n groupMembers\\n );\\n\\n address[] memory stakingProvidersAddresses = new address[](\\n groupMembersAddresses.length\\n );\\n for (uint256 i = 0; i < groupMembersAddresses.length; i++) {\\n stakingProvidersAddresses[i] = operatorToStakingProvider(\\n groupMembersAddresses[i]\\n );\\n }\\n\\n try\\n staking.seize(\\n _unauthorizedSigningSlashingAmount,\\n _unauthorizedSigningNotificationRewardMultiplier,\\n msg.sender,\\n stakingProvidersAddresses\\n )\\n {\\n // slither-disable-next-line reentrancy-events\\n emit UnauthorizedSigningSlashed(\\n groupId,\\n _unauthorizedSigningSlashingAmount,\\n groupMembersAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop the challenge\\n // to complete.\\n emit UnauthorizedSigningSlashingFailed(\\n groupId,\\n _unauthorizedSigningSlashingAmount,\\n groupMembersAddresses\\n );\\n }\\n }\\n\\n /// @notice Notifies about operators who are inactive. Using this function,\\n /// a majority of the group can decide about punishing specific\\n /// group members who constantly fail doing their job. If the provided\\n /// claim is proved to be valid and signed by sufficient number\\n /// of group members, operators of members deemed as inactive are\\n /// banned for sortition pool rewards for duration specified by\\n /// `_sortitionPoolRewardsBanDuration` parameter. The sender of\\n /// the claim must be one of the claim signers. This function can be\\n /// called only for active and non-terminated groups.\\n /// @param claim Operator inactivity claim.\\n /// @param nonce Current inactivity claim nonce for the given group. Must\\n /// be the same as the stored one.\\n /// @param groupMembers Identifiers of group members.\\n function notifyOperatorInactivity(\\n Inactivity.Claim calldata claim,\\n uint256 nonce,\\n uint32[] calldata groupMembers\\n ) external {\\n uint256 gasStart = gasleft();\\n uint64 groupId = claim.groupId;\\n\\n require(nonce == inactivityClaimNonce[groupId], \\\"Invalid nonce\\\");\\n\\n require(groups.isGroupActive(groupId), \\\"Group is not active\\\");\\n\\n Groups.Group storage group = groups.getGroup(groupId);\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n uint32[] memory ineligibleOperators = Inactivity.verifyClaim(\\n sortitionPool,\\n claim,\\n group.groupPubKey,\\n nonce,\\n groupMembers\\n );\\n\\n inactivityClaimNonce[groupId]++;\\n\\n emit InactivityClaimed(groupId, nonce, msg.sender);\\n\\n sortitionPool.setRewardIneligibility(\\n ineligibleOperators,\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp + _sortitionPoolRewardsBanDuration\\n );\\n\\n reimbursementPool.refund(\\n (gasStart - gasleft()) + _notifyOperatorInactivityGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice The minimum authorization amount required so that operator can\\n /// participate in the random beacon. This amount is required to\\n /// execute slashing for providing a malicious DKG result or when\\n /// a relay entry times out.\\n function minimumAuthorization() external view returns (uint96) {\\n return authorization.parameters.minimumAuthorization;\\n }\\n\\n /// @return Flag indicating whether a relay entry request is currently\\n /// in progress.\\n function isRelayRequestInProgress() external view returns (bool) {\\n return relay.isRequestInProgress();\\n }\\n\\n /// @notice Returns the current value of the staking provider's eligible\\n /// stake. Eligible stake is defined as the currently authorized\\n /// stake minus the pending authorization decrease. Eligible stake\\n /// is what is used for operator's weight in the sortition pool.\\n /// If the authorized stake minus the pending authorization decrease\\n /// is below the minimum authorization, eligible stake is 0.\\n function eligibleStake(address stakingProvider)\\n external\\n view\\n returns (uint96)\\n {\\n return authorization.eligibleStake(staking, stakingProvider);\\n }\\n\\n /// @notice Returns the amount of rewards available for withdrawal for the\\n /// given staking provider. Reverts if staking provider has not\\n /// registered the operator address.\\n function availableRewards(address stakingProvider)\\n external\\n view\\n returns (uint96)\\n {\\n address operator = stakingProviderToOperator(stakingProvider);\\n require(operator != address(0), \\\"Unknown operator\\\");\\n return sortitionPool.getAvailableRewards(operator);\\n }\\n\\n /// @notice Returns the amount of stake that is pending authorization\\n /// decrease for the given staking provider. If no authorization\\n /// decrease has been requested, returns zero.\\n function pendingAuthorizationDecrease(address stakingProvider)\\n external\\n view\\n returns (uint96)\\n {\\n return authorization.pendingAuthorizationDecrease(stakingProvider);\\n }\\n\\n /// @notice Returns the remaining time in seconds that needs to pass before\\n /// the requested authorization decrease can be approved.\\n /// If the sortition pool state was not updated yet by the operator\\n /// after requesting the authorization decrease, returns\\n /// `type(uint64).max`.\\n function remainingAuthorizationDecreaseDelay(address stakingProvider)\\n external\\n view\\n returns (uint64)\\n {\\n return\\n authorization.remainingAuthorizationDecreaseDelay(stakingProvider);\\n }\\n\\n /// @notice Returns operator registered for the given staking provider.\\n function stakingProviderToOperator(address stakingProvider)\\n public\\n view\\n returns (address)\\n {\\n return authorization.stakingProviderToOperator[stakingProvider];\\n }\\n\\n /// @notice Returns staking provider of the given operator.\\n function operatorToStakingProvider(address operator)\\n public\\n view\\n returns (address)\\n {\\n return authorization.operatorToStakingProvider[operator];\\n }\\n\\n /// @notice Checks if the operator's authorized stake is in sync with\\n /// operator's weight in the sortition pool.\\n /// If the operator is not in the sortition pool and their\\n /// authorized stake is non-zero, function returns false.\\n function isOperatorUpToDate(address operator) external view returns (bool) {\\n return\\n authorization.isOperatorUpToDate(staking, sortitionPool, operator);\\n }\\n\\n /// @notice Returns true if the given operator is in the sortition pool.\\n /// Otherwise, returns false.\\n function isOperatorInPool(address operator) external view returns (bool) {\\n return sortitionPool.isOperatorInPool(operator);\\n }\\n\\n /// @notice Selects a new group of operators. Can only be called when DKG\\n /// is in progress and the pool is locked.\\n /// At least one operator has to be registered in the pool,\\n /// otherwise the function fails reverting the transaction.\\n /// @return IDs of selected group members.\\n function selectGroup() external view returns (uint32[] memory) {\\n return sortitionPool.selectGroup(DKG.groupSize, bytes32(dkg.seed));\\n }\\n\\n /// @notice Returns authorization-related parameters of the beacon.\\n /// @dev The minimum authorization is also returned by `minimumAuthorization()`\\n /// function, as a requirement of `IApplication` interface.\\n /// @return minimumAuthorization The minimum authorization amount required\\n /// so that operator can participate in the random beacon. This\\n /// amount is required to execute slashing for providing a malicious\\n /// DKG result or when a relay entry times out.\\n /// @return authorizationDecreaseDelay Delay in seconds that needs to pass\\n /// between the time authorization decrease is requested and the\\n /// time that request gets approved. Protects against free-riders\\n /// earning rewards and not being active in the network.\\n /// @return authorizationDecreaseChangePeriod Authorization decrease change\\n /// period in seconds. It is the time, before authorization decrease\\n /// delay end, during which the pending authorization decrease\\n /// request can be overwritten.\\n /// If set to 0, pending authorization decrease request can not be\\n /// overwritten until the entire `authorizationDecreaseDelay` ends.\\n /// If set to value equal `authorizationDecreaseDelay`, request can\\n /// always be overwritten.\\n function authorizationParameters()\\n external\\n view\\n returns (\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseDelay,\\n uint64 authorizationDecreaseChangePeriod\\n )\\n {\\n return (\\n authorization.parameters.minimumAuthorization,\\n authorization.parameters.authorizationDecreaseDelay,\\n authorization.parameters.authorizationDecreaseChangePeriod\\n );\\n }\\n\\n /// @notice Returns relay-entry-related parameters of the beacon.\\n /// @return relayEntrySoftTimeout Soft timeout in blocks for a group to\\n /// submit the relay entry. If the soft timeout is reached for\\n /// submitting the relay entry, the slashing starts.\\n /// @return relayEntryHardTimeout Hard timeout in blocks for a group to\\n /// submit the relay entry. After the soft timeout passes without\\n /// relay entry submitted, all group members start getting slashed.\\n /// The slashing amount increases linearly until the group submits\\n /// the relay entry or until `relayEntryHardTimeout` is reached.\\n /// When the hard timeout is reached, each group member will get\\n /// slashed for `_relayEntrySubmissionFailureSlashingAmount`.\\n /// @return callbackGasLimit Relay entry callback gas limit. This is the gas\\n /// limit with which callback function provided in the relay request\\n /// transaction is executed. The callback is executed with a new\\n /// relay entry value in the same transaction the relay entry is\\n /// submitted.\\n function relayEntryParameters()\\n external\\n view\\n returns (\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n )\\n {\\n return (\\n relay.relayEntrySoftTimeout,\\n relay.relayEntryHardTimeout,\\n _callbackGasLimit\\n );\\n }\\n\\n /// @notice Returns group-creation-related parameters of the beacon.\\n /// @return groupCreationFrequency The frequency of a new group creation.\\n /// Groups are created with a fixed frequency of relay requests.\\n /// @return groupLifetime Group lifetime in blocks. When a group reached its\\n /// lifetime, it is no longer selected for new relay requests but\\n /// may still be responsible for submitting relay entry if relay\\n /// request assigned to that group is still pending.\\n /// @return dkgResultChallengePeriodLength The number of blocks for which\\n /// a DKG result can be challenged. Anyone can challenge DKG result\\n /// for a certain number of blocks before the result is fully\\n /// accepted and the group registered in the pool of active groups.\\n /// If the challenge gets accepted, all operators who signed the\\n /// malicious result get slashed for and the notifier gets rewarded.\\n /// @return dkgResultChallengeExtraGas The extra gas required to be left at\\n /// the end of the challenge DKG result transaction.\\n /// @return dkgResultSubmissionTimeout Timeout in blocks for a group to\\n /// submit the DKG result. All members are eligible to submit the\\n /// DKG result. If `dkgResultSubmissionTimeout` passes without the\\n /// DKG result submitted, DKG is considered as timed out and no DKG\\n /// result for this group creation can be submitted anymore.\\n /// @return dkgSubmitterPrecedencePeriodLength Time during the DKG result\\n /// approval stage when the submitter of the DKG result takes the\\n /// precedence to approve the DKG result. After this time passes\\n /// anyone can approve the DKG result.\\n function groupCreationParameters()\\n external\\n view\\n returns (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n )\\n {\\n return (\\n _groupCreationFrequency,\\n groups.groupLifetime,\\n dkg.parameters.resultChallengePeriodLength,\\n dkg.parameters.resultChallengeExtraGas,\\n dkg.parameters.resultSubmissionTimeout,\\n dkg.parameters.submitterPrecedencePeriodLength\\n );\\n }\\n\\n /// @notice Returns reward-related parameters of the beacon.\\n /// @return sortitionPoolRewardsBanDuration Duration of the sortition pool\\n /// rewards ban imposed on operators who misbehaved during DKG by\\n /// being inactive or disqualified and for operators that were\\n /// identified by the rest of group members as inactive via\\n /// `notifyOperatorInactivity`.\\n /// @return relayEntryTimeoutNotificationRewardMultiplier Percentage of the\\n /// staking contract malicious behavior notification reward which\\n /// will be transferred to the notifier reporting about relay entry\\n /// timeout. Notifiers are rewarded from a notifiers treasury pool.\\n /// For example, if notification reward is 1000 and the value of the\\n /// multiplier is 5, the notifier will receive: 5% of 1000 = 50 per\\n /// each operator affected.\\n /// @return unauthorizedSigningNotificationRewardMultiplier Percentage of the\\n /// staking contract malicious behavior notification reward which\\n /// will be transferred to the notifier reporting about unauthorized\\n /// signing. Notifiers are rewarded from a notifiers treasury pool.\\n /// For example, if a notification reward is 1000 and the value of\\n /// the multiplier is 5, the notifier will receive: 5% of 1000 = 50\\n /// per each operator affected.\\n /// @return dkgMaliciousResultNotificationRewardMultiplier Percentage of the\\n /// staking contract malicious behavior notification reward which\\n /// will be transferred to the notifier reporting about a malicious\\n /// DKG result. Notifiers are rewarded from a notifiers treasury\\n /// pool. For example, if notification reward is 1000 and the value\\n /// of the multiplier is 5, the notifier will receive:\\n /// 5% of 1000 = 50 per each operator affected.\\n function rewardParameters()\\n external\\n view\\n returns (\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n )\\n {\\n return (\\n _sortitionPoolRewardsBanDuration,\\n _relayEntryTimeoutNotificationRewardMultiplier,\\n _unauthorizedSigningNotificationRewardMultiplier,\\n _dkgMaliciousResultNotificationRewardMultiplier\\n );\\n }\\n\\n /// @notice Returns slashing-related parameters of the beacon.\\n /// @return relayEntrySubmissionFailureSlashingAmount Slashing amount for\\n /// not submitting relay entry. When relay entry hard timeout is\\n /// reached without the relay entry submitted, each group member\\n /// gets slashed for `relayEntrySubmissionFailureSlashingAmount`.\\n /// If the relay entry gets submitted after the soft timeout, but\\n /// before the hard timeout, each group member gets slashed\\n /// proportionally to `relayEntrySubmissionFailureSlashingAmount`\\n /// and the time passed since the soft deadline.\\n /// @return maliciousDkgResultSlashingAmount Slashing amount for submitting\\n /// a malicious DKG result. Every DKG result submitted can be\\n /// challenged for the time of `dkg.ResultChallengePeriodLength`.\\n /// If the DKG result submitted is challenged and proven to be\\n /// malicious, the operator who submitted the malicious result is\\n /// slashed for `maliciousDkgResultSlashingAmount`.\\n /// @return unauthorizedSigningSlashingAmount Slashing amount when an\\n /// unauthorized signing has been proved, which means the private\\n /// key leaked and all the group members should be punished.\\n function slashingParameters()\\n external\\n view\\n returns (\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint96 maliciousDkgResultSlashingAmount,\\n uint96 unauthorizedSigningSlashingAmount\\n )\\n {\\n return (\\n relay.relayEntrySubmissionFailureSlashingAmount,\\n _maliciousDkgResultSlashingAmount,\\n _unauthorizedSigningSlashingAmount\\n );\\n }\\n\\n /// @notice Returns gas-related parameters of the beacon.\\n /// @return dkgResultSubmissionGas Calculated gas cost for submitting a DKG\\n /// result. This will be refunded as part of the DKG approval\\n /// process.\\n /// @return dkgResultApprovalGasOffset Gas that is meant to balance the DKG\\n /// result approval's overall cost.\\n /// @return notifyOperatorInactivityGasOffset Gas that is meant to balance\\n /// the operator inactivity notification cost.\\n /// @return relayEntrySubmissionGasOffset Gas that is meant to balance the\\n /// relay entry submission cost.\\n function gasParameters()\\n external\\n view\\n returns (\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n )\\n {\\n return (\\n _dkgResultSubmissionGas,\\n _dkgResultApprovalGasOffset,\\n _notifyOperatorInactivityGasOffset,\\n _relayEntrySubmissionGasOffset\\n );\\n }\\n}\\n\",\"keccak256\":\"0x50e6572ce7e51404a9918bf80d13004c4f4fd2a41fbc898f8aac84fa71423917\",\"license\":\"GPL-3.0-only\"},\"contracts/RandomBeaconGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./RandomBeacon.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/// @title Keep Random Beacon Governance\\n/// @notice Owns the `RandomBeacon` contract and is responsible for updating its\\n/// governable parameters in respect to governance delay individual\\n/// for each parameter.\\ncontract RandomBeaconGovernance is Ownable {\\n uint256 public newGovernanceDelay;\\n uint256 public governanceDelayChangeInitiated;\\n\\n address public newRandomBeaconGovernance;\\n uint256 public randomBeaconGovernanceTransferInitiated;\\n\\n uint256 public newRelayEntrySoftTimeout;\\n uint256 public relayEntrySoftTimeoutChangeInitiated;\\n\\n uint256 public newRelayEntryHardTimeout;\\n uint256 public relayEntryHardTimeoutChangeInitiated;\\n\\n uint256 public newCallbackGasLimit;\\n uint256 public callbackGasLimitChangeInitiated;\\n\\n uint256 public newGroupCreationFrequency;\\n uint256 public groupCreationFrequencyChangeInitiated;\\n\\n uint256 public newGroupLifetime;\\n uint256 public groupLifetimeChangeInitiated;\\n\\n uint256 public newDkgResultChallengePeriodLength;\\n uint256 public dkgResultChallengePeriodLengthChangeInitiated;\\n\\n uint256 public newDkgResultChallengeExtraGas;\\n uint256 public dkgResultChallengeExtraGasChangeInitiated;\\n\\n uint256 public newDkgResultSubmissionTimeout;\\n uint256 public dkgResultSubmissionTimeoutChangeInitiated;\\n\\n uint256 public newDkgSubmitterPrecedencePeriodLength;\\n uint256 public dkgSubmitterPrecedencePeriodLengthChangeInitiated;\\n\\n uint96 public newRelayEntrySubmissionFailureSlashingAmount;\\n uint256 public relayEntrySubmissionFailureSlashingAmountChangeInitiated;\\n\\n uint96 public newMaliciousDkgResultSlashingAmount;\\n uint256 public maliciousDkgResultSlashingAmountChangeInitiated;\\n\\n uint96 public newUnauthorizedSigningSlashingAmount;\\n uint256 public unauthorizedSigningSlashingAmountChangeInitiated;\\n\\n uint256 public newSortitionPoolRewardsBanDuration;\\n uint256 public sortitionPoolRewardsBanDurationChangeInitiated;\\n\\n uint256 public newRelayEntryTimeoutNotificationRewardMultiplier;\\n uint256 public relayEntryTimeoutNotificationRewardMultiplierChangeInitiated;\\n\\n uint256 public newUnauthorizedSigningNotificationRewardMultiplier;\\n uint256\\n public unauthorizedSigningNotificationRewardMultiplierChangeInitiated;\\n\\n uint96 public newMinimumAuthorization;\\n uint256 public minimumAuthorizationChangeInitiated;\\n\\n uint64 public newAuthorizationDecreaseDelay;\\n uint256 public authorizationDecreaseDelayChangeInitiated;\\n\\n uint64 public newAuthorizationDecreaseChangePeriod;\\n uint256 public authorizationDecreaseChangePeriodChangeInitiated;\\n\\n uint256 public newDkgMaliciousResultNotificationRewardMultiplier;\\n uint256\\n public dkgMaliciousResultNotificationRewardMultiplierChangeInitiated;\\n\\n uint256 public newDkgResultSubmissionGas;\\n uint256 public dkgResultSubmissionGasChangeInitiated;\\n\\n uint256 public newDkgResultApprovalGasOffset;\\n uint256 public dkgResultApprovalGasOffsetChangeInitiated;\\n\\n uint256 public newNotifyOperatorInactivityGasOffset;\\n uint256 public notifyOperatorInactivityGasOffsetChangeInitiated;\\n\\n uint256 public newRelayEntrySubmissionGasOffset;\\n uint256 public relayEntrySubmissionGasOffsetChangeInitiated;\\n\\n RandomBeacon public immutable randomBeacon;\\n\\n uint256 public governanceDelay;\\n\\n event GovernanceDelayUpdateStarted(\\n uint256 governanceDelay,\\n uint256 timestamp\\n );\\n event GovernanceDelayUpdated(uint256 governanceDelay);\\n\\n event RandomBeaconGovernanceTransferStarted(\\n address newRandomBeaconGovernance,\\n uint256 timestamp\\n );\\n event RandomBeaconGovernanceTransferred(address newRandomBeaconGovernance);\\n\\n event RelayEntrySoftTimeoutUpdateStarted(\\n uint256 relayEntrySoftTimeout,\\n uint256 timestamp\\n );\\n event RelayEntrySoftTimeoutUpdated(uint256 relayEntrySoftTimeout);\\n\\n event RelayEntryHardTimeoutUpdateStarted(\\n uint256 relayEntryHardTimeout,\\n uint256 timestamp\\n );\\n event RelayEntryHardTimeoutUpdated(uint256 relayEntryHardTimeout);\\n\\n event CallbackGasLimitUpdateStarted(\\n uint256 callbackGasLimit,\\n uint256 timestamp\\n );\\n event CallbackGasLimitUpdated(uint256 callbackGasLimit);\\n\\n event GroupCreationFrequencyUpdateStarted(\\n uint256 groupCreationFrequency,\\n uint256 timestamp\\n );\\n event GroupCreationFrequencyUpdated(uint256 groupCreationFrequency);\\n\\n event GroupLifetimeUpdateStarted(uint256 groupLifetime, uint256 timestamp);\\n event GroupLifetimeUpdated(uint256 groupLifetime);\\n\\n event DkgResultChallengePeriodLengthUpdateStarted(\\n uint256 dkgResultChallengePeriodLength,\\n uint256 timestamp\\n );\\n event DkgResultChallengePeriodLengthUpdated(\\n uint256 dkgResultChallengePeriodLength\\n );\\n\\n event DkgResultChallengeExtraGasUpdateStarted(\\n uint256 dkgResultChallengeExtraGas,\\n uint256 timestamp\\n );\\n event DkgResultChallengeExtraGasUpdated(uint256 dkgResultChallengeExtraGas);\\n\\n event DkgResultSubmissionTimeoutUpdateStarted(\\n uint256 dkgResultSubmissionTimeout,\\n uint256 timestamp\\n );\\n event DkgResultSubmissionTimeoutUpdated(uint256 dkgResultSubmissionTimeout);\\n\\n event DkgSubmitterPrecedencePeriodLengthUpdateStarted(\\n uint256 submitterPrecedencePeriodLength,\\n uint256 timestamp\\n );\\n event DkgSubmitterPrecedencePeriodLengthUpdated(\\n uint256 submitterPrecedencePeriodLength\\n );\\n\\n event RelayEntrySubmissionFailureSlashingAmountUpdateStarted(\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint256 timestamp\\n );\\n event RelayEntrySubmissionFailureSlashingAmountUpdated(\\n uint96 relayEntrySubmissionFailureSlashingAmount\\n );\\n\\n event MaliciousDkgResultSlashingAmountUpdateStarted(\\n uint96 maliciousDkgResultSlashingAmount,\\n uint256 timestamp\\n );\\n event MaliciousDkgResultSlashingAmountUpdated(\\n uint96 maliciousDkgResultSlashingAmount\\n );\\n\\n event UnauthorizedSigningSlashingAmountUpdateStarted(\\n uint96 unauthorizedSigningSlashingAmount,\\n uint256 timestamp\\n );\\n event UnauthorizedSigningSlashingAmountUpdated(\\n uint96 unauthorizedSigningSlashingAmount\\n );\\n\\n event SortitionPoolRewardsBanDurationUpdateStarted(\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 timestamp\\n );\\n event SortitionPoolRewardsBanDurationUpdated(\\n uint256 sortitionPoolRewardsBanDuration\\n );\\n\\n event RelayEntryTimeoutNotificationRewardMultiplierUpdateStarted(\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 timestamp\\n );\\n event RelayEntryTimeoutNotificationRewardMultiplierUpdated(\\n uint256 relayEntryTimeoutNotificationRewardMultiplier\\n );\\n\\n event UnauthorizedSigningNotificationRewardMultiplierUpdateStarted(\\n uint256 unauthorizedSigningTimeoutNotificationRewardMultiplier,\\n uint256 timestamp\\n );\\n event UnauthorizedSigningNotificationRewardMultiplierUpdated(\\n uint256 unauthorizedSigningTimeoutNotificationRewardMultiplier\\n );\\n\\n event MinimumAuthorizationUpdateStarted(\\n uint96 minimumAuthorization,\\n uint256 timestamp\\n );\\n event MinimumAuthorizationUpdated(uint96 minimumAuthorization);\\n\\n event AuthorizationDecreaseDelayUpdateStarted(\\n uint64 authorizationDecreaseDelay,\\n uint256 timestamp\\n );\\n event AuthorizationDecreaseDelayUpdated(uint64 authorizationDecreaseDelay);\\n\\n event AuthorizationDecreaseChangePeriodUpdateStarted(\\n uint64 authorizationDecreaseChangePeriod,\\n uint256 timestamp\\n );\\n\\n event AuthorizationDecreaseChangePeriodUpdated(\\n uint64 authorizationDecreaseChangePeriod\\n );\\n\\n event DkgMaliciousResultNotificationRewardMultiplierUpdateStarted(\\n uint256 dkgMaliciousResultNotificationRewardMultiplier,\\n uint256 timestamp\\n );\\n event DkgMaliciousResultNotificationRewardMultiplierUpdated(\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n );\\n\\n event DkgResultSubmissionGasUpdateStarted(\\n uint256 dkgResultSubmissionGas,\\n uint256 timestamp\\n );\\n event DkgResultSubmissionGasUpdated(uint256 dkgResultSubmissionGas);\\n\\n event DkgResultApprovalGasOffsetUpdateStarted(\\n uint256 dkgResultApprovalGasOffset,\\n uint256 timestamp\\n );\\n event DkgResultApprovalGasOffsetUpdated(uint256 dkgResultApprovalGasOffset);\\n\\n event NotifyOperatorInactivityGasOffsetUpdateStarted(\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 timestamp\\n );\\n event NotifyOperatorInactivityGasOffsetUpdated(\\n uint256 notifyOperatorInactivityGasOffset\\n );\\n\\n event RelayEntrySubmissionGasOffsetUpdateStarted(\\n uint256 relayEntrySubmissionGasOffset,\\n uint256 timestamp\\n );\\n event RelayEntrySubmissionGasOffsetUpdated(\\n uint256 relayEntrySubmissionGasOffset\\n );\\n\\n /// @notice Reverts if called before the governance delay elapses.\\n /// @param changeInitiatedTimestamp Timestamp indicating the beginning\\n /// of the change.\\n modifier onlyAfterGovernanceDelay(uint256 changeInitiatedTimestamp) {\\n /* solhint-disable not-rely-on-time */\\n require(changeInitiatedTimestamp > 0, \\\"Change not initiated\\\");\\n require(\\n block.timestamp - changeInitiatedTimestamp >= governanceDelay,\\n \\\"Governance delay has not elapsed\\\"\\n );\\n _;\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n constructor(RandomBeacon _randomBeacon, uint256 _governanceDelay) {\\n require(address(_randomBeacon) != address(0), \\\"Zero-address reference\\\");\\n require(_governanceDelay != 0, \\\"No governance delay\\\");\\n\\n randomBeacon = _randomBeacon;\\n governanceDelay = _governanceDelay;\\n }\\n\\n /// @notice Begins the governance delay update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newGovernanceDelay New governance delay\\n function beginGovernanceDelayUpdate(uint256 _newGovernanceDelay)\\n external\\n onlyOwner\\n {\\n newGovernanceDelay = _newGovernanceDelay;\\n /* solhint-disable not-rely-on-time */\\n governanceDelayChangeInitiated = block.timestamp;\\n emit GovernanceDelayUpdateStarted(_newGovernanceDelay, block.timestamp);\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the governance delay update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeGovernanceDelayUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(governanceDelayChangeInitiated)\\n {\\n emit GovernanceDelayUpdated(newGovernanceDelay);\\n governanceDelay = newGovernanceDelay;\\n governanceDelayChangeInitiated = 0;\\n newGovernanceDelay = 0;\\n }\\n\\n /// @notice Begins the random beacon governance transfer process.\\n /// @dev Can be called only by the current contract governance.\\n function beginRandomBeaconGovernanceTransfer(\\n address _newRandomBeaconGovernance\\n ) external onlyOwner {\\n require(\\n address(_newRandomBeaconGovernance) != address(0),\\n \\\"New random beacon governance address cannot be zero\\\"\\n );\\n newRandomBeaconGovernance = _newRandomBeaconGovernance;\\n /* solhint-disable not-rely-on-time */\\n randomBeaconGovernanceTransferInitiated = block.timestamp;\\n emit RandomBeaconGovernanceTransferStarted(\\n _newRandomBeaconGovernance,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the random beacon governance transfer process.\\n /// @dev Can be called only by the current contract governance, after the\\n /// governance delay elapses.\\n function finalizeRandomBeaconGovernanceTransfer()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(randomBeaconGovernanceTransferInitiated)\\n {\\n emit RandomBeaconGovernanceTransferred(newRandomBeaconGovernance);\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.transferGovernance(newRandomBeaconGovernance);\\n randomBeaconGovernanceTransferInitiated = 0;\\n newRandomBeaconGovernance = address(0);\\n }\\n\\n /// @notice Begins the relay entry soft timeout update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntrySoftTimeout New relay entry submission timeout in blocks\\n function beginRelayEntrySoftTimeoutUpdate(uint256 _newRelayEntrySoftTimeout)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newRelayEntrySoftTimeout > 0,\\n \\\"Relay entry soft timeout must be > 0\\\"\\n );\\n newRelayEntrySoftTimeout = _newRelayEntrySoftTimeout;\\n relayEntrySoftTimeoutChangeInitiated = block.timestamp;\\n emit RelayEntrySoftTimeoutUpdateStarted(\\n _newRelayEntrySoftTimeout,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the relay entry soft timeout update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntrySoftTimeoutUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(relayEntrySoftTimeoutChangeInitiated)\\n {\\n emit RelayEntrySoftTimeoutUpdated(newRelayEntrySoftTimeout);\\n (\\n ,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n ) = randomBeacon.relayEntryParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRelayEntryParameters(\\n newRelayEntrySoftTimeout,\\n relayEntryHardTimeout,\\n callbackGasLimit\\n );\\n relayEntrySoftTimeoutChangeInitiated = 0;\\n newRelayEntrySoftTimeout = 0;\\n }\\n\\n /// @notice Begins the relay entry hard timeout update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntryHardTimeout New relay entry hard timeout in blocks\\n function beginRelayEntryHardTimeoutUpdate(uint256 _newRelayEntryHardTimeout)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n newRelayEntryHardTimeout = _newRelayEntryHardTimeout;\\n relayEntryHardTimeoutChangeInitiated = block.timestamp;\\n emit RelayEntryHardTimeoutUpdateStarted(\\n _newRelayEntryHardTimeout,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the relay entry hard timeout update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntryHardTimeoutUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(relayEntryHardTimeoutChangeInitiated)\\n {\\n emit RelayEntryHardTimeoutUpdated(newRelayEntryHardTimeout);\\n (\\n uint256 relayEntrySoftTimeout,\\n ,\\n uint256 callbackGasLimit\\n ) = randomBeacon.relayEntryParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRelayEntryParameters(\\n relayEntrySoftTimeout,\\n newRelayEntryHardTimeout,\\n callbackGasLimit\\n );\\n relayEntryHardTimeoutChangeInitiated = 0;\\n newRelayEntryHardTimeout = 0;\\n }\\n\\n /// @notice Begins the callback gas limit update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newCallbackGasLimit New callback gas limit\\n function beginCallbackGasLimitUpdate(uint256 _newCallbackGasLimit)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n // slither-disable-next-line too-many-digits\\n require(\\n _newCallbackGasLimit > 0 && _newCallbackGasLimit <= 1e6,\\n \\\"Callback gas limit must be > 0 and <= 1000000\\\"\\n );\\n newCallbackGasLimit = _newCallbackGasLimit;\\n callbackGasLimitChangeInitiated = block.timestamp;\\n emit CallbackGasLimitUpdateStarted(\\n _newCallbackGasLimit,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the callback gas limit update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeCallbackGasLimitUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(callbackGasLimitChangeInitiated)\\n {\\n emit CallbackGasLimitUpdated(newCallbackGasLimit);\\n (\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n\\n ) = randomBeacon.relayEntryParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRelayEntryParameters(\\n relayEntrySoftTimeout,\\n relayEntryHardTimeout,\\n newCallbackGasLimit\\n );\\n callbackGasLimitChangeInitiated = 0;\\n newCallbackGasLimit = 0;\\n }\\n\\n /// @notice Begins the group creation frequency update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newGroupCreationFrequency New group creation frequency\\n function beginGroupCreationFrequencyUpdate(\\n uint256 _newGroupCreationFrequency\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newGroupCreationFrequency > 0,\\n \\\"Group creation frequency must be > 0\\\"\\n );\\n newGroupCreationFrequency = _newGroupCreationFrequency;\\n groupCreationFrequencyChangeInitiated = block.timestamp;\\n emit GroupCreationFrequencyUpdateStarted(\\n _newGroupCreationFrequency,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the group creation frequency update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeGroupCreationFrequencyUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(groupCreationFrequencyChangeInitiated)\\n {\\n emit GroupCreationFrequencyUpdated(newGroupCreationFrequency);\\n (\\n ,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n newGroupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n groupCreationFrequencyChangeInitiated = 0;\\n newGroupCreationFrequency = 0;\\n }\\n\\n /// @notice Begins the group lifetime update process. Group lifetime needs to\\n /// be shorter than the authorization decrease delay to ensure every\\n /// active group is backed by enough stake. A new group lifetime value\\n /// is in blocks and has to be calculated based on the average block\\n /// time and authorization decrease delay which value is in seconds.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newGroupLifetime New group lifetime in blocks\\n function beginGroupLifetimeUpdate(uint256 _newGroupLifetime)\\n external\\n onlyOwner\\n {\\n require(_newGroupLifetime > 0, \\\"Group lifetime must be greater than 0\\\");\\n /* solhint-disable not-rely-on-time */\\n newGroupLifetime = _newGroupLifetime;\\n groupLifetimeChangeInitiated = block.timestamp;\\n emit GroupLifetimeUpdateStarted(_newGroupLifetime, block.timestamp);\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the group creation frequency update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeGroupLifetimeUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(groupLifetimeChangeInitiated)\\n {\\n emit GroupLifetimeUpdated(newGroupLifetime);\\n (\\n uint256 groupCreationFrequency,\\n ,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n newGroupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n groupLifetimeChangeInitiated = 0;\\n newGroupLifetime = 0;\\n }\\n\\n /// @notice Begins the DKG result challenge period length update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultChallengePeriodLength New DKG result challenge\\n /// period length in blocks\\n function beginDkgResultChallengePeriodLengthUpdate(\\n uint256 _newDkgResultChallengePeriodLength\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgResultChallengePeriodLength >= 10,\\n \\\"DKG result challenge period length must be >= 10\\\"\\n );\\n newDkgResultChallengePeriodLength = _newDkgResultChallengePeriodLength;\\n dkgResultChallengePeriodLengthChangeInitiated = block.timestamp;\\n emit DkgResultChallengePeriodLengthUpdateStarted(\\n _newDkgResultChallengePeriodLength,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result challenge period length update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultChallengePeriodLengthUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultChallengePeriodLengthChangeInitiated)\\n {\\n emit DkgResultChallengePeriodLengthUpdated(\\n newDkgResultChallengePeriodLength\\n );\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n ,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n newDkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n dkgResultChallengePeriodLengthChangeInitiated = 0;\\n newDkgResultChallengePeriodLength = 0;\\n }\\n\\n /// @notice Begins the DKG result challenge extra gas update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultChallengeExtraGas New DKG result challenge extra gas\\n function beginDkgResultChallengeExtraGasUpdate(\\n uint256 _newDkgResultChallengeExtraGas\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newDkgResultChallengeExtraGas = _newDkgResultChallengeExtraGas;\\n dkgResultChallengeExtraGasChangeInitiated = block.timestamp;\\n emit DkgResultChallengeExtraGasUpdateStarted(\\n _newDkgResultChallengeExtraGas,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result challenge extra gas update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultChallengeExtraGasUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultChallengeExtraGasChangeInitiated)\\n {\\n emit DkgResultChallengeExtraGasUpdated(newDkgResultChallengeExtraGas);\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n ,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n newDkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n dkgResultChallengeExtraGasChangeInitiated = 0;\\n newDkgResultChallengeExtraGas = 0;\\n }\\n\\n /// @notice Begins the DKG result submission timeout update\\n /// process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultSubmissionTimeout New DKG result submission\\n /// timeout in blocks\\n function beginDkgResultSubmissionTimeoutUpdate(\\n uint256 _newDkgResultSubmissionTimeout\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgResultSubmissionTimeout > 0,\\n \\\"DKG result submission timeout must be > 0\\\"\\n );\\n newDkgResultSubmissionTimeout = _newDkgResultSubmissionTimeout;\\n dkgResultSubmissionTimeoutChangeInitiated = block.timestamp;\\n emit DkgResultSubmissionTimeoutUpdateStarted(\\n _newDkgResultSubmissionTimeout,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result submission timeout update\\n /// process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultSubmissionTimeoutUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultSubmissionTimeoutChangeInitiated)\\n {\\n emit DkgResultSubmissionTimeoutUpdated(newDkgResultSubmissionTimeout);\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n ,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n newDkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n dkgResultSubmissionTimeoutChangeInitiated = 0;\\n newDkgResultSubmissionTimeout = 0;\\n }\\n\\n /// @notice Begins the DKG submitter precedence period length.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgSubmitterPrecedencePeriodLength New DKG submitter precedence\\n /// period length in blocks\\n function beginDkgSubmitterPrecedencePeriodLengthUpdate(\\n uint256 _newDkgSubmitterPrecedencePeriodLength\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgSubmitterPrecedencePeriodLength > 0,\\n \\\"DKG submitter precedence period length must be > 0\\\"\\n );\\n newDkgSubmitterPrecedencePeriodLength = _newDkgSubmitterPrecedencePeriodLength;\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated = block.timestamp;\\n emit DkgSubmitterPrecedencePeriodLengthUpdateStarted(\\n _newDkgSubmitterPrecedencePeriodLength,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG submitter precedence period length.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgSubmitterPrecedencePeriodLengthUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated\\n )\\n {\\n emit DkgSubmitterPrecedencePeriodLengthUpdated(\\n newDkgSubmitterPrecedencePeriodLength\\n );\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n newDkgSubmitterPrecedencePeriodLength\\n );\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated = 0;\\n newDkgSubmitterPrecedencePeriodLength = 0;\\n }\\n\\n /// @notice Begins the sortition pool rewards ban duration update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newSortitionPoolRewardsBanDuration New sortition pool rewards\\n /// ban duration.\\n function beginSortitionPoolRewardsBanDurationUpdate(\\n uint256 _newSortitionPoolRewardsBanDuration\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newSortitionPoolRewardsBanDuration = _newSortitionPoolRewardsBanDuration;\\n sortitionPoolRewardsBanDurationChangeInitiated = block.timestamp;\\n emit SortitionPoolRewardsBanDurationUpdateStarted(\\n _newSortitionPoolRewardsBanDuration,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the sortition pool rewards ban duration update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeSortitionPoolRewardsBanDurationUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(sortitionPoolRewardsBanDurationChangeInitiated)\\n {\\n emit SortitionPoolRewardsBanDurationUpdated(\\n newSortitionPoolRewardsBanDuration\\n );\\n (\\n ,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n newSortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n sortitionPoolRewardsBanDurationChangeInitiated = 0;\\n newSortitionPoolRewardsBanDuration = 0;\\n }\\n\\n /// @notice Begins the relay entry timeout notification reward multiplier\\n /// update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntryTimeoutNotificationRewardMultiplier New relay\\n /// entry timeout notification reward multiplier.\\n function beginRelayEntryTimeoutNotificationRewardMultiplierUpdate(\\n uint256 _newRelayEntryTimeoutNotificationRewardMultiplier\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newRelayEntryTimeoutNotificationRewardMultiplier <= 100,\\n \\\"Maximum value is 100\\\"\\n );\\n\\n newRelayEntryTimeoutNotificationRewardMultiplier = _newRelayEntryTimeoutNotificationRewardMultiplier;\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated = block\\n .timestamp;\\n emit RelayEntryTimeoutNotificationRewardMultiplierUpdateStarted(\\n _newRelayEntryTimeoutNotificationRewardMultiplier,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Begins the unauthorized signing notification reward multiplier\\n /// update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newUnauthorizedSigningNotificationRewardMultiplier New unauthorized\\n /// signing notification reward multiplier.\\n function beginUnauthorizedSigningNotificationRewardMultiplierUpdate(\\n uint256 _newUnauthorizedSigningNotificationRewardMultiplier\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newUnauthorizedSigningNotificationRewardMultiplier <= 100,\\n \\\"Maximum value is 100\\\"\\n );\\n\\n newUnauthorizedSigningNotificationRewardMultiplier = _newUnauthorizedSigningNotificationRewardMultiplier;\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated = block\\n .timestamp;\\n emit UnauthorizedSigningNotificationRewardMultiplierUpdateStarted(\\n _newUnauthorizedSigningNotificationRewardMultiplier,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the unauthorized signing notification reward\\n /// multiplier update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated\\n )\\n {\\n emit UnauthorizedSigningNotificationRewardMultiplierUpdated(\\n newUnauthorizedSigningNotificationRewardMultiplier\\n );\\n (\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n ,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n sortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n newUnauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated = 0;\\n newUnauthorizedSigningNotificationRewardMultiplier = 0;\\n }\\n\\n /// @notice Finalizes the relay entry timeout notification reward\\n /// multiplier update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated\\n )\\n {\\n emit RelayEntryTimeoutNotificationRewardMultiplierUpdated(\\n newRelayEntryTimeoutNotificationRewardMultiplier\\n );\\n (\\n uint256 sortitionPoolRewardsBanDuration,\\n ,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n sortitionPoolRewardsBanDuration,\\n newRelayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated = 0;\\n newRelayEntryTimeoutNotificationRewardMultiplier = 0;\\n }\\n\\n /// @notice Begins the DKG malicious result notification reward multiplier\\n /// update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgMaliciousResultNotificationRewardMultiplier New DKG\\n /// malicious result notification reward multiplier.\\n function beginDkgMaliciousResultNotificationRewardMultiplierUpdate(\\n uint256 _newDkgMaliciousResultNotificationRewardMultiplier\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgMaliciousResultNotificationRewardMultiplier <= 100,\\n \\\"Maximum value is 100\\\"\\n );\\n\\n newDkgMaliciousResultNotificationRewardMultiplier = _newDkgMaliciousResultNotificationRewardMultiplier;\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated = block\\n .timestamp;\\n emit DkgMaliciousResultNotificationRewardMultiplierUpdateStarted(\\n _newDkgMaliciousResultNotificationRewardMultiplier,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG malicious result notification reward\\n /// multiplier update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated\\n )\\n {\\n emit DkgMaliciousResultNotificationRewardMultiplierUpdated(\\n newDkgMaliciousResultNotificationRewardMultiplier\\n );\\n (\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n sortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n newDkgMaliciousResultNotificationRewardMultiplier\\n );\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated = 0;\\n newDkgMaliciousResultNotificationRewardMultiplier = 0;\\n }\\n\\n /// @notice Begins the relay entry submission failure slashing amount update\\n /// process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntrySubmissionFailureSlashingAmount New relay entry\\n /// submission failure slashing amount\\n function beginRelayEntrySubmissionFailureSlashingAmountUpdate(\\n uint96 _newRelayEntrySubmissionFailureSlashingAmount\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newRelayEntrySubmissionFailureSlashingAmount = _newRelayEntrySubmissionFailureSlashingAmount;\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated = block\\n .timestamp;\\n emit RelayEntrySubmissionFailureSlashingAmountUpdateStarted(\\n _newRelayEntrySubmissionFailureSlashingAmount,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the relay entry submission failure slashing amount\\n /// update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntrySubmissionFailureSlashingAmountUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated\\n )\\n {\\n emit RelayEntrySubmissionFailureSlashingAmountUpdated(\\n newRelayEntrySubmissionFailureSlashingAmount\\n );\\n (\\n ,\\n uint96 maliciousDkgResultSlashingAmount,\\n uint96 unauthorizedSigningSlashingAmount\\n ) = randomBeacon.slashingParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateSlashingParameters(\\n newRelayEntrySubmissionFailureSlashingAmount,\\n maliciousDkgResultSlashingAmount,\\n unauthorizedSigningSlashingAmount\\n );\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated = 0;\\n newRelayEntrySubmissionFailureSlashingAmount = 0;\\n }\\n\\n /// @notice Begins the DKG result submission gas update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultSubmissionGas New relay entry submission gas offset\\n function beginDkgResultSubmissionGasUpdate(\\n uint256 _newDkgResultSubmissionGas\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newDkgResultSubmissionGas = _newDkgResultSubmissionGas;\\n dkgResultSubmissionGasChangeInitiated = block.timestamp;\\n emit DkgResultSubmissionGasUpdateStarted(\\n _newDkgResultSubmissionGas,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes DKG result submission gas update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultSubmissionGasUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultSubmissionGasChangeInitiated)\\n {\\n emit DkgResultSubmissionGasUpdated(newDkgResultSubmissionGas);\\n (\\n ,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n newDkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n dkgResultSubmissionGasChangeInitiated = 0;\\n newDkgResultSubmissionGas = 0;\\n }\\n\\n /// @notice Begins the DKG result approval gas offset update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultApprovalGasOffset New DKG approval gas offset\\n function beginDkgResultApprovalGasOffsetUpdate(\\n uint256 _newDkgResultApprovalGasOffset\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newDkgResultApprovalGasOffset = _newDkgResultApprovalGasOffset;\\n dkgResultApprovalGasOffsetChangeInitiated = block.timestamp;\\n emit DkgResultApprovalGasOffsetUpdateStarted(\\n _newDkgResultApprovalGasOffset,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result approval gas offset update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultApprovalGasOffsetUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultApprovalGasOffsetChangeInitiated)\\n {\\n emit DkgResultApprovalGasOffsetUpdated(newDkgResultApprovalGasOffset);\\n (\\n uint256 dkgResultSubmissionGas,\\n ,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n dkgResultSubmissionGas,\\n newDkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n dkgResultApprovalGasOffsetChangeInitiated = 0;\\n newDkgResultApprovalGasOffset = 0;\\n }\\n\\n /// @notice Begins the notify operator inactivity gas offset update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newNotifyOperatorInactivityGasOffset New operator inactivity\\n /// notification gas offset\\n function beginNotifyOperatorInactivityGasOffsetUpdate(\\n uint256 _newNotifyOperatorInactivityGasOffset\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newNotifyOperatorInactivityGasOffset = _newNotifyOperatorInactivityGasOffset;\\n notifyOperatorInactivityGasOffsetChangeInitiated = block.timestamp;\\n emit NotifyOperatorInactivityGasOffsetUpdateStarted(\\n _newNotifyOperatorInactivityGasOffset,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the notify operator inactivity gas offset update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeNotifyOperatorInactivityGasOffsetUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n notifyOperatorInactivityGasOffsetChangeInitiated\\n )\\n {\\n emit NotifyOperatorInactivityGasOffsetUpdated(\\n newNotifyOperatorInactivityGasOffset\\n );\\n (\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n ,\\n uint256 relayEntrySubmissionGasOffset\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n dkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n newNotifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n notifyOperatorInactivityGasOffsetChangeInitiated = 0;\\n newNotifyOperatorInactivityGasOffset = 0;\\n }\\n\\n /// @notice Begins the relay entry submission gas offset update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntrySubmissionGasOffset New relay entry submission gas offset\\n function beginRelayEntrySubmissionGasOffsetUpdate(\\n uint256 _newRelayEntrySubmissionGasOffset\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newRelayEntrySubmissionGasOffset = _newRelayEntrySubmissionGasOffset;\\n relayEntrySubmissionGasOffsetChangeInitiated = block.timestamp;\\n emit RelayEntrySubmissionGasOffsetUpdateStarted(\\n _newRelayEntrySubmissionGasOffset,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes relay entry submission gas offset update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntrySubmissionGasOffsetUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(relayEntrySubmissionGasOffsetChangeInitiated)\\n {\\n emit RelayEntrySubmissionGasOffsetUpdated(\\n newRelayEntrySubmissionGasOffset\\n );\\n (\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n dkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n newRelayEntrySubmissionGasOffset\\n );\\n relayEntrySubmissionGasOffsetChangeInitiated = 0;\\n newRelayEntrySubmissionGasOffset = 0;\\n }\\n\\n /// @notice Begins the malicious DKG result slashing amount update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newMaliciousDkgResultSlashingAmount New malicious DKG result\\n /// slashing amount\\n function beginMaliciousDkgResultSlashingAmountUpdate(\\n uint96 _newMaliciousDkgResultSlashingAmount\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newMaliciousDkgResultSlashingAmount = _newMaliciousDkgResultSlashingAmount;\\n maliciousDkgResultSlashingAmountChangeInitiated = block.timestamp;\\n emit MaliciousDkgResultSlashingAmountUpdateStarted(\\n _newMaliciousDkgResultSlashingAmount,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the malicious DKG result slashing amount update\\n /// process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeMaliciousDkgResultSlashingAmountUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n maliciousDkgResultSlashingAmountChangeInitiated\\n )\\n {\\n emit MaliciousDkgResultSlashingAmountUpdated(\\n newMaliciousDkgResultSlashingAmount\\n );\\n (\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n ,\\n uint96 unauthorizedSigningSlashingAmount\\n ) = randomBeacon.slashingParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateSlashingParameters(\\n relayEntrySubmissionFailureSlashingAmount,\\n newMaliciousDkgResultSlashingAmount,\\n unauthorizedSigningSlashingAmount\\n );\\n maliciousDkgResultSlashingAmountChangeInitiated = 0;\\n newMaliciousDkgResultSlashingAmount = 0;\\n }\\n\\n /// @notice Begins the unauthorized signing slashing amount update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newUnauthorizedSigningSlashingAmount New unauthorized signing\\n /// slashing amount\\n function beginUnauthorizedSigningSlashingAmountUpdate(\\n uint96 _newUnauthorizedSigningSlashingAmount\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newUnauthorizedSigningSlashingAmount = _newUnauthorizedSigningSlashingAmount;\\n unauthorizedSigningSlashingAmountChangeInitiated = block.timestamp;\\n emit UnauthorizedSigningSlashingAmountUpdateStarted(\\n _newUnauthorizedSigningSlashingAmount,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the unauthorized signing slashing amount update\\n /// process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeUnauthorizedSigningSlashingAmountUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n unauthorizedSigningSlashingAmountChangeInitiated\\n )\\n {\\n emit UnauthorizedSigningSlashingAmountUpdated(\\n newUnauthorizedSigningSlashingAmount\\n );\\n (\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint96 maliciousDkgResultSlashingAmount,\\n\\n ) = randomBeacon.slashingParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateSlashingParameters(\\n relayEntrySubmissionFailureSlashingAmount,\\n maliciousDkgResultSlashingAmount,\\n newUnauthorizedSigningSlashingAmount\\n );\\n unauthorizedSigningSlashingAmountChangeInitiated = 0;\\n newUnauthorizedSigningSlashingAmount = 0;\\n }\\n\\n /// @notice Begins the minimum authorization amount update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newMinimumAuthorization New minimum authorization amount.\\n function beginMinimumAuthorizationUpdate(uint96 _newMinimumAuthorization)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n newMinimumAuthorization = _newMinimumAuthorization;\\n minimumAuthorizationChangeInitiated = block.timestamp;\\n emit MinimumAuthorizationUpdateStarted(\\n _newMinimumAuthorization,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the minimum authorization amount update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeMinimumAuthorizationUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(minimumAuthorizationChangeInitiated)\\n {\\n emit MinimumAuthorizationUpdated(newMinimumAuthorization);\\n (\\n ,\\n uint64 authorizationDecreaseDelay,\\n uint64 authorizationDecreaseChangePeriod\\n ) = randomBeacon.authorizationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateAuthorizationParameters(\\n newMinimumAuthorization,\\n authorizationDecreaseDelay,\\n authorizationDecreaseChangePeriod\\n );\\n minimumAuthorizationChangeInitiated = 0;\\n newMinimumAuthorization = 0;\\n }\\n\\n /// @notice Begins the authorization decrease delay update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newAuthorizationDecreaseDelay New authorization decrease delay\\n function beginAuthorizationDecreaseDelayUpdate(\\n uint64 _newAuthorizationDecreaseDelay\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newAuthorizationDecreaseDelay = _newAuthorizationDecreaseDelay;\\n authorizationDecreaseDelayChangeInitiated = block.timestamp;\\n emit AuthorizationDecreaseDelayUpdateStarted(\\n _newAuthorizationDecreaseDelay,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the authorization decrease delay update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeAuthorizationDecreaseDelayUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(authorizationDecreaseDelayChangeInitiated)\\n {\\n emit AuthorizationDecreaseDelayUpdated(newAuthorizationDecreaseDelay);\\n (\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseChangePeriod,\\n\\n ) = randomBeacon.authorizationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateAuthorizationParameters(\\n minimumAuthorization,\\n newAuthorizationDecreaseDelay,\\n authorizationDecreaseChangePeriod\\n );\\n authorizationDecreaseDelayChangeInitiated = 0;\\n newAuthorizationDecreaseDelay = 0;\\n }\\n\\n /// @notice Begins the authorization decrease change period update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newAuthorizationDecreaseChangePeriod New authorization decrease change period\\n function beginAuthorizationDecreaseChangePeriodUpdate(\\n uint64 _newAuthorizationDecreaseChangePeriod\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newAuthorizationDecreaseChangePeriod = _newAuthorizationDecreaseChangePeriod;\\n authorizationDecreaseChangePeriodChangeInitiated = block.timestamp;\\n emit AuthorizationDecreaseChangePeriodUpdateStarted(\\n _newAuthorizationDecreaseChangePeriod,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the authorization decrease change period update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeAuthorizationDecreaseChangePeriodUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n authorizationDecreaseChangePeriodChangeInitiated\\n )\\n {\\n emit AuthorizationDecreaseChangePeriodUpdated(\\n newAuthorizationDecreaseChangePeriod\\n );\\n (\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseDelay,\\n\\n ) = randomBeacon.authorizationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateAuthorizationParameters(\\n minimumAuthorization,\\n authorizationDecreaseDelay,\\n newAuthorizationDecreaseChangePeriod\\n );\\n authorizationDecreaseChangePeriodChangeInitiated = 0;\\n newAuthorizationDecreaseChangePeriod = 0;\\n }\\n\\n /// @notice Set authorization for requesters that can request a relay\\n /// entry. It can be done by the governance only.\\n /// @param requester Requester, can be a contract or EOA\\n /// @param isAuthorized True or false\\n function setRequesterAuthorization(address requester, bool isAuthorized)\\n external\\n onlyOwner\\n {\\n randomBeacon.setRequesterAuthorization(requester, isAuthorized);\\n }\\n\\n /// @notice Withdraws rewards belonging to operators marked as ineligible\\n /// for sortition pool rewards.\\n /// @dev Can be called only by the contract owner.\\n /// @param recipient Recipient of withdrawn rewards.\\n function withdrawIneligibleRewards(address recipient) external onlyOwner {\\n randomBeacon.withdrawIneligibleRewards(recipient);\\n }\\n\\n /// @notice Get the time remaining until the governance delay can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingGovernanceDelayUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(governanceDelayChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the random beacon governance can\\n /// be transferred.\\n /// @return Remaining time in seconds.\\n function getRemainingRandomBeaconGovernanceTransferDelayTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(randomBeaconGovernanceTransferInitiated);\\n }\\n\\n /// @notice Get the time remaining until the relay entry submission soft\\n /// timeout can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntrySoftTimeoutUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(relayEntrySoftTimeoutChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the relay entry hard timeout can be\\n /// updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntryHardTimeoutUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(relayEntryHardTimeoutChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the callback gas limit can be\\n /// updated.\\n /// @return Remaining time in seconds.\\n function getRemainingCallbackGasLimitUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(callbackGasLimitChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the group creation frequency can be\\n /// updated.\\n /// @return Remaining time in seconds.\\n function getRemainingGroupCreationFrequencyUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(groupCreationFrequencyChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the group lifetime can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingGroupLifetimeUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(groupLifetimeChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the DKG result challenge period\\n /// length can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultChallengePeriodLengthUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n dkgResultChallengePeriodLengthChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the DKG result challenge extra\\n /// gas can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultChallengeExtraGasUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(dkgResultChallengeExtraGasChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the DKG result submission timeout\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultSubmissionTimeoutUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(dkgResultSubmissionTimeoutChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the wallet owner can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the relay entry submission failure\\n /// slashing amount can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the malicious DKG result\\n /// slashing amount can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingMaliciousDkgResultSlashingAmountUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n maliciousDkgResultSlashingAmountChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the unauthorized signing\\n /// slashing amount can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingUnauthorizedSigningSlashingAmountUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n unauthorizedSigningSlashingAmountChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the minimum authorization amount\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingMimimumAuthorizationUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(minimumAuthorizationChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the authorization decrease delay\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingAuthorizationDecreaseDelayUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(authorizationDecreaseDelayChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the authorization decrease change\\n /// period can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingAuthorizationDecreaseChangePeriodUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n authorizationDecreaseChangePeriodChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the sortition pool rewards ban\\n /// duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingSortitionPoolRewardsBanDurationUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n sortitionPoolRewardsBanDurationChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the relay entry timeout\\n /// notification reward multiplier duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the unauthorized signing\\n /// notification reward multiplier duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the DKG malicious result\\n /// notification reward multiplier duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the DKG result submission gas\\n /// duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultSubmissionGasUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(dkgResultSubmissionGasChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the DKG approval gas offset duration\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultApprovalGasOffsetUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(dkgResultApprovalGasOffsetChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the operator inactivity notification\\n /// gas offset duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingNotifyOperatorInactivityGasOffsetUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n notifyOperatorInactivityGasOffsetChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the relay entry submission gas offset\\n /// duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntrySubmissionGasOffsetUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n relayEntrySubmissionGasOffsetChangeInitiated\\n );\\n }\\n\\n /// @notice Gets the time remaining until the governable parameter update\\n /// can be committed.\\n /// @param changeTimestamp Timestamp indicating the beginning of the change.\\n /// @return Remaining time in seconds.\\n function getRemainingChangeTime(uint256 changeTimestamp)\\n internal\\n view\\n returns (uint256)\\n {\\n require(changeTimestamp > 0, \\\"Change not initiated\\\");\\n /* solhint-disable-next-line not-rely-on-time */\\n uint256 elapsed = block.timestamp - changeTimestamp;\\n if (elapsed >= governanceDelay) {\\n return 0;\\n } else {\\n return governanceDelay - elapsed;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4da22ccc2350264caa1093a03cc44f43d080385bafb7b77b244faf8462549b36\",\"license\":\"GPL-3.0-only\"},\"contracts/Reimbursable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./ReimbursementPool.sol\\\";\\n\\nabstract contract Reimbursable {\\n // The variable should be initialized by the implementing contract.\\n // slither-disable-next-line uninitialized-state\\n ReimbursementPool public reimbursementPool;\\n\\n // Reserved storage space in case we need to add more variables,\\n // since there are upgradeable contracts that inherit from this one.\\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n // slither-disable-next-line unused-state\\n uint256[49] private __gap;\\n\\n event ReimbursementPoolUpdated(address newReimbursementPool);\\n\\n modifier refundable(address receiver) {\\n uint256 gasStart = gasleft();\\n _;\\n reimbursementPool.refund(gasStart - gasleft(), receiver);\\n }\\n\\n modifier onlyReimbursableAdmin() virtual {\\n _;\\n }\\n\\n function updateReimbursementPool(ReimbursementPool _reimbursementPool)\\n external\\n onlyReimbursableAdmin\\n {\\n emit ReimbursementPoolUpdated(address(_reimbursementPool));\\n\\n reimbursementPool = _reimbursementPool;\\n }\\n}\\n\",\"keccak256\":\"0x6b01344c1ec13aaab1dc432d3afabe08d6dd0d1a9248be8b36a0747ac22e5d9f\",\"license\":\"GPL-3.0-only\"},\"contracts/ReimbursementPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\n\\ncontract ReimbursementPool is Ownable, ReentrancyGuard {\\n /// @notice Authorized contracts that can interact with the reimbursment pool.\\n /// Authorization can be granted and removed by the owner.\\n mapping(address => bool) public isAuthorized;\\n\\n /// @notice Static gas includes:\\n /// - cost of the refund function\\n /// - base transaction cost\\n uint256 public staticGas;\\n\\n /// @notice Max gas price used to reimburse a transaction submitter. Protects\\n /// against malicious operator-miners.\\n uint256 public maxGasPrice;\\n\\n event StaticGasUpdated(uint256 newStaticGas);\\n\\n event MaxGasPriceUpdated(uint256 newMaxGasPrice);\\n\\n event SendingEtherFailed(uint256 refundAmount, address receiver);\\n\\n event AuthorizedContract(address thirdPartyContract);\\n\\n event UnauthorizedContract(address thirdPartyContract);\\n\\n event FundsWithdrawn(uint256 withdrawnAmount, address receiver);\\n\\n constructor(uint256 _staticGas, uint256 _maxGasPrice) {\\n staticGas = _staticGas;\\n maxGasPrice = _maxGasPrice;\\n }\\n\\n /// @notice Receive ETH\\n receive() external payable {}\\n\\n /// @notice Refunds ETH to a spender for executing specific transactions.\\n /// @dev Ignoring the result of sending ETH to a receiver is made on purpose.\\n /// For EOA receiving ETH should always work. If a receiver is a smart\\n /// contract, then we do not want to fail a transaction, because in some\\n /// cases the refund is done at the very end of multiple calls where all\\n /// the previous calls were already paid off. It is a receiver's smart\\n /// contract resposibility to make sure it can receive ETH.\\n /// @dev Only authorized contracts are allowed calling this function.\\n /// @param gasSpent Gas spent on a transaction that needs to be reimbursed.\\n /// @param receiver Address where the reimbursment is sent.\\n function refund(uint256 gasSpent, address receiver) external nonReentrant {\\n require(\\n isAuthorized[msg.sender],\\n \\\"Contract is not authorized for a refund\\\"\\n );\\n require(receiver != address(0), \\\"Receiver's address cannot be zero\\\");\\n\\n uint256 gasPrice = tx.gasprice < maxGasPrice\\n ? tx.gasprice\\n : maxGasPrice;\\n\\n uint256 refundAmount = (gasSpent + staticGas) * gasPrice;\\n\\n /* solhint-disable avoid-low-level-calls */\\n // slither-disable-next-line low-level-calls,unchecked-lowlevel\\n (bool sent, ) = receiver.call{value: refundAmount}(\\\"\\\");\\n /* solhint-enable avoid-low-level-calls */\\n if (!sent) {\\n // slither-disable-next-line reentrancy-events\\n emit SendingEtherFailed(refundAmount, receiver);\\n }\\n }\\n\\n /// @notice Authorize a contract that can interact with this reimbursment pool.\\n /// Can be authorized by the owner only.\\n /// @param _contract Authorized contract.\\n function authorize(address _contract) external onlyOwner {\\n isAuthorized[_contract] = true;\\n\\n emit AuthorizedContract(_contract);\\n }\\n\\n /// @notice Unauthorize a contract that was previously authorized to interact\\n /// with this reimbursment pool. Can be unauthorized by the\\n /// owner only.\\n /// @param _contract Authorized contract.\\n function unauthorize(address _contract) external onlyOwner {\\n delete isAuthorized[_contract];\\n\\n emit UnauthorizedContract(_contract);\\n }\\n\\n /// @notice Setting a static gas cost for executing a transaction. Can be set\\n /// by the owner only.\\n /// @param _staticGas Static gas cost.\\n function setStaticGas(uint256 _staticGas) external onlyOwner {\\n staticGas = _staticGas;\\n\\n emit StaticGasUpdated(_staticGas);\\n }\\n\\n /// @notice Setting a max gas price for transactions. Can be set by the\\n /// owner only.\\n /// @param _maxGasPrice Max gas price used to reimburse tx submitters.\\n function setMaxGasPrice(uint256 _maxGasPrice) external onlyOwner {\\n maxGasPrice = _maxGasPrice;\\n\\n emit MaxGasPriceUpdated(_maxGasPrice);\\n }\\n\\n /// @notice Withdraws all ETH from this pool which are sent to a given\\n /// address. Can be set by the owner only.\\n /// @param receiver An address where ETH is sent.\\n function withdrawAll(address receiver) external onlyOwner {\\n withdraw(address(this).balance, receiver);\\n }\\n\\n /// @notice Withdraws ETH amount from this pool which are sent to a given\\n /// address. Can be set by the owner only.\\n /// @param amount Amount to withdraw from the pool.\\n /// @param receiver An address where ETH is sent.\\n function withdraw(uint256 amount, address receiver) public onlyOwner {\\n require(\\n address(this).balance >= amount,\\n \\\"Insufficient contract balance\\\"\\n );\\n require(receiver != address(0), \\\"Receiver's address cannot be zero\\\");\\n\\n emit FundsWithdrawn(amount, receiver);\\n\\n /* solhint-disable avoid-low-level-calls */\\n // slither-disable-next-line low-level-calls,arbitrary-send\\n (bool sent, ) = receiver.call{value: amount}(\\\"\\\");\\n /* solhint-enable avoid-low-level-calls */\\n require(sent, \\\"Failed to send Ether\\\");\\n }\\n}\\n\",\"keccak256\":\"0xd6c24368cc4c6349b8b614e878ca961cad8254b8e8db1cc0abe452a70022ce50\",\"license\":\"GPL-3.0-only\"},\"contracts/api/IRandomBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./IRandomBeaconConsumer.sol\\\";\\n\\n/// @title Random Beacon interface\\ninterface IRandomBeacon {\\n /// @notice Creates a request to generate a new relay entry. Requires a\\n /// request fee denominated in T token.\\n /// @param callbackContract Beacon consumer callback contract.\\n function requestRelayEntry(IRandomBeaconConsumer callbackContract) external;\\n}\\n\",\"keccak256\":\"0xc5f6ddbf69b2f2e2c03fe78b3857a1f038982e858679f520101f53c4ebe2f4bf\",\"license\":\"GPL-3.0-only\"},\"contracts/api/IRandomBeaconConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\ninterface IRandomBeaconConsumer {\\n /// @notice Receives relay entry produced by Keep Random Beacon. This function\\n /// should be called only by Keep Random Beacon.\\n ///\\n /// @param relayEntry Relay entry (random number) produced by Keep Random\\n /// Beacon.\\n /// @param blockNumber Block number at which the relay entry was submitted\\n /// to the chain.\\n function __beaconCallback(uint256 relayEntry, uint256 blockNumber) external;\\n}\\n\",\"keccak256\":\"0x84ce236b4eeb664ccb02782777a05c6ebb410be9b9e586a123a1205437a2ed9f\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/AltBn128.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./ModUtils.sol\\\";\\n\\n/// @title Operations on alt_bn128\\n/// @dev Implementations of common elliptic curve operations on Ethereum's\\n/// (poorly named) alt_bn128 curve. Whenever possible, use post-Byzantium\\n/// pre-compiled contracts to offset gas costs. Note that these\\n/// pre-compiles might not be available on all (eg private) chains.\\nlibrary AltBn128 {\\n using ModUtils for uint256;\\n\\n // G1Point implements a point in G1 group.\\n struct G1Point {\\n uint256 x;\\n uint256 y;\\n }\\n\\n // gfP2 implements a field of size p\\u00b2 as a quadratic extension of the base\\n // field.\\n struct gfP2 {\\n uint256 x;\\n uint256 y;\\n }\\n\\n // G2Point implements a point in G2 group.\\n struct G2Point {\\n gfP2 x;\\n gfP2 y;\\n }\\n\\n // p is a prime over which we form a basic field\\n // Taken from go-ethereum/crypto/bn256/cloudflare/constants.go\\n uint256 internal constant p =\\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n\\n /// @dev Gets generator of G1 group.\\n /// Taken from go-ethereum/crypto/bn256/cloudflare/curve.go\\n uint256 internal constant g1x = 1;\\n uint256 internal constant g1y = 2;\\n\\n /// @dev Gets generator of G2 group.\\n /// Taken from go-ethereum/crypto/bn256/cloudflare/twist.go\\n uint256 internal constant g2xx =\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634;\\n uint256 internal constant g2xy =\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781;\\n uint256 internal constant g2yx =\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531;\\n uint256 internal constant g2yy =\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930;\\n\\n /// @dev Gets twist curve B constant.\\n /// Taken from go-ethereum/crypto/bn256/cloudflare/twist.go\\n uint256 internal constant twistBx =\\n 266929791119991161246907387137283842545076965332900288569378510910307636690;\\n uint256 internal constant twistBy =\\n 19485874751759354771024239261021720505790618469301721065564631296452457478373;\\n\\n /// @dev Gets root of the point where x and y are equal.\\n uint256 internal constant hexRootX =\\n 21573744529824266246521972077326577680729363968861965890554801909984373949499;\\n uint256 internal constant hexRootY =\\n 16854739155576650954933913186877292401521110422362946064090026408937773542853;\\n\\n /// @dev g1YFromX computes a Y value for a G1 point based on an X value.\\n /// This computation is simply evaluating the curve equation for Y on a\\n /// given X, and allows a point on the curve to be represented by just\\n /// an X value + a sign bit.\\n function g1YFromX(uint256 x) internal view returns (uint256) {\\n return ((x.modExp(3, p) + 3) % p).modSqrt(p);\\n }\\n\\n /// @dev Hash a byte array message, m, and map it deterministically to a\\n /// point on G1. Note that this approach was chosen for its simplicity\\n /// and lower gas cost on the EVM, rather than good distribution of\\n /// points on G1.\\n function g1HashToPoint(bytes memory m)\\n internal\\n view\\n returns (G1Point memory)\\n {\\n unchecked {\\n bytes32 h = sha256(m);\\n uint256 x = uint256(h) % p;\\n uint256 y;\\n\\n while (true) {\\n y = g1YFromX(x);\\n if (y > 0) {\\n return G1Point(x, y);\\n }\\n x += 1;\\n }\\n }\\n }\\n\\n /// @dev Decompress a point on G1 from a single uint256.\\n function g1Decompress(bytes32 m) internal view returns (G1Point memory) {\\n unchecked {\\n bytes32 mX = bytes32(0);\\n bytes1 leadX = m[0] & 0x7f;\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n mX = (m & ~bytes32(mask)) | (leadX >> 0);\\n\\n uint256 x = uint256(mX);\\n uint256 y = g1YFromX(x);\\n\\n if (parity(y) != (m[0] & 0x80) >> 7) {\\n y = p - y;\\n }\\n\\n require(\\n isG1PointOnCurve(G1Point(x, y)),\\n \\\"Malformed bn256.G1 point.\\\"\\n );\\n\\n return G1Point(x, y);\\n }\\n }\\n\\n /// @dev Wraps the point addition pre-compile introduced in Byzantium.\\n /// Returns the sum of two points on G1. Revert if the provided points\\n /// are not on the curve.\\n function g1Add(G1Point memory a, G1Point memory b)\\n internal\\n view\\n returns (G1Point memory c)\\n {\\n assembly {\\n let arg := mload(0x40)\\n mstore(arg, mload(a))\\n mstore(add(arg, 0x20), mload(add(a, 0x20)))\\n mstore(add(arg, 0x40), mload(b))\\n mstore(add(arg, 0x60), mload(add(b, 0x20)))\\n // 0x60 is the ECADD precompile address\\n if iszero(staticcall(not(0), 0x06, arg, 0x80, c, 0x40)) {\\n revert(0, 0)\\n }\\n }\\n }\\n\\n /// @dev Returns true if G1 point is on the curve.\\n function isG1PointOnCurve(G1Point memory point)\\n internal\\n view\\n returns (bool)\\n {\\n return point.y.modExp(2, p) == (point.x.modExp(3, p) + 3) % p;\\n }\\n\\n /// @dev Wraps the scalar point multiplication pre-compile introduced in\\n /// Byzantium. The result of a point from G1 multiplied by a scalar\\n /// should match the point added to itself the same number of times.\\n /// Revert if the provided point isn't on the curve.\\n function scalarMultiply(G1Point memory p_1, uint256 scalar)\\n internal\\n view\\n returns (G1Point memory p_2)\\n {\\n assembly {\\n let arg := mload(0x40)\\n mstore(arg, mload(p_1))\\n mstore(add(arg, 0x20), mload(add(p_1, 0x20)))\\n mstore(add(arg, 0x40), scalar)\\n // 0x07 is the ECMUL precompile address\\n if iszero(staticcall(not(0), 0x07, arg, 0x60, p_2, 0x40)) {\\n revert(0, 0)\\n }\\n }\\n }\\n\\n /// @dev Wraps the pairing check pre-compile introduced in Byzantium.\\n /// Returns the result of a pairing check of 2 pairs\\n /// (G1 p1, G2 p2) (G1 p3, G2 p4)\\n function pairing(\\n G1Point memory p1,\\n G2Point memory p2,\\n G1Point memory p3,\\n G2Point memory p4\\n ) internal view returns (bool result) {\\n uint256 _c;\\n assembly {\\n let c := mload(0x40)\\n let arg := add(c, 0x20)\\n\\n mstore(arg, mload(p1))\\n mstore(add(arg, 0x20), mload(add(p1, 0x20)))\\n\\n let p2x := mload(p2)\\n mstore(add(arg, 0x40), mload(p2x))\\n mstore(add(arg, 0x60), mload(add(p2x, 0x20)))\\n\\n let p2y := mload(add(p2, 0x20))\\n mstore(add(arg, 0x80), mload(p2y))\\n mstore(add(arg, 0xa0), mload(add(p2y, 0x20)))\\n\\n mstore(add(arg, 0xc0), mload(p3))\\n mstore(add(arg, 0xe0), mload(add(p3, 0x20)))\\n\\n let p4x := mload(p4)\\n mstore(add(arg, 0x100), mload(p4x))\\n mstore(add(arg, 0x120), mload(add(p4x, 0x20)))\\n\\n let p4y := mload(add(p4, 0x20))\\n mstore(add(arg, 0x140), mload(p4y))\\n mstore(add(arg, 0x160), mload(add(p4y, 0x20)))\\n\\n // call(gasLimit, to, value, inputOffset, inputSize, outputOffset, outputSize)\\n if iszero(staticcall(not(0), 0x08, arg, 0x180, c, 0x20)) {\\n revert(0, 0)\\n }\\n _c := mload(c)\\n }\\n return _c != 0;\\n }\\n\\n function getP() internal pure returns (uint256) {\\n return p;\\n }\\n\\n function g1() internal pure returns (G1Point memory) {\\n return G1Point(g1x, g1y);\\n }\\n\\n function g2() internal pure returns (G2Point memory) {\\n return G2Point(gfP2(g2xx, g2xy), gfP2(g2yx, g2yy));\\n }\\n\\n /// @dev g2YFromX computes a Y value for a G2 point based on an X value.\\n /// This computation is simply evaluating the curve equation for Y on a\\n /// given X, and allows a point on the curve to be represented by just\\n /// an X value + a sign bit.\\n function g2YFromX(gfP2 memory _x) internal pure returns (gfP2 memory y) {\\n (uint256 xx, uint256 xy) = _gfP2CubeAddTwistB(_x.x, _x.y);\\n\\n // Using formula y = x ^ (p^2 + 15) / 32 from\\n // https://github.com/ethereum/beacon_chain/blob/master/beacon_chain/utils/bls.py\\n // (p^2 + 15) / 32 results into a big 512bit value, so breaking it to two uint256 as (a * a + b)\\n uint256 a = 3869331240733915743250440106392954448556483137451914450067252501901456824595;\\n uint256 b = 146360017852723390495514512480590656176144969185739259173561346299185050597;\\n\\n (uint256 xbx, uint256 xby) = _gfP2Pow(xx, xy, b);\\n (uint256 yax, uint256 yay) = _gfP2Pow(xx, xy, a);\\n (uint256 ya2x, uint256 ya2y) = _gfP2Pow(yax, yay, a);\\n (y.x, y.y) = _gfP2Multiply(ya2x, ya2y, xbx, xby);\\n\\n // Multiply y by hexRoot constant to find correct y.\\n while (!_g2X2y(xx, xy, y.x, y.y)) {\\n (y.x, y.y) = _gfP2Multiply(y.x, y.y, hexRootX, hexRootY);\\n }\\n }\\n\\n /// @dev Compress a point on G1 to a single uint256 for serialization.\\n function g1Compress(G1Point memory point) internal pure returns (bytes32) {\\n bytes32 m = bytes32(point.x);\\n\\n bytes1 leadM = m[0] | (parity(point.y) << 7);\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n m = (m & ~bytes32(mask)) | (leadM >> 0);\\n\\n return m;\\n }\\n\\n /// @dev Compress a point on G2 to a pair of uint256 for serialization.\\n function g2Compress(G2Point memory point)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes32 m = bytes32(point.x.x);\\n\\n bytes1 leadM = m[0] | (parity(point.y.x) << 7);\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n m = (m & ~bytes32(mask)) | (leadM >> 0);\\n\\n return abi.encodePacked(m, bytes32(point.x.y));\\n }\\n\\n /// @dev Unmarshals a point on G1 from bytes in an uncompressed form.\\n function g1Unmarshal(bytes memory m)\\n internal\\n pure\\n returns (G1Point memory)\\n {\\n require(m.length == 64, \\\"Invalid G1 bytes length\\\");\\n\\n bytes32 x;\\n bytes32 y;\\n\\n assembly {\\n x := mload(add(m, 0x20))\\n y := mload(add(m, 0x40))\\n }\\n\\n return G1Point(uint256(x), uint256(y));\\n }\\n\\n /// @dev Marshals a point on G1 to bytes form.\\n function g1Marshal(G1Point memory point)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes memory m = new bytes(64);\\n bytes32 x = bytes32(point.x);\\n bytes32 y = bytes32(point.y);\\n\\n assembly {\\n mstore(add(m, 32), x)\\n mstore(add(m, 64), y)\\n }\\n\\n return m;\\n }\\n\\n /// @dev Unmarshals a point on G2 from bytes in an uncompressed form.\\n function g2Unmarshal(bytes memory m)\\n internal\\n pure\\n returns (G2Point memory)\\n {\\n require(m.length == 128, \\\"Invalid G2 bytes length\\\");\\n\\n uint256 xx;\\n uint256 xy;\\n uint256 yx;\\n uint256 yy;\\n\\n assembly {\\n xx := mload(add(m, 0x20))\\n xy := mload(add(m, 0x40))\\n yx := mload(add(m, 0x60))\\n yy := mload(add(m, 0x80))\\n }\\n\\n return G2Point(gfP2(xx, xy), gfP2(yx, yy));\\n }\\n\\n /// @dev Decompress a point on G2 from a pair of uint256.\\n function g2Decompress(bytes memory m)\\n internal\\n pure\\n returns (G2Point memory)\\n {\\n require(m.length == 64, \\\"Invalid G2 compressed bytes length\\\");\\n\\n bytes32 x1;\\n bytes32 x2;\\n uint256 temp;\\n\\n // Extract two bytes32 from bytes array\\n assembly {\\n temp := add(m, 32)\\n x1 := mload(temp)\\n temp := add(m, 64)\\n x2 := mload(temp)\\n }\\n\\n bytes32 mX = bytes32(0);\\n bytes1 leadX = x1[0] & 0x7f;\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n mX = (x1 & ~bytes32(mask)) | (leadX >> 0);\\n\\n gfP2 memory x = gfP2(uint256(mX), uint256(x2));\\n gfP2 memory y = g2YFromX(x);\\n\\n if (parity(y.x) != (m[0] & 0x80) >> 7) {\\n y.x = p - y.x;\\n y.y = p - y.y;\\n }\\n\\n return G2Point(x, y);\\n }\\n\\n /// @dev Returns the sum of two gfP2 field elements.\\n function gfP2Add(gfP2 memory a, gfP2 memory b)\\n internal\\n pure\\n returns (gfP2 memory)\\n {\\n return gfP2(addmod(a.x, b.x, p), addmod(a.y, b.y, p));\\n }\\n\\n /// @dev Returns multiplication of two gfP2 field elements.\\n function gfP2Multiply(gfP2 memory a, gfP2 memory b)\\n internal\\n pure\\n returns (gfP2 memory)\\n {\\n return\\n gfP2(\\n addmod(mulmod(a.x, b.y, p), mulmod(b.x, a.y, p), p),\\n addmod(mulmod(a.y, b.y, p), p - mulmod(a.x, b.x, p), p)\\n );\\n }\\n\\n /// @dev Returns gfP2 element to the power of the provided exponent.\\n function gfP2Pow(gfP2 memory _a, uint256 _exp)\\n internal\\n pure\\n returns (gfP2 memory result)\\n {\\n (uint256 x, uint256 y) = _gfP2Pow(_a.x, _a.y, _exp);\\n return gfP2(x, y);\\n }\\n\\n function gfP2Square(gfP2 memory a) internal pure returns (gfP2 memory) {\\n return gfP2Multiply(a, a);\\n }\\n\\n function gfP2Cube(gfP2 memory a) internal pure returns (gfP2 memory) {\\n return gfP2Multiply(a, gfP2Square(a));\\n }\\n\\n function gfP2CubeAddTwistB(gfP2 memory a)\\n internal\\n pure\\n returns (gfP2 memory)\\n {\\n (uint256 x, uint256 y) = _gfP2CubeAddTwistB(a.x, a.y);\\n return gfP2(x, y);\\n }\\n\\n /// @dev Returns true if G2 point's y^2 equals x.\\n function g2X2y(gfP2 memory x, gfP2 memory y) internal pure returns (bool) {\\n gfP2 memory y2;\\n y2 = gfP2Square(y);\\n\\n return (y2.x == x.x && y2.y == x.y);\\n }\\n\\n /// @dev Returns true if G2 point is on the curve.\\n function isG2PointOnCurve(G2Point memory point)\\n internal\\n pure\\n returns (bool)\\n {\\n (uint256 y2x, uint256 y2y) = _gfP2Square(point.y.x, point.y.y);\\n (uint256 x3x, uint256 x3y) = _gfP2CubeAddTwistB(point.x.x, point.x.y);\\n\\n return (y2x == x3x && y2y == x3y);\\n }\\n\\n function twistB() private pure returns (gfP2 memory) {\\n return gfP2(twistBx, twistBy);\\n }\\n\\n function hexRoot() private pure returns (gfP2 memory) {\\n return gfP2(hexRootX, hexRootY);\\n }\\n\\n /// @dev Calculates whether the provided number is even or odd.\\n /// @return 0x01 if y is an even number and 0x00 if it's odd.\\n function parity(uint256 value) private pure returns (bytes1) {\\n return bytes32(value)[31] & 0x01;\\n }\\n\\n function _gfP2Add(\\n uint256 ax,\\n uint256 ay,\\n uint256 bx,\\n uint256 by\\n ) private pure returns (uint256 x, uint256 y) {\\n x = addmod(ax, bx, p);\\n y = addmod(ay, by, p);\\n }\\n\\n function _gfP2Multiply(\\n uint256 ax,\\n uint256 ay,\\n uint256 bx,\\n uint256 by\\n ) private pure returns (uint256 x, uint256 y) {\\n x = addmod(mulmod(ax, by, p), mulmod(bx, ay, p), p);\\n y = addmod(mulmod(ay, by, p), p - mulmod(ax, bx, p), p);\\n }\\n\\n function _gfP2CubeAddTwistB(uint256 ax, uint256 ay)\\n private\\n pure\\n returns (uint256 x, uint256 y)\\n {\\n (uint256 a3x, uint256 a3y) = _gfP2Cube(ax, ay);\\n return _gfP2Add(a3x, a3y, twistBx, twistBy);\\n }\\n\\n function _gfP2Pow(\\n uint256 _ax,\\n uint256 _ay,\\n uint256 _exp\\n ) private pure returns (uint256 x, uint256 y) {\\n uint256 exp = _exp;\\n x = 0;\\n y = 1;\\n uint256 ax = _ax;\\n uint256 ay = _ay;\\n\\n // Reduce exp dividing by 2 gradually to 0 while computing final\\n // result only when exp is an odd number.\\n while (exp > 0) {\\n if (parity(exp) == 0x01) {\\n (x, y) = _gfP2Multiply(x, y, ax, ay);\\n }\\n\\n unchecked {\\n exp = exp / 2;\\n }\\n (ax, ay) = _gfP2Multiply(ax, ay, ax, ay);\\n }\\n }\\n\\n function _gfP2Square(uint256 _ax, uint256 _ay)\\n private\\n pure\\n returns (uint256 x, uint256 y)\\n {\\n return _gfP2Multiply(_ax, _ay, _ax, _ay);\\n }\\n\\n function _gfP2Cube(uint256 _ax, uint256 _ay)\\n private\\n pure\\n returns (uint256 x, uint256 y)\\n {\\n (uint256 _bx, uint256 _by) = _gfP2Square(_ax, _ay);\\n return _gfP2Multiply(_ax, _ay, _bx, _by);\\n }\\n\\n function _g2X2y(\\n uint256 xx,\\n uint256 xy,\\n uint256 yx,\\n uint256 yy\\n ) private pure returns (bool) {\\n (uint256 y2x, uint256 y2y) = _gfP2Square(yx, yy);\\n\\n return (y2x == xx && y2y == xy);\\n }\\n}\\n\",\"keccak256\":\"0x8a100028820ff5c424f4bb780fbedec1da2576fbc6d5aa4e7309d986b730a319\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BLS.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./AltBn128.sol\\\";\\n\\n/// @title BLS signatures verification\\n/// @dev Library for verification of 2-pairing-check BLS signatures, including\\n/// basic, aggregated, or reconstructed threshold BLS signatures, generated\\n/// using the AltBn128 curve.\\nlibrary BLS {\\n /// @dev Creates a signature over message using the provided secret key.\\n function sign(bytes memory message, uint256 secretKey)\\n external\\n view\\n returns (bytes memory)\\n {\\n AltBn128.G1Point memory p_1 = AltBn128.g1HashToPoint(message);\\n AltBn128.G1Point memory p_2 = AltBn128.scalarMultiply(p_1, secretKey);\\n\\n return AltBn128.g1Marshal(p_2);\\n }\\n\\n /// @dev Wraps the functionality of BLS.verify, but hashes a message to\\n /// a point on G1 and marshal to bytes first to allow raw bytes\\n /// verification.\\n function verifyBytes(\\n bytes memory publicKey,\\n bytes memory message,\\n bytes memory signature\\n ) external view returns (bool) {\\n AltBn128.G1Point memory point = AltBn128.g1HashToPoint(message);\\n bytes memory messageAsPoint = AltBn128.g1Marshal(point);\\n\\n return verify(publicKey, messageAsPoint, signature);\\n }\\n\\n /// @dev Verify performs the pairing operation to check if the signature\\n /// is correct for the provided message and the corresponding public\\n /// key. Public key must be a valid point on G2 curve in an\\n /// uncompressed format. Message must be a valid point on G1 curve in\\n /// an uncompressed format. Signature must be a valid point on G1\\n /// curve in an uncompressed format.\\n function verify(\\n bytes memory publicKey,\\n bytes memory message,\\n bytes memory signature\\n ) public view returns (bool) {\\n AltBn128.G1Point memory _signature = AltBn128.g1Unmarshal(signature);\\n\\n return\\n _verify(\\n AltBn128.g2Unmarshal(publicKey),\\n AltBn128.g1Unmarshal(message),\\n _signature\\n );\\n }\\n\\n function _verify(\\n AltBn128.G2Point memory publicKey,\\n AltBn128.G1Point memory message,\\n AltBn128.G1Point memory signature\\n ) public view returns (bool) {\\n return\\n AltBn128.pairing(\\n AltBn128.G1Point(signature.x, AltBn128.getP() - signature.y),\\n AltBn128.g2(),\\n message,\\n publicKey\\n );\\n }\\n}\\n\",\"keccak256\":\"0x08c7e739c63c31f5f45fb390695eca9e98a9525589ace41526f25060f46e43d4\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BeaconAuthorization.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\n// Initial version copied from Keep Network ECDSA Wallets:\\n// https://github.com/keep-network/keep-core/blob/5286ebc8ff99b2aa6569f9dd97fd6995f25b4630/solidity/ecdsa/contracts/libraries/EcdsaAuthorization.sol\\n//\\n// With the following differences:\\n// - functions' visibility was changed to public/external to deploy it as a linked\\n// library.\\n// - documentation was updated to be more generic.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"@threshold-network/solidity-contracts/contracts/staking/IStaking.sol\\\";\\n\\n/// @notice Library managing the state of stake authorizations for the operator\\n/// contract and the presence of operators in the sortition\\n/// pool based on the stake authorized for them.\\nlibrary BeaconAuthorization {\\n struct Parameters {\\n // The minimum authorization required by the beacon so that\\n // operator can join the sortition pool and do the work.\\n uint96 minimumAuthorization;\\n // Authorization decrease delay in seconds between the time\\n // authorization decrease is requested and the time the authorization\\n // decrease can be approved. It is always the same value, no matter if\\n // authorization decrease amount is small, significant, or if it is\\n // a decrease to zero.\\n uint64 authorizationDecreaseDelay;\\n // The time period before the authorization decrease delay end,\\n // during which the authorization decrease request can be overwritten.\\n //\\n // When the request is overwritten, the authorization decrease delay is\\n // reset.\\n //\\n // For example, if `authorizationDecraseChangePeriod` is set to 4\\n // days, `authorizationDecreaseDelay` is set to 14 days, and someone\\n // requested authorization decrease, it means they can not\\n // request another decrease for the first 10 days. After 10 days pass,\\n // they can request again and overwrite the previous authorization\\n // decrease request. The delay time will reset for them and they\\n // will have to wait another 10 days to alter it and 14 days to\\n // approve it.\\n //\\n // This value protects against malicious operators who manipulate\\n // their weight by overwriting authorization decrease request, and\\n // lowering or increasing their eligible stake this way.\\n //\\n // If set to a value equal to `authorizationDecreaseDelay, it means\\n // that authorization decrease request can be always overwritten.\\n // If set to zero, it means authorization decrease request can not be\\n // overwritten until the delay end, and one needs to wait for the entire\\n // authorization decrease delay to approve their decrease and request\\n // for another one or to overwrite the pending one.\\n //\\n // (1) authorization decrease requested timestamp\\n // (2) from this moment authorization decrease request can be\\n // overwritten\\n // (3) from this moment authorization decrease request can be\\n // approved, assuming it was NOT overwritten in (2)\\n //\\n // (1) (2) (3)\\n // --x------------------------------x--------------------------x---->\\n // | \\\\________________________/\\n // | authorizationDecreaseChangePeriod\\n // \\\\______________________________________________________/\\n // authorizationDecreaseDelay\\n //\\n uint64 authorizationDecreaseChangePeriod;\\n }\\n\\n struct AuthorizationDecrease {\\n uint96 decreasingBy; // amount\\n uint64 decreasingAt; // timestamp\\n }\\n\\n struct Data {\\n Parameters parameters;\\n mapping(address => address) stakingProviderToOperator;\\n mapping(address => address) operatorToStakingProvider;\\n mapping(address => AuthorizationDecrease) pendingDecreases;\\n }\\n\\n event OperatorRegistered(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event AuthorizationIncreased(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event AuthorizationDecreaseRequested(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount,\\n uint64 decreasingAt\\n );\\n\\n event AuthorizationDecreaseApproved(address indexed stakingProvider);\\n\\n event InvoluntaryAuthorizationDecreaseFailed(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event OperatorJoinedSortitionPool(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event OperatorStatusUpdated(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n /// @notice Updates authorization-related parameters.\\n /// @param _minimumAuthorization New value of the minimum authorization for\\n /// the beacon. Without at least the minimum authorization, staking\\n /// provider is not eligible to join and operate in the network.\\n /// @param _authorizationDecreaseDelay New value of the authorization\\n /// decrease delay. It is the time in seconds that needs to pass\\n /// between the time authorization decrease is requested and the time\\n /// the authorization decrease can be approved, no matter the\\n /// authorization decrease amount.\\n /// @param _authorizationDecreaseChangePeriod New value of the authorization\\n /// decrease change period. It is the time in seconds, before\\n /// authorization decrease delay end, during which the pending\\n /// authorization decrease request can be overwritten.\\n /// If set to 0, pending authorization decrease request can not be\\n /// overwritten until the entire `authorizationDecreaseDelay` ends.\\n /// If set to value equal `authorizationDecreaseDelay`, request can\\n /// always be overwritten.\\n function setParameters(\\n Data storage self,\\n uint96 _minimumAuthorization,\\n uint64 _authorizationDecreaseDelay,\\n uint64 _authorizationDecreaseChangePeriod\\n ) external {\\n self.parameters.minimumAuthorization = _minimumAuthorization;\\n self\\n .parameters\\n .authorizationDecreaseDelay = _authorizationDecreaseDelay;\\n self\\n .parameters\\n .authorizationDecreaseChangePeriod = _authorizationDecreaseChangePeriod;\\n }\\n\\n /// @notice Used by staking provider to set operator address that will\\n /// operate a node. The given staking provider can set operator\\n /// address only one time. The operator address can not be changed\\n /// and must be unique. Reverts if the operator is already set for\\n /// the staking provider or if the operator address is already in\\n /// use. Reverts if there is a pending authorization decrease for\\n /// the staking provider.\\n function registerOperator(Data storage self, address operator) public {\\n address stakingProvider = msg.sender;\\n\\n require(operator != address(0), \\\"Operator can not be zero address\\\");\\n require(\\n self.stakingProviderToOperator[stakingProvider] == address(0),\\n \\\"Operator already set for the staking provider\\\"\\n );\\n require(\\n self.operatorToStakingProvider[operator] == address(0),\\n \\\"Operator address already in use\\\"\\n );\\n\\n // Authorization request for a staking provider who has not yet\\n // registered their operator can be approved immediately.\\n // We need to make sure that the approval happens before operator\\n // is registered to do not let the operator join the sortition pool\\n // with an unresolved authorization decrease request that can be\\n // approved at any point.\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n require(\\n decrease.decreasingAt == 0,\\n \\\"There is a pending authorization decrease request\\\"\\n );\\n\\n emit OperatorRegistered(stakingProvider, operator);\\n\\n self.stakingProviderToOperator[stakingProvider] = operator;\\n self.operatorToStakingProvider[operator] = stakingProvider;\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorized stake amount for the given staking provider increased.\\n ///\\n /// Reverts if the authorization amount is below the minimum.\\n ///\\n /// The function is not updating the sortition pool. Sortition pool\\n /// state needs to be updated by the operator with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`.\\n ///\\n /// @dev Should only be callable by T staking contract.\\n function authorizationIncreased(\\n Data storage self,\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external {\\n require(\\n toAmount >= self.parameters.minimumAuthorization,\\n \\\"Authorization below the minimum\\\"\\n );\\n\\n // Note that this function does not require the operator address to be\\n // set for the given staking provider. This allows the stake owner\\n // who is also an authorizer to increase the authorization before the\\n // staking provider sets the operator. This allows delegating stake\\n // and increasing authorization immediately one after another without\\n // having to wait for the staking provider to do their part.\\n\\n address operator = self.stakingProviderToOperator[stakingProvider];\\n emit AuthorizationIncreased(\\n stakingProvider,\\n operator,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorization decrease for the given staking provider has been\\n /// requested.\\n ///\\n /// Reverts if the amount after deauthorization would be non-zero\\n /// and lower than the minimum authorization.\\n ///\\n /// Reverts if another authorization decrease request is pending for\\n /// the staking provider and not enough time passed since the\\n /// original request (see `authorizationDecreaseChangePeriod`).\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// it lets to `approveAuthorizationDecrease` immediately. If the\\n /// operator is known (`registerOperator` was called), the operator\\n /// needs to update state of the sortition pool with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`. After the\\n /// sortition pool state is in sync, authorization decrease delay\\n /// starts.\\n ///\\n /// After authorization decrease delay passes, authorization\\n /// decrease request needs to be approved with a call to\\n /// `approveAuthorizationDecrease` function.\\n ///\\n /// If there is a pending authorization decrease request, it is\\n /// overwritten, but only if enough time passed since the original\\n /// request. Otherwise, the function reverts.\\n ///\\n /// @dev Should only be callable by T staking contract.\\n function authorizationDecreaseRequested(\\n Data storage self,\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) public {\\n require(\\n toAmount == 0 || toAmount >= self.parameters.minimumAuthorization,\\n \\\"Authorization amount should be 0 or above the minimum\\\"\\n );\\n\\n address operator = self.stakingProviderToOperator[stakingProvider];\\n\\n uint64 decreasingAt;\\n\\n if (operator == address(0)) {\\n // Operator is not known. It means `registerOperator` was not\\n // called yet, and there is no chance the operator could\\n // call `joinSortitionPool`. We can let to approve authorization\\n // decrease immediately because that operator was never in the\\n // sortition pool.\\n\\n // solhint-disable-next-line not-rely-on-time\\n decreasingAt = uint64(block.timestamp);\\n } else {\\n // Operator is known. It means that this operator is or was in\\n // the sortition pool. Before authorization decrease delay starts,\\n // the operator needs to update the state of the sortition pool\\n // with a call to `joinSortitionPool` or `updateOperatorStatus`.\\n // For now, we set `decreasingAt` as \\\"never decreasing\\\" and let\\n // it be updated by `joinSortitionPool` or `updateOperatorStatus`\\n // once we know the sortition pool is in sync.\\n decreasingAt = type(uint64).max;\\n }\\n\\n uint96 decreasingBy = fromAmount - toAmount;\\n\\n AuthorizationDecrease storage decreaseRequest = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n uint64 pendingDecreaseAt = decreaseRequest.decreasingAt;\\n if (pendingDecreaseAt != 0 && pendingDecreaseAt != type(uint64).max) {\\n // If there is already a pending authorization decrease request for\\n // this staking provider and that request has been activated\\n // (sortition pool was updated), require enough time to pass before\\n // it can be overwritten.\\n require(\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp >=\\n pendingDecreaseAt -\\n self.parameters.authorizationDecreaseChangePeriod,\\n \\\"Not enough time passed since the original request\\\"\\n );\\n }\\n\\n decreaseRequest.decreasingBy = decreasingBy;\\n decreaseRequest.decreasingAt = decreasingAt;\\n\\n emit AuthorizationDecreaseRequested(\\n stakingProvider,\\n operator,\\n fromAmount,\\n toAmount,\\n decreasingAt\\n );\\n }\\n\\n /// @notice Approves the previously registered authorization decrease\\n /// request. Reverts if authorization decrease delay have not passed\\n /// yet or if the authorization decrease was not requested for the\\n /// given staking provider.\\n function approveAuthorizationDecrease(\\n Data storage self,\\n IStaking tokenStaking,\\n address stakingProvider\\n ) public {\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n require(\\n decrease.decreasingAt > 0,\\n \\\"Authorization decrease not requested\\\"\\n );\\n require(\\n decrease.decreasingAt != type(uint64).max,\\n \\\"Authorization decrease request not activated\\\"\\n );\\n require(\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp >= decrease.decreasingAt,\\n \\\"Authorization decrease delay not passed\\\"\\n );\\n\\n emit AuthorizationDecreaseApproved(stakingProvider);\\n\\n // slither-disable-next-line unused-return\\n tokenStaking.approveAuthorizationDecrease(stakingProvider);\\n delete self.pendingDecreases[stakingProvider];\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon the\\n /// authorization has been decreased for the given staking provider\\n /// involuntarily, as a result of slashing.\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// the function does nothing. The operator was never in a sortition\\n /// pool so there is nothing to update.\\n ///\\n /// If the operator is known, sortition pool is unlocked, and the\\n /// operator is in the sortition pool, the sortition pool state is\\n /// updated. If the sortition pool is locked, update needs to be\\n /// postponed. Every other staker is incentivized to call\\n /// `updateOperatorStatus` for the problematic operator to increase\\n /// their own rewards in the pool.\\n ///\\n /// @dev Should only be callable by T staking contract.\\n function involuntaryAuthorizationDecrease(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool,\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external {\\n address operator = self.stakingProviderToOperator[stakingProvider];\\n\\n if (operator == address(0)) {\\n // Operator is not known. It means `registerOperator` was not\\n // called yet, and there is no chance the operator could\\n // call `joinSortitionPool`. We can just ignore this update because\\n // operator was never in the sortition pool.\\n return;\\n } else {\\n // Operator is known. It means that this operator is or was in the\\n // sortition pool and the sortition pool may need to be updated.\\n //\\n // If the sortition pool is not locked and the operator is in the\\n // sortition pool, we are updating it.\\n //\\n // To keep stakes synchronized between applications when staking\\n // providers are slashed, without the risk of running out of gas,\\n // the staking contract queues up slashings and let users process\\n // the transactions. When an application slashes one or more staking\\n // providers, it adds them to the slashing queue on the staking\\n // contract. A queue entry contains the staking provider\\u2019s address\\n // and the amount they are due to be slashed.\\n //\\n // When there is at least one staking provider in the slashing\\n // queue, any account can submit a transaction processing one or\\n // more staking providers' slashings, and collecting a reward for\\n // doing so. A queued slashing is processed by updating the staking\\n // provider\\u2019s stake to the post-slashing amount, updating authorized\\n // amount for each affected application, and notifying all affected\\n // applications that the staking provider\\u2019s authorized stake has\\n // been reduced due to slashing.\\n //\\n // The entire idea is that the process transaction is expensive\\n // because each application needs to be updated, so the reward for\\n // the processor is hefty and comes from the slashed tokens.\\n // Practically, it means that if the sortition pool is unlocked, and\\n // can be updated, it should be updated because we already paid\\n // someone for updating it.\\n //\\n // If the sortition pool is locked, update needs to wait. Other\\n // sortition pool members are incentivized to call\\n // `updateOperatorStatus` for the problematic operator because they\\n // will increase their rewards this way.\\n if (sortitionPool.isOperatorInPool(operator)) {\\n if (sortitionPool.isLocked()) {\\n emit InvoluntaryAuthorizationDecreaseFailed(\\n stakingProvider,\\n operator,\\n fromAmount,\\n toAmount\\n );\\n } else {\\n updateOperatorStatus(\\n self,\\n tokenStaking,\\n sortitionPool,\\n operator\\n );\\n }\\n }\\n }\\n }\\n\\n /// @notice Lets the operator join the sortition pool. The operator address\\n /// must be known - before calling this function, it has to be\\n /// appointed by the staking provider by calling `registerOperator`.\\n /// Also, the operator must have the minimum authorization required\\n /// by the beacon. Function reverts if there is no minimum stake\\n /// authorized or if the operator is not known. If there was an\\n /// authorization decrease requested, it is activated by starting\\n /// the authorization decrease delay.\\n function joinSortitionPool(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool\\n ) public {\\n address operator = msg.sender;\\n\\n address stakingProvider = self.operatorToStakingProvider[operator];\\n require(stakingProvider != address(0), \\\"Unknown operator\\\");\\n\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n uint96 _eligibleStake = eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n decrease.decreasingBy\\n );\\n\\n require(_eligibleStake != 0, \\\"Authorization below the minimum\\\");\\n\\n emit OperatorJoinedSortitionPool(stakingProvider, operator);\\n\\n sortitionPool.insertOperator(operator, _eligibleStake);\\n\\n // If there is a pending authorization decrease request, activate it.\\n // At this point, the sortition pool state is up to date so the\\n // authorization decrease delay can start counting.\\n if (decrease.decreasingAt == type(uint64).max) {\\n decrease.decreasingAt =\\n // solhint-disable-next-line not-rely-on-time\\n uint64(block.timestamp) +\\n self.parameters.authorizationDecreaseDelay;\\n }\\n }\\n\\n /// @notice Updates status of the operator in the sortition pool. If there\\n /// was an authorization decrease requested, it is activated by\\n /// starting the authorization decrease delay.\\n /// Function reverts if the operator is not known.\\n function updateOperatorStatus(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool,\\n address operator\\n ) public {\\n address stakingProvider = self.operatorToStakingProvider[operator];\\n require(stakingProvider != address(0), \\\"Unknown operator\\\");\\n\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n emit OperatorStatusUpdated(stakingProvider, operator);\\n\\n if (sortitionPool.isOperatorInPool(operator)) {\\n uint96 _eligibleStake = eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n decrease.decreasingBy\\n );\\n\\n sortitionPool.updateOperatorStatus(operator, _eligibleStake);\\n }\\n\\n // If there is a pending authorization decrease request, activate it.\\n // At this point, the sortition pool state is up to date so the\\n // authorization decrease delay can start counting.\\n if (decrease.decreasingAt == type(uint64).max) {\\n decrease.decreasingAt =\\n // solhint-disable-next-line not-rely-on-time\\n uint64(block.timestamp) +\\n self.parameters.authorizationDecreaseDelay;\\n }\\n }\\n\\n /// @notice Checks if the operator's authorized stake is in sync with\\n /// operator's weight in the sortition pool.\\n /// If the operator is not in the sortition pool and their\\n /// authorized stake is non-zero, function returns false.\\n function isOperatorUpToDate(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool,\\n address operator\\n ) external view returns (bool) {\\n address stakingProvider = self.operatorToStakingProvider[operator];\\n require(stakingProvider != address(0), \\\"Unknown operator\\\");\\n\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n uint96 _eligibleStake = eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n decrease.decreasingBy\\n );\\n\\n if (!sortitionPool.isOperatorInPool(operator)) {\\n return _eligibleStake == 0;\\n } else {\\n return sortitionPool.isOperatorUpToDate(operator, _eligibleStake);\\n }\\n }\\n\\n /// @notice Returns the current value of the staking provider's eligible\\n /// stake. Eligible stake is defined as the currently authorized\\n /// stake minus the pending authorization decrease. Eligible stake\\n /// is what is used for operator's weight in the pool. If the\\n /// authorized stake minus the pending authorization decrease is\\n /// below the minimum authorization, eligible stake is 0.\\n /// @dev This function can be exposed to the public in contrast to the\\n /// second variant accepting `decreasingBy` as a parameter.\\n function eligibleStake(\\n Data storage self,\\n IStaking tokenStaking,\\n address stakingProvider\\n ) external view returns (uint96) {\\n return\\n eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n pendingAuthorizationDecrease(self, stakingProvider)\\n );\\n }\\n\\n /// @notice Returns the current value of the staking provider's eligible\\n /// stake. Eligible stake is defined as the currently authorized\\n /// stake minus the pending authorization decrease. Eligible stake\\n /// is what is used for operator's weight in the pool. If the\\n /// authorized stake minus the pending authorization decrease is\\n /// below the minimum authorization, eligible stake is 0.\\n /// @dev This function is not intended to be exposes to the public.\\n /// `decreasingBy` must be fetched from `pendingDecreases` mapping and\\n /// it is passed as a parameter to optimize gas usage of functions that\\n /// call `eligibleStake` and need to use `AuthorizationDecrease`\\n /// fetched from `pendingDecreases` for some additional logic.\\n function eligibleStake(\\n Data storage self,\\n IStaking tokenStaking,\\n address stakingProvider,\\n uint96 decreasingBy\\n ) public view returns (uint96) {\\n uint96 authorizedStake = tokenStaking.authorizedStake(\\n stakingProvider,\\n address(this)\\n );\\n\\n uint96 _eligibleStake = authorizedStake > decreasingBy\\n ? authorizedStake - decreasingBy\\n : 0;\\n\\n if (_eligibleStake < self.parameters.minimumAuthorization) {\\n return 0;\\n } else {\\n return _eligibleStake;\\n }\\n }\\n\\n /// @notice Returns the amount of stake that is pending authorization\\n /// decrease for the given staking provider. If no authorization\\n /// decrease has been requested, returns zero.\\n function pendingAuthorizationDecrease(\\n Data storage self,\\n address stakingProvider\\n ) public view returns (uint96) {\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n return decrease.decreasingBy;\\n }\\n\\n /// @notice Returns the remaining time in seconds that needs to pass before\\n /// the requested authorization decrease can be approved.\\n /// If the sortition pool state was not updated yet by the operator\\n /// after requesting the authorization decrease, returns\\n /// `type(uint64).max`.\\n function remainingAuthorizationDecreaseDelay(\\n Data storage self,\\n address stakingProvider\\n ) external view returns (uint64) {\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n if (decrease.decreasingAt == type(uint64).max) {\\n return type(uint64).max;\\n }\\n\\n // solhint-disable-next-line not-rely-on-time\\n uint64 _now = uint64(block.timestamp);\\n return _now > decrease.decreasingAt ? 0 : decrease.decreasingAt - _now;\\n }\\n}\\n\",\"keccak256\":\"0xe146f4a3c662e971317d0189b2fca613f9f83a163ef682ed1e536e6c1f919a08\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BeaconDkg.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"./BytesLib.sol\\\";\\nimport {BeaconDkgValidator as DKGValidator} from \\\"../BeaconDkgValidator.sol\\\";\\n\\nlibrary BeaconDkg {\\n using BytesLib for bytes;\\n using ECDSA for bytes32;\\n\\n struct Parameters {\\n // Time in blocks during which a submitted result can be challenged.\\n uint256 resultChallengePeriodLength;\\n // Extra gas required to be left at the end of the challenge DKG result\\n // transaction.\\n uint256 resultChallengeExtraGas;\\n // Time in blocks during which a result is expected to be submitted.\\n uint256 resultSubmissionTimeout;\\n // Time in blocks during which only the result submitter is allowed to\\n // approve it. Once this period ends and the submitter have not approved\\n // the result, anyone can do it.\\n uint256 submitterPrecedencePeriodLength;\\n }\\n\\n struct Data {\\n // Address of the Sortition Pool contract.\\n SortitionPool sortitionPool;\\n // Address of the DKGValidator contract.\\n DKGValidator dkgValidator;\\n // DKG parameters. The parameters should persist between DKG executions.\\n // They should be updated with dedicated set functions only when DKG is not\\n // in progress.\\n Parameters parameters;\\n // Time in blocks at which DKG started.\\n uint256 startBlock;\\n // Seed used to start DKG.\\n uint256 seed;\\n // Time in blocks that should be added to result submission period calculation.\\n // It is used in case of a challenge to adjust DKG timeout calculation.\\n uint256 resultSubmissionStartBlockOffset;\\n // Hash of submitted DKG result.\\n bytes32 submittedResultHash;\\n // Block number from the moment of the DKG result submission.\\n uint256 submittedResultBlock;\\n }\\n\\n /// @notice DKG result.\\n struct Result {\\n // Claimed submitter candidate group member index.\\n // Must be in range [1, groupSize].\\n uint256 submitterMemberIndex;\\n // Generated candidate group public key\\n bytes groupPubKey;\\n // Array of misbehaved members indices (disqualified or inactive).\\n // Indices must be in range [1, groupSize], unique, and sorted in ascending\\n // order.\\n uint8[] misbehavedMembersIndices;\\n // Concatenation of signatures from members supporting the result.\\n // The message to be signed by each member is keccak256 hash of the\\n // calculated group public key, misbehaved members indices and DKG\\n // start block. The calculated hash should be prefixed with prefixed with\\n // `\\\\x19Ethereum signed message:\\\\n` before signing, so the message to\\n // sign is:\\n // `\\\\x19Ethereum signed message:\\\\n${keccak256(\\n // groupPubKey, misbehavedMembersIndices, dkgStartBlock\\n // )}`\\n bytes signatures;\\n // Indices of members corresponding to each signature. Indices must be\\n // be in range [1, groupSize], unique, and sorted in ascending order.\\n uint256[] signingMembersIndices;\\n // Identifiers of candidate group members as outputted by the group\\n // selection protocol.\\n uint32[] members;\\n // Keccak256 hash of group members identifiers that actively took part\\n // in DKG (excluding IA/DQ members).\\n bytes32 membersHash;\\n }\\n\\n /// @notice States for phases of group creation. The states doesn't include\\n /// timeouts which should be tracked and notified individually.\\n enum State {\\n // Group creation is not in progress. It is a state set after group creation\\n // completion either by timeout or by a result approval.\\n IDLE,\\n // Group creation is awaiting the seed and sortition pool is locked.\\n AWAITING_SEED,\\n // Off-chain DKG protocol execution is in progress. A result is being calculated\\n // by the clients in this state. It's not yet possible to submit the result.\\n KEY_GENERATION,\\n // After off-chain DKG protocol execution the contract awaits result submission.\\n // This is a state to which group creation returns in case of a result\\n // challenge notification.\\n AWAITING_RESULT,\\n // DKG result was submitted and awaits an approval or a challenge. If a result\\n // gets challenge the state returns to `AWAITING_RESULT`. If a result gets\\n // approval the state changes to `IDLE`.\\n CHALLENGE\\n }\\n\\n /// @dev Size of a group in the threshold relay.\\n uint256 public constant groupSize = 64;\\n\\n /// @notice Time in blocks after which DKG result is complete and ready to be\\n // published by clients.\\n uint256 public constant offchainDkgTime = 5 * (1 + 5) + 2 * (1 + 10) + 20;\\n\\n event DkgStarted(uint256 indexed seed);\\n\\n // To recreate the members that actively took part in dkg, the selected members\\n // array should be filtered out from misbehavedMembersIndices.\\n event DkgResultSubmitted(\\n bytes32 indexed resultHash,\\n uint256 indexed seed,\\n Result result\\n );\\n\\n event DkgTimedOut();\\n\\n event DkgResultApproved(\\n bytes32 indexed resultHash,\\n address indexed approver\\n );\\n\\n event DkgResultChallenged(\\n bytes32 indexed resultHash,\\n address indexed challenger,\\n string reason\\n );\\n\\n event DkgStateLocked();\\n\\n event DkgSeedTimedOut();\\n\\n /// @notice Initializes SortitionPool and DKGValidator addresses.\\n /// Can be performed only once.\\n /// @param _sortitionPool Sortition Pool reference\\n /// @param _dkgValidator DKGValidator reference\\n function init(\\n Data storage self,\\n SortitionPool _sortitionPool,\\n DKGValidator _dkgValidator\\n ) internal {\\n require(\\n address(self.sortitionPool) == address(0),\\n \\\"Sortition Pool address already set\\\"\\n );\\n\\n require(\\n address(self.dkgValidator) == address(0),\\n \\\"DKG Validator address already set\\\"\\n );\\n\\n self.sortitionPool = _sortitionPool;\\n self.dkgValidator = _dkgValidator;\\n }\\n\\n /// @notice Determines the current state of group creation. It doesn't take\\n /// timeouts into consideration. The timeouts should be tracked and\\n /// notified separately.\\n function currentState(Data storage self)\\n internal\\n view\\n returns (State state)\\n {\\n state = State.IDLE;\\n\\n if (self.sortitionPool.isLocked()) {\\n state = State.AWAITING_SEED;\\n\\n if (self.startBlock > 0) {\\n state = State.KEY_GENERATION;\\n\\n if (block.number > self.startBlock + offchainDkgTime) {\\n state = State.AWAITING_RESULT;\\n\\n if (self.submittedResultBlock > 0) {\\n state = State.CHALLENGE;\\n }\\n }\\n }\\n }\\n }\\n\\n /// @notice Locks the sortition pool and starts awaiting for the\\n /// group creation seed.\\n function lockState(Data storage self) internal {\\n require(currentState(self) == State.IDLE, \\\"Current state is not IDLE\\\");\\n\\n emit DkgStateLocked();\\n\\n self.sortitionPool.lock();\\n }\\n\\n function start(Data storage self, uint256 seed) internal {\\n require(\\n currentState(self) == State.AWAITING_SEED,\\n \\\"Current state is not AWAITING_SEED\\\"\\n );\\n\\n emit DkgStarted(seed);\\n\\n self.startBlock = block.number;\\n self.seed = seed;\\n }\\n\\n /// @notice Allows to submit a DKG result. The submitted result does not go\\n /// through a validation and before it gets accepted, it needs to\\n /// wait through the challenge period during which everyone has\\n /// a chance to challenge the result as invalid one. Submitter of\\n /// the result needs to be in the sortition pool and if the result\\n /// gets challenged, the submitter will get slashed.\\n function submitResult(Data storage self, Result calldata result) external {\\n require(\\n currentState(self) == State.AWAITING_RESULT,\\n \\\"Current state is not AWAITING_RESULT\\\"\\n );\\n require(!hasDkgTimedOut(self), \\\"DKG timeout already passed\\\");\\n\\n SortitionPool sortitionPool = self.sortitionPool;\\n\\n // Submitter must be an operator in the sortition pool.\\n // Declared submitter's member index in the DKG result needs to match\\n // the address calling this function.\\n require(\\n sortitionPool.isOperatorInPool(msg.sender),\\n \\\"Submitter not in the sortition pool\\\"\\n );\\n require(\\n sortitionPool.getIDOperator(\\n result.members[result.submitterMemberIndex - 1]\\n ) == msg.sender,\\n \\\"Unexpected submitter index\\\"\\n );\\n\\n self.submittedResultHash = keccak256(abi.encode(result));\\n self.submittedResultBlock = block.number;\\n\\n emit DkgResultSubmitted(self.submittedResultHash, self.seed, result);\\n }\\n\\n /// @notice Checks if DKG timed out. The DKG timeout period includes time required\\n /// for off-chain protocol execution and time for the result publication.\\n /// After this time a result cannot be submitted and DKG can be notified\\n /// about the timeout. DKG period is adjusted by result submission\\n /// offset that include blocks that were mined while invalid result\\n /// has been registered until it got challenged.\\n /// @return True if DKG timed out, false otherwise.\\n function hasDkgTimedOut(Data storage self) internal view returns (bool) {\\n return\\n currentState(self) == State.AWAITING_RESULT &&\\n block.number >\\n (self.startBlock +\\n offchainDkgTime +\\n self.resultSubmissionStartBlockOffset +\\n self.parameters.resultSubmissionTimeout);\\n }\\n\\n /// @notice Notifies about DKG timeout.\\n function notifyTimeout(Data storage self) internal {\\n require(hasDkgTimedOut(self), \\\"DKG has not timed out\\\");\\n\\n emit DkgTimedOut();\\n\\n complete(self);\\n }\\n\\n /// @notice Notifies about the seed was not delivered and restores the\\n /// initial DKG state (IDLE).\\n function notifySeedTimedOut(Data storage self) internal {\\n require(\\n currentState(self) == State.AWAITING_SEED,\\n \\\"Current state is not AWAITING_SEED\\\"\\n );\\n\\n emit DkgSeedTimedOut();\\n\\n complete(self);\\n }\\n\\n /// @notice Approves DKG result. Can be called when the challenge period for\\n /// the submitted result is finished. Considers the submitted result\\n /// as valid. For the first `submitterPrecedencePeriodLength`\\n /// blocks after the end of the challenge period can be called only\\n /// by the DKG result submitter. After that time, can be called by\\n /// anyone.\\n /// @dev Can be called after a challenge period for the submitted result.\\n /// @param result Result to approve. Must match the submitted result stored\\n /// during `submitResult`.\\n /// @return misbehavedMembers Identifiers of members who misbehaved during DKG.\\n function approveResult(Data storage self, Result calldata result)\\n external\\n returns (uint32[] memory misbehavedMembers)\\n {\\n require(\\n currentState(self) == State.CHALLENGE,\\n \\\"Current state is not CHALLENGE\\\"\\n );\\n\\n uint256 challengePeriodEnd = self.submittedResultBlock +\\n self.parameters.resultChallengePeriodLength;\\n\\n require(\\n block.number > challengePeriodEnd,\\n \\\"Challenge period has not passed yet\\\"\\n );\\n\\n require(\\n keccak256(abi.encode(result)) == self.submittedResultHash,\\n \\\"Result under approval is different than the submitted one\\\"\\n );\\n\\n // Extract submitter member address. Submitter member index is in\\n // range [1, groupSize] so we need to -1 when fetching identifier from members\\n // array.\\n address submitterMember = self.sortitionPool.getIDOperator(\\n result.members[result.submitterMemberIndex - 1]\\n );\\n\\n require(\\n msg.sender == submitterMember ||\\n block.number >\\n challengePeriodEnd +\\n self.parameters.submitterPrecedencePeriodLength,\\n \\\"Only the DKG result submitter can approve the result at this moment\\\"\\n );\\n\\n // Extract misbehaved members identifiers. Misbehaved members indices\\n // are in range [1, groupSize], so we need to -1 when fetching identifiers from\\n // members array.\\n misbehavedMembers = new uint32[](\\n result.misbehavedMembersIndices.length\\n );\\n for (uint256 i = 0; i < result.misbehavedMembersIndices.length; i++) {\\n misbehavedMembers[i] = result.members[\\n result.misbehavedMembersIndices[i] - 1\\n ];\\n }\\n\\n emit DkgResultApproved(self.submittedResultHash, msg.sender);\\n\\n return misbehavedMembers;\\n }\\n\\n /// @notice Challenges DKG result. If the submitted result is proved to be\\n /// invalid it reverts the DKG back to the result submission phase.\\n /// @dev Can be called during a challenge period for the submitted result.\\n /// @param result Result to challenge. Must match the submitted result\\n /// stored during `submitResult`.\\n /// @return maliciousResultHash Hash of the malicious result.\\n /// @return maliciousSubmitter Identifier of the malicious submitter.\\n function challengeResult(Data storage self, Result calldata result)\\n external\\n returns (bytes32 maliciousResultHash, uint32 maliciousSubmitter)\\n {\\n require(\\n currentState(self) == State.CHALLENGE,\\n \\\"Current state is not CHALLENGE\\\"\\n );\\n\\n require(\\n block.number <=\\n self.submittedResultBlock +\\n self.parameters.resultChallengePeriodLength,\\n \\\"Challenge period has already passed\\\"\\n );\\n\\n require(\\n keccak256(abi.encode(result)) == self.submittedResultHash,\\n \\\"Result under challenge is different than the submitted one\\\"\\n );\\n\\n // https://github.com/crytic/slither/issues/982\\n // slither-disable-next-line unused-return\\n try\\n self.dkgValidator.validate(result, self.seed, self.startBlock)\\n returns (\\n // slither-disable-next-line uninitialized-local,variable-scope\\n bool isValid,\\n // slither-disable-next-line uninitialized-local,variable-scope\\n string memory errorMsg\\n ) {\\n if (isValid) {\\n revert(\\\"unjustified challenge\\\");\\n }\\n\\n emit DkgResultChallenged(\\n self.submittedResultHash,\\n msg.sender,\\n errorMsg\\n );\\n } catch {\\n // if the validation reverted we consider the DKG result as invalid\\n emit DkgResultChallenged(\\n self.submittedResultHash,\\n msg.sender,\\n \\\"validation reverted\\\"\\n );\\n }\\n\\n // Consider result hash as malicious.\\n maliciousResultHash = self.submittedResultHash;\\n maliciousSubmitter = result.members[result.submitterMemberIndex - 1];\\n\\n // Adjust DKG result submission block start, so submission stage starts\\n // from the beginning.\\n self.resultSubmissionStartBlockOffset =\\n block.number -\\n self.startBlock -\\n offchainDkgTime;\\n\\n submittedResultCleanup(self);\\n\\n return (maliciousResultHash, maliciousSubmitter);\\n }\\n\\n /// @notice Due to EIP150, 1/64 of the gas is not forwarded to the call, and\\n /// will be kept to execute the remaining operations in the function\\n /// after the call inside the try-catch.\\n ///\\n /// To ensure there is no way for the caller to manipulate gas limit\\n /// in such a way that the call inside try-catch fails with out-of-gas\\n /// and the rest of the function is executed with the remaining\\n /// 1/64 of gas, we require an extra gas amount to be left at the\\n /// end of the call to the function challenging DKG result and\\n /// wrapping the call to BeaconDkgValidator and TokenStaking\\n /// contracts inside a try-catch.\\n function requireChallengeExtraGas(Data storage self) internal view {\\n require(\\n gasleft() >= self.parameters.resultChallengeExtraGas,\\n \\\"Not enough extra gas left\\\"\\n );\\n }\\n\\n /// @notice Updates DKG-related parameters\\n /// @param _resultChallengePeriodLength New value of the result challenge\\n /// period length. It is the number of blocks for which a DKG result\\n /// can be challenged.\\n /// @param _resultChallengeExtraGas New value of the result challenge extra\\n /// gas. It is the extra gas required to be left at the end of the\\n /// challenge DKG result transaction.\\n /// @param _resultSubmissionTimeout New value of the result submission\\n /// timeout in seconds. It is a timeout for a group to provide a DKG\\n /// result.\\n /// @param _submitterPrecedencePeriodLength New value of the submitter\\n /// precedence period length in blocks. It is the time during which\\n /// only the original DKG result submitter can approve it.\\n function setParameters(\\n Data storage self,\\n uint256 _resultChallengePeriodLength,\\n uint256 _resultChallengeExtraGas,\\n uint256 _resultSubmissionTimeout,\\n uint256 _submitterPrecedencePeriodLength\\n ) internal {\\n require(currentState(self) == State.IDLE, \\\"Current state is not IDLE\\\");\\n\\n require(\\n _resultChallengePeriodLength > 0,\\n \\\"Result challenge period length should be greater than zero\\\"\\n );\\n require(\\n _resultSubmissionTimeout > 0,\\n \\\"Result submission timeout should be greater than zero\\\"\\n );\\n require(\\n _submitterPrecedencePeriodLength < _resultSubmissionTimeout,\\n \\\"Submitter precedence period length should be less than the result submission timeout\\\"\\n );\\n\\n self\\n .parameters\\n .resultChallengePeriodLength = _resultChallengePeriodLength;\\n self.parameters.resultChallengeExtraGas = _resultChallengeExtraGas;\\n self.parameters.resultSubmissionTimeout = _resultSubmissionTimeout;\\n self\\n .parameters\\n .submitterPrecedencePeriodLength = _submitterPrecedencePeriodLength;\\n }\\n\\n /// @notice Completes DKG by cleaning up state.\\n /// @dev Should be called after DKG times out or a result is approved.\\n function complete(Data storage self) internal {\\n delete self.startBlock;\\n delete self.seed;\\n delete self.resultSubmissionStartBlockOffset;\\n submittedResultCleanup(self);\\n self.sortitionPool.unlock();\\n }\\n\\n /// @notice Cleans up submitted result state either after DKG completion\\n /// (as part of `complete` method) or after justified challenge.\\n function submittedResultCleanup(Data storage self) private {\\n delete self.submittedResultHash;\\n delete self.submittedResultBlock;\\n }\\n}\\n\",\"keccak256\":\"0x86bea35ab775ec969bc91208305f6f85aa9dd49bb74f8e57e7d453797e8ad98e\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BeaconInactivity.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./BytesLib.sol\\\";\\nimport \\\"./Groups.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\n\\nlibrary BeaconInactivity {\\n using BytesLib for bytes;\\n using ECDSA for bytes32;\\n\\n struct Claim {\\n // ID of the group raising the inactivity claim.\\n uint64 groupId;\\n // Indices of members accused of being inactive. Indices must be in\\n // range [1, groupMembers.length], unique, and sorted in ascending order.\\n uint256[] inactiveMembersIndices;\\n // Concatenation of signatures from members supporting the claim.\\n // The message to be signed by each member is keccak256 hash of the\\n // concatenation of the chain ID, inactivity claim nonce for the given\\n // group, group public key, and inactive members indices. The calculated\\n // hash should be prefixed with `\\\\x19Ethereum signed message:\\\\n` before\\n // signing, so the message to sign is:\\n // `\\\\x19Ethereum signed message:\\\\n${keccak256(\\n // chainID | nonce | groupPubKey | inactiveMembersIndices\\n // )}`\\n bytes signatures;\\n // Indices of members corresponding to each signature. Indices must be\\n // in range [1, groupMembers.length], unique, and sorted in ascending\\n // order.\\n uint256[] signingMembersIndices;\\n }\\n\\n /// @notice The minimum number of group members needed to interact according\\n /// to the protocol to produce a valid inactivity claim.\\n uint256 public constant groupThreshold = 33;\\n\\n /// @notice Size in bytes of a single signature produced by member\\n /// supporting the inactivity claim.\\n uint256 public constant signatureByteSize = 65;\\n\\n /// @notice Verifies the inactivity claim according to the rules defined in\\n /// `Claim` struct documentation. Reverts if verification fails.\\n /// @dev Group members hash is validated upstream in\\n /// RandomBeacon.notifyOperatorInactivity()\\n /// @param sortitionPool Sortition pool reference\\n /// @param claim Inactivity claim\\n /// @param groupPubKey Public key of the group raising the claim\\n /// @param nonce Current nonce for group used in the claim\\n /// @param groupMembers Identifiers of group members\\n /// @return inactiveMembers Identifiers of members who are inactive\\n function verifyClaim(\\n SortitionPool sortitionPool,\\n Claim calldata claim,\\n bytes memory groupPubKey,\\n uint256 nonce,\\n uint32[] calldata groupMembers\\n ) external view returns (uint32[] memory inactiveMembers) {\\n // Validate inactive members indices. Maximum indices count is equal to\\n // the group size and is not limited deliberately to leave a theoretical\\n // possibility to accuse more members than `groupSize - groupThreshold`.\\n validateMembersIndices(\\n claim.inactiveMembersIndices,\\n groupMembers.length\\n );\\n\\n // Validate signatures array is properly formed and number of\\n // signatures and signers is correct.\\n uint256 signaturesCount = claim.signatures.length / signatureByteSize;\\n require(claim.signatures.length != 0, \\\"No signatures provided\\\");\\n require(\\n claim.signatures.length % signatureByteSize == 0,\\n \\\"Malformed signatures array\\\"\\n );\\n require(\\n signaturesCount == claim.signingMembersIndices.length,\\n \\\"Unexpected signatures count\\\"\\n );\\n require(signaturesCount >= groupThreshold, \\\"Too few signatures\\\");\\n require(signaturesCount <= groupMembers.length, \\\"Too many signatures\\\");\\n\\n // Validate signing members indices. Note that `signingMembersIndices`\\n // were already partially validated during `signatures` parameter\\n // validation.\\n validateMembersIndices(\\n claim.signingMembersIndices,\\n groupMembers.length\\n );\\n\\n // Usage of group public key and not group ID is important because it\\n // provides uniqueness of signed messages and prevent against reusing\\n // them in future in case some other application has a group with the\\n // same ID and subset of members.\\n bytes32 signedMessageHash = keccak256(\\n abi.encode(\\n block.chainid,\\n nonce,\\n groupPubKey,\\n claim.inactiveMembersIndices\\n )\\n ).toEthSignedMessageHash();\\n\\n address[] memory groupMembersAddresses = sortitionPool.getIDOperators(\\n groupMembers\\n );\\n\\n // Verify each signature.\\n bytes memory checkedSignature;\\n bool senderSignatureExists = false;\\n for (uint256 i = 0; i < signaturesCount; i++) {\\n uint256 memberIndex = claim.signingMembersIndices[i];\\n checkedSignature = claim.signatures.slice(\\n signatureByteSize * i,\\n signatureByteSize\\n );\\n address recoveredAddress = signedMessageHash.recover(\\n checkedSignature\\n );\\n\\n require(\\n groupMembersAddresses[memberIndex - 1] == recoveredAddress,\\n \\\"Invalid signature\\\"\\n );\\n\\n if (!senderSignatureExists && msg.sender == recoveredAddress) {\\n senderSignatureExists = true;\\n }\\n }\\n\\n require(senderSignatureExists, \\\"Sender must be claim signer\\\");\\n\\n inactiveMembers = new uint32[](claim.inactiveMembersIndices.length);\\n for (uint256 i = 0; i < claim.inactiveMembersIndices.length; i++) {\\n uint256 memberIndex = claim.inactiveMembersIndices[i];\\n inactiveMembers[i] = groupMembers[memberIndex - 1];\\n }\\n\\n return inactiveMembers;\\n }\\n\\n /// @notice Validates members indices array. Array is considered valid\\n /// if its size and each single index are in [1, groupSize] range,\\n /// indexes are unique, and sorted in an ascending order.\\n /// Reverts if validation fails.\\n /// @param indices Array to validate\\n /// @param groupSize Group size used as reference\\n function validateMembersIndices(\\n uint256[] calldata indices,\\n uint256 groupSize\\n ) internal pure {\\n require(\\n indices.length > 0 && indices.length <= groupSize,\\n \\\"Corrupted members indices\\\"\\n );\\n\\n // Check if first and last indices are in range [1, groupSize].\\n // This check combined with the loop below makes sure every single\\n // index is in the correct range.\\n require(\\n indices[0] > 0 && indices[indices.length - 1] <= groupSize,\\n \\\"Corrupted members indices\\\"\\n );\\n\\n for (uint256 i = 0; i < indices.length - 1; i++) {\\n // Check whether given index is smaller than the next one. This\\n // way we are sure indexes are ordered in the ascending order\\n // and there are no duplicates.\\n require(indices[i] < indices[i + 1], \\\"Corrupted members indices\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8dffb20eb4ffd2e388080c5fbcb648e33480aca3dab4be2254cf30c5e72413bf\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BytesLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\n/*\\nVersion pulled from keep-core v1:\\nhttps://github.com/keep-network/keep-core/blob/f297202db00c027978ad8e7103a356503de5773c/solidity-v1/contracts/utils/BytesLib.sol\\n\\nTo compile it with solidity 0.8 `_preBytes_slot` was replaced with `_preBytes.slot`.\\n*/\\n\\n/*\\nhttps://github.com/GNSPS/solidity-bytes-utils/\\nThis is free and unencumbered software released into the public domain.\\nAnyone is free to copy, modify, publish, use, compile, sell, or\\ndistribute this software, either in source code form or as a compiled\\nbinary, for any purpose, commercial or non-commercial, and by any\\nmeans.\\nIn jurisdictions that recognize copyright laws, the author or authors\\nof this software dedicate any and all copyright interest in the\\nsoftware to the public domain. We make this dedication for the benefit\\nof the public at large and to the detriment of our heirs and\\nsuccessors. We intend this dedication to be an overt act of\\nrelinquishment in perpetuity of all present and future rights to this\\nsoftware under copyright law.\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND,\\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\\nOTHER DEALINGS IN THE SOFTWARE.\\nFor more information, please refer to <https://unlicense.org>\\n*/\\n\\n/** @title BytesLib **/\\n/** @author https://github.com/GNSPS **/\\n\\nlibrary BytesLib {\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes)\\n internal\\n {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(\\n and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),\\n 2\\n )\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(\\n fslot,\\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\\n ),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes)\\n internal\\n view\\n returns (bool)\\n {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(\\n and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),\\n 2\\n )\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n for {\\n\\n } eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function concat(bytes memory _preBytes, bytes memory _postBytes)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(\\n 0x40,\\n and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n )\\n )\\n }\\n\\n return tempBytes;\\n }\\n\\n function slice(\\n bytes memory _bytes,\\n uint256 _start,\\n uint256 _length\\n ) internal pure returns (bytes memory res) {\\n uint256 _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n // Alloc bytes array with additional 32 bytes afterspace and assign it's size\\n res := mload(0x40)\\n mstore(0x40, add(add(res, 64), _length))\\n mstore(res, _length)\\n\\n // Compute distance between source and destination pointers\\n let diff := sub(res, add(_bytes, _start))\\n\\n for {\\n let src := add(add(_bytes, 32), _start)\\n let end := add(src, _length)\\n } lt(src, end) {\\n src := add(src, 32)\\n } {\\n mstore(add(src, diff), mload(src))\\n }\\n }\\n }\\n\\n function toAddress(bytes memory _bytes, uint256 _start)\\n internal\\n pure\\n returns (address)\\n {\\n uint256 _totalLen = _start + 20;\\n require(\\n _totalLen > _start && _bytes.length >= _totalLen,\\n \\\"Address conversion out of bounds.\\\"\\n );\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(\\n mload(add(add(_bytes, 0x20), _start)),\\n 0x1000000000000000000000000\\n )\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint8(bytes memory _bytes, uint256 _start)\\n internal\\n pure\\n returns (uint8)\\n {\\n require(\\n _bytes.length >= (_start + 1),\\n \\\"Uint8 conversion out of bounds.\\\"\\n );\\n uint8 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x1), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint(bytes memory _bytes, uint256 _start)\\n internal\\n pure\\n returns (uint256)\\n {\\n uint256 _totalLen = _start + 32;\\n require(\\n _totalLen > _start && _bytes.length >= _totalLen,\\n \\\"Uint conversion out of bounds.\\\"\\n );\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes)\\n internal\\n pure\\n returns (bool)\\n {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function toBytes32(bytes memory _source)\\n internal\\n pure\\n returns (bytes32 result)\\n {\\n if (_source.length == 0) {\\n return 0x0;\\n }\\n\\n assembly {\\n result := mload(add(_source, 32))\\n }\\n }\\n\\n function keccak256Slice(\\n bytes memory _bytes,\\n uint256 _start,\\n uint256 _length\\n ) internal pure returns (bytes32 result) {\\n uint256 _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n result := keccak256(add(add(_bytes, 32), _start), _length)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b76e2fe36eb777440250dcf2ea7a689375e8af22f3cc33521095ff6954becdb\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/Callback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"../api/IRandomBeaconConsumer.sol\\\";\\n\\n/// @title Callback library\\n/// @dev Library for handling calls to random beacon consumer.\\nlibrary Callback {\\n struct Data {\\n IRandomBeaconConsumer callbackContract;\\n }\\n\\n event CallbackFailed(uint256 entry, uint256 entrySubmittedBlock);\\n\\n /// @notice Sets callback contract.\\n /// @param callbackContract Callback contract.\\n function setCallbackContract(\\n Data storage self,\\n IRandomBeaconConsumer callbackContract\\n ) internal {\\n self.callbackContract = callbackContract;\\n }\\n\\n /// @notice Executes consumer specified callback for the relay entry request.\\n /// @param entry The generated random number.\\n /// @param callbackGasLimit Callback gas limit.\\n function executeCallback(\\n Data storage self,\\n uint256 entry,\\n uint256 callbackGasLimit\\n ) internal {\\n if (address(self.callbackContract) != address(0)) {\\n try\\n self.callbackContract.__beaconCallback{gas: callbackGasLimit}(\\n entry,\\n block.number\\n )\\n {} catch {\\n // slither-disable-next-line reentrancy-events\\n emit CallbackFailed(entry, block.number);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x258d635d74d8906c73d1c2d0929f033c7e548cdaf9c9a71a7e82b4ab70e5ad29\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/Groups.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\n/// @notice This library is used as a registry of created groups.\\n/// @dev This library should be used along with DKG library that ensures linear\\n/// groups creation (only one group creation happens at a time). A candidate\\n/// group has to be popped or activated before adding a new candidate group.\\nlibrary Groups {\\n struct Group {\\n bytes groupPubKey;\\n uint256 registrationBlockNumber;\\n // Keccak256 hash of group members identifiers array. Group members do not\\n // include operators selected by the sortition pool that misbehaved during DKG.\\n // See how `misbehavedMembersIndices` are used in `hashGroupMembers` function.\\n bytes32 membersHash;\\n // When selected group does not create a relay entry on-time it should\\n // be marked as terminated.\\n bool terminated;\\n }\\n\\n struct Data {\\n // Mapping of keccak256 hashes of group public keys to groups details.\\n mapping(bytes32 => Group) groupsData;\\n // Holds keccak256 hashes of group public keys in the order of registration.\\n bytes32[] groupsRegistry;\\n // Group ids that were active but failed creating a relay entry. When an\\n // active-terminated group qualifies to become 'expired', then it will\\n // be removed from this array.\\n uint64[] activeTerminatedGroups;\\n // Points to the first active group, it is also the expired groups counter.\\n uint64 expiredGroupOffset;\\n // Group lifetime in blocks. When a group reached its lifetime, it\\n // is no longer selected for new relay requests but may still be\\n // responsible for submitting relay entry if relay request assigned\\n // to that group is still pending.\\n uint256 groupLifetime;\\n }\\n\\n event GroupRegistered(uint64 indexed groupId, bytes indexed groupPubKey);\\n\\n /// @notice Performs preliminary validation of a new group public key.\\n /// The group public key must be unique and have 128 bytes in length.\\n /// If the validation fails, the function reverts. This function\\n /// must be called first for a public key of a group added with\\n /// `addGroup` function.\\n /// @param groupPubKey Candidate group public key\\n function validatePublicKey(Data storage self, bytes calldata groupPubKey)\\n internal\\n view\\n {\\n require(groupPubKey.length == 128, \\\"Invalid length of the public key\\\");\\n\\n bytes32 groupPubKeyHash = keccak256(groupPubKey);\\n\\n require(\\n self.groupsData[groupPubKeyHash].registrationBlockNumber == 0,\\n \\\"Group with this public key was already registered\\\"\\n );\\n }\\n\\n /// @notice Adds a new candidate group. The group is stored with group public\\n /// key and group members, but is not yet activated.\\n /// @dev The group members list is stored with all misbehaved members filtered out.\\n /// The code calling this function should ensure that the number of\\n /// candidate (not activated) groups is never more than one.\\n /// @param groupPubKey Generated candidate group public key\\n /// @param membersHash Keccak256 hash of members that actively took part in DKG.\\n function addGroup(\\n Data storage self,\\n bytes calldata groupPubKey,\\n bytes32 membersHash\\n ) internal {\\n bytes32 groupPubKeyHash = keccak256(groupPubKey);\\n\\n // We use group from storage that is assumed to be a struct set to the\\n // default values. We need to remember to overwrite fields in case a\\n // candidate group was already registered before and popped.\\n Group storage group = self.groupsData[groupPubKeyHash];\\n group.groupPubKey = groupPubKey;\\n group.membersHash = membersHash;\\n group.registrationBlockNumber = block.number;\\n\\n self.groupsRegistry.push(groupPubKeyHash);\\n\\n emit GroupRegistered(\\n uint64(self.groupsRegistry.length - 1),\\n groupPubKey\\n );\\n }\\n\\n /// @notice Goes through groups starting from the oldest one that is still\\n /// active and checks if it hasn't expired. If so, updates the information\\n /// about expired groups so that all expired groups are marked as such.\\n function expireOldGroups(Data storage self) internal {\\n // Move expiredGroupOffset as long as there are some groups that should\\n // be marked as expired. It is possible that expired group offset will\\n // move out of the groups array by one position. It means that all groups\\n // are expired (it points to the first active group) and that place in\\n // groups array - currently empty - will be possibly filled later by\\n // a new group.\\n while (\\n self.expiredGroupOffset < self.groupsRegistry.length &&\\n groupLifetimeOf(\\n self,\\n self.groupsRegistry[self.expiredGroupOffset]\\n ) <\\n block.number\\n ) {\\n self.expiredGroupOffset++;\\n }\\n\\n // Go through all activeTerminatedGroups and if some of the terminated\\n // groups are expired, remove them from activeTerminatedGroups collection\\n // and rearrange the array to preserve the original order.\\n // This is needed because we evaluate the shift of selected group index\\n // based on how many non-expired groups have been terminated. Hence it is\\n // important that a number of terminated groups matches the length of\\n // activeTerminatedGroups[].\\n uint256 i = 0;\\n while (i < self.activeTerminatedGroups.length) {\\n if (self.expiredGroupOffset > self.activeTerminatedGroups[i]) {\\n // When 'i'th group qualifies for expiration, we need to remove\\n // it from the activeTerminatedGroups array manually by rearranging\\n // the order starting from 'i'th group.\\n for (\\n uint256 j = i;\\n j < self.activeTerminatedGroups.length - 1;\\n j++\\n ) {\\n self.activeTerminatedGroups[j] = self\\n .activeTerminatedGroups[j + 1];\\n }\\n // Resizing the array length by 1. The last element was copied\\n // over in the loop above to an index \\\"second to last\\\". This is\\n // why we can safely remove it from here.\\n self.activeTerminatedGroups.pop();\\n } else {\\n i++;\\n }\\n }\\n }\\n\\n /// @notice Terminates group with the provided index. Reverts if the group\\n /// is already terminated.\\n /// @param groupId Index in the groupRegistry array.\\n function terminateGroup(Data storage self, uint64 groupId) internal {\\n require(\\n !isGroupTerminated(self, groupId),\\n \\\"Group has been already terminated\\\"\\n );\\n self.groupsData[self.groupsRegistry[groupId]].terminated = true;\\n // Expanding array for a new terminated group that is added below during\\n // sortition in ascending order.\\n self.activeTerminatedGroups.push();\\n\\n // Sorting activeTerminatedGroups by groupId in ascending order so a\\n // non-terminated group is properly selected.\\n uint256 i;\\n for (\\n i = self.activeTerminatedGroups.length - 1;\\n i > 0 && self.activeTerminatedGroups[i - 1] > groupId;\\n i--\\n ) {\\n self.activeTerminatedGroups[i] = self.activeTerminatedGroups[i - 1];\\n }\\n self.activeTerminatedGroups[i] = groupId;\\n }\\n\\n /// @notice Returns an index of a randomly selected active group. Terminated\\n /// and expired groups are not considered as active.\\n /// Before new group is selected, information about expired groups\\n /// is updated. At least one active group needs to be present for this\\n /// function to succeed.\\n /// @param seed Random number used as a group selection seed.\\n function selectGroup(Data storage self, uint256 seed)\\n internal\\n returns (uint64)\\n {\\n expireOldGroups(self);\\n\\n require(numberOfActiveGroups(self) > 0, \\\"No active groups\\\");\\n\\n uint64 selectedGroup = uint64(seed % numberOfActiveGroups(self));\\n uint64 result = shiftByTerminatedGroups(\\n self,\\n shiftByExpiredGroups(self, selectedGroup)\\n );\\n return result;\\n }\\n\\n /// @notice Setter for group lifetime.\\n /// @param lifetime Lifetime of a group in blocks.\\n function setGroupLifetime(Data storage self, uint256 lifetime) internal {\\n self.groupLifetime = lifetime;\\n }\\n\\n /// @notice Checks if group with the given index is terminated.\\n function isGroupTerminated(Data storage self, uint64 groupId)\\n internal\\n view\\n returns (bool)\\n {\\n return self.groupsData[self.groupsRegistry[groupId]].terminated;\\n }\\n\\n /// @notice Gets the cutoff time until which the given group is considered\\n /// to be active assuming it hasn't been terminated before.\\n function groupLifetimeOf(Data storage self, bytes32 groupPubKeyHash)\\n internal\\n view\\n returns (uint256)\\n {\\n return\\n self.groupsData[groupPubKeyHash].registrationBlockNumber +\\n self.groupLifetime;\\n }\\n\\n /// @notice Checks if group with the given index is active and non-terminated.\\n function isGroupActive(Data storage self, uint64 groupId)\\n internal\\n view\\n returns (bool)\\n {\\n return\\n groupLifetimeOf(self, self.groupsRegistry[groupId]) >=\\n block.number &&\\n !isGroupTerminated(self, groupId);\\n }\\n\\n function getGroup(Data storage self, uint64 groupId)\\n internal\\n view\\n returns (Group storage)\\n {\\n return self.groupsData[self.groupsRegistry[groupId]];\\n }\\n\\n function getGroup(Data storage self, bytes memory groupPubKey)\\n internal\\n view\\n returns (Group storage)\\n {\\n return self.groupsData[keccak256(groupPubKey)];\\n }\\n\\n /// @notice Gets the number of active groups. Expired and terminated\\n /// groups are not counted as active.\\n function numberOfActiveGroups(Data storage self)\\n internal\\n view\\n returns (uint64)\\n {\\n if (self.groupsRegistry.length == 0) {\\n return 0;\\n }\\n\\n uint256 activeGroups = self.groupsRegistry.length -\\n self.expiredGroupOffset -\\n self.activeTerminatedGroups.length;\\n\\n return uint64(activeGroups);\\n }\\n\\n /// @notice Evaluates the shift of a selected group index based on the number\\n /// of expired groups.\\n function shiftByExpiredGroups(Data storage self, uint64 selectedIndex)\\n internal\\n view\\n returns (uint64)\\n {\\n return self.expiredGroupOffset + selectedIndex;\\n }\\n\\n /// @notice Evaluates the shift of a selected group index based on the number\\n /// of non-expired but terminated groups.\\n function shiftByTerminatedGroups(Data storage self, uint64 selectedIndex)\\n internal\\n view\\n returns (uint64)\\n {\\n uint64 shiftedIndex = selectedIndex;\\n for (uint64 i = 0; i < self.activeTerminatedGroups.length; i++) {\\n if (self.activeTerminatedGroups[i] <= shiftedIndex) {\\n shiftedIndex++;\\n }\\n }\\n\\n return shiftedIndex;\\n }\\n}\\n\",\"keccak256\":\"0x27a3cee268e5afa5ee3a00089aa82faffff7c3882aa94919499de4ef55dcfb0c\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/ModUtils.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nlibrary ModUtils {\\n /// @dev Wraps the modular exponent pre-compile introduced in Byzantium.\\n /// Returns base^exponent mod p.\\n function modExp(\\n uint256 base,\\n uint256 exponent,\\n uint256 p\\n ) internal view returns (uint256 o) {\\n assembly {\\n // Args for the precompile: [<length_of_BASE> <length_of_EXPONENT>\\n // <length_of_MODULUS> <BASE> <EXPONENT> <MODULUS>]\\n let output := mload(0x40)\\n let args := add(output, 0x20)\\n mstore(args, 0x20)\\n mstore(add(args, 0x20), 0x20)\\n mstore(add(args, 0x40), 0x20)\\n mstore(add(args, 0x60), base)\\n mstore(add(args, 0x80), exponent)\\n mstore(add(args, 0xa0), p)\\n\\n // 0x05 is the modular exponent contract address\\n if iszero(staticcall(not(0), 0x05, args, 0xc0, output, 0x20)) {\\n revert(0, 0)\\n }\\n o := mload(output)\\n }\\n }\\n\\n /// @dev Calculates and returns the square root of a mod p if such a square\\n /// root exists. The modulus p must be an odd prime. If a square root\\n /// does not exist, function returns 0.\\n function modSqrt(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n if (legendre(a, p) != 1) {\\n return 0;\\n }\\n\\n if (a == 0) {\\n return 0;\\n }\\n\\n if (p % 4 == 3) {\\n return modExp(a, (p + 1) / 4, p);\\n }\\n\\n uint256 s = p - 1;\\n uint256 e = 0;\\n\\n while (s % 2 == 0) {\\n s = s / 2;\\n e = e + 1;\\n }\\n\\n // Note the smaller int- finding n with Legendre symbol or -1\\n // should be quick\\n uint256 n = 2;\\n while (legendre(n, p) != -1) {\\n n = n + 1;\\n }\\n\\n uint256 x = modExp(a, (s + 1) / 2, p);\\n uint256 b = modExp(a, s, p);\\n uint256 g = modExp(n, s, p);\\n uint256 r = e;\\n uint256 gs = 0;\\n uint256 m = 0;\\n uint256 t = b;\\n\\n while (true) {\\n t = b;\\n m = 0;\\n\\n for (m = 0; m < r; m++) {\\n if (t == 1) {\\n break;\\n }\\n t = modExp(t, 2, p);\\n }\\n\\n if (m == 0) {\\n return x;\\n }\\n\\n gs = modExp(g, uint256(2)**(r - m - 1), p);\\n g = (gs * gs) % p;\\n x = (x * gs) % p;\\n b = (b * g) % p;\\n r = m;\\n }\\n }\\n }\\n\\n /// @dev Calculates the Legendre symbol of the given a mod p.\\n /// @return Returns 1 if a is a quadratic residue mod p, -1 if it is\\n /// a non-quadratic residue, and 0 if a is 0.\\n function legendre(uint256 a, uint256 p) internal view returns (int256) {\\n unchecked {\\n uint256 raised = modExp(a, (p - 1) / uint256(2), p);\\n\\n if (raised == 0 || raised == 1) {\\n return int256(raised);\\n } else if (raised == p - 1) {\\n return -1;\\n }\\n\\n require(false, \\\"Failed to calculate legendre.\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x57bb4ab4f257715c6daafa1a4e4bc6dd9edfe45afca797e5b8e98db577826505\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/Relay.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"./AltBn128.sol\\\";\\nimport \\\"./BLS.sol\\\";\\nimport \\\"./Groups.sol\\\";\\n\\nlibrary Relay {\\n using SafeERC20 for IERC20;\\n\\n struct Data {\\n // Total count of all requests.\\n uint64 requestCount;\\n // Data of current request.\\n // Request identifier.\\n uint64 currentRequestID;\\n // Identifier of group responsible for signing.\\n uint64 currentRequestGroupID;\\n // Request start block.\\n uint64 currentRequestStartBlock;\\n // Previous entry value.\\n AltBn128.G1Point previousEntry;\\n // Time in blocks during which a result is expected to be submitted.\\n uint32 relayEntrySoftTimeout;\\n // Hard timeout in blocks for a group to submit the relay entry.\\n uint32 relayEntryHardTimeout;\\n // Slashing amount for not submitting relay entry\\n uint96 relayEntrySubmissionFailureSlashingAmount;\\n }\\n\\n /// @notice Seed used as the first relay entry value.\\n /// It's a G1 point G * PI =\\n /// G * 31415926535897932384626433832795028841971693993751058209749445923078164062862\\n /// Where G is the generator of G1 abstract cyclic group.\\n bytes public constant relaySeed =\\n hex\\\"15c30f4b6cf6dbbcbdcc10fe22f54c8170aea44e198139b776d512d8f027319a1b9e8bfaf1383978231ce98e42bafc8129f473fc993cf60ce327f7d223460663\\\";\\n\\n event RelayEntryRequested(\\n uint256 indexed requestId,\\n uint64 groupId,\\n bytes previousEntry\\n );\\n\\n event RelayEntrySubmitted(\\n uint256 indexed requestId,\\n address submitter,\\n bytes entry\\n );\\n\\n event RelayEntryTimedOut(\\n uint256 indexed requestId,\\n uint64 terminatedGroupId\\n );\\n\\n /// @notice Initializes the very first `previousEntry` with an initial\\n /// `relaySeed` value. Can be performed only once.\\n function initSeedEntry(Data storage self) internal {\\n require(\\n self.previousEntry.x == 0 && self.previousEntry.y == 0,\\n \\\"Seed entry already initialized\\\"\\n );\\n self.previousEntry = AltBn128.g1Unmarshal(relaySeed);\\n }\\n\\n /// @notice Creates a request to generate a new relay entry, which will\\n /// include a random number (by signing the previous entry's\\n /// random number).\\n /// @param groupId Identifier of the group chosen to handle the request.\\n function requestEntry(Data storage self, uint64 groupId) internal {\\n require(\\n !isRequestInProgress(self),\\n \\\"Another relay request in progress\\\"\\n );\\n\\n uint64 currentRequestId = ++self.requestCount;\\n\\n self.currentRequestID = currentRequestId;\\n self.currentRequestGroupID = groupId;\\n self.currentRequestStartBlock = uint64(block.number);\\n\\n emit RelayEntryRequested(\\n currentRequestId,\\n groupId,\\n AltBn128.g1Marshal(self.previousEntry)\\n );\\n }\\n\\n /// @notice Creates a new relay entry. Gas-optimized version that can be\\n /// called only before the soft timeout. This should be the majority\\n /// of cases.\\n /// @param entry Group BLS signature over the previous entry.\\n /// @param groupPubKey Public key of the group which signed the relay entry.\\n function submitEntryBeforeSoftTimeout(\\n Data storage self,\\n bytes calldata entry,\\n bytes storage groupPubKey\\n ) internal {\\n require(\\n block.number < softTimeoutBlock(self),\\n \\\"Relay entry soft timeout passed\\\"\\n );\\n _submitEntry(self, entry, groupPubKey);\\n }\\n\\n /// @notice Creates a new relay entry. Can be called at any time.\\n /// In case the soft timeout has not been exceeded, it is more\\n /// gas-efficient to call the second variation of `submitEntry`.\\n /// @param entry Group BLS signature over the previous entry.\\n /// @param groupPubKey Public key of the group which signed the relay entry.\\n /// @return slashingAmount Amount by which group members should be slashed\\n /// in case the relay entry was submitted after the soft timeout.\\n /// The value is zero if entry was submitted on time.\\n function submitEntry(\\n Data storage self,\\n bytes calldata entry,\\n bytes storage groupPubKey\\n ) internal returns (uint96) {\\n // If the soft timeout has been exceeded apply stake slashing for\\n // all group members. Otherwise, no slashing.\\n uint96 slashingAmount = calculateSlashingAmount(self);\\n\\n _submitEntry(self, entry, groupPubKey);\\n\\n return slashingAmount;\\n }\\n\\n function _submitEntry(\\n Data storage self,\\n bytes calldata entry,\\n bytes storage groupPubKey\\n ) internal {\\n require(isRequestInProgress(self), \\\"No relay request in progress\\\");\\n require(!hasRequestTimedOut(self), \\\"Relay request timed out\\\");\\n\\n require(\\n BLS._verify(\\n AltBn128.g2Unmarshal(groupPubKey),\\n self.previousEntry,\\n AltBn128.g1Unmarshal(entry)\\n ),\\n \\\"Invalid entry\\\"\\n );\\n\\n emit RelayEntrySubmitted(self.currentRequestID, msg.sender, entry);\\n\\n self.previousEntry = AltBn128.g1Unmarshal(entry);\\n self.currentRequestID = 0;\\n self.currentRequestGroupID = 0;\\n self.currentRequestStartBlock = 0;\\n }\\n\\n /// @notice Calculates the slashing amount for all group members.\\n /// @dev Must be used when a soft timeout was hit.\\n /// @return Amount by which group members should be slashed\\n /// in case the relay entry was submitted after the soft timeout.\\n function calculateSlashingAmount(Data storage self)\\n internal\\n view\\n returns (uint96)\\n {\\n uint256 softTimeout = softTimeoutBlock(self);\\n\\n if (block.number > softTimeout) {\\n uint256 submissionDelay = block.number - softTimeout;\\n // The slashing amount is a result of a calculated portion of the submission\\n // delay blocks. The max delay can be set up to relayEntryHardTimeout, which\\n // in consequence sets the max slashing amount.\\n if (submissionDelay > self.relayEntryHardTimeout) {\\n submissionDelay = self.relayEntryHardTimeout;\\n }\\n\\n return\\n uint96(\\n (submissionDelay *\\n self.relayEntrySubmissionFailureSlashingAmount) /\\n self.relayEntryHardTimeout\\n );\\n }\\n\\n return 0;\\n }\\n\\n /// @notice Updates relay-related parameters\\n /// @param _relayEntrySoftTimeout New relay entry soft timeout value.\\n /// It is the time in blocks during which a result is expected to be\\n /// submitted so that the group is not slashed.\\n /// @param _relayEntryHardTimeout New relay entry hard timeout value.\\n /// It is the time in blocks for a group to submit the relay entry\\n /// before slashing for the full slashing amount happens.\\n function setTimeouts(\\n Data storage self,\\n uint256 _relayEntrySoftTimeout,\\n uint256 _relayEntryHardTimeout\\n ) internal {\\n require(!isRequestInProgress(self), \\\"Relay request in progress\\\");\\n\\n self.relayEntrySoftTimeout = uint32(_relayEntrySoftTimeout);\\n self.relayEntryHardTimeout = uint32(_relayEntryHardTimeout);\\n }\\n\\n /// @notice Set relayEntrySubmissionFailureSlashingAmount parameter.\\n /// @param newRelayEntrySubmissionFailureSlashingAmount New value of\\n /// the parameter.\\n function setRelayEntrySubmissionFailureSlashingAmount(\\n Data storage self,\\n uint96 newRelayEntrySubmissionFailureSlashingAmount\\n ) internal {\\n require(!isRequestInProgress(self), \\\"Relay request in progress\\\");\\n\\n self\\n .relayEntrySubmissionFailureSlashingAmount = newRelayEntrySubmissionFailureSlashingAmount;\\n }\\n\\n /// @notice Retries the current relay request in case a relay entry\\n /// timeout was reported.\\n /// @param newGroupId ID of the group chosen to retry the current request.\\n function retryOnEntryTimeout(Data storage self, uint64 newGroupId)\\n internal\\n {\\n require(hasRequestTimedOut(self), \\\"Relay request did not time out\\\");\\n\\n uint64 currentRequestId = self.currentRequestID;\\n uint64 previousGroupId = self.currentRequestGroupID;\\n\\n emit RelayEntryTimedOut(currentRequestId, previousGroupId);\\n\\n self.currentRequestGroupID = newGroupId;\\n self.currentRequestStartBlock = uint64(block.number);\\n\\n emit RelayEntryRequested(\\n currentRequestId,\\n newGroupId,\\n AltBn128.g1Marshal(self.previousEntry)\\n );\\n }\\n\\n /// @notice Cleans up the current relay request in case a relay entry\\n /// timeout was reported.\\n function cleanupOnEntryTimeout(Data storage self) internal {\\n require(hasRequestTimedOut(self), \\\"Relay request did not time out\\\");\\n\\n emit RelayEntryTimedOut(\\n self.currentRequestID,\\n self.currentRequestGroupID\\n );\\n\\n self.currentRequestID = 0;\\n self.currentRequestGroupID = 0;\\n self.currentRequestStartBlock = 0;\\n }\\n\\n /// @notice Returns whether a relay entry request is currently in progress.\\n /// @return True if there is a request in progress. False otherwise.\\n function isRequestInProgress(Data storage self)\\n internal\\n view\\n returns (bool)\\n {\\n return self.currentRequestID != 0;\\n }\\n\\n /// @notice Returns whether the current relay request has timed out.\\n /// @return True if the request timed out. False otherwise.\\n function hasRequestTimedOut(Data storage self)\\n internal\\n view\\n returns (bool)\\n {\\n uint256 _relayEntryTimeout = self.relayEntrySoftTimeout +\\n self.relayEntryHardTimeout;\\n\\n return\\n isRequestInProgress(self) &&\\n block.number > self.currentRequestStartBlock + _relayEntryTimeout;\\n }\\n\\n /// @notice Calculates soft timeout block for the pending relay request.\\n /// @return The soft timeout block\\n function softTimeoutBlock(Data storage self)\\n internal\\n view\\n returns (uint256)\\n {\\n return self.currentRequestStartBlock + self.relayEntrySoftTimeout;\\n }\\n}\\n\",\"keccak256\":\"0x0ff1513ef6dceda503d19d1798d9de97510ec3c033b9a59aa240ce2a3052e6d3\",\"license\":\"GPL-3.0-only\"}},\"version\":1}",
2442
- "bytecode": "0x60a06040523480156200001157600080fd5b5060405162004efa38038062004efa833981016040819052620000349162000154565b6200003f3362000104565b6001600160a01b0382166200009b5760405162461bcd60e51b815260206004820152601660248201527f5a65726f2d61646472657373207265666572656e63650000000000000000000060448201526064015b60405180910390fd5b80600003620000ed5760405162461bcd60e51b815260206004820152601360248201527f4e6f20676f7665726e616e63652064656c617900000000000000000000000000604482015260640162000092565b6001600160a01b0390911660805260335562000190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156200016857600080fd5b82516001600160a01b03811681146200018057600080fd5b6020939093015192949293505050565b608051614bf7620003036000396000818161080501528181610eba01528181610f7a015281816110a10152818161114f0152818161136c0152818161143f0152818161154801528181611607015281816118ac0152818161196101528181611acb01528181611b9f01528181611eb101528181611f6901528181612073015281816121cb015281816122a0015281816123c001528181612479015281816125880152818161264001528181612802015281816128c1015281816129d601528181612aa801528181612c6301528181612d2201528181612e2e01528181612f510152818161301101528181613126015281816131d4015281816132ef015281816133a6015281816135dc015281816136950152818161387f0152818161395201528181613a7801528181613c1a01528181613cda01528181613f5001528181614010015281816141770152818161422f0152818161434801528181614400015281816145bb015261468f0152614bf76000f3fe608060405234801561001057600080fd5b50600436106107bb5760003560e01c80638b63cc22116103f5578063af21b29011610215578063d24521aa11610130578063e731cc53116100c3578063ee8e6e5e11610092578063ee8e6e5e14610dd5578063f0bb6ce814610dde578063f2fde38b14610de6578063fb5ccedc14610df9578063fe3bb37014610e0257600080fd5b8063e731cc5314610da9578063e79b8c4614610db1578063e8507b0614610dba578063ec9d1d9614610dcd57600080fd5b8063dde37ab8116100ff578063dde37ab814610d88578063de0ce4c914610d90578063df5ee8f614610d98578063e259b55114610da157600080fd5b8063d24521aa14610d67578063d31121de14610d6f578063d57da0b814610d77578063dbc439c714610d7f57600080fd5b8063c17a1471116101a8578063cb1ec15311610177578063cb1ec15314610d3a578063ccc5488a14610d43578063cdfaeb9814610d4b578063ce123d2814610d5457600080fd5b8063c17a147114610d03578063c1b2ba9714610d16578063c268650e14610d1f578063c97e8feb14610d3257600080fd5b8063ba5c9e7e116101e4578063ba5c9e7e14610ccc578063bba3293914610cd4578063bcc5d20414610cdd578063c16d606f14610cf057600080fd5b8063af21b29014610c94578063b0ed20bb14610c9d578063b1fae48b14610cb0578063b392e3be14610cb957600080fd5b80639de6bc9d11610310578063a72aedae116102a3578063ac21f57c11610272578063ac21f57c14610c5f578063aceb164814610c72578063ae1a332514610c7b578063ae98cbf014610c83578063aea6933914610c8c57600080fd5b8063a72aedae14610c29578063a7b9a7a014610c3c578063a955b3f314610c44578063a9b32c3d14610c5757600080fd5b8063a01bc828116102df578063a01bc82814610bfd578063a0a94bbb14610c05578063a5b9ab4d14610c0d578063a6d025f114610c1657600080fd5b80639de6bc9d14610bd05780639ec67b3114610bd85780639f40edf014610bec5780639fc3da9614610bf557600080fd5b8063914f512f11610388578063985e648711610357578063985e648714610ba55780639949d70e14610bb85780639b849b9214610bc05780639cde7da914610bc857600080fd5b8063914f512f14610b6e57806395ba105d14610b7657806396fd955e14610b7f5780639810f32714610b9257600080fd5b80638d2e0c3c116103c45780638d2e0c3c14610b395780638da5cb5b14610b425780638e0442f814610b53578063914adf8f14610b6657600080fd5b80638b63cc2214610b0e5780638bc32f3314610b215780638c5f0d6714610b295780638cdb432914610b3157600080fd5b80634885b171116105e057806364e32d74116104fb578063785180e71161048e57806382e70cb81161045d57806382e70cb814610ae4578063863b45a414610aec5780638837037714610af5578063894ee96814610afe5780638a4f77ef14610b0657600080fd5b8063785180e714610ab8578063798f022314610acb5780637ab18adf14610ad35780637b81ef5214610adc57600080fd5b8063692be745116104ca578063692be74514610a95578063715018a614610a9e578063765a783214610aa657806377bf781414610aaf57600080fd5b806364e32d7414610a54578063660f903114610a5c578063663032cd14610a6f5780636795afe614610a8257600080fd5b8063542ced771161057357806361038b911161054257806361038b9114610a2857806361d4b5ef14610a3157806362c78d0914610a39578063648392ac14610a4157600080fd5b8063542ced77146109f15780635b6bd01714610a045780635c07405614610a0c5780635f735a1014610a1f57600080fd5b80634ca107cc116105af5780634ca107cc146109c45780634cf11abc146109cd5780634ed05ade146109d557806352f1bf14146109de57600080fd5b80634885b17114610996578063488a4b261461099f578063495cb121146109a85780634b928642146109bb57600080fd5b80632d318efc116106db578063363388331161066e5780633bf8a5381161063d5780633bf8a5381461093d5780633edf74e71461096a578063412bd7b41461097d578063429cdaa814610985578063481d021f1461098e57600080fd5b8063363388331461091057806337f547901461091957806337fa5d51146109215780633b7b1b081461093457600080fd5b80632ff8aa33116106aa5780632ff8aa33146108e357806333a17f98146108f6578063345cdef5146108fe5780633611f0021461090757600080fd5b80632d318efc146108c15780632d340433146108c95780632f006f4e146108d25780632f505f1f146108db57600080fd5b80631937c64711610753578063209e80ea11610722578063209e80ea14610895578063260b5a85146108a857806326825a9d146108b15780632b702150146108b957600080fd5b80631937c6471461087257806319f1103f1461087a5780631e44a72c146108835780631ff566c71461088c57600080fd5b8063152ba58f1161078f578063152ba58f146107f8578063153622b314610800578063154028f41461083f5780631722dd291461086a57600080fd5b80626b050c146107c0578063040215af146107dc57806306201e1c146107e557806314385adb146107ef575b600080fd5b6107c960315481565b6040519081526020015b60405180910390f35b6107c9600c5481565b6107ed610e15565b005b6107c960205481565b6107c9610ff9565b6108277f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016107d3565b601b54610852906001600160601b031681565b6040516001600160601b0390911681526020016107d3565b6107ed61100b565b6107c96111c2565b6107c9601e5481565b6107c960085481565b6107c960025481565b6107ed6108a33660046148db565b6111cf565b6107c960225481565b6107ed611220565b6107c96112c4565b6107ed6112d1565b6107c9600d5481565b6107c960105481565b6107ed6114ad565b6107ed6108f13660046148db565b611686565b6107c96116f0565b6107c9602f5481565b6107c960135481565b6107c960165481565b6107c96116fd565b6107ed61092f3660046148db565b61170a565b6107c960155481565b6025546109519067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016107d3565b6107ed6109783660046148db565b611754565b6107c9611809565b6107c9600f5481565b6107ed611816565b6107c960095481565b6107c960285481565b6107ed6109b6366004614909565b6119cd565b6107c960215481565b6107c960265481565b6107ed611a30565b6107c960185481565b6107ed6109ec3660046148db565b611c0d565b6107ed6109ff3660046148db565b611cb3565b6107c9611cfd565b6107ed610a1a3660046148db565b611d0a565b6107c9602d5481565b6107c960305481565b6107c9611db2565b6107c9611dbf565b6107ed610a4f3660046148db565b611dcc565b6107ed611e16565b6107ed610a6a36600461493c565b611fe7565b6107ed610a7d366004614975565b61204c565b6107ed610a903660046148db565b6120d2565b6107c9601d5481565b6107ed61211c565b6107c960075481565b6107c960295481565b601954610852906001600160601b031681565b6107ed612130565b6107c9601a5481565b6107c961230e565b6107c961231b565b6107c960065481565b6107c960245481565b6107ed612328565b6107ed6124ed565b6107ed610b1c3660046148db565b6126be565b6107ed61276a565b6107c961292e565b6107ed61293b565b6107c9600a5481565b6000546001600160a01b0316610827565b6107ed610b613660046148db565b612b17565b6107ed612bcb565b6107c9612d8f565b6107c960015481565b602354610852906001600160601b031681565b6107ed610ba0366004614909565b612d9c565b6107ed610bb3366004614990565b612dff565b6107c9612e8e565b6107c9612e9b565b6107c9612ea8565b6107ed612eb5565b6027546109519067ffffffffffffffff1681565b6107c9601c5481565b6107ed613090565b6107c9613247565b6107ed613254565b6107c960145481565b6107ed610c243660046148db565b613425565b6107ed610c37366004614975565b61346f565b6107ed613544565b6107ed610c523660046148db565b613709565b6107c9613774565b6107ed610c6d366004614909565b613781565b6107c960045481565b6107ed6137e4565b6107c960055481565b6107ed6139c0565b6107c9602a5481565b6107ed610cab3660046148db565b613aee565b6107c9602c5481565b6107ed610cc73660046148db565b613b38565b6107ed613b82565b6107c960335481565b601754610852906001600160601b031681565b6107ed610cfe3660046148db565b613d46565b600354610827906001600160a01b031681565b6107c9602e5481565b6107ed610d2d3660046148db565b613e05565b6107c9613eab565b6107c9601f5481565b6107ed613eb8565b6107c9602b5481565b6107ed610d62366004614909565b61407c565b6107ed6140df565b6107c96142a3565b6107ed6142b0565b6107c960115481565b6107c9614474565b6107c9614481565b6107c960125481565b6107c961448e565b6107c961449b565b6107c9600e5481565b6107ed610dc83660046148db565b6144a8565b6107c9614513565b6107c9600b5481565b6107ed614520565b6107ed610df4366004614975565b6146fd565b6107c960325481565b6107ed610e1036600461493c565b614776565b610e1d6147db565b60285460008111610e495760405162461bcd60e51b8152600401610e40906149cc565b60405180910390fd5b603354610e5682426149fa565b1015610e745760405162461bcd60e51b8152600401610e4090614a21565b60275460405167ffffffffffffffff90911681527f6a7551372930a2bc4aec844a266609ca90cf9b805f875e92680e901b43d5273f9060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190614a56565b506027546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff8084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b158015610fc657600080fd5b505af1158015610fda573d6000803e3d6000fd5b5050600060285550506027805467ffffffffffffffff19169055505050565b6000611006601454614835565b905090565b6110136147db565b600854600081116110365760405162461bcd60e51b8152600401610e40906149cc565b60335461104382426149fa565b10156110615760405162461bcd60e51b8152600401610e4090614a21565b7f1aa56185678cf82df5663d3bf97731024fc6da8f9ab832de58fe6411bb7aacad60075460405161109491815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa1580156110fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111219190614aa3565b600754604051639a7d093560e01b8152600481018590526024810191909152604481018290529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b5050600060088190556007555050505050565b6000611006600654614835565b6111d76147db565b601d81905542601e8190556040805183815260208101929092527f523803e7f157ab532da5ae1e1d19b71f16b18376cf65a301ef8e3f07076d6bfd91015b60405180910390a150565b6112286147db565b6002546000811161124b5760405162461bcd60e51b8152600401610e40906149cc565b60335461125882426149fa565b10156112765760405162461bcd60e51b8152600401610e4090614a21565b7f657e578b1ed229f1e01ab5ce4700399f19ddd24b09b071ab9e72122f18aa72976001546040516112a991815260200190565b60405180910390a15060018054603355600060028190559055565b6000611006601054614835565b6112d96147db565b600e54600081116112fc5760405162461bcd60e51b8152600401610e40906149cc565b60335461130982426149fa565b10156113275760405162461bcd60e51b8152600401610e4090614a21565b7fc2b1fc49f84728c2be30441ba73a73fe63ff40017b462dca6045e8b5933dfd97600d5460405161135a91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156113c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ec9190614ad1565b600d546040516377a5a7bd60e01b815260048101889052602481019190915260448101859052606481018490526084810183905260a48101829052959a5092985090965094509250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561148357600080fd5b505af1158015611497573d6000803e3d6000fd5b50506000600e819055600d555050505050505050565b6114b56147db565b602454600081116114d85760405162461bcd60e51b8152600401610e40906149cc565b6033546114e582426149fa565b10156115035760405162461bcd60e51b8152600401610e4090614a21565b6023546040516001600160601b0390911681527fca5de5c00e5da52e22f64b23ecfa308e487441bcbd0f4b84657799102e3ee3719060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156115a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c89190614a56565b6023546040516301409c5360e71b81526001600160601b03909116600482015267ffffffffffffffff80841660248301528216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063a04e298090606401600060405180830381600087803b15801561165457600080fd5b505af1158015611668573d6000803e3d6000fd5b505060006024555050602380546001600160601b0319169055505050565b61168e6147db565b60648111156116af5760405162461bcd60e51b8152600401610e4090614b1b565b601f81905542602081815560408051848152918201929092527f236b3b5a701c1727d0ddd01db13475e0da9be45561decb6f0d3d958c18e09e8b9101611215565b6000611006603254614835565b6000611006602054614835565b6117126147db565b60018190554260028190556040805183815260208101929092527f1ed485551399b30c188ed4d426c6c62d7b703b9fec6b486c70a3fe616c2707c89101611215565b61175c6147db565b600081116117c75760405162461bcd60e51b815260206004820152603260248201527f444b47207375626d697474657220707265636564656e636520706572696f642060448201527106c656e677468206d757374206265203e20360741b6064820152608401610e40565b60158190554260168190556040805183815260208101929092527f69f992e32ba993676818a20dfe808b5d41e0db4bdd3a52917701443500a423ca9101611215565b6000611006602c54614835565b61181e6147db565b600654600081116118415760405162461bcd60e51b8152600401610e40906149cc565b60335461184e82426149fa565b101561186c5760405162461bcd60e51b8152600401610e4090614a21565b7f63db42a2e13b78bf39d9f3c14718c3c925ccdf3e30a0477d5a7626914164620260055460405161189f91815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192c9190614aa3565b600554604051639a7d093560e01b81526004810191909152602481018390526044810182905291945092506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169150639a7d093590606401600060405180830381600087803b1580156119a657600080fd5b505af11580156119ba573d6000803e3d6000fd5b5050600060068190556005555050505050565b6119d56147db565b601980546001600160601b0319166001600160601b03831690811790915542601a8190556040805192835260208301919091527f8087387fa6bcbf89a9e273adcf21735f21e89ae8024417df321d8ccc106123089101611215565b611a386147db565b60105460008111611a5b5760405162461bcd60e51b8152600401610e40906149cc565b603354611a6882426149fa565b1015611a865760405162461bcd60e51b8152600401610e4090614a21565b7f54eb240e49fe7d2dc26863f9a2682d5834812e39417dbac77797c3b01b97395c600f54604051611ab991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015611b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4b9190614ad1565b600f546040516377a5a7bd60e01b815260048101889052602481018790526044810191909152606481018490526084810183905260a48101829052959a509398509096509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b158015611be357600080fd5b505af1158015611bf7573d6000803e3d6000fd5b505060006010819055600f555050505050505050565b611c156147db565b60008111611c715760405162461bcd60e51b8152602060048201526024808201527f47726f7570206372656174696f6e206672657175656e6379206d7573742062656044820152630203e20360e41b6064820152608401610e40565b600b81905542600c8190556040805183815260208101929092527f9356f2202b7c2dd20837653ce617753f36c435d28464b7f8c4c4c174acecec3d9101611215565b611cbb6147db565b602b81905542602c8190556040805183815260208101929092527fe7f67ed355ceb941da1b6600c508f5493967c944c9fee75936aaa986b9e0344c9101611215565b6000611006601e54614835565b611d126147db565b60008111611d705760405162461bcd60e51b815260206004820152602560248201527f47726f7570206c69666574696d65206d75737420626520677265617465722074604482015264068616e20360dc1b6064820152608401610e40565b600d81905542600e8190556040805183815260208101929092527f2061f522ba42a34f2907b875dca3bf5f0d999cacbbb635e894ee3c5792727e649101611215565b6000611006602854614835565b6000611006600854614835565b611dd46147db565b602f8190554260308190556040805183815260208101929092527f6ff3903999be3f8c1262f638998917b6d6c6f8097cb7cb9e60edaa1a5f2a66719101611215565b611e1e6147db565b601c5460008111611e415760405162461bcd60e51b8152600401610e40906149cc565b603354611e4e82426149fa565b1015611e6c5760405162461bcd60e51b8152600401610e4090614a21565b601b546040516001600160601b0390911681527f13f3e65295154bda4919d5f46898c2284edbf9283ee94654515cec984e767c809060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa158015611f0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f319190614b49565b50601b54604051630519e99160e01b81526001600160601b0380851660048301528084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b158015611fb557600080fd5b505af1158015611fc9573d6000803e3d6000fd5b50506000601c555050601b80546001600160601b0319169055505050565b611fef6147db565b6027805467ffffffffffffffff191667ffffffffffffffff83169081179091554260288190556040805192835260208301919091527f979c18cc9822195c2af34f89e0713a14edbd9713b32932c60471951cc1fa02db9101611215565b6120546147db565b60405163663032cd60e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063663032cd90602401600060405180830381600087803b1580156120b757600080fd5b505af11580156120cb573d6000803e3d6000fd5b5050505050565b6120da6147db565b60118190554260128190556040805183815260208101929092527fff34014c09b30234094b14f309369c4b204ab5f24daa98f6922ac40a04768bf09101611215565b6121246147db565b61212e600061488b565b565b6121386147db565b6012546000811161215b5760405162461bcd60e51b8152600401610e40906149cc565b60335461216882426149fa565b10156121865760405162461bcd60e51b8152600401610e4090614a21565b7ffc489bb20492c4590e5a1edb8e096301dd7e9c24843a5af9221ddafff010f0f06011546040516121b991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224b9190614ad1565b6011546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101919091526084810183905260a48101829052959a50939850919650909450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156122e457600080fd5b505af11580156122f8573d6000803e3d6000fd5b5050600060128190556011555050505050505050565b6000611006602454614835565b6000611006602654614835565b6123306147db565b603054600081116123535760405162461bcd60e51b8152600401610e40906149cc565b60335461236082426149fa565b101561237e5760405162461bcd60e51b8152600401610e4090614a21565b7fc02f8fddd9d337adf38d4f97d3ab8c91b69075b48db9bc25c461b0d02c3d4092602f546040516123b191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190614b8b565b602f54604051635868086b60e11b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b1580156124c557600080fd5b505af11580156124d9573d6000803e3d6000fd5b505060006030819055602f55505050505050565b6124f56147db565b601a54600081116125185760405162461bcd60e51b8152600401610e40906149cc565b60335461252582426149fa565b10156125435760405162461bcd60e51b8152600401610e4090614a21565b6019546040516001600160601b0390911681527fe1adae42a74e6bb380e06f34e96abe3134e824a1a152a8e6a7458be153404d179060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa1580156125e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126089190614b49565b601954604051630519e99160e01b81526001600160601b038086166004830152918216602482015290821660448201529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b15801561268c57600080fd5b505af11580156126a0573d6000803e3d6000fd5b50506000601a555050601980546001600160601b0319169055505050565b6126c66147db565b600081116127285760405162461bcd60e51b815260206004820152602960248201527f444b4720726573756c74207375626d697373696f6e2074696d656f7574206d7560448201526807374206265203e20360bc1b6064820152608401610e40565b60138190554260148190556040805183815260208101929092527f77bd6dceb389516c704e337d2e53bab8397e3fd1de7e3b852090742804ba13b49101611215565b6127726147db565b602c54600081116127955760405162461bcd60e51b8152600401610e40906149cc565b6033546127a282426149fa565b10156127c05760405162461bcd60e51b8152600401610e4090614a21565b7ff71bf0b76dcaef665875c3a1d4959efda6ea75c7171f5fae1bd305f7c8509283602b546040516127f391815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561285e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128829190614b8b565b602b54604051635868086b60e11b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063b0d010d690608401600060405180830381600087803b15801561290657600080fd5b505af115801561291a573d6000803e3d6000fd5b50506000602c819055602b55505050505050565b6000611006601854614835565b6129436147db565b600c54600081116129665760405162461bcd60e51b8152600401610e40906149cc565b60335461297382426149fa565b10156129915760405162461bcd60e51b8152600401610e4090614a21565b7fe3daa3940e1269d029800f83e889021793ccd69dd79a7152b9171a3071eb45a3600b546040516129c491815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a569190614ad1565b600b546040516377a5a7bd60e01b815260048101919091526024810186905260448101859052606481018490526084810183905260a48101829052949a50929850909650945092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506377a5a7bd9060c401600060405180830381600087803b158015612aed57600080fd5b505af1158015612b01573d6000803e3d6000fd5b50506000600c819055600b555050505050505050565b612b1f6147db565b600a811015612b895760405162461bcd60e51b815260206004820152603060248201527f444b4720726573756c74206368616c6c656e676520706572696f64206c656e6760448201526f07468206d757374206265203e3d2031360841b6064820152608401610e40565b600f8190554260108190556040805183815260208101929092527f4bc54f06db7242d34e1d1cdd7b4b33807a8210c54fc440ba45e6e5ffa04e083d9101611215565b612bd36147db565b601e5460008111612bf65760405162461bcd60e51b8152600401610e40906149cc565b603354612c0382426149fa565b1015612c215760405162461bcd60e51b8152600401610e4090614a21565b7f0945b46b311d9dd20cdadf139b3449fe2e50026e619f33cabedbd7461c429076601d54604051612c5491815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015612cbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce39190614b8b565b601d54604051630ce591ab60e21b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063339646ac90608401600060405180830381600087803b158015612d6757600080fd5b505af1158015612d7b573d6000803e3d6000fd5b50506000601e819055601d55505050505050565b6000611006602a54614835565b612da46147db565b601b80546001600160601b0319166001600160601b03831690811790915542601c8190556040805192835260208301919091527f060327865259e01939f90eed5ad911c6e0509663b7671bccd0f6382f56aba4d39101611215565b612e076147db565b60405163985e648760e01b81526001600160a01b03838116600483015282151560248301527f0000000000000000000000000000000000000000000000000000000000000000169063985e648790604401600060405180830381600087803b158015612e7257600080fd5b505af1158015612e86573d6000803e3d6000fd5b505050505050565b6000611006601a54614835565b6000611006600c54614835565b6000611006601254614835565b612ebd6147db565b60265460008111612ee05760405162461bcd60e51b8152600401610e40906149cc565b603354612eed82426149fa565b1015612f0b5760405162461bcd60e51b8152600401610e4090614a21565b60255460405167ffffffffffffffff90911681527fcc354ece588e8fa730a65a72ebb90039caf81a2a9efedf80e8124566d42a75e89060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd19190614a56565b506025546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff9182166024820152908216604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b15801561305d57600080fd5b505af1158015613071573d6000803e3d6000fd5b5050600060265550506025805467ffffffffffffffff19169055505050565b6130986147db565b600a54600081116130bb5760405162461bcd60e51b8152600401610e40906149cc565b6033546130c882426149fa565b10156130e65760405162461bcd60e51b8152600401610e4090614a21565b7f01e43c4ca2dc8df5a6c64198b1ad31e61ff7584833e5a7933892dd79d8eb905260095460405161311991815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015613182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a69190614aa3565b50600954604051639a7d093560e01b81526004810184905260248101839052604481019190915291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561322057600080fd5b505af1158015613234573d6000803e3d6000fd5b50506000600a8190556009555050505050565b6000611006600254614835565b61325c6147db565b6018546000811161327f5760405162461bcd60e51b8152600401610e40906149cc565b60335461328c82426149fa565b10156132aa5760405162461bcd60e51b8152600401610e4090614a21565b6017546040516001600160601b0390911681527f5e7ca6fb8d090a2753e006c53b0aab79da28ab5e198b62cc105bda8f96caa6a09060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa15801561334b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061336f9190614b49565b601754604051630519e99160e01b81526001600160601b0391821660048201528184166024820152908216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169150630519e99190606401600060405180830381600087803b1580156133f357600080fd5b505af1158015613407573d6000803e3d6000fd5b505060006018555050601780546001600160601b0319169055505050565b61342d6147db565b602d81905542602e8190556040805183815260208101929092527f8ff92b4fa51728d3b3bebd82f5bcfa8904b0278abbce025a1e33aaf9719fdb0d9101611215565b6134776147db565b6001600160a01b0381166134e95760405162461bcd60e51b815260206004820152603360248201527f4e65772072616e646f6d20626561636f6e20676f7665726e616e636520616464604482015272726573732063616e6e6f74206265207a65726f60681b6064820152608401610e40565b600380546001600160a01b0319166001600160a01b0383169081179091554260048190556040805192835260208301919091527fcda4dd0dbaee4278532e4689e026f08f707ec8602188caa303750b225cde00789101611215565b61354c6147db565b6022546000811161356f5760405162461bcd60e51b8152600401610e40906149cc565b60335461357c82426149fa565b101561359a5760405162461bcd60e51b8152600401610e4090614a21565b7f32aac559d8ae735853362fec3c6751b37b45f12097c074ee06d51b10180c68626021546040516135cd91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365c9190614b8b565b602154604051630ce591ab60e21b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b1580156136e157600080fd5b505af11580156136f5573d6000803e3d6000fd5b505060006022819055602155505050505050565b6137116147db565b60648111156137325760405162461bcd60e51b8152600401610e4090614b1b565b60218190554260228190556040805183815260208101929092527fb62064224fade801c12ce2e348d8fff15f8e451792137664811b44b6ffe37d919101611215565b6000611006600e54614835565b6137896147db565b601780546001600160601b0319166001600160601b0383169081179091554260188190556040805192835260208301919091527fb5da59c72c3f617da3620449ee7c88d5b8a81e1f98e9f61fc62207ecab6b099f9101611215565b6137ec6147db565b6016546000811161380f5760405162461bcd60e51b8152600401610e40906149cc565b60335461381c82426149fa565b101561383a5760405162461bcd60e51b8152600401610e4090614a21565b7ffc88a5167b8569e72b62f4b76b3caae7699e46c7f6f16a8d011b135ac613acc460155460405161386d91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156138db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138ff9190614ad1565b506015546040516377a5a7bd60e01b8152600481018790526024810186905260448101859052606481018490526084810183905260a4810191909152949950929750909550935091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561399657600080fd5b505af11580156139aa573d6000803e3d6000fd5b5050600060168190556015555050505050505050565b6139c86147db565b600454600081116139eb5760405162461bcd60e51b8152600401610e40906149cc565b6033546139f882426149fa565b1015613a165760405162461bcd60e51b8152600401610e4090614a21565b6003546040516001600160a01b0390911681527f2682a33c437aa00b19b3e527d140e9800f735bc8fab66653e6ae22c8d07b4a909060200160405180910390a16003546040516334e2fffd60e21b81526001600160a01b0391821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063d38bfff490602401600060405180830381600087803b158015613abe57600080fd5b505af1158015613ad2573d6000803e3d6000fd5b505060006004555050600380546001600160a01b031916905550565b613af66147db565b60318190554260328190556040805183815260208101929092527f9eeb84ca445446640c66e65b8036794dd92ad3c3b9177714c8802c2644ab79e59101611215565b613b406147db565b60078190554260088190556040805183815260208101929092527f9cd90f9d45b916da6108ff464eaded2b92aa41867f12437a20b57247298086979101611215565b613b8a6147db565b60325460008111613bad5760405162461bcd60e51b8152600401610e40906149cc565b603354613bba82426149fa565b1015613bd85760405162461bcd60e51b8152600401610e4090614a21565b7f274cf9dfd48eeb8969817e347b3a2951ff7b3127772bd70827012266466ae229603154604051613c0b91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa158015613c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9a9190614b8b565b50603154604051635868086b60e11b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b0d010d690608401600060405180830381600087803b158015613d1e57600080fd5b505af1158015613d32573d6000803e3d6000fd5b505060006032819055603155505050505050565b613d4e6147db565b600081118015613d615750620f42408111155b613dc35760405162461bcd60e51b815260206004820152602d60248201527f43616c6c6261636b20676173206c696d6974206d757374206265203e2030206160448201526c06e64203c3d203130303030303609c1b6064820152608401610e40565b600981905542600a8190556040805183815260208101929092527f0aeac6506f5606a033c22dd1659065c5f75e5ea933fd3b49948ea79a59759b239101611215565b613e0d6147db565b60008111613e695760405162461bcd60e51b8152602060048201526024808201527f52656c617920656e74727920736f66742074696d656f7574206d7573742062656044820152630203e20360e41b6064820152608401610e40565b60058190554260068190556040805183815260208101929092527fb4c6d786da48691c308faaf332c8a4ccaa952d2145eb5798624c60548ce4b8a39101611215565b6000611006603054614835565b613ec06147db565b602a5460008111613ee35760405162461bcd60e51b8152600401610e40906149cc565b603354613ef082426149fa565b1015613f0e5760405162461bcd60e51b8152600401610e4090614a21565b7f8ad0f1f70b7c422ad8dee17b865a5118d91bc633151cdf66293f7827fea7164c602954604051613f4191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fd09190614b8b565b50602954604051630ce591ab60e21b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063339646ac90608401600060405180830381600087803b15801561405457600080fd5b505af1158015614068573d6000803e3d6000fd5b50506000602a819055602955505050505050565b6140846147db565b602380546001600160601b0319166001600160601b0383169081179091554260248190556040805192835260208301919091527f456911403e756f0141f9a154095c7495b7002db4f6b26a7ff03c4f09335abc4b9101611215565b6140e76147db565b602e546000811161410a5760405162461bcd60e51b8152600401610e40906149cc565b60335461411782426149fa565b10156141355760405162461bcd60e51b8152600401610e4090614a21565b7f9eb4413d73f3cae81d9e8ab119d94a8d2cd6b2564117c30f2112b972dcf84f96602d5460405161416891815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa1580156141d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f79190614b8b565b602d54604051635868086b60e11b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b15801561427b57600080fd5b505af115801561428f573d6000803e3d6000fd5b50506000602e819055602d55505050505050565b6000611006600454614835565b6142b86147db565b602054600081116142db5760405162461bcd60e51b8152600401610e40906149cc565b6033546142e882426149fa565b10156143065760405162461bcd60e51b8152600401610e4090614a21565b7f3114ff9b112e2012da7dadf3d620cfd5af0546afe8cd887c052f0166fddb0004601f5460405161433991815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa1580156143a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143c89190614b8b565b601f54604051630ce591ab60e21b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b15801561444c57600080fd5b505af1158015614460573d6000803e3d6000fd5b505060006020819055601f55505050505050565b6000611006601c54614835565b6000611006601654614835565b6000611006602254614835565b6000611006600a54614835565b6144b06147db565b60648111156144d15760405162461bcd60e51b8152600401610e4090614b1b565b602981905542602a8190556040805183815260208101929092527f363de88db002648ead34367d7bc43c7eb86051555a3e29ff3d6ab2cd12f880569101611215565b6000611006602e54614835565b6145286147db565b6014546000811161454b5760405162461bcd60e51b8152600401610e40906149cc565b60335461455882426149fa565b10156145765760405162461bcd60e51b8152600401610e4090614a21565b7ff0db347eb933ec2636808975682b1fd63249be20775411ced58d2fd61e0fe7426013546040516145a991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015614617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061463b9190614ad1565b6013546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101859052608481019190915260a48101829052959a509398509196509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156146d357600080fd5b505af11580156146e7573d6000803e3d6000fd5b5050600060148190556013555050505050505050565b6147056147db565b6001600160a01b03811661476a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e40565b6147738161488b565b50565b61477e6147db565b6025805467ffffffffffffffff191667ffffffffffffffff83169081179091554260268190556040805192835260208301919091527f98f756aaf5ba8f60be58f0b035a3a5f54bdfbc5d1ada450c235b9e500625df389101611215565b6000546001600160a01b0316331461212e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e40565b60008082116148565760405162461bcd60e51b8152600401610e40906149cc565b600061486283426149fa565b905060335481106148765750600092915050565b8060335461488491906149fa565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156148ed57600080fd5b5035919050565b6001600160601b038116811461477357600080fd5b60006020828403121561491b57600080fd5b8135614884816148f4565b67ffffffffffffffff8116811461477357600080fd5b60006020828403121561494e57600080fd5b813561488481614926565b80356001600160a01b038116811461497057600080fd5b919050565b60006020828403121561498757600080fd5b61488482614959565b600080604083850312156149a357600080fd5b6149ac83614959565b9150602083013580151581146149c157600080fd5b809150509250929050565b60208082526014908201527310da185b99d9481b9bdd081a5b9a5d1a585d195960621b604082015260600190565b81810381811115614a1b57634e487b7160e01b600052601160045260246000fd5b92915050565b6020808252818101527f476f7665726e616e63652064656c617920686173206e6f7420656c6170736564604082015260600190565b600080600060608486031215614a6b57600080fd5b8351614a76816148f4565b6020850151909350614a8781614926565b6040850151909250614a9881614926565b809150509250925092565b600080600060608486031215614ab857600080fd5b8351925060208401519150604084015190509250925092565b60008060008060008060c08789031215614aea57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60208082526014908201527304d6178696d756d2076616c7565206973203130360641b604082015260600190565b600080600060608486031215614b5e57600080fd5b8351614b69816148f4565b6020850151909350614b7a816148f4565b6040850151909250614a98816148f4565b60008060008060808587031215614ba157600080fd5b50508251602084015160408501516060909501519196909550909250905056fea2646970667358221220dff594b8c6aac1a365d035d01ae8eae9d7c80e0425bd51442abea140d74a917e64736f6c63430008110033",
2443
- "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106107bb5760003560e01c80638b63cc22116103f5578063af21b29011610215578063d24521aa11610130578063e731cc53116100c3578063ee8e6e5e11610092578063ee8e6e5e14610dd5578063f0bb6ce814610dde578063f2fde38b14610de6578063fb5ccedc14610df9578063fe3bb37014610e0257600080fd5b8063e731cc5314610da9578063e79b8c4614610db1578063e8507b0614610dba578063ec9d1d9614610dcd57600080fd5b8063dde37ab8116100ff578063dde37ab814610d88578063de0ce4c914610d90578063df5ee8f614610d98578063e259b55114610da157600080fd5b8063d24521aa14610d67578063d31121de14610d6f578063d57da0b814610d77578063dbc439c714610d7f57600080fd5b8063c17a1471116101a8578063cb1ec15311610177578063cb1ec15314610d3a578063ccc5488a14610d43578063cdfaeb9814610d4b578063ce123d2814610d5457600080fd5b8063c17a147114610d03578063c1b2ba9714610d16578063c268650e14610d1f578063c97e8feb14610d3257600080fd5b8063ba5c9e7e116101e4578063ba5c9e7e14610ccc578063bba3293914610cd4578063bcc5d20414610cdd578063c16d606f14610cf057600080fd5b8063af21b29014610c94578063b0ed20bb14610c9d578063b1fae48b14610cb0578063b392e3be14610cb957600080fd5b80639de6bc9d11610310578063a72aedae116102a3578063ac21f57c11610272578063ac21f57c14610c5f578063aceb164814610c72578063ae1a332514610c7b578063ae98cbf014610c83578063aea6933914610c8c57600080fd5b8063a72aedae14610c29578063a7b9a7a014610c3c578063a955b3f314610c44578063a9b32c3d14610c5757600080fd5b8063a01bc828116102df578063a01bc82814610bfd578063a0a94bbb14610c05578063a5b9ab4d14610c0d578063a6d025f114610c1657600080fd5b80639de6bc9d14610bd05780639ec67b3114610bd85780639f40edf014610bec5780639fc3da9614610bf557600080fd5b8063914f512f11610388578063985e648711610357578063985e648714610ba55780639949d70e14610bb85780639b849b9214610bc05780639cde7da914610bc857600080fd5b8063914f512f14610b6e57806395ba105d14610b7657806396fd955e14610b7f5780639810f32714610b9257600080fd5b80638d2e0c3c116103c45780638d2e0c3c14610b395780638da5cb5b14610b425780638e0442f814610b53578063914adf8f14610b6657600080fd5b80638b63cc2214610b0e5780638bc32f3314610b215780638c5f0d6714610b295780638cdb432914610b3157600080fd5b80634885b171116105e057806364e32d74116104fb578063785180e71161048e57806382e70cb81161045d57806382e70cb814610ae4578063863b45a414610aec5780638837037714610af5578063894ee96814610afe5780638a4f77ef14610b0657600080fd5b8063785180e714610ab8578063798f022314610acb5780637ab18adf14610ad35780637b81ef5214610adc57600080fd5b8063692be745116104ca578063692be74514610a95578063715018a614610a9e578063765a783214610aa657806377bf781414610aaf57600080fd5b806364e32d7414610a54578063660f903114610a5c578063663032cd14610a6f5780636795afe614610a8257600080fd5b8063542ced771161057357806361038b911161054257806361038b9114610a2857806361d4b5ef14610a3157806362c78d0914610a39578063648392ac14610a4157600080fd5b8063542ced77146109f15780635b6bd01714610a045780635c07405614610a0c5780635f735a1014610a1f57600080fd5b80634ca107cc116105af5780634ca107cc146109c45780634cf11abc146109cd5780634ed05ade146109d557806352f1bf14146109de57600080fd5b80634885b17114610996578063488a4b261461099f578063495cb121146109a85780634b928642146109bb57600080fd5b80632d318efc116106db578063363388331161066e5780633bf8a5381161063d5780633bf8a5381461093d5780633edf74e71461096a578063412bd7b41461097d578063429cdaa814610985578063481d021f1461098e57600080fd5b8063363388331461091057806337f547901461091957806337fa5d51146109215780633b7b1b081461093457600080fd5b80632ff8aa33116106aa5780632ff8aa33146108e357806333a17f98146108f6578063345cdef5146108fe5780633611f0021461090757600080fd5b80632d318efc146108c15780632d340433146108c95780632f006f4e146108d25780632f505f1f146108db57600080fd5b80631937c64711610753578063209e80ea11610722578063209e80ea14610895578063260b5a85146108a857806326825a9d146108b15780632b702150146108b957600080fd5b80631937c6471461087257806319f1103f1461087a5780631e44a72c146108835780631ff566c71461088c57600080fd5b8063152ba58f1161078f578063152ba58f146107f8578063153622b314610800578063154028f41461083f5780631722dd291461086a57600080fd5b80626b050c146107c0578063040215af146107dc57806306201e1c146107e557806314385adb146107ef575b600080fd5b6107c960315481565b6040519081526020015b60405180910390f35b6107c9600c5481565b6107ed610e15565b005b6107c960205481565b6107c9610ff9565b6108277f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016107d3565b601b54610852906001600160601b031681565b6040516001600160601b0390911681526020016107d3565b6107ed61100b565b6107c96111c2565b6107c9601e5481565b6107c960085481565b6107c960025481565b6107ed6108a33660046148db565b6111cf565b6107c960225481565b6107ed611220565b6107c96112c4565b6107ed6112d1565b6107c9600d5481565b6107c960105481565b6107ed6114ad565b6107ed6108f13660046148db565b611686565b6107c96116f0565b6107c9602f5481565b6107c960135481565b6107c960165481565b6107c96116fd565b6107ed61092f3660046148db565b61170a565b6107c960155481565b6025546109519067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016107d3565b6107ed6109783660046148db565b611754565b6107c9611809565b6107c9600f5481565b6107ed611816565b6107c960095481565b6107c960285481565b6107ed6109b6366004614909565b6119cd565b6107c960215481565b6107c960265481565b6107ed611a30565b6107c960185481565b6107ed6109ec3660046148db565b611c0d565b6107ed6109ff3660046148db565b611cb3565b6107c9611cfd565b6107ed610a1a3660046148db565b611d0a565b6107c9602d5481565b6107c960305481565b6107c9611db2565b6107c9611dbf565b6107ed610a4f3660046148db565b611dcc565b6107ed611e16565b6107ed610a6a36600461493c565b611fe7565b6107ed610a7d366004614975565b61204c565b6107ed610a903660046148db565b6120d2565b6107c9601d5481565b6107ed61211c565b6107c960075481565b6107c960295481565b601954610852906001600160601b031681565b6107ed612130565b6107c9601a5481565b6107c961230e565b6107c961231b565b6107c960065481565b6107c960245481565b6107ed612328565b6107ed6124ed565b6107ed610b1c3660046148db565b6126be565b6107ed61276a565b6107c961292e565b6107ed61293b565b6107c9600a5481565b6000546001600160a01b0316610827565b6107ed610b613660046148db565b612b17565b6107ed612bcb565b6107c9612d8f565b6107c960015481565b602354610852906001600160601b031681565b6107ed610ba0366004614909565b612d9c565b6107ed610bb3366004614990565b612dff565b6107c9612e8e565b6107c9612e9b565b6107c9612ea8565b6107ed612eb5565b6027546109519067ffffffffffffffff1681565b6107c9601c5481565b6107ed613090565b6107c9613247565b6107ed613254565b6107c960145481565b6107ed610c243660046148db565b613425565b6107ed610c37366004614975565b61346f565b6107ed613544565b6107ed610c523660046148db565b613709565b6107c9613774565b6107ed610c6d366004614909565b613781565b6107c960045481565b6107ed6137e4565b6107c960055481565b6107ed6139c0565b6107c9602a5481565b6107ed610cab3660046148db565b613aee565b6107c9602c5481565b6107ed610cc73660046148db565b613b38565b6107ed613b82565b6107c960335481565b601754610852906001600160601b031681565b6107ed610cfe3660046148db565b613d46565b600354610827906001600160a01b031681565b6107c9602e5481565b6107ed610d2d3660046148db565b613e05565b6107c9613eab565b6107c9601f5481565b6107ed613eb8565b6107c9602b5481565b6107ed610d62366004614909565b61407c565b6107ed6140df565b6107c96142a3565b6107ed6142b0565b6107c960115481565b6107c9614474565b6107c9614481565b6107c960125481565b6107c961448e565b6107c961449b565b6107c9600e5481565b6107ed610dc83660046148db565b6144a8565b6107c9614513565b6107c9600b5481565b6107ed614520565b6107ed610df4366004614975565b6146fd565b6107c960325481565b6107ed610e1036600461493c565b614776565b610e1d6147db565b60285460008111610e495760405162461bcd60e51b8152600401610e40906149cc565b60405180910390fd5b603354610e5682426149fa565b1015610e745760405162461bcd60e51b8152600401610e4090614a21565b60275460405167ffffffffffffffff90911681527f6a7551372930a2bc4aec844a266609ca90cf9b805f875e92680e901b43d5273f9060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190614a56565b506027546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff8084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b158015610fc657600080fd5b505af1158015610fda573d6000803e3d6000fd5b5050600060285550506027805467ffffffffffffffff19169055505050565b6000611006601454614835565b905090565b6110136147db565b600854600081116110365760405162461bcd60e51b8152600401610e40906149cc565b60335461104382426149fa565b10156110615760405162461bcd60e51b8152600401610e4090614a21565b7f1aa56185678cf82df5663d3bf97731024fc6da8f9ab832de58fe6411bb7aacad60075460405161109491815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa1580156110fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111219190614aa3565b600754604051639a7d093560e01b8152600481018590526024810191909152604481018290529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b5050600060088190556007555050505050565b6000611006600654614835565b6111d76147db565b601d81905542601e8190556040805183815260208101929092527f523803e7f157ab532da5ae1e1d19b71f16b18376cf65a301ef8e3f07076d6bfd91015b60405180910390a150565b6112286147db565b6002546000811161124b5760405162461bcd60e51b8152600401610e40906149cc565b60335461125882426149fa565b10156112765760405162461bcd60e51b8152600401610e4090614a21565b7f657e578b1ed229f1e01ab5ce4700399f19ddd24b09b071ab9e72122f18aa72976001546040516112a991815260200190565b60405180910390a15060018054603355600060028190559055565b6000611006601054614835565b6112d96147db565b600e54600081116112fc5760405162461bcd60e51b8152600401610e40906149cc565b60335461130982426149fa565b10156113275760405162461bcd60e51b8152600401610e4090614a21565b7fc2b1fc49f84728c2be30441ba73a73fe63ff40017b462dca6045e8b5933dfd97600d5460405161135a91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156113c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ec9190614ad1565b600d546040516377a5a7bd60e01b815260048101889052602481019190915260448101859052606481018490526084810183905260a48101829052959a5092985090965094509250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561148357600080fd5b505af1158015611497573d6000803e3d6000fd5b50506000600e819055600d555050505050505050565b6114b56147db565b602454600081116114d85760405162461bcd60e51b8152600401610e40906149cc565b6033546114e582426149fa565b10156115035760405162461bcd60e51b8152600401610e4090614a21565b6023546040516001600160601b0390911681527fca5de5c00e5da52e22f64b23ecfa308e487441bcbd0f4b84657799102e3ee3719060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156115a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c89190614a56565b6023546040516301409c5360e71b81526001600160601b03909116600482015267ffffffffffffffff80841660248301528216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063a04e298090606401600060405180830381600087803b15801561165457600080fd5b505af1158015611668573d6000803e3d6000fd5b505060006024555050602380546001600160601b0319169055505050565b61168e6147db565b60648111156116af5760405162461bcd60e51b8152600401610e4090614b1b565b601f81905542602081815560408051848152918201929092527f236b3b5a701c1727d0ddd01db13475e0da9be45561decb6f0d3d958c18e09e8b9101611215565b6000611006603254614835565b6000611006602054614835565b6117126147db565b60018190554260028190556040805183815260208101929092527f1ed485551399b30c188ed4d426c6c62d7b703b9fec6b486c70a3fe616c2707c89101611215565b61175c6147db565b600081116117c75760405162461bcd60e51b815260206004820152603260248201527f444b47207375626d697474657220707265636564656e636520706572696f642060448201527106c656e677468206d757374206265203e20360741b6064820152608401610e40565b60158190554260168190556040805183815260208101929092527f69f992e32ba993676818a20dfe808b5d41e0db4bdd3a52917701443500a423ca9101611215565b6000611006602c54614835565b61181e6147db565b600654600081116118415760405162461bcd60e51b8152600401610e40906149cc565b60335461184e82426149fa565b101561186c5760405162461bcd60e51b8152600401610e4090614a21565b7f63db42a2e13b78bf39d9f3c14718c3c925ccdf3e30a0477d5a7626914164620260055460405161189f91815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192c9190614aa3565b600554604051639a7d093560e01b81526004810191909152602481018390526044810182905291945092506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169150639a7d093590606401600060405180830381600087803b1580156119a657600080fd5b505af11580156119ba573d6000803e3d6000fd5b5050600060068190556005555050505050565b6119d56147db565b601980546001600160601b0319166001600160601b03831690811790915542601a8190556040805192835260208301919091527f8087387fa6bcbf89a9e273adcf21735f21e89ae8024417df321d8ccc106123089101611215565b611a386147db565b60105460008111611a5b5760405162461bcd60e51b8152600401610e40906149cc565b603354611a6882426149fa565b1015611a865760405162461bcd60e51b8152600401610e4090614a21565b7f54eb240e49fe7d2dc26863f9a2682d5834812e39417dbac77797c3b01b97395c600f54604051611ab991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015611b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4b9190614ad1565b600f546040516377a5a7bd60e01b815260048101889052602481018790526044810191909152606481018490526084810183905260a48101829052959a509398509096509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b158015611be357600080fd5b505af1158015611bf7573d6000803e3d6000fd5b505060006010819055600f555050505050505050565b611c156147db565b60008111611c715760405162461bcd60e51b8152602060048201526024808201527f47726f7570206372656174696f6e206672657175656e6379206d7573742062656044820152630203e20360e41b6064820152608401610e40565b600b81905542600c8190556040805183815260208101929092527f9356f2202b7c2dd20837653ce617753f36c435d28464b7f8c4c4c174acecec3d9101611215565b611cbb6147db565b602b81905542602c8190556040805183815260208101929092527fe7f67ed355ceb941da1b6600c508f5493967c944c9fee75936aaa986b9e0344c9101611215565b6000611006601e54614835565b611d126147db565b60008111611d705760405162461bcd60e51b815260206004820152602560248201527f47726f7570206c69666574696d65206d75737420626520677265617465722074604482015264068616e20360dc1b6064820152608401610e40565b600d81905542600e8190556040805183815260208101929092527f2061f522ba42a34f2907b875dca3bf5f0d999cacbbb635e894ee3c5792727e649101611215565b6000611006602854614835565b6000611006600854614835565b611dd46147db565b602f8190554260308190556040805183815260208101929092527f6ff3903999be3f8c1262f638998917b6d6c6f8097cb7cb9e60edaa1a5f2a66719101611215565b611e1e6147db565b601c5460008111611e415760405162461bcd60e51b8152600401610e40906149cc565b603354611e4e82426149fa565b1015611e6c5760405162461bcd60e51b8152600401610e4090614a21565b601b546040516001600160601b0390911681527f13f3e65295154bda4919d5f46898c2284edbf9283ee94654515cec984e767c809060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa158015611f0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f319190614b49565b50601b54604051630519e99160e01b81526001600160601b0380851660048301528084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b158015611fb557600080fd5b505af1158015611fc9573d6000803e3d6000fd5b50506000601c555050601b80546001600160601b0319169055505050565b611fef6147db565b6027805467ffffffffffffffff191667ffffffffffffffff83169081179091554260288190556040805192835260208301919091527f979c18cc9822195c2af34f89e0713a14edbd9713b32932c60471951cc1fa02db9101611215565b6120546147db565b60405163663032cd60e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063663032cd90602401600060405180830381600087803b1580156120b757600080fd5b505af11580156120cb573d6000803e3d6000fd5b5050505050565b6120da6147db565b60118190554260128190556040805183815260208101929092527fff34014c09b30234094b14f309369c4b204ab5f24daa98f6922ac40a04768bf09101611215565b6121246147db565b61212e600061488b565b565b6121386147db565b6012546000811161215b5760405162461bcd60e51b8152600401610e40906149cc565b60335461216882426149fa565b10156121865760405162461bcd60e51b8152600401610e4090614a21565b7ffc489bb20492c4590e5a1edb8e096301dd7e9c24843a5af9221ddafff010f0f06011546040516121b991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224b9190614ad1565b6011546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101919091526084810183905260a48101829052959a50939850919650909450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156122e457600080fd5b505af11580156122f8573d6000803e3d6000fd5b5050600060128190556011555050505050505050565b6000611006602454614835565b6000611006602654614835565b6123306147db565b603054600081116123535760405162461bcd60e51b8152600401610e40906149cc565b60335461236082426149fa565b101561237e5760405162461bcd60e51b8152600401610e4090614a21565b7fc02f8fddd9d337adf38d4f97d3ab8c91b69075b48db9bc25c461b0d02c3d4092602f546040516123b191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190614b8b565b602f54604051635868086b60e11b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b1580156124c557600080fd5b505af11580156124d9573d6000803e3d6000fd5b505060006030819055602f55505050505050565b6124f56147db565b601a54600081116125185760405162461bcd60e51b8152600401610e40906149cc565b60335461252582426149fa565b10156125435760405162461bcd60e51b8152600401610e4090614a21565b6019546040516001600160601b0390911681527fe1adae42a74e6bb380e06f34e96abe3134e824a1a152a8e6a7458be153404d179060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa1580156125e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126089190614b49565b601954604051630519e99160e01b81526001600160601b038086166004830152918216602482015290821660448201529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b15801561268c57600080fd5b505af11580156126a0573d6000803e3d6000fd5b50506000601a555050601980546001600160601b0319169055505050565b6126c66147db565b600081116127285760405162461bcd60e51b815260206004820152602960248201527f444b4720726573756c74207375626d697373696f6e2074696d656f7574206d7560448201526807374206265203e20360bc1b6064820152608401610e40565b60138190554260148190556040805183815260208101929092527f77bd6dceb389516c704e337d2e53bab8397e3fd1de7e3b852090742804ba13b49101611215565b6127726147db565b602c54600081116127955760405162461bcd60e51b8152600401610e40906149cc565b6033546127a282426149fa565b10156127c05760405162461bcd60e51b8152600401610e4090614a21565b7ff71bf0b76dcaef665875c3a1d4959efda6ea75c7171f5fae1bd305f7c8509283602b546040516127f391815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561285e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128829190614b8b565b602b54604051635868086b60e11b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063b0d010d690608401600060405180830381600087803b15801561290657600080fd5b505af115801561291a573d6000803e3d6000fd5b50506000602c819055602b55505050505050565b6000611006601854614835565b6129436147db565b600c54600081116129665760405162461bcd60e51b8152600401610e40906149cc565b60335461297382426149fa565b10156129915760405162461bcd60e51b8152600401610e4090614a21565b7fe3daa3940e1269d029800f83e889021793ccd69dd79a7152b9171a3071eb45a3600b546040516129c491815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a569190614ad1565b600b546040516377a5a7bd60e01b815260048101919091526024810186905260448101859052606481018490526084810183905260a48101829052949a50929850909650945092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506377a5a7bd9060c401600060405180830381600087803b158015612aed57600080fd5b505af1158015612b01573d6000803e3d6000fd5b50506000600c819055600b555050505050505050565b612b1f6147db565b600a811015612b895760405162461bcd60e51b815260206004820152603060248201527f444b4720726573756c74206368616c6c656e676520706572696f64206c656e6760448201526f07468206d757374206265203e3d2031360841b6064820152608401610e40565b600f8190554260108190556040805183815260208101929092527f4bc54f06db7242d34e1d1cdd7b4b33807a8210c54fc440ba45e6e5ffa04e083d9101611215565b612bd36147db565b601e5460008111612bf65760405162461bcd60e51b8152600401610e40906149cc565b603354612c0382426149fa565b1015612c215760405162461bcd60e51b8152600401610e4090614a21565b7f0945b46b311d9dd20cdadf139b3449fe2e50026e619f33cabedbd7461c429076601d54604051612c5491815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015612cbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce39190614b8b565b601d54604051630ce591ab60e21b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063339646ac90608401600060405180830381600087803b158015612d6757600080fd5b505af1158015612d7b573d6000803e3d6000fd5b50506000601e819055601d55505050505050565b6000611006602a54614835565b612da46147db565b601b80546001600160601b0319166001600160601b03831690811790915542601c8190556040805192835260208301919091527f060327865259e01939f90eed5ad911c6e0509663b7671bccd0f6382f56aba4d39101611215565b612e076147db565b60405163985e648760e01b81526001600160a01b03838116600483015282151560248301527f0000000000000000000000000000000000000000000000000000000000000000169063985e648790604401600060405180830381600087803b158015612e7257600080fd5b505af1158015612e86573d6000803e3d6000fd5b505050505050565b6000611006601a54614835565b6000611006600c54614835565b6000611006601254614835565b612ebd6147db565b60265460008111612ee05760405162461bcd60e51b8152600401610e40906149cc565b603354612eed82426149fa565b1015612f0b5760405162461bcd60e51b8152600401610e4090614a21565b60255460405167ffffffffffffffff90911681527fcc354ece588e8fa730a65a72ebb90039caf81a2a9efedf80e8124566d42a75e89060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd19190614a56565b506025546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff9182166024820152908216604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b15801561305d57600080fd5b505af1158015613071573d6000803e3d6000fd5b5050600060265550506025805467ffffffffffffffff19169055505050565b6130986147db565b600a54600081116130bb5760405162461bcd60e51b8152600401610e40906149cc565b6033546130c882426149fa565b10156130e65760405162461bcd60e51b8152600401610e4090614a21565b7f01e43c4ca2dc8df5a6c64198b1ad31e61ff7584833e5a7933892dd79d8eb905260095460405161311991815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015613182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a69190614aa3565b50600954604051639a7d093560e01b81526004810184905260248101839052604481019190915291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561322057600080fd5b505af1158015613234573d6000803e3d6000fd5b50506000600a8190556009555050505050565b6000611006600254614835565b61325c6147db565b6018546000811161327f5760405162461bcd60e51b8152600401610e40906149cc565b60335461328c82426149fa565b10156132aa5760405162461bcd60e51b8152600401610e4090614a21565b6017546040516001600160601b0390911681527f5e7ca6fb8d090a2753e006c53b0aab79da28ab5e198b62cc105bda8f96caa6a09060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa15801561334b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061336f9190614b49565b601754604051630519e99160e01b81526001600160601b0391821660048201528184166024820152908216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169150630519e99190606401600060405180830381600087803b1580156133f357600080fd5b505af1158015613407573d6000803e3d6000fd5b505060006018555050601780546001600160601b0319169055505050565b61342d6147db565b602d81905542602e8190556040805183815260208101929092527f8ff92b4fa51728d3b3bebd82f5bcfa8904b0278abbce025a1e33aaf9719fdb0d9101611215565b6134776147db565b6001600160a01b0381166134e95760405162461bcd60e51b815260206004820152603360248201527f4e65772072616e646f6d20626561636f6e20676f7665726e616e636520616464604482015272726573732063616e6e6f74206265207a65726f60681b6064820152608401610e40565b600380546001600160a01b0319166001600160a01b0383169081179091554260048190556040805192835260208301919091527fcda4dd0dbaee4278532e4689e026f08f707ec8602188caa303750b225cde00789101611215565b61354c6147db565b6022546000811161356f5760405162461bcd60e51b8152600401610e40906149cc565b60335461357c82426149fa565b101561359a5760405162461bcd60e51b8152600401610e4090614a21565b7f32aac559d8ae735853362fec3c6751b37b45f12097c074ee06d51b10180c68626021546040516135cd91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365c9190614b8b565b602154604051630ce591ab60e21b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b1580156136e157600080fd5b505af11580156136f5573d6000803e3d6000fd5b505060006022819055602155505050505050565b6137116147db565b60648111156137325760405162461bcd60e51b8152600401610e4090614b1b565b60218190554260228190556040805183815260208101929092527fb62064224fade801c12ce2e348d8fff15f8e451792137664811b44b6ffe37d919101611215565b6000611006600e54614835565b6137896147db565b601780546001600160601b0319166001600160601b0383169081179091554260188190556040805192835260208301919091527fb5da59c72c3f617da3620449ee7c88d5b8a81e1f98e9f61fc62207ecab6b099f9101611215565b6137ec6147db565b6016546000811161380f5760405162461bcd60e51b8152600401610e40906149cc565b60335461381c82426149fa565b101561383a5760405162461bcd60e51b8152600401610e4090614a21565b7ffc88a5167b8569e72b62f4b76b3caae7699e46c7f6f16a8d011b135ac613acc460155460405161386d91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156138db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138ff9190614ad1565b506015546040516377a5a7bd60e01b8152600481018790526024810186905260448101859052606481018490526084810183905260a4810191909152949950929750909550935091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561399657600080fd5b505af11580156139aa573d6000803e3d6000fd5b5050600060168190556015555050505050505050565b6139c86147db565b600454600081116139eb5760405162461bcd60e51b8152600401610e40906149cc565b6033546139f882426149fa565b1015613a165760405162461bcd60e51b8152600401610e4090614a21565b6003546040516001600160a01b0390911681527f2682a33c437aa00b19b3e527d140e9800f735bc8fab66653e6ae22c8d07b4a909060200160405180910390a16003546040516334e2fffd60e21b81526001600160a01b0391821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063d38bfff490602401600060405180830381600087803b158015613abe57600080fd5b505af1158015613ad2573d6000803e3d6000fd5b505060006004555050600380546001600160a01b031916905550565b613af66147db565b60318190554260328190556040805183815260208101929092527f9eeb84ca445446640c66e65b8036794dd92ad3c3b9177714c8802c2644ab79e59101611215565b613b406147db565b60078190554260088190556040805183815260208101929092527f9cd90f9d45b916da6108ff464eaded2b92aa41867f12437a20b57247298086979101611215565b613b8a6147db565b60325460008111613bad5760405162461bcd60e51b8152600401610e40906149cc565b603354613bba82426149fa565b1015613bd85760405162461bcd60e51b8152600401610e4090614a21565b7f274cf9dfd48eeb8969817e347b3a2951ff7b3127772bd70827012266466ae229603154604051613c0b91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa158015613c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9a9190614b8b565b50603154604051635868086b60e11b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b0d010d690608401600060405180830381600087803b158015613d1e57600080fd5b505af1158015613d32573d6000803e3d6000fd5b505060006032819055603155505050505050565b613d4e6147db565b600081118015613d615750620f42408111155b613dc35760405162461bcd60e51b815260206004820152602d60248201527f43616c6c6261636b20676173206c696d6974206d757374206265203e2030206160448201526c06e64203c3d203130303030303609c1b6064820152608401610e40565b600981905542600a8190556040805183815260208101929092527f0aeac6506f5606a033c22dd1659065c5f75e5ea933fd3b49948ea79a59759b239101611215565b613e0d6147db565b60008111613e695760405162461bcd60e51b8152602060048201526024808201527f52656c617920656e74727920736f66742074696d656f7574206d7573742062656044820152630203e20360e41b6064820152608401610e40565b60058190554260068190556040805183815260208101929092527fb4c6d786da48691c308faaf332c8a4ccaa952d2145eb5798624c60548ce4b8a39101611215565b6000611006603054614835565b613ec06147db565b602a5460008111613ee35760405162461bcd60e51b8152600401610e40906149cc565b603354613ef082426149fa565b1015613f0e5760405162461bcd60e51b8152600401610e4090614a21565b7f8ad0f1f70b7c422ad8dee17b865a5118d91bc633151cdf66293f7827fea7164c602954604051613f4191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fd09190614b8b565b50602954604051630ce591ab60e21b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063339646ac90608401600060405180830381600087803b15801561405457600080fd5b505af1158015614068573d6000803e3d6000fd5b50506000602a819055602955505050505050565b6140846147db565b602380546001600160601b0319166001600160601b0383169081179091554260248190556040805192835260208301919091527f456911403e756f0141f9a154095c7495b7002db4f6b26a7ff03c4f09335abc4b9101611215565b6140e76147db565b602e546000811161410a5760405162461bcd60e51b8152600401610e40906149cc565b60335461411782426149fa565b10156141355760405162461bcd60e51b8152600401610e4090614a21565b7f9eb4413d73f3cae81d9e8ab119d94a8d2cd6b2564117c30f2112b972dcf84f96602d5460405161416891815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa1580156141d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f79190614b8b565b602d54604051635868086b60e11b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b15801561427b57600080fd5b505af115801561428f573d6000803e3d6000fd5b50506000602e819055602d55505050505050565b6000611006600454614835565b6142b86147db565b602054600081116142db5760405162461bcd60e51b8152600401610e40906149cc565b6033546142e882426149fa565b10156143065760405162461bcd60e51b8152600401610e4090614a21565b7f3114ff9b112e2012da7dadf3d620cfd5af0546afe8cd887c052f0166fddb0004601f5460405161433991815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa1580156143a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143c89190614b8b565b601f54604051630ce591ab60e21b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b15801561444c57600080fd5b505af1158015614460573d6000803e3d6000fd5b505060006020819055601f55505050505050565b6000611006601c54614835565b6000611006601654614835565b6000611006602254614835565b6000611006600a54614835565b6144b06147db565b60648111156144d15760405162461bcd60e51b8152600401610e4090614b1b565b602981905542602a8190556040805183815260208101929092527f363de88db002648ead34367d7bc43c7eb86051555a3e29ff3d6ab2cd12f880569101611215565b6000611006602e54614835565b6145286147db565b6014546000811161454b5760405162461bcd60e51b8152600401610e40906149cc565b60335461455882426149fa565b10156145765760405162461bcd60e51b8152600401610e4090614a21565b7ff0db347eb933ec2636808975682b1fd63249be20775411ced58d2fd61e0fe7426013546040516145a991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015614617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061463b9190614ad1565b6013546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101859052608481019190915260a48101829052959a509398509196509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156146d357600080fd5b505af11580156146e7573d6000803e3d6000fd5b5050600060148190556013555050505050505050565b6147056147db565b6001600160a01b03811661476a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e40565b6147738161488b565b50565b61477e6147db565b6025805467ffffffffffffffff191667ffffffffffffffff83169081179091554260268190556040805192835260208301919091527f98f756aaf5ba8f60be58f0b035a3a5f54bdfbc5d1ada450c235b9e500625df389101611215565b6000546001600160a01b0316331461212e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e40565b60008082116148565760405162461bcd60e51b8152600401610e40906149cc565b600061486283426149fa565b905060335481106148765750600092915050565b8060335461488491906149fa565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156148ed57600080fd5b5035919050565b6001600160601b038116811461477357600080fd5b60006020828403121561491b57600080fd5b8135614884816148f4565b67ffffffffffffffff8116811461477357600080fd5b60006020828403121561494e57600080fd5b813561488481614926565b80356001600160a01b038116811461497057600080fd5b919050565b60006020828403121561498757600080fd5b61488482614959565b600080604083850312156149a357600080fd5b6149ac83614959565b9150602083013580151581146149c157600080fd5b809150509250929050565b60208082526014908201527310da185b99d9481b9bdd081a5b9a5d1a585d195960621b604082015260600190565b81810381811115614a1b57634e487b7160e01b600052601160045260246000fd5b92915050565b6020808252818101527f476f7665726e616e63652064656c617920686173206e6f7420656c6170736564604082015260600190565b600080600060608486031215614a6b57600080fd5b8351614a76816148f4565b6020850151909350614a8781614926565b6040850151909250614a9881614926565b809150509250925092565b600080600060608486031215614ab857600080fd5b8351925060208401519150604084015190509250925092565b60008060008060008060c08789031215614aea57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60208082526014908201527304d6178696d756d2076616c7565206973203130360641b604082015260600190565b600080600060608486031215614b5e57600080fd5b8351614b69816148f4565b6020850151909350614b7a816148f4565b6040850151909250614a98816148f4565b60008060008060808587031215614ba157600080fd5b50508251602084015160408501516060909501519196909550909250905056fea2646970667358221220dff594b8c6aac1a365d035d01ae8eae9d7c80e0425bd51442abea140d74a917e64736f6c63430008110033",
2441
+ "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract RandomBeacon\",\"name\":\"_randomBeacon\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_governanceDelay\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseChangePeriod\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"AuthorizationDecreaseChangePeriodUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseChangePeriod\",\"type\":\"uint64\"}],\"name\":\"AuthorizationDecreaseChangePeriodUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseDelay\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"AuthorizationDecreaseDelayUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"authorizationDecreaseDelay\",\"type\":\"uint64\"}],\"name\":\"AuthorizationDecreaseDelayUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callbackGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"CallbackGasLimitUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callbackGasLimit\",\"type\":\"uint256\"}],\"name\":\"CallbackGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgMaliciousResultNotificationRewardMultiplier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgMaliciousResultNotificationRewardMultiplierUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgMaliciousResultNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"DkgMaliciousResultNotificationRewardMultiplierUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultApprovalGasOffset\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultApprovalGasOffsetUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultApprovalGasOffset\",\"type\":\"uint256\"}],\"name\":\"DkgResultApprovalGasOffsetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengeExtraGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengeExtraGasUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengeExtraGas\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengeExtraGasUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengePeriodLength\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengePeriodLengthUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultChallengePeriodLength\",\"type\":\"uint256\"}],\"name\":\"DkgResultChallengePeriodLengthUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionGasUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionGas\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionGasUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionTimeoutUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dkgResultSubmissionTimeout\",\"type\":\"uint256\"}],\"name\":\"DkgResultSubmissionTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"submitterPrecedencePeriodLength\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"DkgSubmitterPrecedencePeriodLengthUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"submitterPrecedencePeriodLength\",\"type\":\"uint256\"}],\"name\":\"DkgSubmitterPrecedencePeriodLengthUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"governanceDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"GovernanceDelayUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"governanceDelay\",\"type\":\"uint256\"}],\"name\":\"GovernanceDelayUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupCreationFrequency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"GroupCreationFrequencyUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupCreationFrequency\",\"type\":\"uint256\"}],\"name\":\"GroupCreationFrequencyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupLifetime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"GroupLifetimeUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"groupLifetime\",\"type\":\"uint256\"}],\"name\":\"GroupLifetimeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"maliciousDkgResultSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"MaliciousDkgResultSlashingAmountUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"maliciousDkgResultSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"MaliciousDkgResultSlashingAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"minimumAuthorization\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"MinimumAuthorizationUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"minimumAuthorization\",\"type\":\"uint96\"}],\"name\":\"MinimumAuthorizationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"notifyOperatorInactivityGasOffset\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"NotifyOperatorInactivityGasOffsetUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"notifyOperatorInactivityGasOffset\",\"type\":\"uint256\"}],\"name\":\"NotifyOperatorInactivityGasOffsetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRandomBeaconGovernance\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RandomBeaconGovernanceTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRandomBeaconGovernance\",\"type\":\"address\"}],\"name\":\"RandomBeaconGovernanceTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryHardTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntryHardTimeoutUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryHardTimeout\",\"type\":\"uint256\"}],\"name\":\"RelayEntryHardTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySoftTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySoftTimeoutUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySoftTimeout\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySoftTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"relayEntrySubmissionFailureSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySubmissionFailureSlashingAmountUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"relayEntrySubmissionFailureSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"RelayEntrySubmissionFailureSlashingAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySubmissionGasOffset\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySubmissionGasOffsetUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntrySubmissionGasOffset\",\"type\":\"uint256\"}],\"name\":\"RelayEntrySubmissionGasOffsetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"RelayEntryTimeoutNotificationRewardMultiplierUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"relayEntryTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"RelayEntryTimeoutNotificationRewardMultiplierUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sortitionPoolRewardsBanDuration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"SortitionPoolRewardsBanDurationUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sortitionPoolRewardsBanDuration\",\"type\":\"uint256\"}],\"name\":\"SortitionPoolRewardsBanDurationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unauthorizedSigningTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UnauthorizedSigningNotificationRewardMultiplierUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unauthorizedSigningTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"UnauthorizedSigningNotificationRewardMultiplierUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"unauthorizedSigningSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"name\":\"UnauthorizedSigningSlashingAmountUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"unauthorizedSigningSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"UnauthorizedSigningSlashingAmountUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"authorizationDecreaseChangePeriodChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"authorizationDecreaseDelayChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_newAuthorizationDecreaseChangePeriod\",\"type\":\"uint64\"}],\"name\":\"beginAuthorizationDecreaseChangePeriodUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_newAuthorizationDecreaseDelay\",\"type\":\"uint64\"}],\"name\":\"beginAuthorizationDecreaseDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newCallbackGasLimit\",\"type\":\"uint256\"}],\"name\":\"beginCallbackGasLimitUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgMaliciousResultNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"beginDkgMaliciousResultNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultApprovalGasOffset\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultApprovalGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultChallengeExtraGas\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultChallengeExtraGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultChallengePeriodLength\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultChallengePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultSubmissionGas\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultSubmissionGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgResultSubmissionTimeout\",\"type\":\"uint256\"}],\"name\":\"beginDkgResultSubmissionTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newDkgSubmitterPrecedencePeriodLength\",\"type\":\"uint256\"}],\"name\":\"beginDkgSubmitterPrecedencePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newGovernanceDelay\",\"type\":\"uint256\"}],\"name\":\"beginGovernanceDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newGroupCreationFrequency\",\"type\":\"uint256\"}],\"name\":\"beginGroupCreationFrequencyUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newGroupLifetime\",\"type\":\"uint256\"}],\"name\":\"beginGroupLifetimeUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newMaliciousDkgResultSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"beginMaliciousDkgResultSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newMinimumAuthorization\",\"type\":\"uint96\"}],\"name\":\"beginMinimumAuthorizationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNotifyOperatorInactivityGasOffset\",\"type\":\"uint256\"}],\"name\":\"beginNotifyOperatorInactivityGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newRandomBeaconGovernance\",\"type\":\"address\"}],\"name\":\"beginRandomBeaconGovernanceTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntryHardTimeout\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntryHardTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntrySoftTimeout\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntrySoftTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newRelayEntrySubmissionFailureSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"beginRelayEntrySubmissionFailureSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntrySubmissionGasOffset\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntrySubmissionGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newRelayEntryTimeoutNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"beginRelayEntryTimeoutNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newSortitionPoolRewardsBanDuration\",\"type\":\"uint256\"}],\"name\":\"beginSortitionPoolRewardsBanDurationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newUnauthorizedSigningNotificationRewardMultiplier\",\"type\":\"uint256\"}],\"name\":\"beginUnauthorizedSigningNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_newUnauthorizedSigningSlashingAmount\",\"type\":\"uint96\"}],\"name\":\"beginUnauthorizedSigningSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"callbackGasLimitChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgMaliciousResultNotificationRewardMultiplierChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultApprovalGasOffsetChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultChallengeExtraGasChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultChallengePeriodLengthChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultSubmissionGasChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgResultSubmissionTimeoutChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dkgSubmitterPrecedencePeriodLengthChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeAuthorizationDecreaseChangePeriodUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeAuthorizationDecreaseDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeCallbackGasLimitUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultApprovalGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultChallengeExtraGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultChallengePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultSubmissionGasUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgResultSubmissionTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeDkgSubmitterPrecedencePeriodLengthUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeGovernanceDelayUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeGroupCreationFrequencyUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeGroupLifetimeUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeMaliciousDkgResultSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeMinimumAuthorizationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeNotifyOperatorInactivityGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRandomBeaconGovernanceTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntryHardTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntrySoftTimeoutUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntrySubmissionFailureSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntrySubmissionGasOffsetUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeSortitionPoolRewardsBanDurationUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeUnauthorizedSigningSlashingAmountUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingAuthorizationDecreaseChangePeriodUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingAuthorizationDecreaseDelayUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingCallbackGasLimitUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultApprovalGasOffsetUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultChallengeExtraGasUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultChallengePeriodLengthUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultSubmissionGasUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgResultSubmissionTimeoutUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingGovernanceDelayUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingGroupCreationFrequencyUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingGroupLifetimeUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingMaliciousDkgResultSlashingAmountUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingMimimumAuthorizationUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingNotifyOperatorInactivityGasOffsetUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRandomBeaconGovernanceTransferDelayTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntryHardTimeoutUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntrySoftTimeoutUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntrySubmissionGasOffsetUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingSortitionPoolRewardsBanDurationUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRemainingUnauthorizedSigningSlashingAmountUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governanceDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governanceDelayChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"groupCreationFrequencyChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"groupLifetimeChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maliciousDkgResultSlashingAmountChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumAuthorizationChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newAuthorizationDecreaseChangePeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newAuthorizationDecreaseDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newCallbackGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgMaliciousResultNotificationRewardMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultApprovalGasOffset\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultChallengeExtraGas\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultChallengePeriodLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultSubmissionGas\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgResultSubmissionTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newDkgSubmitterPrecedencePeriodLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newGovernanceDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newGroupCreationFrequency\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newGroupLifetime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newMaliciousDkgResultSlashingAmount\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newMinimumAuthorization\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newNotifyOperatorInactivityGasOffset\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRandomBeaconGovernance\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntryHardTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntrySoftTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntrySubmissionFailureSlashingAmount\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntrySubmissionGasOffset\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newRelayEntryTimeoutNotificationRewardMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newSortitionPoolRewardsBanDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newUnauthorizedSigningNotificationRewardMultiplier\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newUnauthorizedSigningSlashingAmount\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"notifyOperatorInactivityGasOffsetChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomBeacon\",\"outputs\":[{\"internalType\":\"contract RandomBeacon\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomBeaconGovernanceTransferInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntryHardTimeoutChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntrySoftTimeoutChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntrySubmissionFailureSlashingAmountChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntrySubmissionGasOffsetChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayEntryTimeoutNotificationRewardMultiplierChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isAuthorized\",\"type\":\"bool\"}],\"name\":\"setRequesterAuthorization\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionPoolRewardsBanDurationChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unauthorizedSigningNotificationRewardMultiplierChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unauthorizedSigningSlashingAmountChangeInitiated\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdrawIneligibleRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"beginAuthorizationDecreaseChangePeriodUpdate(uint64)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newAuthorizationDecreaseChangePeriod\":\"New authorization decrease change period\"}},\"beginAuthorizationDecreaseDelayUpdate(uint64)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newAuthorizationDecreaseDelay\":\"New authorization decrease delay\"}},\"beginCallbackGasLimitUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newCallbackGasLimit\":\"New callback gas limit\"}},\"beginDkgMaliciousResultNotificationRewardMultiplierUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgMaliciousResultNotificationRewardMultiplier\":\"New DKG malicious result notification reward multiplier.\"}},\"beginDkgResultApprovalGasOffsetUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultApprovalGasOffset\":\"New DKG approval gas offset\"}},\"beginDkgResultChallengeExtraGasUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultChallengeExtraGas\":\"New DKG result challenge extra gas\"}},\"beginDkgResultChallengePeriodLengthUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultChallengePeriodLength\":\"New DKG result challenge period length in blocks\"}},\"beginDkgResultSubmissionGasUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultSubmissionGas\":\"New relay entry submission gas offset\"}},\"beginDkgResultSubmissionTimeoutUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgResultSubmissionTimeout\":\"New DKG result submission timeout in blocks\"}},\"beginDkgSubmitterPrecedencePeriodLengthUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newDkgSubmitterPrecedencePeriodLength\":\"New DKG submitter precedence period length in blocks\"}},\"beginGovernanceDelayUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newGovernanceDelay\":\"New governance delay\"}},\"beginGroupCreationFrequencyUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newGroupCreationFrequency\":\"New group creation frequency\"}},\"beginGroupLifetimeUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newGroupLifetime\":\"New group lifetime in blocks\"}},\"beginMaliciousDkgResultSlashingAmountUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newMaliciousDkgResultSlashingAmount\":\"New malicious DKG result slashing amount\"}},\"beginMinimumAuthorizationUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newMinimumAuthorization\":\"New minimum authorization amount.\"}},\"beginNotifyOperatorInactivityGasOffsetUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newNotifyOperatorInactivityGasOffset\":\"New operator inactivity notification gas offset\"}},\"beginRandomBeaconGovernanceTransfer(address)\":{\"details\":\"Can be called only by the current contract governance.\"},\"beginRelayEntryHardTimeoutUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntryHardTimeout\":\"New relay entry hard timeout in blocks\"}},\"beginRelayEntrySoftTimeoutUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntrySoftTimeout\":\"New relay entry submission timeout in blocks\"}},\"beginRelayEntrySubmissionFailureSlashingAmountUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntrySubmissionFailureSlashingAmount\":\"New relay entry submission failure slashing amount\"}},\"beginRelayEntrySubmissionGasOffsetUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntrySubmissionGasOffset\":\"New relay entry submission gas offset\"}},\"beginRelayEntryTimeoutNotificationRewardMultiplierUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newRelayEntryTimeoutNotificationRewardMultiplier\":\"New relay entry timeout notification reward multiplier.\"}},\"beginSortitionPoolRewardsBanDurationUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newSortitionPoolRewardsBanDuration\":\"New sortition pool rewards ban duration.\"}},\"beginUnauthorizedSigningNotificationRewardMultiplierUpdate(uint256)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newUnauthorizedSigningNotificationRewardMultiplier\":\"New unauthorized signing notification reward multiplier.\"}},\"beginUnauthorizedSigningSlashingAmountUpdate(uint96)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"_newUnauthorizedSigningSlashingAmount\":\"New unauthorized signing slashing amount\"}},\"finalizeAuthorizationDecreaseChangePeriodUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeAuthorizationDecreaseDelayUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeCallbackGasLimitUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultApprovalGasOffsetUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultChallengeExtraGasUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultChallengePeriodLengthUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultSubmissionGasUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgResultSubmissionTimeoutUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeDkgSubmitterPrecedencePeriodLengthUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeGovernanceDelayUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeGroupCreationFrequencyUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeGroupLifetimeUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeMaliciousDkgResultSlashingAmountUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeMinimumAuthorizationUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeNotifyOperatorInactivityGasOffsetUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRandomBeaconGovernanceTransfer()\":{\"details\":\"Can be called only by the current contract governance, after the governance delay elapses.\"},\"finalizeRelayEntryHardTimeoutUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntrySoftTimeoutUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntrySubmissionFailureSlashingAmountUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntrySubmissionGasOffsetUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeSortitionPoolRewardsBanDurationUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"finalizeUnauthorizedSigningSlashingAmountUpdate()\":{\"details\":\"Can be called only by the contract owner, after the governance delay elapses.\"},\"getRemainingAuthorizationDecreaseChangePeriodUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingAuthorizationDecreaseDelayUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingCallbackGasLimitUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultApprovalGasOffsetUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultChallengeExtraGasUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultChallengePeriodLengthUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultSubmissionGasUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgResultSubmissionTimeoutUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingGovernanceDelayUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingGroupCreationFrequencyUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingGroupLifetimeUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingMaliciousDkgResultSlashingAmountUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingMimimumAuthorizationUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingNotifyOperatorInactivityGasOffsetUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRandomBeaconGovernanceTransferDelayTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntryHardTimeoutUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntrySoftTimeoutUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntrySubmissionGasOffsetUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingSortitionPoolRewardsBanDurationUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"getRemainingUnauthorizedSigningSlashingAmountUpdateTime()\":{\"returns\":{\"_0\":\"Remaining time in seconds.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setRequesterAuthorization(address,bool)\":{\"params\":{\"isAuthorized\":\"True or false\",\"requester\":\"Requester, can be a contract or EOA\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawIneligibleRewards(address)\":{\"details\":\"Can be called only by the contract owner.\",\"params\":{\"recipient\":\"Recipient of withdrawn rewards.\"}}},\"title\":\"Keep Random Beacon Governance\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"beginAuthorizationDecreaseChangePeriodUpdate(uint64)\":{\"notice\":\"Begins the authorization decrease change period update process.\"},\"beginAuthorizationDecreaseDelayUpdate(uint64)\":{\"notice\":\"Begins the authorization decrease delay update process.\"},\"beginCallbackGasLimitUpdate(uint256)\":{\"notice\":\"Begins the callback gas limit update process.\"},\"beginDkgMaliciousResultNotificationRewardMultiplierUpdate(uint256)\":{\"notice\":\"Begins the DKG malicious result notification reward multiplier update process.\"},\"beginDkgResultApprovalGasOffsetUpdate(uint256)\":{\"notice\":\"Begins the DKG result approval gas offset update process.\"},\"beginDkgResultChallengeExtraGasUpdate(uint256)\":{\"notice\":\"Begins the DKG result challenge extra gas update process.\"},\"beginDkgResultChallengePeriodLengthUpdate(uint256)\":{\"notice\":\"Begins the DKG result challenge period length update process.\"},\"beginDkgResultSubmissionGasUpdate(uint256)\":{\"notice\":\"Begins the DKG result submission gas update process.\"},\"beginDkgResultSubmissionTimeoutUpdate(uint256)\":{\"notice\":\"Begins the DKG result submission timeout update process.\"},\"beginDkgSubmitterPrecedencePeriodLengthUpdate(uint256)\":{\"notice\":\"Begins the DKG submitter precedence period length.\"},\"beginGovernanceDelayUpdate(uint256)\":{\"notice\":\"Begins the governance delay update process.\"},\"beginGroupCreationFrequencyUpdate(uint256)\":{\"notice\":\"Begins the group creation frequency update process.\"},\"beginGroupLifetimeUpdate(uint256)\":{\"notice\":\"Begins the group lifetime update process. Group lifetime needs to be shorter than the authorization decrease delay to ensure every active group is backed by enough stake. A new group lifetime value is in blocks and has to be calculated based on the average block time and authorization decrease delay which value is in seconds.\"},\"beginMaliciousDkgResultSlashingAmountUpdate(uint96)\":{\"notice\":\"Begins the malicious DKG result slashing amount update process.\"},\"beginMinimumAuthorizationUpdate(uint96)\":{\"notice\":\"Begins the minimum authorization amount update process.\"},\"beginNotifyOperatorInactivityGasOffsetUpdate(uint256)\":{\"notice\":\"Begins the notify operator inactivity gas offset update process.\"},\"beginRandomBeaconGovernanceTransfer(address)\":{\"notice\":\"Begins the random beacon governance transfer process.\"},\"beginRelayEntryHardTimeoutUpdate(uint256)\":{\"notice\":\"Begins the relay entry hard timeout update process.\"},\"beginRelayEntrySoftTimeoutUpdate(uint256)\":{\"notice\":\"Begins the relay entry soft timeout update process.\"},\"beginRelayEntrySubmissionFailureSlashingAmountUpdate(uint96)\":{\"notice\":\"Begins the relay entry submission failure slashing amount update process.\"},\"beginRelayEntrySubmissionGasOffsetUpdate(uint256)\":{\"notice\":\"Begins the relay entry submission gas offset update process.\"},\"beginRelayEntryTimeoutNotificationRewardMultiplierUpdate(uint256)\":{\"notice\":\"Begins the relay entry timeout notification reward multiplier update process.\"},\"beginSortitionPoolRewardsBanDurationUpdate(uint256)\":{\"notice\":\"Begins the sortition pool rewards ban duration update process.\"},\"beginUnauthorizedSigningNotificationRewardMultiplierUpdate(uint256)\":{\"notice\":\"Begins the unauthorized signing notification reward multiplier update process.\"},\"beginUnauthorizedSigningSlashingAmountUpdate(uint96)\":{\"notice\":\"Begins the unauthorized signing slashing amount update process.\"},\"finalizeAuthorizationDecreaseChangePeriodUpdate()\":{\"notice\":\"Finalizes the authorization decrease change period update process.\"},\"finalizeAuthorizationDecreaseDelayUpdate()\":{\"notice\":\"Finalizes the authorization decrease delay update process.\"},\"finalizeCallbackGasLimitUpdate()\":{\"notice\":\"Finalizes the callback gas limit update process.\"},\"finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate()\":{\"notice\":\"Finalizes the DKG malicious result notification reward multiplier update process.\"},\"finalizeDkgResultApprovalGasOffsetUpdate()\":{\"notice\":\"Finalizes the DKG result approval gas offset update process.\"},\"finalizeDkgResultChallengeExtraGasUpdate()\":{\"notice\":\"Finalizes the DKG result challenge extra gas update process.\"},\"finalizeDkgResultChallengePeriodLengthUpdate()\":{\"notice\":\"Finalizes the DKG result challenge period length update process.\"},\"finalizeDkgResultSubmissionGasUpdate()\":{\"notice\":\"Finalizes DKG result submission gas update process.\"},\"finalizeDkgResultSubmissionTimeoutUpdate()\":{\"notice\":\"Finalizes the DKG result submission timeout update process.\"},\"finalizeDkgSubmitterPrecedencePeriodLengthUpdate()\":{\"notice\":\"Finalizes the DKG submitter precedence period length.\"},\"finalizeGovernanceDelayUpdate()\":{\"notice\":\"Finalizes the governance delay update process.\"},\"finalizeGroupCreationFrequencyUpdate()\":{\"notice\":\"Finalizes the group creation frequency update process.\"},\"finalizeGroupLifetimeUpdate()\":{\"notice\":\"Finalizes the group creation frequency update process.\"},\"finalizeMaliciousDkgResultSlashingAmountUpdate()\":{\"notice\":\"Finalizes the malicious DKG result slashing amount update process.\"},\"finalizeMinimumAuthorizationUpdate()\":{\"notice\":\"Finalizes the minimum authorization amount update process.\"},\"finalizeNotifyOperatorInactivityGasOffsetUpdate()\":{\"notice\":\"Finalizes the notify operator inactivity gas offset update process.\"},\"finalizeRandomBeaconGovernanceTransfer()\":{\"notice\":\"Finalizes the random beacon governance transfer process.\"},\"finalizeRelayEntryHardTimeoutUpdate()\":{\"notice\":\"Finalizes the relay entry hard timeout update process.\"},\"finalizeRelayEntrySoftTimeoutUpdate()\":{\"notice\":\"Finalizes the relay entry soft timeout update process.\"},\"finalizeRelayEntrySubmissionFailureSlashingAmountUpdate()\":{\"notice\":\"Finalizes the relay entry submission failure slashing amount update process.\"},\"finalizeRelayEntrySubmissionGasOffsetUpdate()\":{\"notice\":\"Finalizes relay entry submission gas offset update process.\"},\"finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate()\":{\"notice\":\"Finalizes the relay entry timeout notification reward multiplier update process.\"},\"finalizeSortitionPoolRewardsBanDurationUpdate()\":{\"notice\":\"Finalizes the sortition pool rewards ban duration update process.\"},\"finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate()\":{\"notice\":\"Finalizes the unauthorized signing notification reward multiplier update process.\"},\"finalizeUnauthorizedSigningSlashingAmountUpdate()\":{\"notice\":\"Finalizes the unauthorized signing slashing amount update process.\"},\"getRemainingAuthorizationDecreaseChangePeriodUpdateTime()\":{\"notice\":\"Get the time remaining until the authorization decrease change period can be updated.\"},\"getRemainingAuthorizationDecreaseDelayUpdateTime()\":{\"notice\":\"Get the time remaining until the authorization decrease delay can be updated.\"},\"getRemainingCallbackGasLimitUpdateTime()\":{\"notice\":\"Get the time remaining until the callback gas limit can be updated.\"},\"getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG malicious result notification reward multiplier duration can be updated.\"},\"getRemainingDkgResultApprovalGasOffsetUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG approval gas offset duration can be updated.\"},\"getRemainingDkgResultChallengeExtraGasUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result challenge extra gas can be updated.\"},\"getRemainingDkgResultChallengePeriodLengthUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result challenge period length can be updated.\"},\"getRemainingDkgResultSubmissionGasUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result submission gas duration can be updated.\"},\"getRemainingDkgResultSubmissionTimeoutUpdateTime()\":{\"notice\":\"Get the time remaining until the DKG result submission timeout can be updated.\"},\"getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime()\":{\"notice\":\"Get the time remaining until the wallet owner can be updated.\"},\"getRemainingGovernanceDelayUpdateTime()\":{\"notice\":\"Get the time remaining until the governance delay can be updated.\"},\"getRemainingGroupCreationFrequencyUpdateTime()\":{\"notice\":\"Get the time remaining until the group creation frequency can be updated.\"},\"getRemainingGroupLifetimeUpdateTime()\":{\"notice\":\"Get the time remaining until the group lifetime can be updated.\"},\"getRemainingMaliciousDkgResultSlashingAmountUpdateTime()\":{\"notice\":\"Get the time remaining until the malicious DKG result slashing amount can be updated.\"},\"getRemainingMimimumAuthorizationUpdateTime()\":{\"notice\":\"Get the time remaining until the minimum authorization amount can be updated.\"},\"getRemainingNotifyOperatorInactivityGasOffsetUpdateTime()\":{\"notice\":\"Get the time remaining until the operator inactivity notification gas offset duration can be updated.\"},\"getRemainingRandomBeaconGovernanceTransferDelayTime()\":{\"notice\":\"Get the time remaining until the random beacon governance can be transferred.\"},\"getRemainingRelayEntryHardTimeoutUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry hard timeout can be updated.\"},\"getRemainingRelayEntrySoftTimeoutUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry submission soft timeout can be updated.\"},\"getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry submission failure slashing amount can be updated.\"},\"getRemainingRelayEntrySubmissionGasOffsetUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry submission gas offset duration can be updated.\"},\"getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime()\":{\"notice\":\"Get the time remaining until the relay entry timeout notification reward multiplier duration can be updated.\"},\"getRemainingSortitionPoolRewardsBanDurationUpdateTime()\":{\"notice\":\"Get the time remaining until the sortition pool rewards ban duration can be updated.\"},\"getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime()\":{\"notice\":\"Get the time remaining until the unauthorized signing notification reward multiplier duration can be updated.\"},\"getRemainingUnauthorizedSigningSlashingAmountUpdateTime()\":{\"notice\":\"Get the time remaining until the unauthorized signing slashing amount can be updated.\"},\"setRequesterAuthorization(address,bool)\":{\"notice\":\"Set authorization for requesters that can request a relay entry. It can be done by the governance only.\"},\"withdrawIneligibleRewards(address)\":{\"notice\":\"Withdraws rewards belonging to operators marked as ineligible for sortition pool rewards.\"}},\"notice\":\"Owns the `RandomBeacon` contract and is responsible for updating its governable parameters in respect to governance delay individual for each parameter.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/RandomBeaconGovernance.sol\":\"RandomBeaconGovernance\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@keep-network/sortition-pools/contracts/Branch.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Constants.sol\\\";\\n\\n/// @notice The implicit 8-ary trees of the sortition pool\\n/// rely on packing 8 \\\"slots\\\" of 32-bit values into each uint256.\\n/// The Branch library permits efficient calculations on these slots.\\nlibrary Branch {\\n /// @notice Calculate the right shift required\\n /// to make the 32 least significant bits of an uint256\\n /// be the bits of the `position`th slot\\n /// when treating the uint256 as a uint32[8].\\n ///\\n /// @dev Not used for efficiency reasons,\\n /// but left to illustrate the meaning of a common pattern.\\n /// I wish solidity had macros, even C macros.\\n function slotShift(uint256 position) internal pure returns (uint256) {\\n unchecked {\\n return position * Constants.SLOT_WIDTH;\\n }\\n }\\n\\n /// @notice Return the `position`th slot of the `node`,\\n /// treating `node` as a uint32[32].\\n function getSlot(uint256 node, uint256 position)\\n internal\\n pure\\n returns (uint256)\\n {\\n unchecked {\\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\\n // Doing a bitwise AND with `SLOT_MAX`\\n // clears all but the 32 least significant bits.\\n // Because of the right shift by `slotShift(position)` bits,\\n // those 32 bits contain the 32 bits in the `position`th slot of `node`.\\n return (node >> shiftBits) & Constants.SLOT_MAX;\\n }\\n }\\n\\n /// @notice Return `node` with the `position`th slot set to zero.\\n function clearSlot(uint256 node, uint256 position)\\n internal\\n pure\\n returns (uint256)\\n {\\n unchecked {\\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\\n // Shifting `SLOT_MAX` left by `slotShift(position)` bits\\n // gives us a number where all bits of the `position`th slot are set,\\n // and all other bits are unset.\\n //\\n // Using a bitwise NOT on this number,\\n // we get a uint256 where all bits are set\\n // except for those of the `position`th slot.\\n //\\n // Bitwise ANDing the original `node` with this number\\n // sets the bits of `position`th slot to zero,\\n // leaving all other bits unchanged.\\n return node & ~(Constants.SLOT_MAX << shiftBits);\\n }\\n }\\n\\n /// @notice Return `node` with the `position`th slot set to `weight`.\\n ///\\n /// @param weight The weight of of the node.\\n /// Safely truncated to a 32-bit number,\\n /// but this should never be called with an overflowing weight regardless.\\n function setSlot(\\n uint256 node,\\n uint256 position,\\n uint256 weight\\n ) internal pure returns (uint256) {\\n unchecked {\\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\\n // Clear the `position`th slot like in `clearSlot()`.\\n uint256 clearedNode = node & ~(Constants.SLOT_MAX << shiftBits);\\n // Bitwise AND `weight` with `SLOT_MAX`\\n // to clear all but the 32 least significant bits.\\n //\\n // Shift this left by `slotShift(position)` bits\\n // to obtain a uint256 with all bits unset\\n // except in the `position`th slot\\n // which contains the 32-bit value of `weight`.\\n uint256 shiftedWeight = (weight & Constants.SLOT_MAX) << shiftBits;\\n // When we bitwise OR these together,\\n // all other slots except the `position`th one come from the left argument,\\n // and the `position`th gets filled with `weight` from the right argument.\\n return clearedNode | shiftedWeight;\\n }\\n }\\n\\n /// @notice Calculate the summed weight of all slots in the `node`.\\n function sumWeight(uint256 node) internal pure returns (uint256 sum) {\\n unchecked {\\n sum = node & Constants.SLOT_MAX;\\n // Iterate through each slot\\n // by shifting `node` right in increments of 32 bits,\\n // and adding the 32 least significant bits to the `sum`.\\n uint256 newNode = node >> Constants.SLOT_WIDTH;\\n while (newNode > 0) {\\n sum += (newNode & Constants.SLOT_MAX);\\n newNode = newNode >> Constants.SLOT_WIDTH;\\n }\\n return sum;\\n }\\n }\\n\\n /// @notice Pick a slot in `node` that corresponds to `index`.\\n /// Treats the node like an array of virtual stakers,\\n /// the number of virtual stakers in each slot corresponding to its weight,\\n /// and picks which slot contains the `index`th virtual staker.\\n ///\\n /// @dev Requires that `index` be lower than `sumWeight(node)`.\\n /// However, this is not enforced for performance reasons.\\n /// If `index` exceeds the permitted range,\\n /// `pickWeightedSlot()` returns the rightmost slot\\n /// and an excessively high `newIndex`.\\n ///\\n /// @return slot The slot of `node` containing the `index`th virtual staker.\\n ///\\n /// @return newIndex The index of the `index`th virtual staker of `node`\\n /// within the returned slot.\\n function pickWeightedSlot(uint256 node, uint256 index)\\n internal\\n pure\\n returns (uint256 slot, uint256 newIndex)\\n {\\n unchecked {\\n newIndex = index;\\n uint256 newNode = node;\\n uint256 currentSlotWeight = newNode & Constants.SLOT_MAX;\\n while (newIndex >= currentSlotWeight) {\\n newIndex -= currentSlotWeight;\\n slot++;\\n newNode = newNode >> Constants.SLOT_WIDTH;\\n currentSlotWeight = newNode & Constants.SLOT_MAX;\\n }\\n return (slot, newIndex);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa7fb1c9c9789f30493e9a40e24a24f46875dc5e7630b4f67478167759f6d1882\"},\"@keep-network/sortition-pools/contracts/Chaosnet.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\n/// @title Chaosnet\\n/// @notice This is a beta staker program for stakers willing to go the extra\\n/// mile with monitoring, share their logs with the dev team, and allow to more\\n/// carefully monitor the bootstrapping network. As the network matures, the\\n/// beta program will be ended.\\ncontract Chaosnet {\\n /// @notice Indicates if the chaosnet is active. The chaosnet is active\\n /// after the contract deployment and can be ended with a call to\\n /// `deactivateChaosnet()`. Once deactivated chaosnet can not be activated\\n /// again.\\n bool public isChaosnetActive;\\n\\n /// @notice Indicates if the given operator is a beta operator for chaosnet.\\n mapping(address => bool) public isBetaOperator;\\n\\n /// @notice Address controlling chaosnet status and beta operator addresses.\\n address public chaosnetOwner;\\n\\n event BetaOperatorsAdded(address[] operators);\\n\\n event ChaosnetOwnerRoleTransferred(\\n address oldChaosnetOwner,\\n address newChaosnetOwner\\n );\\n\\n event ChaosnetDeactivated();\\n\\n constructor() {\\n _transferChaosnetOwner(msg.sender);\\n isChaosnetActive = true;\\n }\\n\\n modifier onlyChaosnetOwner() {\\n require(msg.sender == chaosnetOwner, \\\"Not the chaosnet owner\\\");\\n _;\\n }\\n\\n modifier onlyOnChaosnet() {\\n require(isChaosnetActive, \\\"Chaosnet is not active\\\");\\n _;\\n }\\n\\n /// @notice Adds beta operator to chaosnet. Can be called only by the\\n /// chaosnet owner when the chaosnet is active. Once the operator is added\\n /// as a beta operator, it can not be removed.\\n function addBetaOperators(address[] calldata operators)\\n public\\n onlyOnChaosnet\\n onlyChaosnetOwner\\n {\\n for (uint256 i = 0; i < operators.length; i++) {\\n isBetaOperator[operators[i]] = true;\\n }\\n\\n emit BetaOperatorsAdded(operators);\\n }\\n\\n /// @notice Deactivates the chaosnet. Can be called only by the chaosnet\\n /// owner. Once deactivated chaosnet can not be activated again.\\n function deactivateChaosnet() public onlyOnChaosnet onlyChaosnetOwner {\\n isChaosnetActive = false;\\n emit ChaosnetDeactivated();\\n }\\n\\n /// @notice Transfers the chaosnet owner role to another non-zero address.\\n function transferChaosnetOwnerRole(address newChaosnetOwner)\\n public\\n onlyChaosnetOwner\\n {\\n require(\\n newChaosnetOwner != address(0),\\n \\\"New chaosnet owner must not be zero address\\\"\\n );\\n _transferChaosnetOwner(newChaosnetOwner);\\n }\\n\\n function _transferChaosnetOwner(address newChaosnetOwner) internal {\\n address oldChaosnetOwner = chaosnetOwner;\\n chaosnetOwner = newChaosnetOwner;\\n emit ChaosnetOwnerRoleTransferred(oldChaosnetOwner, newChaosnetOwner);\\n }\\n}\\n\",\"keccak256\":\"0xeaf7bdd5626f88c329793a012621039692ce1b6e1f13013997ddb13d7e3032df\"},\"@keep-network/sortition-pools/contracts/Constants.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nlibrary Constants {\\n ////////////////////////////////////////////////////////////////////////////\\n // Parameters for configuration\\n\\n // How many bits a position uses per level of the tree;\\n // each branch of the tree contains 2**SLOT_BITS slots.\\n uint256 constant SLOT_BITS = 3;\\n uint256 constant LEVELS = 7;\\n ////////////////////////////////////////////////////////////////////////////\\n\\n ////////////////////////////////////////////////////////////////////////////\\n // Derived constants, do not touch\\n uint256 constant SLOT_COUNT = 2**SLOT_BITS;\\n uint256 constant SLOT_WIDTH = 256 / SLOT_COUNT;\\n uint256 constant LAST_SLOT = SLOT_COUNT - 1;\\n uint256 constant SLOT_MAX = (2**SLOT_WIDTH) - 1;\\n uint256 constant POOL_CAPACITY = SLOT_COUNT**LEVELS;\\n\\n uint256 constant ID_WIDTH = SLOT_WIDTH;\\n uint256 constant ID_MAX = SLOT_MAX;\\n\\n uint256 constant BLOCKHEIGHT_WIDTH = 96 - ID_WIDTH;\\n uint256 constant BLOCKHEIGHT_MAX = (2**BLOCKHEIGHT_WIDTH) - 1;\\n\\n uint256 constant SLOT_POINTER_MAX = (2**SLOT_BITS) - 1;\\n uint256 constant LEAF_FLAG = 1 << 255;\\n\\n uint256 constant WEIGHT_WIDTH = 256 / SLOT_COUNT;\\n ////////////////////////////////////////////////////////////////////////////\\n}\\n\",\"keccak256\":\"0xaef690ced707935745ff1482b7bb9bd9eb77bf6a39c717465e64cf12db8a7d39\"},\"@keep-network/sortition-pools/contracts/Leaf.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Constants.sol\\\";\\n\\nlibrary Leaf {\\n function make(\\n address _operator,\\n uint256 _creationBlock,\\n uint256 _id\\n ) internal pure returns (uint256) {\\n assert(_creationBlock <= type(uint64).max);\\n assert(_id <= type(uint32).max);\\n // Converting a bytesX type into a larger type\\n // adds zero bytes on the right.\\n uint256 op = uint256(bytes32(bytes20(_operator)));\\n // Bitwise AND the id to erase\\n // all but the 32 least significant bits\\n uint256 uid = _id & Constants.ID_MAX;\\n // Erase all but the 64 least significant bits,\\n // then shift left by 32 bits to make room for the id\\n uint256 cb = (_creationBlock & Constants.BLOCKHEIGHT_MAX) <<\\n Constants.ID_WIDTH;\\n // Bitwise OR them all together to get\\n // [address operator || uint64 creationBlock || uint32 id]\\n return (op | cb | uid);\\n }\\n\\n function operator(uint256 leaf) internal pure returns (address) {\\n // Converting a bytesX type into a smaller type\\n // truncates it on the right.\\n return address(bytes20(bytes32(leaf)));\\n }\\n\\n /// @notice Return the block number the leaf was created in.\\n function creationBlock(uint256 leaf) internal pure returns (uint256) {\\n return ((leaf >> Constants.ID_WIDTH) & Constants.BLOCKHEIGHT_MAX);\\n }\\n\\n function id(uint256 leaf) internal pure returns (uint32) {\\n // Id is stored in the 32 least significant bits.\\n // Bitwise AND ensures that we only get the contents of those bits.\\n return uint32(leaf & Constants.ID_MAX);\\n }\\n}\\n\",\"keccak256\":\"0xbd107a1a43e48884885e5e966ffcbcd8fa5e89863715d717bb4006e9f89cdc2b\"},\"@keep-network/sortition-pools/contracts/Position.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Constants.sol\\\";\\n\\nlibrary Position {\\n // Return the last 3 bits of a position number,\\n // corresponding to its slot in its parent\\n function slot(uint256 a) internal pure returns (uint256) {\\n return a & Constants.SLOT_POINTER_MAX;\\n }\\n\\n // Return the parent of a position number\\n function parent(uint256 a) internal pure returns (uint256) {\\n return a >> Constants.SLOT_BITS;\\n }\\n\\n // Return the location of the child of a at the given slot\\n function child(uint256 a, uint256 s) internal pure returns (uint256) {\\n return (a << Constants.SLOT_BITS) | (s & Constants.SLOT_POINTER_MAX); // slot(s)\\n }\\n\\n // Return the uint p as a flagged position uint:\\n // the least significant 21 bits contain the position\\n // and the 22nd bit is set as a flag\\n // to distinguish the position 0x000000 from an empty field.\\n function setFlag(uint256 p) internal pure returns (uint256) {\\n return p | Constants.LEAF_FLAG;\\n }\\n\\n // Turn a flagged position into an unflagged position\\n // by removing the flag at the 22nd least significant bit.\\n //\\n // We shouldn't _actually_ need this\\n // as all position-manipulating code should ignore non-position bits anyway\\n // but it's cheap to call so might as well do it.\\n function unsetFlag(uint256 p) internal pure returns (uint256) {\\n return p & (~Constants.LEAF_FLAG);\\n }\\n}\\n\",\"keccak256\":\"0xd3a927908080ac21353a92a6bce3d69e94a5c30f6b51f16b271b6cc679f110e2\"},\"@keep-network/sortition-pools/contracts/RNG.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Leaf.sol\\\";\\nimport \\\"./Constants.sol\\\";\\n\\nlibrary RNG {\\n /// @notice Get an index in the range `[0 .. range-1]`\\n /// and the new state of the RNG,\\n /// using the provided `state` of the RNG.\\n ///\\n /// @param range The upper bound of the index, exclusive.\\n ///\\n /// @param state The previous state of the RNG.\\n /// The initial state needs to be obtained\\n /// from a trusted randomness oracle (the random beacon),\\n /// or from a chain of earlier calls to `RNG.getIndex()`\\n /// on an originally trusted seed.\\n ///\\n /// @dev Calculates the number of bits required for the desired range,\\n /// takes the least significant bits of `state`\\n /// and checks if the obtained index is within the desired range.\\n /// The original state is hashed with `keccak256` to get a new state.\\n /// If the index is outside the range,\\n /// the function retries until it gets a suitable index.\\n ///\\n /// @return index A random integer between `0` and `range - 1`, inclusive.\\n ///\\n /// @return newState The new state of the RNG.\\n /// When `getIndex()` is called one or more times,\\n /// care must be taken to always use the output `state`\\n /// of the most recent call as the input `state` of a subsequent call.\\n /// At the end of a transaction calling `RNG.getIndex()`,\\n /// the previous stored state must be overwritten with the latest output.\\n function getIndex(\\n uint256 range,\\n bytes32 state,\\n uint256 bits\\n ) internal view returns (uint256, bytes32) {\\n bool found = false;\\n uint256 index = 0;\\n bytes32 newState = state;\\n while (!found) {\\n index = truncate(bits, uint256(newState));\\n newState = keccak256(abi.encodePacked(newState, address(this)));\\n if (index < range) {\\n found = true;\\n }\\n }\\n return (index, newState);\\n }\\n\\n /// @notice Calculate how many bits are required\\n /// for an index in the range `[0 .. range-1]`.\\n ///\\n /// @param range The upper bound of the desired range, exclusive.\\n ///\\n /// @return uint The smallest number of bits\\n /// that can contain the number `range-1`.\\n function bitsRequired(uint256 range) internal pure returns (uint256) {\\n unchecked {\\n if (range == 1) {\\n return 0;\\n }\\n\\n uint256 bits = Constants.WEIGHT_WIDTH - 1;\\n\\n // Left shift by `bits`,\\n // so we have a 1 in the (bits + 1)th least significant bit\\n // and 0 in other bits.\\n // If this number is equal or greater than `range`,\\n // the range [0, range-1] fits in `bits` bits.\\n //\\n // Because we loop from high bits to low bits,\\n // we find the highest number of bits that doesn't fit the range,\\n // and return that number + 1.\\n while (1 << bits >= range) {\\n bits--;\\n }\\n\\n return bits + 1;\\n }\\n }\\n\\n /// @notice Truncate `input` to the `bits` least significant bits.\\n function truncate(uint256 bits, uint256 input)\\n internal\\n pure\\n returns (uint256)\\n {\\n unchecked {\\n return input & ((1 << bits) - 1);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67f87f589cd5123ffa32f883ea2f09b0e56258508bae82b8c655b3c27c71eb5e\"},\"@keep-network/sortition-pools/contracts/Rewards.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\n/// @title Rewards\\n/// @notice Rewards are allocated proportionally to operators\\n/// present in the pool at payout based on their weight in the pool.\\n///\\n/// To facilitate this, we use a global accumulator value\\n/// to track the total rewards one unit of weight would've earned\\n/// since the creation of the pool.\\n///\\n/// Whenever a reward is paid, the accumulator is increased\\n/// by the size of the reward divided by the total weight\\n/// of all eligible operators in the pool.\\n///\\n/// Each operator has an individual accumulator value,\\n/// set to equal the global accumulator when the operator joins the pool.\\n/// This accumulator reflects the amount of rewards\\n/// that have already been accounted for with that operator.\\n///\\n/// Whenever an operator's weight in the pool changes,\\n/// we can update the amount of rewards the operator has earned\\n/// by subtracting the operator's accumulator from the global accumulator.\\n/// This gives us the amount of rewards one unit of weight has earned\\n/// since the last time the operator's rewards have been updated.\\n/// Then we multiply that by the operator's previous (pre-change) weight\\n/// to determine how much rewards in total the operator has earned,\\n/// and add this to the operator's earned rewards.\\n/// Finally, we set the operator's accumulator to the global accumulator value.\\ncontract Rewards {\\n struct OperatorRewards {\\n // The state of the global accumulator\\n // when the operator's rewards were last updated\\n uint96 accumulated;\\n // The amount of rewards collected by the operator after the latest update.\\n // The amount the operator could withdraw may equal `available`\\n // or it may be greater, if more rewards have been paid in since then.\\n // To evaulate the most recent amount including rewards potentially paid\\n // since the last update, use `availableRewards` function.\\n uint96 available;\\n // If nonzero, the operator is ineligible for rewards\\n // and may only re-enable rewards after the specified timestamp.\\n // XXX: unsigned 32-bit integer unix seconds, will break around 2106\\n uint32 ineligibleUntil;\\n // Locally cached weight of the operator,\\n // used to reduce the cost of setting operators ineligible.\\n uint32 weight;\\n }\\n\\n // The global accumulator of how much rewards\\n // a hypothetical operator of weight 1 would have earned\\n // since the creation of the pool.\\n uint96 internal globalRewardAccumulator;\\n // If the amount of reward tokens paid in\\n // does not divide cleanly by pool weight,\\n // the difference is recorded as rounding dust\\n // and added to the next reward.\\n uint96 internal rewardRoundingDust;\\n\\n // The amount of rewards that would've been earned by ineligible operators\\n // had they not been ineligible.\\n uint96 public ineligibleEarnedRewards;\\n\\n // Ineligibility times are calculated from this offset,\\n // set at contract creation.\\n uint256 internal immutable ineligibleOffsetStart;\\n\\n mapping(uint32 => OperatorRewards) internal operatorRewards;\\n\\n constructor() {\\n // solhint-disable-next-line not-rely-on-time\\n ineligibleOffsetStart = block.timestamp;\\n }\\n\\n /// @notice Return whether the operator is eligible for rewards or not.\\n function isEligibleForRewards(uint32 operator) internal view returns (bool) {\\n return operatorRewards[operator].ineligibleUntil == 0;\\n }\\n\\n /// @notice Return the time the operator's reward eligibility can be restored.\\n function rewardsEligibilityRestorableAt(uint32 operator)\\n internal\\n view\\n returns (uint256)\\n {\\n uint32 until = operatorRewards[operator].ineligibleUntil;\\n require(until != 0, \\\"Operator already eligible\\\");\\n return (uint256(until) + ineligibleOffsetStart);\\n }\\n\\n /// @notice Return whether the operator is able to restore their eligibility\\n /// for rewards right away.\\n function canRestoreRewardEligibility(uint32 operator)\\n internal\\n view\\n returns (bool)\\n {\\n // solhint-disable-next-line not-rely-on-time\\n return rewardsEligibilityRestorableAt(operator) <= block.timestamp;\\n }\\n\\n /// @notice Internal function for updating the global state of rewards.\\n function addRewards(uint96 rewardAmount, uint32 currentPoolWeight) internal {\\n require(currentPoolWeight > 0, \\\"No recipients in pool\\\");\\n\\n uint96 totalAmount = rewardAmount + rewardRoundingDust;\\n uint96 perWeightReward = totalAmount / currentPoolWeight;\\n uint96 newRoundingDust = totalAmount % currentPoolWeight;\\n\\n globalRewardAccumulator += perWeightReward;\\n rewardRoundingDust = newRoundingDust;\\n }\\n\\n /// @notice Internal function for updating the operator's reward state.\\n function updateOperatorRewards(uint32 operator, uint32 newWeight) internal {\\n uint96 acc = globalRewardAccumulator;\\n OperatorRewards memory o = operatorRewards[operator];\\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\\n if (o.ineligibleUntil == 0) {\\n // If operator is not ineligible, update their earned rewards\\n o.available += accruedRewards;\\n } else {\\n // If ineligible, put the rewards into the ineligible pot\\n ineligibleEarnedRewards += accruedRewards;\\n }\\n // In any case, update their accumulator and weight\\n o.accumulated = acc;\\n o.weight = newWeight;\\n operatorRewards[operator] = o;\\n }\\n\\n /// @notice Set the amount of withdrawable tokens to zero\\n /// and return the previous withdrawable amount.\\n /// @dev Does not update the withdrawable amount,\\n /// but should usually be accompanied by an update.\\n function withdrawOperatorRewards(uint32 operator)\\n internal\\n returns (uint96 withdrawable)\\n {\\n OperatorRewards storage o = operatorRewards[operator];\\n withdrawable = o.available;\\n o.available = 0;\\n }\\n\\n /// @notice Set the amount of ineligible-earned tokens to zero\\n /// and return the previous amount.\\n function withdrawIneligibleRewards() internal returns (uint96 withdrawable) {\\n withdrawable = ineligibleEarnedRewards;\\n ineligibleEarnedRewards = 0;\\n }\\n\\n /// @notice Set the given operators as ineligible for rewards.\\n /// The operators can restore their eligibility at the given time.\\n function setIneligible(uint32[] memory operators, uint256 until) internal {\\n OperatorRewards memory o = OperatorRewards(0, 0, 0, 0);\\n uint96 globalAcc = globalRewardAccumulator;\\n uint96 accrued = 0;\\n // Record ineligibility as seconds after contract creation\\n uint32 _until = uint32(until - ineligibleOffsetStart);\\n\\n for (uint256 i = 0; i < operators.length; i++) {\\n uint32 operator = operators[i];\\n OperatorRewards storage r = operatorRewards[operator];\\n o.available = r.available;\\n o.accumulated = r.accumulated;\\n o.ineligibleUntil = r.ineligibleUntil;\\n o.weight = r.weight;\\n\\n if (o.ineligibleUntil != 0) {\\n // If operator is already ineligible,\\n // don't earn rewards or shorten its ineligibility\\n if (o.ineligibleUntil < _until) {\\n o.ineligibleUntil = _until;\\n }\\n } else {\\n // The operator becomes ineligible -> earn rewards\\n o.ineligibleUntil = _until;\\n accrued = (globalAcc - o.accumulated) * uint96(o.weight);\\n o.available += accrued;\\n }\\n o.accumulated = globalAcc;\\n\\n r.available = o.available;\\n r.accumulated = o.accumulated;\\n r.ineligibleUntil = o.ineligibleUntil;\\n r.weight = o.weight;\\n }\\n }\\n\\n /// @notice Restore the given operator's eligibility for rewards.\\n function restoreEligibility(uint32 operator) internal {\\n // solhint-disable-next-line not-rely-on-time\\n require(canRestoreRewardEligibility(operator), \\\"Operator still ineligible\\\");\\n uint96 acc = globalRewardAccumulator;\\n OperatorRewards memory o = operatorRewards[operator];\\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\\n ineligibleEarnedRewards += accruedRewards;\\n o.accumulated = acc;\\n o.ineligibleUntil = 0;\\n operatorRewards[operator] = o;\\n }\\n\\n /// @notice Returns the amount of rewards currently available for withdrawal\\n /// for the given operator.\\n function availableRewards(uint32 operator) internal view returns (uint96) {\\n uint96 acc = globalRewardAccumulator;\\n OperatorRewards memory o = operatorRewards[operator];\\n if (o.ineligibleUntil == 0) {\\n // If operator is not ineligible, calculate newly accrued rewards and add\\n // them to the available ones, calculated during the last update.\\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\\n return o.available + accruedRewards;\\n } else {\\n // If ineligible, return only the rewards calculated during the last\\n // update.\\n return o.available;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3a10abb408b44335a092387b2c7ee01db3b27997f1f2c888d9b7a2d92934c4e2\"},\"@keep-network/sortition-pools/contracts/SortitionPool.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"@thesis/solidity-contracts/contracts/token/IERC20WithPermit.sol\\\";\\nimport \\\"@thesis/solidity-contracts/contracts/token/IReceiveApproval.sol\\\";\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./RNG.sol\\\";\\nimport \\\"./SortitionTree.sol\\\";\\nimport \\\"./Rewards.sol\\\";\\nimport \\\"./Chaosnet.sol\\\";\\n\\n/// @title Sortition Pool\\n/// @notice A logarithmic data structure used to store the pool of eligible\\n/// operators weighted by their stakes. It allows to select a group of operators\\n/// based on the provided pseudo-random seed.\\ncontract SortitionPool is\\n SortitionTree,\\n Rewards,\\n Ownable,\\n Chaosnet,\\n IReceiveApproval\\n{\\n using Branch for uint256;\\n using Leaf for uint256;\\n using Position for uint256;\\n\\n IERC20WithPermit public immutable rewardToken;\\n\\n uint256 public immutable poolWeightDivisor;\\n\\n bool public isLocked;\\n\\n event IneligibleForRewards(uint32[] ids, uint256 until);\\n\\n event RewardEligibilityRestored(address indexed operator, uint32 indexed id);\\n\\n /// @notice Reverts if called while pool is locked.\\n modifier onlyUnlocked() {\\n require(!isLocked, \\\"Sortition pool locked\\\");\\n _;\\n }\\n\\n /// @notice Reverts if called while pool is unlocked.\\n modifier onlyLocked() {\\n require(isLocked, \\\"Sortition pool unlocked\\\");\\n _;\\n }\\n\\n constructor(IERC20WithPermit _rewardToken, uint256 _poolWeightDivisor) {\\n rewardToken = _rewardToken;\\n poolWeightDivisor = _poolWeightDivisor;\\n }\\n\\n function receiveApproval(\\n address sender,\\n uint256 amount,\\n address token,\\n bytes calldata\\n ) external override {\\n require(token == address(rewardToken), \\\"Unsupported token\\\");\\n rewardToken.transferFrom(sender, address(this), amount);\\n Rewards.addRewards(uint96(amount), uint32(root.sumWeight()));\\n }\\n\\n /// @notice Withdraws all available rewards for the given operator to the\\n /// given beneficiary.\\n /// @dev Can be called only be the owner. Does not validate if the provided\\n /// beneficiary is associated with the provided operator - this needs to\\n /// be done by the owner calling this function.\\n /// @return The amount of rewards withdrawn in this call.\\n function withdrawRewards(address operator, address beneficiary)\\n public\\n onlyOwner\\n returns (uint96)\\n {\\n uint32 id = getOperatorID(operator);\\n Rewards.updateOperatorRewards(id, uint32(getPoolWeight(operator)));\\n uint96 earned = Rewards.withdrawOperatorRewards(id);\\n rewardToken.transfer(beneficiary, uint256(earned));\\n return earned;\\n }\\n\\n /// @notice Withdraws rewards not allocated to operators marked as ineligible\\n /// to the given recipient address.\\n /// @dev Can be called only by the owner.\\n function withdrawIneligible(address recipient) public onlyOwner {\\n uint96 earned = Rewards.withdrawIneligibleRewards();\\n rewardToken.transfer(recipient, uint256(earned));\\n }\\n\\n /// @notice Locks the sortition pool. In locked state, members cannot be\\n /// inserted and removed from the pool. Members statuses cannot\\n /// be updated as well.\\n /// @dev Can be called only by the contract owner.\\n function lock() public onlyOwner {\\n isLocked = true;\\n }\\n\\n /// @notice Unlocks the sortition pool. Removes all restrictions set by\\n /// the `lock` method.\\n /// @dev Can be called only by the contract owner.\\n function unlock() public onlyOwner {\\n isLocked = false;\\n }\\n\\n /// @notice Inserts an operator to the pool. Reverts if the operator is\\n /// already present. Reverts if the operator is not eligible because of their\\n /// authorized stake. Reverts if the chaosnet is active and the operator is\\n /// not a beta operator.\\n /// @dev Can be called only by the contract owner.\\n /// @param operator Address of the inserted operator.\\n /// @param authorizedStake Inserted operator's authorized stake for the application.\\n function insertOperator(address operator, uint256 authorizedStake)\\n public\\n onlyOwner\\n onlyUnlocked\\n {\\n uint256 weight = getWeight(authorizedStake);\\n require(weight > 0, \\\"Operator not eligible\\\");\\n\\n if (isChaosnetActive) {\\n require(isBetaOperator[operator], \\\"Not beta operator for chaosnet\\\");\\n }\\n\\n _insertOperator(operator, weight);\\n uint32 id = getOperatorID(operator);\\n Rewards.updateOperatorRewards(id, uint32(weight));\\n }\\n\\n /// @notice Update the operator's weight if present and eligible,\\n /// or remove from the pool if present and ineligible.\\n /// @dev Can be called only by the contract owner.\\n /// @param operator Address of the updated operator.\\n /// @param authorizedStake Operator's authorized stake for the application.\\n function updateOperatorStatus(address operator, uint256 authorizedStake)\\n public\\n onlyOwner\\n onlyUnlocked\\n {\\n uint256 weight = getWeight(authorizedStake);\\n\\n uint32 id = getOperatorID(operator);\\n Rewards.updateOperatorRewards(id, uint32(weight));\\n\\n if (weight == 0) {\\n _removeOperator(operator);\\n } else {\\n updateOperator(operator, weight);\\n }\\n }\\n\\n /// @notice Set the given operators as ineligible for rewards.\\n /// The operators can restore their eligibility at the given time.\\n function setRewardIneligibility(uint32[] calldata operators, uint256 until)\\n public\\n onlyOwner\\n {\\n Rewards.setIneligible(operators, until);\\n emit IneligibleForRewards(operators, until);\\n }\\n\\n /// @notice Restores reward eligibility for the operator.\\n function restoreRewardEligibility(address operator) public {\\n uint32 id = getOperatorID(operator);\\n Rewards.restoreEligibility(id);\\n emit RewardEligibilityRestored(operator, id);\\n }\\n\\n /// @notice Returns whether the operator is eligible for rewards or not.\\n function isEligibleForRewards(address operator) public view returns (bool) {\\n uint32 id = getOperatorID(operator);\\n return Rewards.isEligibleForRewards(id);\\n }\\n\\n /// @notice Returns the time the operator's reward eligibility can be restored.\\n function rewardsEligibilityRestorableAt(address operator)\\n public\\n view\\n returns (uint256)\\n {\\n uint32 id = getOperatorID(operator);\\n return Rewards.rewardsEligibilityRestorableAt(id);\\n }\\n\\n /// @notice Returns whether the operator is able to restore their eligibility\\n /// for rewards right away.\\n function canRestoreRewardEligibility(address operator)\\n public\\n view\\n returns (bool)\\n {\\n uint32 id = getOperatorID(operator);\\n return Rewards.canRestoreRewardEligibility(id);\\n }\\n\\n /// @notice Returns the amount of rewards withdrawable for the given operator.\\n function getAvailableRewards(address operator) public view returns (uint96) {\\n uint32 id = getOperatorID(operator);\\n return availableRewards(id);\\n }\\n\\n /// @notice Return whether the operator is present in the pool.\\n function isOperatorInPool(address operator) public view returns (bool) {\\n return getFlaggedLeafPosition(operator) != 0;\\n }\\n\\n /// @notice Return whether the operator's weight in the pool\\n /// matches their eligible weight.\\n function isOperatorUpToDate(address operator, uint256 authorizedStake)\\n public\\n view\\n returns (bool)\\n {\\n return getWeight(authorizedStake) == getPoolWeight(operator);\\n }\\n\\n /// @notice Return the weight of the operator in the pool,\\n /// which may or may not be out of date.\\n function getPoolWeight(address operator) public view returns (uint256) {\\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\\n if (flaggedPosition == 0) {\\n return 0;\\n } else {\\n uint256 leafPosition = flaggedPosition.unsetFlag();\\n uint256 leafWeight = getLeafWeight(leafPosition);\\n return leafWeight;\\n }\\n }\\n\\n /// @notice Selects a new group of operators of the provided size based on\\n /// the provided pseudo-random seed. At least one operator has to be\\n /// registered in the pool, otherwise the function fails reverting the\\n /// transaction.\\n /// @param groupSize Size of the requested group\\n /// @param seed Pseudo-random number used to select operators to group\\n /// @return selected Members of the selected group\\n function selectGroup(uint256 groupSize, bytes32 seed)\\n public\\n view\\n onlyLocked\\n returns (uint32[] memory)\\n {\\n uint256 _root = root;\\n\\n bytes32 rngState = seed;\\n uint256 rngRange = _root.sumWeight();\\n require(rngRange > 0, \\\"Not enough operators in pool\\\");\\n uint256 currentIndex;\\n\\n uint256 bits = RNG.bitsRequired(rngRange);\\n\\n uint32[] memory selected = new uint32[](groupSize);\\n\\n for (uint256 i = 0; i < groupSize; i++) {\\n (currentIndex, rngState) = RNG.getIndex(rngRange, rngState, bits);\\n\\n uint256 leafPosition = pickWeightedLeaf(currentIndex, _root);\\n\\n uint256 leaf = leaves[leafPosition];\\n selected[i] = leaf.id();\\n }\\n return selected;\\n }\\n\\n function getWeight(uint256 authorization) internal view returns (uint256) {\\n return authorization / poolWeightDivisor;\\n }\\n}\\n\",\"keccak256\":\"0xab42e7c5b1828f42a73f699eb2dc96d4f793572a6323b8b1fbd7c5e0c065bda7\"},\"@keep-network/sortition-pools/contracts/SortitionTree.sol\":{\"content\":\"pragma solidity 0.8.17;\\n\\nimport \\\"./Branch.sol\\\";\\nimport \\\"./Position.sol\\\";\\nimport \\\"./Leaf.sol\\\";\\nimport \\\"./Constants.sol\\\";\\n\\ncontract SortitionTree {\\n using Branch for uint256;\\n using Position for uint256;\\n using Leaf for uint256;\\n\\n // implicit tree\\n // root 8\\n // level2 64\\n // level3 512\\n // level4 4k\\n // level5 32k\\n // level6 256k\\n // level7 2M\\n uint256 internal root;\\n\\n // A 2-index mapping from layer => (index (0-index) => branch). For example,\\n // to access the 6th branch in the 2nd layer (right below the root node; the\\n // first branch layer), call branches[2][5]. Mappings are used in place of\\n // arrays for efficiency. The root is the first layer, the branches occupy\\n // layers 2 through 7, and layer 8 is for the leaves. Following this\\n // convention, the first index in `branches` is `2`, and the last index is\\n // `7`.\\n mapping(uint256 => mapping(uint256 => uint256)) internal branches;\\n\\n // A 0-index mapping from index => leaf, acting as an array. For example, to\\n // access the 42nd leaf, call leaves[41].\\n mapping(uint256 => uint256) internal leaves;\\n\\n // the flagged (see setFlag() and unsetFlag() in Position.sol) positions\\n // of all operators present in the pool\\n mapping(address => uint256) internal flaggedLeafPosition;\\n\\n // the leaf after the rightmost occupied leaf of each stack\\n uint256 internal rightmostLeaf;\\n\\n // the empty leaves in each stack\\n // between 0 and the rightmost occupied leaf\\n uint256[] internal emptyLeaves;\\n\\n // Each operator has an uint32 ID number\\n // which is allocated when they first join the pool\\n // and remains unchanged even if they leave and rejoin the pool.\\n mapping(address => uint32) internal operatorID;\\n\\n // The idAddress array records the address corresponding to each ID number.\\n // The ID number 0 is initialized with a zero address and is not used.\\n address[] internal idAddress;\\n\\n constructor() {\\n root = 0;\\n rightmostLeaf = 0;\\n idAddress.push();\\n }\\n\\n /// @notice Return the ID number of the given operator address. An ID number\\n /// of 0 means the operator has not been allocated an ID number yet.\\n /// @param operator Address of the operator.\\n /// @return the ID number of the given operator address\\n function getOperatorID(address operator) public view returns (uint32) {\\n return operatorID[operator];\\n }\\n\\n /// @notice Get the operator address corresponding to the given ID number. A\\n /// zero address means the ID number has not been allocated yet.\\n /// @param id ID of the operator\\n /// @return the address of the operator\\n function getIDOperator(uint32 id) public view returns (address) {\\n return idAddress.length > id ? idAddress[id] : address(0);\\n }\\n\\n /// @notice Gets the operator addresses corresponding to the given ID\\n /// numbers. A zero address means the ID number has not been allocated yet.\\n /// This function works just like getIDOperator except that it allows to fetch\\n /// operator addresses for multiple IDs in one call.\\n /// @param ids the array of the operator ids\\n /// @return an array of the associated operator addresses\\n function getIDOperators(uint32[] calldata ids)\\n public\\n view\\n returns (address[] memory)\\n {\\n uint256 idCount = idAddress.length;\\n\\n address[] memory operators = new address[](ids.length);\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint32 id = ids[i];\\n operators[i] = idCount > id ? idAddress[id] : address(0);\\n }\\n return operators;\\n }\\n\\n /// @notice Checks if operator is already registered in the pool.\\n /// @param operator the address of the operator\\n /// @return whether or not the operator is already registered in the pool\\n function isOperatorRegistered(address operator) public view returns (bool) {\\n return getFlaggedLeafPosition(operator) != 0;\\n }\\n\\n /// @notice Sum the number of operators in each trunk.\\n /// @return the number of operators in the pool\\n function operatorsInPool() public view returns (uint256) {\\n // Get the number of leaves that might be occupied;\\n // if `rightmostLeaf` equals `firstLeaf()` the tree must be empty,\\n // otherwise the difference between these numbers\\n // gives the number of leaves that may be occupied.\\n uint256 nPossiblyUsedLeaves = rightmostLeaf;\\n // Get the number of empty leaves\\n // not accounted for by the `rightmostLeaf`\\n uint256 nEmptyLeaves = emptyLeaves.length;\\n\\n return (nPossiblyUsedLeaves - nEmptyLeaves);\\n }\\n\\n /// @notice Convenience method to return the total weight of the pool\\n /// @return the total weight of the pool\\n function totalWeight() public view returns (uint256) {\\n return root.sumWeight();\\n }\\n\\n /// @notice Give the operator a new ID number.\\n /// Does not check if the operator already has an ID number.\\n /// @param operator the address of the operator\\n /// @return a new ID for that operator\\n function allocateOperatorID(address operator) internal returns (uint256) {\\n uint256 id = idAddress.length;\\n\\n require(id <= type(uint32).max, \\\"Pool capacity exceeded\\\");\\n\\n operatorID[operator] = uint32(id);\\n idAddress.push(operator);\\n return id;\\n }\\n\\n /// @notice Inserts an operator into the sortition pool\\n /// @param operator the address of an operator to insert\\n /// @param weight how much weight that operator has in the pool\\n function _insertOperator(address operator, uint256 weight) internal {\\n require(\\n !isOperatorRegistered(operator),\\n \\\"Operator is already registered in the pool\\\"\\n );\\n\\n // Fetch the operator's ID, and if they don't have one, allocate them one.\\n uint256 id = getOperatorID(operator);\\n if (id == 0) {\\n id = allocateOperatorID(operator);\\n }\\n\\n // Determine which leaf to insert them into\\n uint256 position = getEmptyLeafPosition();\\n // Record the block the operator was inserted in\\n uint256 theLeaf = Leaf.make(operator, block.number, id);\\n\\n // Update the leaf, and propagate the weight changes all the way up to the\\n // root.\\n root = setLeaf(position, theLeaf, weight, root);\\n\\n // Without position flags,\\n // the position 0x000000 would be treated as empty\\n flaggedLeafPosition[operator] = position.setFlag();\\n }\\n\\n /// @notice Remove an operator (and their weight) from the pool.\\n /// @param operator the address of the operator to remove\\n function _removeOperator(address operator) internal {\\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\\n require(flaggedPosition != 0, \\\"Operator is not registered in the pool\\\");\\n uint256 unflaggedPosition = flaggedPosition.unsetFlag();\\n\\n // Update the leaf, and propagate the weight changes all the way up to the\\n // root.\\n root = removeLeaf(unflaggedPosition, root);\\n removeLeafPositionRecord(operator);\\n }\\n\\n /// @notice Update an operator's weight in the pool.\\n /// @param operator the address of the operator to update\\n /// @param weight the new weight\\n function updateOperator(address operator, uint256 weight) internal {\\n require(\\n isOperatorRegistered(operator),\\n \\\"Operator is not registered in the pool\\\"\\n );\\n\\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\\n uint256 unflaggedPosition = flaggedPosition.unsetFlag();\\n root = updateLeaf(unflaggedPosition, weight, root);\\n }\\n\\n /// @notice Helper method to remove a leaf position record for an operator.\\n /// @param operator the address of the operator to remove the record for\\n function removeLeafPositionRecord(address operator) internal {\\n flaggedLeafPosition[operator] = 0;\\n }\\n\\n /// @notice Removes the data and weight from a particular leaf.\\n /// @param position the leaf index to remove\\n /// @param _root the root node containing the leaf\\n /// @return the updated root node\\n function removeLeaf(uint256 position, uint256 _root)\\n internal\\n returns (uint256)\\n {\\n uint256 rightmostSubOne = rightmostLeaf - 1;\\n bool isRightmost = position == rightmostSubOne;\\n\\n // Clears out the data in the leaf node, and then propagates the weight\\n // changes all the way up to the root.\\n uint256 newRoot = setLeaf(position, 0, 0, _root);\\n\\n // Infer if need to fall back on emptyLeaves yet\\n if (isRightmost) {\\n rightmostLeaf = rightmostSubOne;\\n } else {\\n emptyLeaves.push(position);\\n }\\n return newRoot;\\n }\\n\\n /// @notice Updates the tree to give a particular leaf a new weight.\\n /// @param position the index of the leaf to update\\n /// @param weight the new weight\\n /// @param _root the root node containing the leaf\\n /// @return the updated root node\\n function updateLeaf(\\n uint256 position,\\n uint256 weight,\\n uint256 _root\\n ) internal returns (uint256) {\\n if (getLeafWeight(position) != weight) {\\n return updateTree(position, weight, _root);\\n } else {\\n return _root;\\n }\\n }\\n\\n /// @notice Places a leaf into a particular position, with a given weight and\\n /// propagates that change.\\n /// @param position the index to place the leaf in\\n /// @param theLeaf the new leaf to place in the position\\n /// @param leafWeight the weight of the leaf\\n /// @param _root the root containing the new leaf\\n /// @return the updated root node\\n function setLeaf(\\n uint256 position,\\n uint256 theLeaf,\\n uint256 leafWeight,\\n uint256 _root\\n ) internal returns (uint256) {\\n // set leaf\\n leaves[position] = theLeaf;\\n\\n return (updateTree(position, leafWeight, _root));\\n }\\n\\n /// @notice Propagates a weight change at a position through the tree,\\n /// eventually returning the updated root.\\n /// @param position the index of leaf to update\\n /// @param weight the new weight of the leaf\\n /// @param _root the root node containing the leaf\\n /// @return the updated root node\\n function updateTree(\\n uint256 position,\\n uint256 weight,\\n uint256 _root\\n ) internal returns (uint256) {\\n uint256 childSlot;\\n uint256 treeNode;\\n uint256 newNode;\\n uint256 nodeWeight = weight;\\n\\n uint256 parent = position;\\n // set levels 7 to 2\\n for (uint256 level = Constants.LEVELS; level >= 2; level--) {\\n childSlot = parent.slot();\\n parent = parent.parent();\\n treeNode = branches[level][parent];\\n newNode = treeNode.setSlot(childSlot, nodeWeight);\\n branches[level][parent] = newNode;\\n nodeWeight = newNode.sumWeight();\\n }\\n\\n // set level Root\\n childSlot = parent.slot();\\n return _root.setSlot(childSlot, nodeWeight);\\n }\\n\\n /// @notice Retrieves the next available empty leaf position. Tries to fill\\n /// left to right first, ignoring leaf removals, and then fills\\n /// most-recent-removals first.\\n /// @return the position of the empty leaf\\n function getEmptyLeafPosition() internal returns (uint256) {\\n uint256 rLeaf = rightmostLeaf;\\n bool spaceOnRight = (rLeaf + 1) < Constants.POOL_CAPACITY;\\n if (spaceOnRight) {\\n rightmostLeaf = rLeaf + 1;\\n return rLeaf;\\n } else {\\n uint256 emptyLeafCount = emptyLeaves.length;\\n require(emptyLeafCount > 0, \\\"Pool is full\\\");\\n uint256 emptyLeaf = emptyLeaves[emptyLeafCount - 1];\\n emptyLeaves.pop();\\n return emptyLeaf;\\n }\\n }\\n\\n /// @notice Gets the flagged leaf position for an operator.\\n /// @param operator the address of the operator\\n /// @return the leaf position of that operator\\n function getFlaggedLeafPosition(address operator)\\n internal\\n view\\n returns (uint256)\\n {\\n return flaggedLeafPosition[operator];\\n }\\n\\n /// @notice Gets the weight of a leaf at a particular position.\\n /// @param position the index of the leaf\\n /// @return the weight of the leaf at that position\\n function getLeafWeight(uint256 position) internal view returns (uint256) {\\n uint256 slot = position.slot();\\n uint256 parent = position.parent();\\n\\n // A leaf's weight information is stored a 32-bit slot in the branch layer\\n // directly above the leaf layer. To access it, we calculate that slot and\\n // parent position, and always know the hard-coded layer index.\\n uint256 node = branches[Constants.LEVELS][parent];\\n return node.getSlot(slot);\\n }\\n\\n /// @notice Picks a leaf given a random index.\\n /// @param index a number in `[0, _root.totalWeight())` used to decide\\n /// between leaves\\n /// @param _root the root of the tree\\n function pickWeightedLeaf(uint256 index, uint256 _root)\\n internal\\n view\\n returns (uint256 leafPosition)\\n {\\n uint256 currentIndex = index;\\n uint256 currentNode = _root;\\n uint256 currentPosition = 0;\\n uint256 currentSlot;\\n\\n require(index < currentNode.sumWeight(), \\\"Index exceeds weight\\\");\\n\\n // get root slot\\n (currentSlot, currentIndex) = currentNode.pickWeightedSlot(currentIndex);\\n\\n // get slots from levels 2 to 7\\n for (uint256 level = 2; level <= Constants.LEVELS; level++) {\\n currentPosition = currentPosition.child(currentSlot);\\n currentNode = branches[level][currentPosition];\\n (currentSlot, currentIndex) = currentNode.pickWeightedSlot(currentIndex);\\n }\\n\\n // get leaf position\\n leafPosition = currentPosition.child(currentSlot);\\n }\\n}\\n\",\"keccak256\":\"0x51daeca62ef52be78a1a9de4d2a1c5900c873165f59eda14d5965d7d7da90a03\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x0e9621f60b2faabe65549f7ed0f24e8853a45c1b7990d47e8160e523683f3935\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20Permit token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x032807210d1d7d218963d7355d62e021a84bf1b3339f4f50be2f63b53cccaf29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n } else if (error == RecoverError.InvalidSignatureV) {\\n revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n if (v != 27 && v != 28) {\\n return (address(0), RecoverError.InvalidSignatureV);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xdb7f5c28fc61cda0bd8ab60ce288e206b791643bcd3ba464a70cbec18895a2f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. It the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`.\\n // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`.\\n // This gives `2**k < a <= 2**(k+1)` \\u2192 `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`.\\n // Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a\\n // good first aproximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1;\\n uint256 x = a;\\n if (x >> 128 > 0) {\\n x >>= 128;\\n result <<= 64;\\n }\\n if (x >> 64 > 0) {\\n x >>= 64;\\n result <<= 32;\\n }\\n if (x >> 32 > 0) {\\n x >>= 32;\\n result <<= 16;\\n }\\n if (x >> 16 > 0) {\\n x >>= 16;\\n result <<= 8;\\n }\\n if (x >> 8 > 0) {\\n x >>= 8;\\n result <<= 4;\\n }\\n if (x >> 4 > 0) {\\n x >>= 4;\\n result <<= 2;\\n }\\n if (x >> 2 > 0) {\\n result <<= 1;\\n }\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = sqrt(a);\\n if (rounding == Rounding.Up && result * result < a) {\\n result += 1;\\n }\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0xd15c3e400531f00203839159b2b8e7209c5158b35618f570c695b7e47f12e9f0\",\"license\":\"MIT\"},\"@thesis/solidity-contracts/contracts/token/IApproveAndCall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.4;\\n\\n/// @notice An interface that should be implemented by tokens supporting\\n/// `approveAndCall`/`receiveApproval` pattern.\\ninterface IApproveAndCall {\\n /// @notice Executes `receiveApproval` function on spender as specified in\\n /// `IReceiveApproval` interface. Approves spender to withdraw from\\n /// the caller multiple times, up to the `amount`. If this\\n /// function is called again, it overwrites the current allowance\\n /// with `amount`. Reverts if the approval reverted or if\\n /// `receiveApproval` call on the spender reverted.\\n function approveAndCall(\\n address spender,\\n uint256 amount,\\n bytes memory extraData\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x393d18ef81a57dcc96fff4c340cc2945deaebb37b9796c322cf2bc96872c3df8\",\"license\":\"MIT\"},\"@thesis/solidity-contracts/contracts/token/IERC20WithPermit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\nimport \\\"./IApproveAndCall.sol\\\";\\n\\n/// @title IERC20WithPermit\\n/// @notice Burnable ERC20 token with EIP2612 permit functionality. User can\\n/// authorize a transfer of their token with a signature conforming\\n/// EIP712 standard instead of an on-chain transaction from their\\n/// address. Anyone can submit this signature on the user's behalf by\\n/// calling the permit function, as specified in EIP2612 standard,\\n/// paying gas fees, and possibly performing other actions in the same\\n/// transaction.\\ninterface IERC20WithPermit is IERC20, IERC20Metadata, IApproveAndCall {\\n /// @notice EIP2612 approval made with secp256k1 signature.\\n /// Users can authorize a transfer of their tokens with a signature\\n /// conforming EIP712 standard, rather than an on-chain transaction\\n /// from their address. Anyone can submit this signature on the\\n /// user's behalf by calling the permit function, paying gas fees,\\n /// and possibly performing other actions in the same transaction.\\n /// @dev The deadline argument can be set to `type(uint256).max to create\\n /// permits that effectively never expire.\\n function permit(\\n address owner,\\n address spender,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /// @notice Destroys `amount` tokens from the caller.\\n function burn(uint256 amount) external;\\n\\n /// @notice Destroys `amount` of tokens from `account`, deducting the amount\\n /// from caller's allowance.\\n function burnFrom(address account, uint256 amount) external;\\n\\n /// @notice Returns hash of EIP712 Domain struct with the token name as\\n /// a signing domain and token contract as a verifying contract.\\n /// Used to construct EIP2612 signature provided to `permit`\\n /// function.\\n /* solhint-disable-next-line func-name-mixedcase */\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n\\n /// @notice Returns the current nonce for EIP2612 permission for the\\n /// provided token owner for a replay protection. Used to construct\\n /// EIP2612 signature provided to `permit` function.\\n function nonce(address owner) external view returns (uint256);\\n\\n /// @notice Returns EIP2612 Permit message hash. Used to construct EIP2612\\n /// signature provided to `permit` function.\\n /* solhint-disable-next-line func-name-mixedcase */\\n function PERMIT_TYPEHASH() external pure returns (bytes32);\\n}\\n\",\"keccak256\":\"0xdac9a5086c19a7128b505a7be1ab0ac1aa314f6989cb88d2417e9d7383f89fa9\",\"license\":\"MIT\"},\"@thesis/solidity-contracts/contracts/token/IReceiveApproval.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.4;\\n\\n/// @notice An interface that should be implemented by contracts supporting\\n/// `approveAndCall`/`receiveApproval` pattern.\\ninterface IReceiveApproval {\\n /// @notice Receives approval to spend tokens. Called as a result of\\n /// `approveAndCall` call on the token.\\n function receiveApproval(\\n address from,\\n uint256 amount,\\n address token,\\n bytes calldata extraData\\n ) external;\\n}\\n\",\"keccak256\":\"0x6a30d83ad230548b1e7839737affc8489a035314209de14b89dbef7fb0f66395\",\"license\":\"MIT\"},\"@threshold-network/solidity-contracts/contracts/staking/IApplication.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity ^0.8.9;\\n\\n/// @title Application interface for Threshold Network applications\\n/// @notice Generic interface for an application. Application is an external\\n/// smart contract or a set of smart contracts utilizing functionalities\\n/// offered by Threshold Network. Applications authorized for the given\\n/// staking provider are eligible to slash the stake delegated to that\\n/// staking provider.\\ninterface IApplication {\\n /// @dev Event emitted by `withdrawRewards` function.\\n event RewardsWithdrawn(address indexed stakingProvider, uint96 amount);\\n\\n /// @notice Withdraws application rewards for the given staking provider.\\n /// Rewards are withdrawn to the staking provider's beneficiary\\n /// address set in the staking contract.\\n /// @dev Emits `RewardsWithdrawn` event.\\n function withdrawRewards(address stakingProvider) external;\\n\\n /// @notice Used by T staking contract to inform the application that the\\n /// authorized amount for the given staking provider increased.\\n /// The application may do any necessary housekeeping. The\\n /// application must revert the transaction in case the\\n /// authorization is below the minimum required.\\n function authorizationIncreased(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external;\\n\\n /// @notice Used by T staking contract to inform the application that the\\n /// authorization decrease for the given staking provider has been\\n /// requested. The application should mark the authorization as\\n /// pending decrease and respond to the staking contract with\\n /// `approveAuthorizationDecrease` at its discretion. It may\\n /// happen right away but it also may happen several months later.\\n /// If there is already a pending authorization decrease request\\n /// for the application, and the application does not agree for\\n /// overwriting it, the function should revert.\\n function authorizationDecreaseRequested(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external;\\n\\n /// @notice Used by T staking contract to inform the application the\\n /// authorization has been decreased for the given staking provider\\n /// involuntarily, as a result of slashing. Lets the application to\\n /// do any housekeeping neccessary. Called with 250k gas limit and\\n /// does not revert the transaction if\\n /// `involuntaryAuthorizationDecrease` call failed.\\n function involuntaryAuthorizationDecrease(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external;\\n\\n /// @notice Returns the amount of application rewards available for\\n /// withdrawal for the given staking provider.\\n function availableRewards(address stakingProvider)\\n external\\n view\\n returns (uint96);\\n\\n /// @notice The minimum authorization amount required for the staking\\n /// provider so that they can participate in the application.\\n function minimumAuthorization() external view returns (uint96);\\n}\\n\",\"keccak256\":\"0x43d707dccc548bf48ad316d9652450cb297203234d251132cdc6b97508eb44c5\",\"license\":\"GPL-3.0-or-later\"},\"@threshold-network/solidity-contracts/contracts/staking/IStaking.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity ^0.8.9;\\n\\n/// @title Interface of Threshold Network staking contract\\n/// @notice The staking contract enables T owners to have their wallets offline\\n/// and their stake managed by staking providers on their behalf.\\n/// The staking contract does not define operator role. The operator\\n/// responsible for running off-chain client software is appointed by\\n/// the staking provider in the particular application utilizing the\\n/// staking contract. All off-chain client software should be able\\n/// to run without exposing operator's or staking provider\\u2019s private\\n/// key and should not require any owner\\u2019s keys at all. The stake\\n/// delegation optimizes the network throughput without compromising the\\n/// security of the owners\\u2019 stake.\\ninterface IStaking {\\n enum StakeType {\\n NU,\\n KEEP,\\n T\\n }\\n\\n //\\n //\\n // Delegating a stake\\n //\\n //\\n\\n /// @notice Creates a delegation with `msg.sender` owner with the given\\n /// staking provider, beneficiary, and authorizer. Transfers the\\n /// given amount of T to the staking contract.\\n /// @dev The owner of the delegation needs to have the amount approved to\\n /// transfer to the staking contract.\\n function stake(\\n address stakingProvider,\\n address payable beneficiary,\\n address authorizer,\\n uint96 amount\\n ) external;\\n\\n /// @notice Allows the Governance to set the minimum required stake amount.\\n /// This amount is required to protect against griefing the staking\\n /// contract and individual applications are allowed to require\\n /// higher minimum stakes if necessary.\\n function setMinimumStakeAmount(uint96 amount) external;\\n\\n //\\n //\\n // Authorizing an application\\n //\\n //\\n\\n /// @notice Allows the Governance to approve the particular application\\n /// before individual stake authorizers are able to authorize it.\\n function approveApplication(address application) external;\\n\\n /// @notice Increases the authorization of the given staking provider for\\n /// the given application by the given amount. Can only be called by\\n /// the authorizer for that staking provider.\\n /// @dev Calls `authorizationIncreased(address stakingProvider, uint256 amount)`\\n /// on the given application to notify the application about\\n /// authorization change. See `IApplication`.\\n function increaseAuthorization(\\n address stakingProvider,\\n address application,\\n uint96 amount\\n ) external;\\n\\n /// @notice Requests decrease of the authorization for the given staking\\n /// provider on the given application by the provided amount.\\n /// It may not change the authorized amount immediatelly. When\\n /// it happens depends on the application. Can only be called by the\\n /// given staking provider\\u2019s authorizer. Overwrites pending\\n /// authorization decrease for the given staking provider and\\n /// application if the application agrees for that. If the\\n /// application does not agree for overwriting, the function\\n /// reverts.\\n /// @dev Calls `authorizationDecreaseRequested(address stakingProvider, uint256 amount)`\\n /// on the given application. See `IApplication`.\\n function requestAuthorizationDecrease(\\n address stakingProvider,\\n address application,\\n uint96 amount\\n ) external;\\n\\n /// @notice Requests decrease of all authorizations for the given staking\\n /// provider on all applications by all authorized amount.\\n /// It may not change the authorized amount immediatelly. When\\n /// it happens depends on the application. Can only be called by the\\n /// given staking provider\\u2019s authorizer. Overwrites pending\\n /// authorization decrease for the given staking provider and\\n /// application.\\n /// @dev Calls `authorizationDecreaseRequested(address stakingProvider, uint256 amount)`\\n /// for each authorized application. See `IApplication`.\\n function requestAuthorizationDecrease(address stakingProvider) external;\\n\\n /// @notice Called by the application at its discretion to approve the\\n /// previously requested authorization decrease request. Can only be\\n /// called by the application that was previously requested to\\n /// decrease the authorization for that staking provider.\\n /// Returns resulting authorized amount for the application.\\n function approveAuthorizationDecrease(address stakingProvider)\\n external\\n returns (uint96);\\n\\n /// @notice Decreases the authorization for the given `stakingProvider` on\\n /// the given disabled `application`, for all authorized amount.\\n /// Can be called by anyone.\\n function forceDecreaseAuthorization(\\n address stakingProvider,\\n address application\\n ) external;\\n\\n /// @notice Pauses the given application\\u2019s eligibility to slash stakes.\\n /// Besides that stakers can't change authorization to the application.\\n /// Can be called only by the Panic Button of the particular\\n /// application. The paused application can not slash stakes until\\n /// it is approved again by the Governance using `approveApplication`\\n /// function. Should be used only in case of an emergency.\\n function pauseApplication(address application) external;\\n\\n /// @notice Disables the given application. The disabled application can't\\n /// slash stakers. Also stakers can't increase authorization to that\\n /// application but can decrease without waiting by calling\\n /// `requestAuthorizationDecrease` at any moment. Can be called only\\n /// by the governance. The disabled application can't be approved\\n /// again. Should be used only in case of an emergency.\\n function disableApplication(address application) external;\\n\\n /// @notice Sets the Panic Button role for the given application to the\\n /// provided address. Can only be called by the Governance. If the\\n /// Panic Button for the given application should be disabled, the\\n /// role address should be set to 0x0 address.\\n function setPanicButton(address application, address panicButton) external;\\n\\n /// @notice Sets the maximum number of applications one staking provider can\\n /// have authorized. Used to protect against DoSing slashing queue.\\n /// Can only be called by the Governance.\\n function setAuthorizationCeiling(uint256 ceiling) external;\\n\\n //\\n //\\n // Stake top-up\\n //\\n //\\n\\n /// @notice Increases the amount of the stake for the given staking provider.\\n /// If `autoIncrease` flag is true then the amount will be added for\\n /// all authorized applications.\\n /// @dev The sender of this transaction needs to have the amount approved to\\n /// transfer to the staking contract.\\n function topUp(address stakingProvider, uint96 amount) external;\\n\\n /// @notice Toggle `autoIncrease` flag. If true then the complete amount\\n /// in top-up will be added to already authorized applications.\\n function toggleAutoAuthorizationIncrease(address stakingProvider) external;\\n\\n //\\n //\\n // Undelegating a stake (unstaking)\\n //\\n //\\n\\n /// @notice Reduces the liquid T stake amount by the provided amount and\\n /// withdraws T to the owner. Reverts if there is at least one\\n /// authorization higher than the sum of the legacy stake and\\n /// remaining liquid T stake or if the unstake amount is higher than\\n /// the liquid T stake amount. Can be called only by the delegation\\n /// owner or the staking provider.\\n function unstakeT(address stakingProvider, uint96 amount) external;\\n\\n /// @notice Sets the legacy KEEP staking contract active stake amount cached\\n /// in T staking contract to 0. Reverts if the amount of liquid T\\n /// staked in T staking contract is lower than the highest\\n /// application authorization. This function allows to unstake from\\n /// KEEP staking contract and still being able to operate in T\\n /// network and earning rewards based on the liquid T staked. Can be\\n /// called only by the delegation owner or the staking provider.\\n function unstakeKeep(address stakingProvider) external;\\n\\n /// @notice Sets to 0 the amount of T that is cached from the legacy\\n /// NU staking contract. Reverts if there is at least one\\n /// authorization higher than the sum of remaining legacy NU stake\\n /// and native T stake for that staking provider or if the unstaked\\n /// amount is higher than the cached legacy stake amount. If succeeded,\\n /// the legacy NU stake can be partially or fully undelegated on\\n /// the legacy NU staking contract. This function allows to unstake\\n /// from NU staking contract while still being able to operate in\\n /// T network and earning rewards based on the native T staked.\\n /// Can be called only by the stake owner or the staking provider.\\n function unstakeNu(address stakingProvider) external;\\n\\n /// @notice Sets cached legacy stake amount to 0, sets the liquid T stake\\n /// amount to 0 and withdraws all liquid T from the stake to the\\n /// owner. Reverts if there is at least one non-zero authorization.\\n /// Can be called only by the delegation owner or the staking\\n /// provider.\\n function unstakeAll(address stakingProvider) external;\\n\\n //\\n //\\n // Keeping information in sync\\n //\\n //\\n\\n /// @notice Sets reward in T tokens for notification of misbehaviour\\n /// of one staking provider. Can only be called by the governance.\\n function setNotificationReward(uint96 reward) external;\\n\\n /// @notice Transfer some amount of T tokens as reward for notifications\\n /// of misbehaviour\\n function pushNotificationReward(uint96 reward) external;\\n\\n /// @notice Withdraw some amount of T tokens from notifiers treasury.\\n /// Can only be called by the governance.\\n function withdrawNotificationReward(address recipient, uint96 amount)\\n external;\\n\\n /// @notice Adds staking providers to the slashing queue along with the\\n /// amount that should be slashed from each one of them. Can only be\\n /// called by application authorized for all staking providers in\\n /// the array.\\n function slash(uint96 amount, address[] memory stakingProviders) external;\\n\\n /// @notice Adds staking providers to the slashing queue along with the\\n /// amount. The notifier will receive reward per each staking\\n /// provider from notifiers treasury. Can only be called by\\n /// application authorized for all staking providers in the array.\\n function seize(\\n uint96 amount,\\n uint256 rewardMultipier,\\n address notifier,\\n address[] memory stakingProviders\\n ) external;\\n\\n /// @notice Takes the given number of queued slashing operations and\\n /// processes them. Receives 5% of the slashed amount.\\n /// Executes `involuntaryAllocationDecrease` function on each\\n /// affected application.\\n function processSlashing(uint256 count) external;\\n\\n //\\n //\\n // Auxiliary functions\\n //\\n //\\n\\n /// @notice Returns the authorized stake amount of the staking provider for\\n /// the application.\\n function authorizedStake(address stakingProvider, address application)\\n external\\n view\\n returns (uint96);\\n\\n /// @notice Returns staked amount of T, Keep and Nu for the specified\\n /// staking provider.\\n /// @dev All values are in T denomination\\n function stakes(address stakingProvider)\\n external\\n view\\n returns (\\n uint96 tStake,\\n uint96 keepInTStake,\\n uint96 nuInTStake\\n );\\n\\n /// @notice Returns start staking timestamp.\\n /// @dev This value is set at most once.\\n function getStartStakingTimestamp(address stakingProvider)\\n external\\n view\\n returns (uint256);\\n\\n /// @notice Returns auto-increase flag.\\n function getAutoIncreaseFlag(address stakingProvider)\\n external\\n view\\n returns (bool);\\n\\n /// @notice Returns staked amount of NU for the specified staking provider.\\n function stakedNu(address stakingProvider) external view returns (uint256);\\n\\n /// @notice Gets the stake owner, the beneficiary and the authorizer\\n /// for the specified staking provider address.\\n /// @return owner Stake owner address.\\n /// @return beneficiary Beneficiary address.\\n /// @return authorizer Authorizer address.\\n function rolesOf(address stakingProvider)\\n external\\n view\\n returns (\\n address owner,\\n address payable beneficiary,\\n address authorizer\\n );\\n\\n /// @notice Returns length of application array\\n function getApplicationsLength() external view returns (uint256);\\n\\n /// @notice Returns length of slashing queue\\n function getSlashingQueueLength() external view returns (uint256);\\n\\n /// @notice Returns minimum possible stake for T, KEEP or NU in T\\n /// denomination.\\n /// @dev For example, suppose the given staking provider has 10 T, 20 T worth\\n /// of KEEP, and 30 T worth of NU all staked, and the maximum\\n /// application authorization is 40 T, then `getMinStaked` for\\n /// that staking provider returns:\\n /// * 0 T if KEEP stake type specified i.e.\\n /// min = 40 T max - (10 T) = 30 T\\n /// * 10 T if NU stake type specified i.e.\\n /// min = 40 T max - (10 T) = 30 T\\n /// * 0 T if T stake type specified i.e.\\n /// min = 40 T max = 40 T\\n /// In other words, the minimum stake amount for the specified\\n /// stake type is the minimum amount of stake of the given type\\n /// needed to satisfy the maximum application authorization given\\n /// the staked amounts of the T stake types for that staking provider.\\n function getMinStaked(address stakingProvider, StakeType stakeTypes)\\n external\\n view\\n returns (uint96);\\n\\n /// @notice Returns available amount to authorize for the specified application\\n function getAvailableToAuthorize(\\n address stakingProvider,\\n address application\\n ) external view returns (uint96);\\n}\\n\",\"keccak256\":\"0xc8fbea45ba10de0383d6e7b2dd0f3931971e1b702e4a308ff8325bb23fdff81c\",\"license\":\"GPL-3.0-or-later\"},\"contracts/BeaconDkgValidator.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"./libraries/BytesLib.sol\\\";\\nimport {BeaconDkg as DKG} from \\\"./libraries/BeaconDkg.sol\\\";\\n\\n/// @title DKG result validator\\n/// @notice DKGValidator allows performing a full validation of DKG result,\\n/// including checking the format of fields in the result, declared\\n/// selected group members, and signatures of operators supporting the\\n/// result. The operator submitting the result should perform the\\n/// validation using a free contract call before submitting the result\\n/// to ensure their result is valid and can not be challenged. All other\\n/// network operators should perform validation of the submitted result\\n/// using a free contract call and challenge the result if the\\n/// validation fails.\\ncontract BeaconDkgValidator {\\n using BytesLib for bytes;\\n using ECDSA for bytes32;\\n\\n /// @dev Size of a group in the threshold relay.\\n uint256 public constant groupSize = 64;\\n\\n /// @dev The minimum number of group members needed to interact according to\\n /// the protocol to produce a relay entry. The adversary can not learn\\n /// anything about the key as long as it does not break into\\n /// groupThreshold+1 of members.\\n uint256 public constant groupThreshold = 33;\\n\\n /// @dev The minimum number of active and properly behaving group members\\n /// during the DKG needed to accept the result. This number is higher\\n /// than `groupThreshold` to keep a safety margin for members becoming\\n /// inactive after DKG so that the group can still produce a relay\\n /// entry.\\n uint256 public constant activeThreshold = 58; // 90% of groupSize\\n\\n /// @dev Size in bytes of a single signature produced by operator supporting\\n /// DKG result.\\n uint256 public constant signatureByteSize = 65;\\n\\n SortitionPool public immutable sortitionPool;\\n\\n constructor(SortitionPool _sortitionPool) {\\n require(\\n address(_sortitionPool) != address(0),\\n \\\"Zero-address reference\\\"\\n );\\n\\n sortitionPool = _sortitionPool;\\n }\\n\\n /// @notice Performs a full validation of DKG result, including checking the\\n /// format of fields in the result, declared selected group members,\\n /// and signatures of operators supporting the result.\\n /// @param seed seed used to start the DKG and select group members\\n /// @param startBlock DKG start block\\n /// @return isValid true if the result is valid, false otherwise\\n /// @return errorMsg validation error message; empty for a valid result\\n function validate(\\n DKG.Result calldata result,\\n uint256 seed,\\n uint256 startBlock\\n ) external view returns (bool isValid, string memory errorMsg) {\\n (bool hasValidFields, string memory error) = validateFields(result);\\n if (!hasValidFields) {\\n return (false, error);\\n }\\n\\n if (!validateSignatures(result, startBlock)) {\\n return (false, \\\"Invalid signatures\\\");\\n }\\n\\n if (!validateGroupMembers(result, seed)) {\\n return (false, \\\"Invalid group members\\\");\\n }\\n\\n // At this point all group members and mishbehaved members were verified\\n if (!validateMembersHash(result)) {\\n return (false, \\\"Invalid members hash\\\");\\n }\\n\\n return (true, \\\"\\\");\\n }\\n\\n /// @notice Performs a static validation of DKG result fields: lengths,\\n /// ranges, and order of arrays.\\n /// @return isValid true if the result is valid, false otherwise\\n /// @return errorMsg validation error message; empty for a valid result\\n function validateFields(DKG.Result calldata result)\\n public\\n pure\\n returns (bool isValid, string memory errorMsg)\\n {\\n // Group public key needs to be 128 bytes long.\\n if (result.groupPubKey.length != 128) {\\n return (false, \\\"Malformed group public key\\\");\\n }\\n\\n // The number of misbehaved members can not exceed the threshold.\\n // Misbehaved member indices needs to be unique, between [1, groupSize],\\n // and sorted in ascending order.\\n uint8[] calldata misbehavedMembersIndices = result\\n .misbehavedMembersIndices;\\n if (groupSize - misbehavedMembersIndices.length < activeThreshold) {\\n return (false, \\\"Too many members misbehaving during DKG\\\");\\n }\\n if (misbehavedMembersIndices.length > 1) {\\n if (\\n misbehavedMembersIndices[0] < 1 ||\\n misbehavedMembersIndices[misbehavedMembersIndices.length - 1] >\\n groupSize\\n ) {\\n return (false, \\\"Corrupted misbehaved members indices\\\");\\n }\\n for (uint256 i = 1; i < misbehavedMembersIndices.length; i++) {\\n if (\\n misbehavedMembersIndices[i - 1] >=\\n misbehavedMembersIndices[i]\\n ) {\\n return (false, \\\"Corrupted misbehaved members indices\\\");\\n }\\n }\\n }\\n\\n // Each signature needs to have a correct length and signatures need to\\n // be provided.\\n uint256 signaturesCount = result.signatures.length / signatureByteSize;\\n if (result.signatures.length == 0) {\\n return (false, \\\"No signatures provided\\\");\\n }\\n if (result.signatures.length % signatureByteSize != 0) {\\n return (false, \\\"Malformed signatures array\\\");\\n }\\n\\n // We expect the same amount of signatures as the number of declared\\n // group member indices that signed the result.\\n uint256[] calldata signingMembersIndices = result.signingMembersIndices;\\n if (signaturesCount != signingMembersIndices.length) {\\n return (false, \\\"Unexpected signatures count\\\");\\n }\\n if (signaturesCount < groupThreshold) {\\n return (false, \\\"Too few signatures\\\");\\n }\\n if (signaturesCount > groupSize) {\\n return (false, \\\"Too many signatures\\\");\\n }\\n\\n // Signing member indices needs to be unique, between [1,groupSize],\\n // and sorted in ascending order.\\n if (\\n signingMembersIndices[0] < 1 ||\\n signingMembersIndices[signingMembersIndices.length - 1] > groupSize\\n ) {\\n return (false, \\\"Corrupted signing member indices\\\");\\n }\\n for (uint256 i = 1; i < signingMembersIndices.length; i++) {\\n if (signingMembersIndices[i - 1] >= signingMembersIndices[i]) {\\n return (false, \\\"Corrupted signing member indices\\\");\\n }\\n }\\n\\n return (true, \\\"\\\");\\n }\\n\\n /// @notice Performs validation of group members as declared in DKG\\n /// result against group members selected by the sortition pool.\\n /// @param seed seed used to start the DKG and select group members\\n /// @return true if group members matches; false otherwise\\n function validateGroupMembers(DKG.Result calldata result, uint256 seed)\\n public\\n view\\n returns (bool)\\n {\\n uint32[] calldata resultMembers = result.members;\\n uint32[] memory actualGroupMembers = sortitionPool.selectGroup(\\n groupSize,\\n bytes32(seed)\\n );\\n if (resultMembers.length != actualGroupMembers.length) {\\n return false;\\n }\\n for (uint256 i = 0; i < resultMembers.length; i++) {\\n if (resultMembers[i] != actualGroupMembers[i]) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @notice Performs validation of signatures supplied in DKG result.\\n /// Note that this function does not check if addresses which\\n /// supplied signatures supporting the result are the ones selected\\n /// to the group by sortition pool. This function should be used\\n /// together with `validateGroupMembers`.\\n /// @param startBlock DKG start block\\n /// @return true if group members matches; false otherwise\\n function validateSignatures(DKG.Result calldata result, uint256 startBlock)\\n public\\n view\\n returns (bool)\\n {\\n bytes32 hash = keccak256(\\n abi.encode(\\n block.chainid,\\n result.groupPubKey,\\n result.misbehavedMembersIndices,\\n startBlock\\n )\\n ).toEthSignedMessageHash();\\n\\n uint256[] calldata signingMembersIndices = result.signingMembersIndices;\\n uint32[] memory signingMemberIds = new uint32[](\\n signingMembersIndices.length\\n );\\n for (uint256 i = 0; i < signingMembersIndices.length; i++) {\\n signingMemberIds[i] = result.members[signingMembersIndices[i] - 1];\\n }\\n\\n address[] memory signingMemberAddresses = sortitionPool.getIDOperators(\\n signingMemberIds\\n );\\n\\n bytes memory current; // Current signature to be checked.\\n\\n uint256 signaturesCount = result.signatures.length / signatureByteSize;\\n for (uint256 i = 0; i < signaturesCount; i++) {\\n current = result.signatures.slice(\\n signatureByteSize * i,\\n signatureByteSize\\n );\\n address recoveredAddress = hash.recover(current);\\n\\n if (signingMemberAddresses[i] != recoveredAddress) {\\n return false;\\n }\\n }\\n\\n return true;\\n }\\n\\n /// @notice Performs validation of hashed group members that actively took\\n /// part in DKG.\\n /// @param result DKG result\\n /// @return true if result's group members hash matches with the one that is\\n /// challenged.\\n function validateMembersHash(DKG.Result calldata result)\\n public\\n pure\\n returns (bool)\\n {\\n if (result.misbehavedMembersIndices.length > 0) {\\n // members that generated a group signing key\\n uint32[] memory groupMembers = new uint32[](\\n result.members.length - result.misbehavedMembersIndices.length\\n );\\n uint256 k = 0; // misbehaved members counter\\n uint256 j = 0; // group members counter\\n for (uint256 i = 0; i < result.members.length; i++) {\\n // misbehaved member indices start from 1, so we need to -1 on misbehaved\\n if (i != result.misbehavedMembersIndices[k] - 1) {\\n groupMembers[j] = result.members[i];\\n j++;\\n } else if (k < result.misbehavedMembersIndices.length - 1) {\\n k++;\\n }\\n }\\n\\n return keccak256(abi.encode(groupMembers)) == result.membersHash;\\n }\\n\\n return keccak256(abi.encode(result.members)) == result.membersHash;\\n }\\n}\\n\",\"keccak256\":\"0xaacb5961dc3181238036f1e747b3d1935f356ca5ff27bd9c9c1c0c22dee6630c\",\"license\":\"GPL-3.0-only\"},\"contracts/Governable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\n/// @notice Governable contract.\\n/// @dev A constructor is not defined, which makes the contract compatible with\\n/// upgradable proxies. This requires calling explicitly `_transferGovernance`\\n/// function in a child contract.\\nabstract contract Governable {\\n // Governance of the contract\\n // The variable should be initialized by the implementing contract.\\n // slither-disable-next-line uninitialized-state\\n address public governance;\\n\\n // Reserved storage space in case we need to add more variables,\\n // since there are upgradeable contracts that inherit from this one.\\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n // slither-disable-next-line unused-state\\n uint256[49] private __gap;\\n\\n event GovernanceTransferred(address oldGovernance, address newGovernance);\\n\\n modifier onlyGovernance() virtual {\\n require(governance == msg.sender, \\\"Caller is not the governance\\\");\\n _;\\n }\\n\\n /// @notice Transfers governance of the contract to `newGovernance`.\\n function transferGovernance(address newGovernance)\\n external\\n virtual\\n onlyGovernance\\n {\\n require(\\n newGovernance != address(0),\\n \\\"New governance is the zero address\\\"\\n );\\n _transferGovernance(newGovernance);\\n }\\n\\n function _transferGovernance(address newGovernance) internal virtual {\\n address oldGovernance = governance;\\n governance = newGovernance;\\n emit GovernanceTransferred(oldGovernance, newGovernance);\\n }\\n}\\n\",\"keccak256\":\"0xcc6a0fe8fdf05a805d2874dc7dd76dede1eb16e3ab77f2d0069dbb92272ab0a3\",\"license\":\"GPL-3.0-only\"},\"contracts/RandomBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./api/IRandomBeacon.sol\\\";\\nimport \\\"./libraries/Groups.sol\\\";\\nimport \\\"./libraries/Relay.sol\\\";\\nimport \\\"./libraries/Groups.sol\\\";\\nimport \\\"./libraries/Callback.sol\\\";\\nimport \\\"./Reimbursable.sol\\\";\\nimport \\\"./Governable.sol\\\";\\nimport {BeaconInactivity as Inactivity} from \\\"./libraries/BeaconInactivity.sol\\\";\\nimport {BeaconAuthorization as Authorization} from \\\"./libraries/BeaconAuthorization.sol\\\";\\nimport {BeaconDkg as DKG} from \\\"./libraries/BeaconDkg.sol\\\";\\nimport {BeaconDkgValidator as DKGValidator} from \\\"./BeaconDkgValidator.sol\\\";\\n\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"@threshold-network/solidity-contracts/contracts/staking/IApplication.sol\\\";\\nimport \\\"@threshold-network/solidity-contracts/contracts/staking/IStaking.sol\\\";\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\n/// @title Keep Random Beacon\\n/// @notice Keep Random Beacon contract. It lets to request a new\\n/// relay entry and validates the new relay entry provided by the\\n/// network. This contract is in charge of all other Random Beacon\\n/// activities such as group lifecycle or slashing.\\n/// @dev Should be owned by the governance contract controlling Random Beacon\\n/// parameters.\\ncontract RandomBeacon is IRandomBeacon, IApplication, Governable, Reimbursable {\\n using SafeERC20 for IERC20;\\n using Authorization for Authorization.Data;\\n using DKG for DKG.Data;\\n using Groups for Groups.Data;\\n using Relay for Relay.Data;\\n using Callback for Callback.Data;\\n\\n // Constant parameters\\n\\n /// @notice Seed value used for the genesis group selection.\\n /// https://www.wolframalpha.com/input/?i=pi+to+78+digits\\n uint256 internal constant genesisSeed =\\n 31415926535897932384626433832795028841971693993751058209749445923078164062862;\\n\\n // Governable parameters\\n\\n /// @notice Relay entry callback gas limit. This is the gas limit with which\\n /// callback function provided in the relay request transaction is\\n /// executed. The callback is executed with a new relay entry value\\n /// in the same transaction the relay entry is submitted.\\n uint256 internal _callbackGasLimit;\\n\\n /// @notice The frequency of new group creation. Groups are created with\\n /// a fixed frequency of relay requests.\\n uint256 internal _groupCreationFrequency;\\n\\n /// @notice Slashing amount for submitting a malicious DKG result. Every\\n /// DKG result submitted can be challenged for the time of\\n /// `dkg.ResultChallengePeriodLength`. If the DKG result submitted\\n /// is challenged and proven to be malicious, the operator who\\n /// submitted the malicious result is slashed for\\n /// `_maliciousDkgResultSlashingAmount`.\\n uint96 internal _maliciousDkgResultSlashingAmount;\\n\\n /// @notice Slashing amount when an unauthorized signing has been proved,\\n /// which means the private key leaked and all the group members\\n /// should be punished.\\n uint96 internal _unauthorizedSigningSlashingAmount;\\n\\n /// @notice Duration of the sortition pool rewards ban imposed on operators\\n /// who misbehaved during DKG by being inactive or disqualified and\\n /// for operators that were identified by the rest of group members\\n /// as inactive via `notifyOperatorInactivity`.\\n uint256 internal _sortitionPoolRewardsBanDuration;\\n\\n /// @notice Percentage of the staking contract malicious behavior\\n /// notification reward which will be transferred to the notifier\\n /// reporting about relay entry timeout. Notifiers are rewarded\\n /// from a notifiers treasury pool. For example, if\\n /// notification reward is 1000 and the value of the multiplier is\\n /// 5, the notifier will receive: 5% of 1000 = 50 per each\\n /// operator affected.\\n uint256 internal _relayEntryTimeoutNotificationRewardMultiplier;\\n\\n /// @notice Percentage of the staking contract malicious behavior\\n /// notification reward which will be transferred to the notifier\\n /// reporting about unauthorized signing. Notifiers are rewarded\\n /// from a notifiers treasury pool. For example, if a\\n /// notification reward is 1000 and the value of the multiplier is\\n /// 5, the notifier will receive: 5% of 1000 = 50 per each\\n /// operator affected.\\n uint256 internal _unauthorizedSigningNotificationRewardMultiplier;\\n\\n /// @notice Percentage of the staking contract malicious behavior\\n /// notification reward which will be transferred to the notifier\\n /// reporting about a malicious DKG result. Notifiers are rewarded\\n /// from a notifiers treasury pool. For example, if\\n /// notification reward is 1000 and the value of the multiplier is\\n /// 5, the notifier will receive: 5% of 1000 = 50 per each\\n /// operator affected.\\n uint256 internal _dkgMaliciousResultNotificationRewardMultiplier;\\n\\n /// @notice Calculated gas cost for submitting a DKG result. This will\\n /// be refunded as part of the DKG approval process. It is in the\\n /// submitter's interest to not skip his priority turn on the approval,\\n /// otherwise the refund of the DKG submission will be refunded to\\n /// another group member that will call the DKG approve function.\\n uint256 internal _dkgResultSubmissionGas;\\n\\n /// @notice Gas that is meant to balance the DKG result approval's overall\\n /// cost. Can be updated by the governance based on the current\\n /// market conditions.\\n uint256 internal _dkgResultApprovalGasOffset;\\n\\n /// @notice Gas that is meant to balance the operator inactivity notification\\n /// cost. Can be updated by the governance based on the current\\n /// market conditions.\\n uint256 internal _notifyOperatorInactivityGasOffset;\\n\\n /// @notice Gas that is meant to balance the relay entry submission cost.\\n /// Can be updated by the governance based on the current market\\n /// conditions.\\n uint256 internal _relayEntrySubmissionGasOffset;\\n\\n // Other parameters\\n\\n /// @notice Stores current operator inactivity claim nonce for given group.\\n /// Each claim is made with an unique nonce which protects\\n /// against claim replay.\\n mapping(uint64 => uint256) public inactivityClaimNonce; // groupId -> nonce\\n\\n /// @notice Authorized addresses that can request a relay entry.\\n mapping(address => bool) public authorizedRequesters;\\n\\n // External dependencies\\n\\n SortitionPool public sortitionPool;\\n IERC20 public tToken;\\n IStaking public staking;\\n\\n // Libraries data storages\\n\\n Authorization.Data internal authorization;\\n DKG.Data internal dkg;\\n Groups.Data internal groups;\\n Relay.Data internal relay;\\n Callback.Data internal callback;\\n\\n // Events\\n\\n event AuthorizationParametersUpdated(\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseDelay,\\n uint64 authorizationDecreaseChangePeriod\\n );\\n\\n event RelayEntryParametersUpdated(\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n );\\n\\n event GroupCreationParametersUpdated(\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgResultSubmitterPrecedencePeriodLength\\n );\\n\\n event RewardParametersUpdated(\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n );\\n\\n event SlashingParametersUpdated(\\n uint256 relayEntrySubmissionFailureSlashingAmount,\\n uint256 maliciousDkgResultSlashingAmount,\\n uint256 unauthorizedSigningSlashingAmount\\n );\\n\\n event GasParametersUpdated(\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n );\\n\\n event RequesterAuthorizationUpdated(\\n address indexed requester,\\n bool isAuthorized\\n );\\n\\n event DkgStarted(uint256 indexed seed);\\n\\n event DkgResultSubmitted(\\n bytes32 indexed resultHash,\\n uint256 indexed seed,\\n DKG.Result result\\n );\\n\\n event DkgTimedOut();\\n\\n event DkgResultApproved(\\n bytes32 indexed resultHash,\\n address indexed approver\\n );\\n\\n event DkgResultChallenged(\\n bytes32 indexed resultHash,\\n address indexed challenger,\\n string reason\\n );\\n\\n event DkgMaliciousResultSlashed(\\n bytes32 indexed resultHash,\\n uint256 slashingAmount,\\n address maliciousSubmitter\\n );\\n\\n event DkgMaliciousResultSlashingFailed(\\n bytes32 indexed resultHash,\\n uint256 slashingAmount,\\n address maliciousSubmitter\\n );\\n\\n event DkgStateLocked();\\n\\n event DkgSeedTimedOut();\\n\\n event GroupRegistered(uint64 indexed groupId, bytes indexed groupPubKey);\\n\\n event RelayEntryRequested(\\n uint256 indexed requestId,\\n uint64 groupId,\\n bytes previousEntry\\n );\\n\\n event RelayEntrySubmitted(\\n uint256 indexed requestId,\\n address submitter,\\n bytes entry\\n );\\n\\n event RelayEntryTimedOut(\\n uint256 indexed requestId,\\n uint64 terminatedGroupId\\n );\\n\\n event RelayEntryDelaySlashed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event RelayEntryDelaySlashingFailed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event RelayEntryTimeoutSlashed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event RelayEntryTimeoutSlashingFailed(\\n uint256 indexed requestId,\\n uint256 slashingAmount,\\n address[] groupMembers\\n );\\n\\n event UnauthorizedSigningSlashed(\\n uint64 indexed groupId,\\n uint256 unauthorizedSigningSlashingAmount,\\n address[] groupMembers\\n );\\n\\n event UnauthorizedSigningSlashingFailed(\\n uint64 indexed groupId,\\n uint256 unauthorizedSigningSlashingAmount,\\n address[] groupMembers\\n );\\n\\n event CallbackFailed(uint256 entry, uint256 entrySubmittedBlock);\\n\\n event InactivityClaimed(\\n uint64 indexed groupId,\\n uint256 nonce,\\n address notifier\\n );\\n\\n event OperatorRegistered(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event AuthorizationIncreased(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event AuthorizationDecreaseRequested(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount,\\n uint64 decreasingAt\\n );\\n\\n event AuthorizationDecreaseApproved(address indexed stakingProvider);\\n\\n event InvoluntaryAuthorizationDecreaseFailed(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event OperatorJoinedSortitionPool(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event OperatorStatusUpdated(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n /// @dev Assigns initial values to parameters to make the beacon work\\n /// safely. These parameters are just proposed defaults and they might\\n /// be updated with `update*` functions after the contract deployment\\n /// and before transferring the ownership to the governance contract.\\n constructor(\\n SortitionPool _sortitionPool,\\n IERC20 _tToken,\\n IStaking _staking,\\n DKGValidator _dkgValidator,\\n ReimbursementPool _reimbursementPool\\n ) {\\n sortitionPool = _sortitionPool;\\n tToken = _tToken;\\n staking = _staking;\\n reimbursementPool = _reimbursementPool;\\n\\n require(\\n address(_sortitionPool) != address(0),\\n \\\"Zero-address reference\\\"\\n );\\n require(address(_tToken) != address(0), \\\"Zero-address reference\\\");\\n require(address(_staking) != address(0), \\\"Zero-address reference\\\");\\n require(address(_dkgValidator) != address(0), \\\"Zero-address reference\\\");\\n require(\\n address(_reimbursementPool) != address(0),\\n \\\"Zero-address reference\\\"\\n );\\n\\n dkg.init(_sortitionPool, _dkgValidator);\\n relay.initSeedEntry();\\n\\n _transferGovernance(msg.sender);\\n\\n //\\n // All parameters set in the constructor are initial ones, used at the\\n // moment contracts were deployed for the first time. Parameters are\\n // governable and values assigned in the constructor do not need to\\n // reflect the current ones.\\n //\\n\\n // Minimum authorization is 40k T.\\n //\\n // Authorization decrease delay is 45 days.\\n //\\n // Authorization decrease change period is 45 days. It means pending\\n // authorization decrease can be overwritten all the time.\\n authorization.setParameters(40_000e18, 3_888_000, 3_888_000);\\n\\n // Malicious DKG result slashing amount is set initially to 1% of the\\n // minimum authorization (400 T). This values needs to be increased\\n // significantly once the system is fully launched.\\n //\\n // Unauthorized signing slashing amount is set initially to 1% of the\\n // minimum authorization (400 T). This values needs to be increased\\n // significantly once the system is fully launched.\\n //\\n // Slashing amount for not providing relay entry on time is set\\n // initially to 1% of the minimum authorization (400 T). This values\\n // needs to be increased significantly once the system is fully launched.\\n //\\n // Inactive operators are set as ineligible for rewards for 2 weeks.\\n _maliciousDkgResultSlashingAmount = 400e18;\\n _unauthorizedSigningSlashingAmount = 400e18;\\n relay.setRelayEntrySubmissionFailureSlashingAmount(400e18);\\n\\n // Notifier of a malicious DKG result receives 100% of the notifier\\n // reward from the staking contract.\\n //\\n // Notifier of unauthorized signing receives 100% of the notifier\\n // reward from the staking contract.\\n //\\n // Notifier of relay entry timeout receives 100% of the notifier\\n // reward from the staking contract.\\n _dkgMaliciousResultNotificationRewardMultiplier = 100;\\n _unauthorizedSigningNotificationRewardMultiplier = 100;\\n _relayEntryTimeoutNotificationRewardMultiplier = 100;\\n\\n // Inactive operators are set as ineligible for rewards for 2 weeks.\\n _sortitionPoolRewardsBanDuration = 2 weeks;\\n\\n // DKG result challenge period length is set to 48h, assuming\\n // 15s block time.\\n //\\n // The extra gas required for DKG result challenge is 50k units.\\n //\\n // DKG result submission timeout, gives each member 20 blocks to submit\\n // the result. Assuming 15s block time, it is ~8h to submit the result\\n // in the pessimistic case.\\n //\\n // The original DKG result submitter has 20 blocks to approve it before\\n // anyone else can do that.\\n //\\n // With these parameters, the happy path takes no more than 56 hours.\\n // In practice, it should take about 48 hours (just the challenge time).\\n dkg.setParameters(11_520, 50_000, 1_280, 20);\\n\\n // Relay entry soft timeout gives each of 64 members 20 blocks to submit\\n // the result.\\n //\\n // Relay entry hard timeout is set to ~48h assuming 15s block time.\\n relay.setTimeouts(1_280, 5_760);\\n\\n // Callback gas limit is set to 56k units of gas. As of April 2022, it\\n // is enough to store new entry and block number on-chain.\\n // If the cost of EVM opcodes change over time, these parameters will\\n // have to be updated.\\n _callbackGasLimit = 64_000;\\n\\n // Group lifetime is set to 45 days assuming 15s block time.\\n //\\n // New group is created every 2 relay requests.\\n //\\n // This way, even if ECDSA WalletRegistry is the only consumer of the\\n // beacon initially, and relay request is executed every week, we should\\n // have 2 active groups in the system all the time.\\n groups.setGroupLifetime(259_200);\\n _groupCreationFrequency = 2;\\n\\n // Gas parameters were adjusted based on Ethereum state in April 2022.\\n // If the cost of EVM opcodes change over time, these parameters will\\n // have to be updated.\\n _dkgResultSubmissionGas = 237_650;\\n _dkgResultApprovalGasOffset = 41_500;\\n _notifyOperatorInactivityGasOffset = 54_500;\\n _relayEntrySubmissionGasOffset = 11_250;\\n }\\n\\n modifier onlyStakingContract() {\\n require(\\n msg.sender == address(staking),\\n \\\"Caller is not the staking contract\\\"\\n );\\n _;\\n }\\n\\n modifier onlyReimbursableAdmin() override {\\n require(governance == msg.sender, \\\"Caller is not the governance\\\");\\n _;\\n }\\n\\n /// @notice Updates the values of authorization parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param _minimumAuthorization New minimum authorization amount\\n /// @param _authorizationDecreaseDelay New authorization decrease delay in\\n /// seconds\\n /// @param _authorizationDecreaseChangePeriod New authorization decrease\\n /// change period in seconds\\n function updateAuthorizationParameters(\\n uint96 _minimumAuthorization,\\n uint64 _authorizationDecreaseDelay,\\n uint64 _authorizationDecreaseChangePeriod\\n ) external onlyGovernance {\\n authorization.setParameters(\\n _minimumAuthorization,\\n _authorizationDecreaseDelay,\\n _authorizationDecreaseChangePeriod\\n );\\n\\n emit AuthorizationParametersUpdated(\\n _minimumAuthorization,\\n _authorizationDecreaseDelay,\\n _authorizationDecreaseChangePeriod\\n );\\n }\\n\\n /// @notice Updates the values of relay entry parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param relayEntrySoftTimeout New relay entry submission soft timeout\\n /// @param relayEntryHardTimeout New relay entry hard timeout\\n /// @param callbackGasLimit New callback gas limit\\n function updateRelayEntryParameters(\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n ) external onlyGovernance {\\n _callbackGasLimit = callbackGasLimit;\\n relay.setTimeouts(relayEntrySoftTimeout, relayEntryHardTimeout);\\n\\n emit RelayEntryParametersUpdated(\\n relayEntrySoftTimeout,\\n relayEntryHardTimeout,\\n callbackGasLimit\\n );\\n }\\n\\n /// @notice Updates the values of group creation parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param groupCreationFrequency New group creation frequency\\n /// @param groupLifetime New group lifetime in blocks\\n /// @param dkgResultChallengePeriodLength New DKG result challenge period\\n /// length\\n /// @param dkgResultChallengeExtraGas New DKG result challenge extra gas\\n /// @param dkgResultSubmissionTimeout New DKG result submission timeout\\n /// @param dkgSubmitterPrecedencePeriodLength New DKG result submitter\\n /// precedence period length\\n function updateGroupCreationParameters(\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) external onlyGovernance {\\n _groupCreationFrequency = groupCreationFrequency;\\n groups.setGroupLifetime(groupLifetime);\\n dkg.setParameters(\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n\\n emit GroupCreationParametersUpdated(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n }\\n\\n /// @notice Updates the values of reward parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param sortitionPoolRewardsBanDuration New sortition pool rewards\\n /// ban duration in seconds.\\n /// @param relayEntryTimeoutNotificationRewardMultiplier New value of the\\n /// relay entry timeout notification reward multiplier\\n /// @param unauthorizedSigningNotificationRewardMultiplier New value of the\\n /// unauthorized signing notification reward multiplier\\n /// @param dkgMaliciousResultNotificationRewardMultiplier New value of the\\n /// DKG malicious result notification reward multiplier\\n function updateRewardParameters(\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) external onlyGovernance {\\n _sortitionPoolRewardsBanDuration = sortitionPoolRewardsBanDuration;\\n _relayEntryTimeoutNotificationRewardMultiplier = relayEntryTimeoutNotificationRewardMultiplier;\\n _unauthorizedSigningNotificationRewardMultiplier = unauthorizedSigningNotificationRewardMultiplier;\\n _dkgMaliciousResultNotificationRewardMultiplier = dkgMaliciousResultNotificationRewardMultiplier;\\n emit RewardParametersUpdated(\\n sortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n }\\n\\n /// @notice Updates the values of slashing parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param relayEntrySubmissionFailureSlashingAmount New relay entry\\n /// submission failure amount\\n /// @param maliciousDkgResultSlashingAmount New malicious DKG result\\n /// slashing amount\\n /// @param unauthorizedSigningSlashingAmount New unauthorized signing\\n /// slashing amount\\n function updateSlashingParameters(\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint96 maliciousDkgResultSlashingAmount,\\n uint96 unauthorizedSigningSlashingAmount\\n ) external onlyGovernance {\\n relay.setRelayEntrySubmissionFailureSlashingAmount(\\n relayEntrySubmissionFailureSlashingAmount\\n );\\n _maliciousDkgResultSlashingAmount = maliciousDkgResultSlashingAmount;\\n _unauthorizedSigningSlashingAmount = unauthorizedSigningSlashingAmount;\\n emit SlashingParametersUpdated(\\n relayEntrySubmissionFailureSlashingAmount,\\n maliciousDkgResultSlashingAmount,\\n unauthorizedSigningSlashingAmount\\n );\\n }\\n\\n /// @notice Updates the values of gas parameters.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract. The caller is responsible for\\n /// validating parameters.\\n /// @param dkgResultSubmissionGas New DKG result submission gas\\n /// @param dkgResultApprovalGasOffset New DKG result approval gas offset\\n /// @param notifyOperatorInactivityGasOffset New operator inactivity\\n /// notification gas offset\\n /// @param relayEntrySubmissionGasOffset New relay entry submission gas\\n /// offset\\n function updateGasParameters(\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n ) external onlyGovernance {\\n _dkgResultSubmissionGas = dkgResultSubmissionGas;\\n _dkgResultApprovalGasOffset = dkgResultApprovalGasOffset;\\n _notifyOperatorInactivityGasOffset = notifyOperatorInactivityGasOffset;\\n _relayEntrySubmissionGasOffset = relayEntrySubmissionGasOffset;\\n\\n emit GasParametersUpdated(\\n dkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n }\\n\\n /// @notice Set authorization for requesters that can request a relay\\n /// entry.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract.\\n /// @param requester Requester, can be a contract or EOA\\n /// @param isAuthorized True or false\\n function setRequesterAuthorization(address requester, bool isAuthorized)\\n external\\n onlyGovernance\\n {\\n authorizedRequesters[requester] = isAuthorized;\\n\\n emit RequesterAuthorizationUpdated(requester, isAuthorized);\\n }\\n\\n /// @notice Withdraws application rewards for the given staking provider.\\n /// Rewards are withdrawn to the staking provider's beneficiary\\n /// address set in the staking contract. Reverts if staking provider\\n /// has not registered the operator address.\\n /// @dev Emits `RewardsWithdrawn` event.\\n function withdrawRewards(address stakingProvider) external {\\n address operator = stakingProviderToOperator(stakingProvider);\\n require(operator != address(0), \\\"Unknown operator\\\");\\n (, address beneficiary, ) = staking.rolesOf(stakingProvider);\\n uint96 amount = sortitionPool.withdrawRewards(operator, beneficiary);\\n // slither-disable-next-line reentrancy-events\\n emit RewardsWithdrawn(stakingProvider, amount);\\n }\\n\\n /// @notice Withdraws rewards belonging to operators marked as ineligible\\n /// for sortition pool rewards.\\n /// @dev Can be called only by the contract guvnor, which should be the\\n /// random beacon governance contract.\\n /// @param recipient Recipient of withdrawn rewards.\\n function withdrawIneligibleRewards(address recipient)\\n external\\n onlyGovernance\\n {\\n sortitionPool.withdrawIneligible(recipient);\\n }\\n\\n /// @notice Used by staking provider to set operator address that will\\n /// operate a node. The given staking provider can set operator\\n /// address only one time. The operator address can not be changed\\n /// and must be unique. Reverts if the operator is already set for\\n /// the staking provider or if the operator address is already in\\n /// use. Reverts if there is a pending authorization decrease for\\n /// the staking provider.\\n function registerOperator(address operator) external {\\n authorization.registerOperator(operator);\\n }\\n\\n /// @notice Lets the operator join the sortition pool. The operator address\\n /// must be known - before calling this function, it has to be\\n /// appointed by the staking provider by calling `registerOperator`.\\n /// Also, the operator must have the minimum authorization required\\n /// by the beacon. Function reverts if there is no minimum stake\\n /// authorized or if the operator is not known. If there was an\\n /// authorization decrease requested, it is activated by starting\\n /// the authorization decrease delay.\\n function joinSortitionPool() external {\\n authorization.joinSortitionPool(staking, sortitionPool);\\n }\\n\\n /// @notice Updates status of the operator in the sortition pool. If there\\n /// was an authorization decrease requested, it is activated by\\n /// starting the authorization decrease delay.\\n /// Function reverts if the operator is not known.\\n function updateOperatorStatus(address operator) external {\\n authorization.updateOperatorStatus(staking, sortitionPool, operator);\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorized stake amount for the given staking provider increased.\\n ///\\n /// Reverts if the authorization amount is below the minimum.\\n ///\\n /// The function is not updating the sortition pool. Sortition pool\\n /// state needs to be updated by the operator with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`.\\n ///\\n /// @dev Can only be called by T staking contract.\\n function authorizationIncreased(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external onlyStakingContract {\\n authorization.authorizationIncreased(\\n stakingProvider,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorization decrease for the given staking provider has been\\n /// requested.\\n ///\\n /// Reverts if the amount after deauthorization would be non-zero\\n /// and lower than the minimum authorization.\\n ///\\n /// Reverts if another authorization decrease request is pending for\\n /// the staking provider and not enough time passed since the\\n /// original request (see `authorizationDecreaseChangePeriod`).\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// it lets to `approveAuthorizationDecrease` immediately. If the\\n /// operator is known (`registerOperator` was called), the operator\\n /// needs to update state of the sortition pool with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`. After the\\n /// sortition pool state is in sync, authorization decrease delay\\n /// starts.\\n ///\\n /// After authorization decrease delay passes, authorization\\n /// decrease request needs to be approved with a call to\\n /// `approveAuthorizationDecrease` function.\\n ///\\n /// If there is a pending authorization decrease request, it is\\n /// overwritten, but only if enough time passed since the original\\n /// request. Otherwise, the function reverts.\\n ///\\n /// @dev Can only be called by T staking contract.\\n function authorizationDecreaseRequested(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external onlyStakingContract {\\n authorization.authorizationDecreaseRequested(\\n stakingProvider,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Approves the previously registered authorization decrease\\n /// request. Reverts if authorization decrease delay has not passed\\n /// yet or if the authorization decrease was not requested for the\\n /// given staking provider.\\n function approveAuthorizationDecrease(address stakingProvider) external {\\n authorization.approveAuthorizationDecrease(staking, stakingProvider);\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon the\\n /// authorization has been decreased for the given staking provider\\n /// involuntarily, as a result of slashing.\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// the function does nothing. The operator was never in a sortition\\n /// pool so there is nothing to update.\\n ///\\n /// If the operator is known, sortition pool is unlocked, and the\\n /// operator is in the sortition pool, the sortition pool state is\\n /// updated. If the sortition pool is locked, update needs to be\\n /// postponed. Every other staker is incentivized to call\\n /// `updateOperatorStatus` for the problematic operator to increase\\n /// their own rewards in the pool.\\n function involuntaryAuthorizationDecrease(\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external onlyStakingContract {\\n authorization.involuntaryAuthorizationDecrease(\\n staking,\\n sortitionPool,\\n stakingProvider,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Triggers group selection if there are no active groups.\\n function genesis() external {\\n require(groups.numberOfActiveGroups() == 0, \\\"Not awaiting genesis\\\");\\n\\n dkg.lockState();\\n dkg.start(\\n uint256(keccak256(abi.encodePacked(genesisSeed, block.number)))\\n );\\n }\\n\\n /// @notice Submits result of DKG protocol. It is on-chain part of phase 14 of\\n /// the protocol. The DKG result consists of result submitting member\\n /// index, calculated group public key, bytes array of misbehaved\\n /// members, concatenation of signatures from group members,\\n /// indices of members corresponding to each signature and\\n /// the list of group members.\\n /// When the result is verified successfully it gets registered and\\n /// waits for an approval. A result can be challenged to verify the\\n /// members list corresponds to the expected set of members determined\\n /// by the sortition pool.\\n /// A candidate group is registered based on the submitted DKG result\\n /// details.\\n /// @dev The message to be signed by each member is keccak256 hash of the\\n /// chain ID, calculated group public key, misbehaved members as bytes\\n /// and DKG start block. The calculated hash should be prefixed with\\n // prefixed with\\n /// `\\\\x19Ethereum signed message:\\\\n` before signing, so the message to\\n /// sign is:\\n /// `\\\\x19Ethereum signed message:\\\\n${keccak256(chainID,groupPubKey,misbehaved,startBlock)}`\\n /// @param dkgResult DKG result.\\n function submitDkgResult(DKG.Result calldata dkgResult) external {\\n groups.validatePublicKey(dkgResult.groupPubKey);\\n dkg.submitResult(dkgResult);\\n }\\n\\n /// @notice Notifies about DKG timeout.\\n function notifyDkgTimeout() external refundable(msg.sender) {\\n dkg.notifyTimeout();\\n }\\n\\n /// @notice Approves DKG result. Can be called when the challenge period for\\n /// the submitted result is finished. Considers the submitted result\\n /// as valid, bans misbehaved group members from the sortition pool\\n /// rewards, and completes the group creation by activating the\\n /// candidate group. For the first `submitterPrecedencePeriodLength`\\n /// blocks after the end of the challenge period can be called only\\n /// by the DKG result submitter. After that time, can be called by\\n /// anyone.\\n /// @param dkgResult Result to approve. Must match the submitted result\\n /// stored during `submitDkgResult`.\\n function approveDkgResult(DKG.Result calldata dkgResult) external {\\n uint256 gasStart = gasleft();\\n\\n uint32[] memory misbehavedMembers = dkg.approveResult(dkgResult);\\n\\n if (misbehavedMembers.length > 0) {\\n sortitionPool.setRewardIneligibility(\\n misbehavedMembers,\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp + _sortitionPoolRewardsBanDuration\\n );\\n }\\n\\n groups.addGroup(dkgResult.groupPubKey, dkgResult.membersHash);\\n dkg.complete();\\n\\n // Refund msg.sender's ETH for DKG result submission and result approval\\n reimbursementPool.refund(\\n _dkgResultSubmissionGas +\\n (gasStart - gasleft()) +\\n _dkgResultApprovalGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice Challenges DKG result. If the submitted result is proved to be\\n /// invalid it reverts the DKG back to the result submission phase.\\n /// It removes a candidate group that was previously registered with\\n /// the DKG result submission.\\n /// @param dkgResult Result to challenge. Must match the submitted result\\n /// stored during `submitDkgResult`.\\n /// @dev Due to EIP-150 1/64 of the gas is not forwarded to the call, and\\n /// will be kept to execute the remaining operations in the function\\n /// after the call inside the try-catch. To eliminate a class of\\n /// attacks related to the gas limit manipulation, this function\\n /// requires an extra amount of gas to be left at the end of the\\n /// execution.\\n function challengeDkgResult(DKG.Result calldata dkgResult) external {\\n (bytes32 maliciousResultHash, uint32 maliciousSubmitter) = dkg\\n .challengeResult(dkgResult);\\n\\n uint96 slashingAmount = _maliciousDkgResultSlashingAmount;\\n address maliciousSubmitterAddresses = sortitionPool.getIDOperator(\\n maliciousSubmitter\\n );\\n\\n address[] memory stakingProviderWrapper = new address[](1);\\n stakingProviderWrapper[0] = operatorToStakingProvider(\\n maliciousSubmitterAddresses\\n );\\n try\\n staking.seize(\\n slashingAmount,\\n _dkgMaliciousResultNotificationRewardMultiplier,\\n msg.sender,\\n stakingProviderWrapper\\n )\\n {\\n // slither-disable-next-line reentrancy-events\\n emit DkgMaliciousResultSlashed(\\n maliciousResultHash,\\n slashingAmount,\\n maliciousSubmitterAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop the challenge\\n // to complete.\\n emit DkgMaliciousResultSlashingFailed(\\n maliciousResultHash,\\n slashingAmount,\\n maliciousSubmitterAddresses\\n );\\n }\\n\\n // Due to EIP-150, 1/64 of the gas is not forwarded to the call, and\\n // will be kept to execute the remaining operations in the function\\n // after the call inside the try-catch.\\n //\\n // To ensure there is no way for the caller to manipulate gas limit in\\n // such a way that the call inside try-catch fails with out-of-gas and\\n // the rest of the function is executed with the remaining 1/64 of gas,\\n // we require an extra gas amount to be left at the end of the call to\\n // `challengeDkgResult`.\\n dkg.requireChallengeExtraGas();\\n }\\n\\n /// @notice Check current group creation state.\\n function getGroupCreationState() external view returns (DKG.State) {\\n return dkg.currentState();\\n }\\n\\n /// @notice Checks if DKG timed out. The DKG timeout period includes time required\\n /// for off-chain protocol execution and time for the result publication\\n /// for all group members. After this time result cannot be submitted\\n /// and DKG can be notified about the timeout.\\n /// @return True if DKG timed out, false otherwise.\\n function hasDkgTimedOut() external view returns (bool) {\\n return dkg.hasDkgTimedOut();\\n }\\n\\n function getGroupsRegistry() external view returns (bytes32[] memory) {\\n return groups.groupsRegistry;\\n }\\n\\n function getGroup(uint64 groupId)\\n external\\n view\\n returns (Groups.Group memory)\\n {\\n return groups.getGroup(groupId);\\n }\\n\\n function getGroup(bytes memory groupPubKey)\\n external\\n view\\n returns (Groups.Group memory)\\n {\\n return groups.getGroup(groupPubKey);\\n }\\n\\n /// @notice Creates a request to generate a new relay entry, which will\\n /// include a random number (by signing the previous entry's\\n /// random number). Requester must be previously authorized by the\\n /// governance.\\n /// @param callbackContract Beacon consumer callback contract.\\n function requestRelayEntry(IRandomBeaconConsumer callbackContract)\\n external\\n {\\n require(\\n authorizedRequesters[msg.sender],\\n \\\"Requester must be authorized\\\"\\n );\\n\\n uint64 groupId = groups.selectGroup(\\n uint256(keccak256(AltBn128.g1Marshal(relay.previousEntry)))\\n );\\n\\n relay.requestEntry(groupId);\\n\\n callback.setCallbackContract(callbackContract);\\n\\n // If the current request should trigger group creation we need to lock\\n // DKG state (lock sortition pool) to prevent operators from changing\\n // its state before relay entry is known. That entry will be used as a\\n // group selection seed.\\n if (\\n relay.requestCount % _groupCreationFrequency == 0 &&\\n dkg.currentState() == DKG.State.IDLE\\n ) {\\n dkg.lockState();\\n }\\n }\\n\\n /// @notice Creates a new relay entry. Gas-optimized version that can be\\n /// called only before the soft timeout. This should be the majority\\n /// of cases.\\n /// @param entry Group BLS signature over the previous entry.\\n function submitRelayEntry(bytes calldata entry) external {\\n uint256 gasStart = gasleft();\\n\\n Groups.Group storage group = groups.getGroup(\\n relay.currentRequestGroupID\\n );\\n\\n relay.submitEntryBeforeSoftTimeout(entry, group.groupPubKey);\\n\\n // If DKG is awaiting a seed, that means the we should start the actual\\n // group creation process.\\n if (dkg.currentState() == DKG.State.AWAITING_SEED) {\\n dkg.start(uint256(keccak256(entry)));\\n }\\n\\n callback.executeCallback(uint256(keccak256(entry)), _callbackGasLimit);\\n\\n reimbursementPool.refund(\\n (gasStart - gasleft()) + _relayEntrySubmissionGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice Creates a new relay entry.\\n /// @param entry Group BLS signature over the previous entry.\\n /// @param groupMembers Identifiers of group members.\\n function submitRelayEntry(\\n bytes calldata entry,\\n uint32[] calldata groupMembers\\n ) external {\\n uint256 gasStart = gasleft();\\n uint256 currentRequestId = relay.currentRequestID;\\n\\n Groups.Group storage group = groups.getGroup(\\n relay.currentRequestGroupID\\n );\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n uint96 slashingAmount = relay.submitEntry(entry, group.groupPubKey);\\n\\n if (slashingAmount > 0) {\\n address[] memory groupMembersAddresses = sortitionPool\\n .getIDOperators(groupMembers);\\n\\n address[] memory stakingProvidersAddresses = new address[](\\n groupMembersAddresses.length\\n );\\n for (uint256 i = 0; i < groupMembersAddresses.length; i++) {\\n stakingProvidersAddresses[i] = operatorToStakingProvider(\\n groupMembersAddresses[i]\\n );\\n }\\n\\n try staking.slash(slashingAmount, stakingProvidersAddresses) {\\n // slither-disable-next-line reentrancy-events\\n emit RelayEntryDelaySlashed(\\n currentRequestId,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop group members\\n // from submitting a valid relay entry.\\n emit RelayEntryDelaySlashingFailed(\\n currentRequestId,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n }\\n }\\n\\n // If DKG is awaiting a seed, that means the we should start the actual\\n // group creation process.\\n if (dkg.currentState() == DKG.State.AWAITING_SEED) {\\n dkg.start(uint256(keccak256(entry)));\\n }\\n\\n callback.executeCallback(uint256(keccak256(entry)), _callbackGasLimit);\\n reimbursementPool.refund(\\n (gasStart - gasleft()) + _relayEntrySubmissionGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice Reports a relay entry timeout.\\n /// @param groupMembers Identifiers of group members.\\n function reportRelayEntryTimeout(uint32[] calldata groupMembers) external {\\n uint64 groupId = relay.currentRequestGroupID;\\n Groups.Group storage group = groups.getGroup(groupId);\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n uint96 slashingAmount = relay.relayEntrySubmissionFailureSlashingAmount;\\n address[] memory groupMembersAddresses = sortitionPool.getIDOperators(\\n groupMembers\\n );\\n\\n address[] memory stakingProvidersAddresses = new address[](\\n groupMembersAddresses.length\\n );\\n for (uint256 i = 0; i < groupMembersAddresses.length; i++) {\\n stakingProvidersAddresses[i] = operatorToStakingProvider(\\n groupMembersAddresses[i]\\n );\\n }\\n\\n try\\n staking.seize(\\n slashingAmount,\\n _relayEntryTimeoutNotificationRewardMultiplier,\\n msg.sender,\\n stakingProvidersAddresses\\n )\\n {\\n // slither-disable-next-line reentrancy-events\\n emit RelayEntryTimeoutSlashed(\\n relay.currentRequestID,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop the challenge\\n // to complete.\\n emit RelayEntryTimeoutSlashingFailed(\\n relay.currentRequestID,\\n slashingAmount,\\n groupMembersAddresses\\n );\\n }\\n\\n groups.terminateGroup(groupId);\\n groups.expireOldGroups();\\n\\n if (groups.numberOfActiveGroups() > 0) {\\n groupId = groups.selectGroup(\\n uint256(keccak256(AltBn128.g1Marshal(relay.previousEntry)))\\n );\\n relay.retryOnEntryTimeout(groupId);\\n } else {\\n relay.cleanupOnEntryTimeout();\\n\\n // If DKG is awaiting a seed, we should notify about its timeout to\\n // avoid blocking the future group creation.\\n if (dkg.currentState() == DKG.State.AWAITING_SEED) {\\n dkg.notifySeedTimedOut();\\n }\\n }\\n }\\n\\n /// @notice Reports unauthorized groups signing. Must provide a valid signature\\n /// of the sender's address as a message. Successful signature\\n /// verification means the private key has been leaked and all group\\n /// members should be punished by slashing their tokens. Group has\\n /// to be active or expired. Unauthorized signing cannot be reported\\n /// for a terminated group. In case of reporting unauthorized\\n /// signing for a terminated group, or when the signature is invalid,\\n /// function reverts.\\n /// @param signedMsgSender Signature of the sender's address as a message.\\n /// @param groupId Group that is being reported for leaking a private key.\\n /// @param groupMembers Identifiers of group members.\\n function reportUnauthorizedSigning(\\n bytes memory signedMsgSender,\\n uint64 groupId,\\n uint32[] calldata groupMembers\\n ) external {\\n Groups.Group memory group = groups.getGroup(groupId);\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n require(!group.terminated, \\\"Group cannot be terminated\\\");\\n\\n require(\\n BLS.verifyBytes(\\n group.groupPubKey,\\n abi.encodePacked(msg.sender),\\n signedMsgSender\\n ),\\n \\\"Invalid signature\\\"\\n );\\n\\n groups.terminateGroup(groupId);\\n\\n address[] memory groupMembersAddresses = sortitionPool.getIDOperators(\\n groupMembers\\n );\\n\\n address[] memory stakingProvidersAddresses = new address[](\\n groupMembersAddresses.length\\n );\\n for (uint256 i = 0; i < groupMembersAddresses.length; i++) {\\n stakingProvidersAddresses[i] = operatorToStakingProvider(\\n groupMembersAddresses[i]\\n );\\n }\\n\\n try\\n staking.seize(\\n _unauthorizedSigningSlashingAmount,\\n _unauthorizedSigningNotificationRewardMultiplier,\\n msg.sender,\\n stakingProvidersAddresses\\n )\\n {\\n // slither-disable-next-line reentrancy-events\\n emit UnauthorizedSigningSlashed(\\n groupId,\\n _unauthorizedSigningSlashingAmount,\\n groupMembersAddresses\\n );\\n } catch {\\n // Should never happen but we want to ensure a non-critical path\\n // failure from an external contract does not stop the challenge\\n // to complete.\\n emit UnauthorizedSigningSlashingFailed(\\n groupId,\\n _unauthorizedSigningSlashingAmount,\\n groupMembersAddresses\\n );\\n }\\n }\\n\\n /// @notice Notifies about operators who are inactive. Using this function,\\n /// a majority of the group can decide about punishing specific\\n /// group members who constantly fail doing their job. If the provided\\n /// claim is proved to be valid and signed by sufficient number\\n /// of group members, operators of members deemed as inactive are\\n /// banned for sortition pool rewards for duration specified by\\n /// `_sortitionPoolRewardsBanDuration` parameter. The sender of\\n /// the claim must be one of the claim signers. This function can be\\n /// called only for active and non-terminated groups.\\n /// @param claim Operator inactivity claim.\\n /// @param nonce Current inactivity claim nonce for the given group. Must\\n /// be the same as the stored one.\\n /// @param groupMembers Identifiers of group members.\\n function notifyOperatorInactivity(\\n Inactivity.Claim calldata claim,\\n uint256 nonce,\\n uint32[] calldata groupMembers\\n ) external {\\n uint256 gasStart = gasleft();\\n uint64 groupId = claim.groupId;\\n\\n require(nonce == inactivityClaimNonce[groupId], \\\"Invalid nonce\\\");\\n\\n require(groups.isGroupActive(groupId), \\\"Group is not active\\\");\\n\\n Groups.Group storage group = groups.getGroup(groupId);\\n\\n require(\\n group.membersHash == keccak256(abi.encode(groupMembers)),\\n \\\"Invalid group members\\\"\\n );\\n\\n uint32[] memory ineligibleOperators = Inactivity.verifyClaim(\\n sortitionPool,\\n claim,\\n group.groupPubKey,\\n nonce,\\n groupMembers\\n );\\n\\n inactivityClaimNonce[groupId]++;\\n\\n emit InactivityClaimed(groupId, nonce, msg.sender);\\n\\n sortitionPool.setRewardIneligibility(\\n ineligibleOperators,\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp + _sortitionPoolRewardsBanDuration\\n );\\n\\n reimbursementPool.refund(\\n (gasStart - gasleft()) + _notifyOperatorInactivityGasOffset,\\n msg.sender\\n );\\n }\\n\\n /// @notice The minimum authorization amount required so that operator can\\n /// participate in the random beacon. This amount is required to\\n /// execute slashing for providing a malicious DKG result or when\\n /// a relay entry times out.\\n function minimumAuthorization() external view returns (uint96) {\\n return authorization.parameters.minimumAuthorization;\\n }\\n\\n /// @return Flag indicating whether a relay entry request is currently\\n /// in progress.\\n function isRelayRequestInProgress() external view returns (bool) {\\n return relay.isRequestInProgress();\\n }\\n\\n /// @notice Returns the current value of the staking provider's eligible\\n /// stake. Eligible stake is defined as the currently authorized\\n /// stake minus the pending authorization decrease. Eligible stake\\n /// is what is used for operator's weight in the sortition pool.\\n /// If the authorized stake minus the pending authorization decrease\\n /// is below the minimum authorization, eligible stake is 0.\\n function eligibleStake(address stakingProvider)\\n external\\n view\\n returns (uint96)\\n {\\n return authorization.eligibleStake(staking, stakingProvider);\\n }\\n\\n /// @notice Returns the amount of rewards available for withdrawal for the\\n /// given staking provider. Reverts if staking provider has not\\n /// registered the operator address.\\n function availableRewards(address stakingProvider)\\n external\\n view\\n returns (uint96)\\n {\\n address operator = stakingProviderToOperator(stakingProvider);\\n require(operator != address(0), \\\"Unknown operator\\\");\\n return sortitionPool.getAvailableRewards(operator);\\n }\\n\\n /// @notice Returns the amount of stake that is pending authorization\\n /// decrease for the given staking provider. If no authorization\\n /// decrease has been requested, returns zero.\\n function pendingAuthorizationDecrease(address stakingProvider)\\n external\\n view\\n returns (uint96)\\n {\\n return authorization.pendingAuthorizationDecrease(stakingProvider);\\n }\\n\\n /// @notice Returns the remaining time in seconds that needs to pass before\\n /// the requested authorization decrease can be approved.\\n /// If the sortition pool state was not updated yet by the operator\\n /// after requesting the authorization decrease, returns\\n /// `type(uint64).max`.\\n function remainingAuthorizationDecreaseDelay(address stakingProvider)\\n external\\n view\\n returns (uint64)\\n {\\n return\\n authorization.remainingAuthorizationDecreaseDelay(stakingProvider);\\n }\\n\\n /// @notice Returns operator registered for the given staking provider.\\n function stakingProviderToOperator(address stakingProvider)\\n public\\n view\\n returns (address)\\n {\\n return authorization.stakingProviderToOperator[stakingProvider];\\n }\\n\\n /// @notice Returns staking provider of the given operator.\\n function operatorToStakingProvider(address operator)\\n public\\n view\\n returns (address)\\n {\\n return authorization.operatorToStakingProvider[operator];\\n }\\n\\n /// @notice Checks if the operator's authorized stake is in sync with\\n /// operator's weight in the sortition pool.\\n /// If the operator is not in the sortition pool and their\\n /// authorized stake is non-zero, function returns false.\\n function isOperatorUpToDate(address operator) external view returns (bool) {\\n return\\n authorization.isOperatorUpToDate(staking, sortitionPool, operator);\\n }\\n\\n /// @notice Returns true if the given operator is in the sortition pool.\\n /// Otherwise, returns false.\\n function isOperatorInPool(address operator) external view returns (bool) {\\n return sortitionPool.isOperatorInPool(operator);\\n }\\n\\n /// @notice Selects a new group of operators. Can only be called when DKG\\n /// is in progress and the pool is locked.\\n /// At least one operator has to be registered in the pool,\\n /// otherwise the function fails reverting the transaction.\\n /// @return IDs of selected group members.\\n function selectGroup() external view returns (uint32[] memory) {\\n return sortitionPool.selectGroup(DKG.groupSize, bytes32(dkg.seed));\\n }\\n\\n /// @notice Returns authorization-related parameters of the beacon.\\n /// @dev The minimum authorization is also returned by `minimumAuthorization()`\\n /// function, as a requirement of `IApplication` interface.\\n /// @return minimumAuthorization The minimum authorization amount required\\n /// so that operator can participate in the random beacon. This\\n /// amount is required to execute slashing for providing a malicious\\n /// DKG result or when a relay entry times out.\\n /// @return authorizationDecreaseDelay Delay in seconds that needs to pass\\n /// between the time authorization decrease is requested and the\\n /// time that request gets approved. Protects against free-riders\\n /// earning rewards and not being active in the network.\\n /// @return authorizationDecreaseChangePeriod Authorization decrease change\\n /// period in seconds. It is the time, before authorization decrease\\n /// delay end, during which the pending authorization decrease\\n /// request can be overwritten.\\n /// If set to 0, pending authorization decrease request can not be\\n /// overwritten until the entire `authorizationDecreaseDelay` ends.\\n /// If set to value equal `authorizationDecreaseDelay`, request can\\n /// always be overwritten.\\n function authorizationParameters()\\n external\\n view\\n returns (\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseDelay,\\n uint64 authorizationDecreaseChangePeriod\\n )\\n {\\n return (\\n authorization.parameters.minimumAuthorization,\\n authorization.parameters.authorizationDecreaseDelay,\\n authorization.parameters.authorizationDecreaseChangePeriod\\n );\\n }\\n\\n /// @notice Returns relay-entry-related parameters of the beacon.\\n /// @return relayEntrySoftTimeout Soft timeout in blocks for a group to\\n /// submit the relay entry. If the soft timeout is reached for\\n /// submitting the relay entry, the slashing starts.\\n /// @return relayEntryHardTimeout Hard timeout in blocks for a group to\\n /// submit the relay entry. After the soft timeout passes without\\n /// relay entry submitted, all group members start getting slashed.\\n /// The slashing amount increases linearly until the group submits\\n /// the relay entry or until `relayEntryHardTimeout` is reached.\\n /// When the hard timeout is reached, each group member will get\\n /// slashed for `_relayEntrySubmissionFailureSlashingAmount`.\\n /// @return callbackGasLimit Relay entry callback gas limit. This is the gas\\n /// limit with which callback function provided in the relay request\\n /// transaction is executed. The callback is executed with a new\\n /// relay entry value in the same transaction the relay entry is\\n /// submitted.\\n function relayEntryParameters()\\n external\\n view\\n returns (\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n )\\n {\\n return (\\n relay.relayEntrySoftTimeout,\\n relay.relayEntryHardTimeout,\\n _callbackGasLimit\\n );\\n }\\n\\n /// @notice Returns group-creation-related parameters of the beacon.\\n /// @return groupCreationFrequency The frequency of a new group creation.\\n /// Groups are created with a fixed frequency of relay requests.\\n /// @return groupLifetime Group lifetime in blocks. When a group reached its\\n /// lifetime, it is no longer selected for new relay requests but\\n /// may still be responsible for submitting relay entry if relay\\n /// request assigned to that group is still pending.\\n /// @return dkgResultChallengePeriodLength The number of blocks for which\\n /// a DKG result can be challenged. Anyone can challenge DKG result\\n /// for a certain number of blocks before the result is fully\\n /// accepted and the group registered in the pool of active groups.\\n /// If the challenge gets accepted, all operators who signed the\\n /// malicious result get slashed for and the notifier gets rewarded.\\n /// @return dkgResultChallengeExtraGas The extra gas required to be left at\\n /// the end of the challenge DKG result transaction.\\n /// @return dkgResultSubmissionTimeout Timeout in blocks for a group to\\n /// submit the DKG result. All members are eligible to submit the\\n /// DKG result. If `dkgResultSubmissionTimeout` passes without the\\n /// DKG result submitted, DKG is considered as timed out and no DKG\\n /// result for this group creation can be submitted anymore.\\n /// @return dkgSubmitterPrecedencePeriodLength Time during the DKG result\\n /// approval stage when the submitter of the DKG result takes the\\n /// precedence to approve the DKG result. After this time passes\\n /// anyone can approve the DKG result.\\n function groupCreationParameters()\\n external\\n view\\n returns (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n )\\n {\\n return (\\n _groupCreationFrequency,\\n groups.groupLifetime,\\n dkg.parameters.resultChallengePeriodLength,\\n dkg.parameters.resultChallengeExtraGas,\\n dkg.parameters.resultSubmissionTimeout,\\n dkg.parameters.submitterPrecedencePeriodLength\\n );\\n }\\n\\n /// @notice Returns reward-related parameters of the beacon.\\n /// @return sortitionPoolRewardsBanDuration Duration of the sortition pool\\n /// rewards ban imposed on operators who misbehaved during DKG by\\n /// being inactive or disqualified and for operators that were\\n /// identified by the rest of group members as inactive via\\n /// `notifyOperatorInactivity`.\\n /// @return relayEntryTimeoutNotificationRewardMultiplier Percentage of the\\n /// staking contract malicious behavior notification reward which\\n /// will be transferred to the notifier reporting about relay entry\\n /// timeout. Notifiers are rewarded from a notifiers treasury pool.\\n /// For example, if notification reward is 1000 and the value of the\\n /// multiplier is 5, the notifier will receive: 5% of 1000 = 50 per\\n /// each operator affected.\\n /// @return unauthorizedSigningNotificationRewardMultiplier Percentage of the\\n /// staking contract malicious behavior notification reward which\\n /// will be transferred to the notifier reporting about unauthorized\\n /// signing. Notifiers are rewarded from a notifiers treasury pool.\\n /// For example, if a notification reward is 1000 and the value of\\n /// the multiplier is 5, the notifier will receive: 5% of 1000 = 50\\n /// per each operator affected.\\n /// @return dkgMaliciousResultNotificationRewardMultiplier Percentage of the\\n /// staking contract malicious behavior notification reward which\\n /// will be transferred to the notifier reporting about a malicious\\n /// DKG result. Notifiers are rewarded from a notifiers treasury\\n /// pool. For example, if notification reward is 1000 and the value\\n /// of the multiplier is 5, the notifier will receive:\\n /// 5% of 1000 = 50 per each operator affected.\\n function rewardParameters()\\n external\\n view\\n returns (\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n )\\n {\\n return (\\n _sortitionPoolRewardsBanDuration,\\n _relayEntryTimeoutNotificationRewardMultiplier,\\n _unauthorizedSigningNotificationRewardMultiplier,\\n _dkgMaliciousResultNotificationRewardMultiplier\\n );\\n }\\n\\n /// @notice Returns slashing-related parameters of the beacon.\\n /// @return relayEntrySubmissionFailureSlashingAmount Slashing amount for\\n /// not submitting relay entry. When relay entry hard timeout is\\n /// reached without the relay entry submitted, each group member\\n /// gets slashed for `relayEntrySubmissionFailureSlashingAmount`.\\n /// If the relay entry gets submitted after the soft timeout, but\\n /// before the hard timeout, each group member gets slashed\\n /// proportionally to `relayEntrySubmissionFailureSlashingAmount`\\n /// and the time passed since the soft deadline.\\n /// @return maliciousDkgResultSlashingAmount Slashing amount for submitting\\n /// a malicious DKG result. Every DKG result submitted can be\\n /// challenged for the time of `dkg.ResultChallengePeriodLength`.\\n /// If the DKG result submitted is challenged and proven to be\\n /// malicious, the operator who submitted the malicious result is\\n /// slashed for `maliciousDkgResultSlashingAmount`.\\n /// @return unauthorizedSigningSlashingAmount Slashing amount when an\\n /// unauthorized signing has been proved, which means the private\\n /// key leaked and all the group members should be punished.\\n function slashingParameters()\\n external\\n view\\n returns (\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint96 maliciousDkgResultSlashingAmount,\\n uint96 unauthorizedSigningSlashingAmount\\n )\\n {\\n return (\\n relay.relayEntrySubmissionFailureSlashingAmount,\\n _maliciousDkgResultSlashingAmount,\\n _unauthorizedSigningSlashingAmount\\n );\\n }\\n\\n /// @notice Returns gas-related parameters of the beacon.\\n /// @return dkgResultSubmissionGas Calculated gas cost for submitting a DKG\\n /// result. This will be refunded as part of the DKG approval\\n /// process.\\n /// @return dkgResultApprovalGasOffset Gas that is meant to balance the DKG\\n /// result approval's overall cost.\\n /// @return notifyOperatorInactivityGasOffset Gas that is meant to balance\\n /// the operator inactivity notification cost.\\n /// @return relayEntrySubmissionGasOffset Gas that is meant to balance the\\n /// relay entry submission cost.\\n function gasParameters()\\n external\\n view\\n returns (\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n )\\n {\\n return (\\n _dkgResultSubmissionGas,\\n _dkgResultApprovalGasOffset,\\n _notifyOperatorInactivityGasOffset,\\n _relayEntrySubmissionGasOffset\\n );\\n }\\n}\\n\",\"keccak256\":\"0x50e6572ce7e51404a9918bf80d13004c4f4fd2a41fbc898f8aac84fa71423917\",\"license\":\"GPL-3.0-only\"},\"contracts/RandomBeaconGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./RandomBeacon.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\n/// @title Keep Random Beacon Governance\\n/// @notice Owns the `RandomBeacon` contract and is responsible for updating its\\n/// governable parameters in respect to governance delay individual\\n/// for each parameter.\\ncontract RandomBeaconGovernance is Ownable {\\n uint256 public newGovernanceDelay;\\n uint256 public governanceDelayChangeInitiated;\\n\\n address public newRandomBeaconGovernance;\\n uint256 public randomBeaconGovernanceTransferInitiated;\\n\\n uint256 public newRelayEntrySoftTimeout;\\n uint256 public relayEntrySoftTimeoutChangeInitiated;\\n\\n uint256 public newRelayEntryHardTimeout;\\n uint256 public relayEntryHardTimeoutChangeInitiated;\\n\\n uint256 public newCallbackGasLimit;\\n uint256 public callbackGasLimitChangeInitiated;\\n\\n uint256 public newGroupCreationFrequency;\\n uint256 public groupCreationFrequencyChangeInitiated;\\n\\n uint256 public newGroupLifetime;\\n uint256 public groupLifetimeChangeInitiated;\\n\\n uint256 public newDkgResultChallengePeriodLength;\\n uint256 public dkgResultChallengePeriodLengthChangeInitiated;\\n\\n uint256 public newDkgResultChallengeExtraGas;\\n uint256 public dkgResultChallengeExtraGasChangeInitiated;\\n\\n uint256 public newDkgResultSubmissionTimeout;\\n uint256 public dkgResultSubmissionTimeoutChangeInitiated;\\n\\n uint256 public newDkgSubmitterPrecedencePeriodLength;\\n uint256 public dkgSubmitterPrecedencePeriodLengthChangeInitiated;\\n\\n uint96 public newRelayEntrySubmissionFailureSlashingAmount;\\n uint256 public relayEntrySubmissionFailureSlashingAmountChangeInitiated;\\n\\n uint96 public newMaliciousDkgResultSlashingAmount;\\n uint256 public maliciousDkgResultSlashingAmountChangeInitiated;\\n\\n uint96 public newUnauthorizedSigningSlashingAmount;\\n uint256 public unauthorizedSigningSlashingAmountChangeInitiated;\\n\\n uint256 public newSortitionPoolRewardsBanDuration;\\n uint256 public sortitionPoolRewardsBanDurationChangeInitiated;\\n\\n uint256 public newRelayEntryTimeoutNotificationRewardMultiplier;\\n uint256 public relayEntryTimeoutNotificationRewardMultiplierChangeInitiated;\\n\\n uint256 public newUnauthorizedSigningNotificationRewardMultiplier;\\n uint256\\n public unauthorizedSigningNotificationRewardMultiplierChangeInitiated;\\n\\n uint96 public newMinimumAuthorization;\\n uint256 public minimumAuthorizationChangeInitiated;\\n\\n uint64 public newAuthorizationDecreaseDelay;\\n uint256 public authorizationDecreaseDelayChangeInitiated;\\n\\n uint64 public newAuthorizationDecreaseChangePeriod;\\n uint256 public authorizationDecreaseChangePeriodChangeInitiated;\\n\\n uint256 public newDkgMaliciousResultNotificationRewardMultiplier;\\n uint256\\n public dkgMaliciousResultNotificationRewardMultiplierChangeInitiated;\\n\\n uint256 public newDkgResultSubmissionGas;\\n uint256 public dkgResultSubmissionGasChangeInitiated;\\n\\n uint256 public newDkgResultApprovalGasOffset;\\n uint256 public dkgResultApprovalGasOffsetChangeInitiated;\\n\\n uint256 public newNotifyOperatorInactivityGasOffset;\\n uint256 public notifyOperatorInactivityGasOffsetChangeInitiated;\\n\\n uint256 public newRelayEntrySubmissionGasOffset;\\n uint256 public relayEntrySubmissionGasOffsetChangeInitiated;\\n\\n RandomBeacon public immutable randomBeacon;\\n\\n uint256 public governanceDelay;\\n\\n event GovernanceDelayUpdateStarted(\\n uint256 governanceDelay,\\n uint256 timestamp\\n );\\n event GovernanceDelayUpdated(uint256 governanceDelay);\\n\\n event RandomBeaconGovernanceTransferStarted(\\n address newRandomBeaconGovernance,\\n uint256 timestamp\\n );\\n event RandomBeaconGovernanceTransferred(address newRandomBeaconGovernance);\\n\\n event RelayEntrySoftTimeoutUpdateStarted(\\n uint256 relayEntrySoftTimeout,\\n uint256 timestamp\\n );\\n event RelayEntrySoftTimeoutUpdated(uint256 relayEntrySoftTimeout);\\n\\n event RelayEntryHardTimeoutUpdateStarted(\\n uint256 relayEntryHardTimeout,\\n uint256 timestamp\\n );\\n event RelayEntryHardTimeoutUpdated(uint256 relayEntryHardTimeout);\\n\\n event CallbackGasLimitUpdateStarted(\\n uint256 callbackGasLimit,\\n uint256 timestamp\\n );\\n event CallbackGasLimitUpdated(uint256 callbackGasLimit);\\n\\n event GroupCreationFrequencyUpdateStarted(\\n uint256 groupCreationFrequency,\\n uint256 timestamp\\n );\\n event GroupCreationFrequencyUpdated(uint256 groupCreationFrequency);\\n\\n event GroupLifetimeUpdateStarted(uint256 groupLifetime, uint256 timestamp);\\n event GroupLifetimeUpdated(uint256 groupLifetime);\\n\\n event DkgResultChallengePeriodLengthUpdateStarted(\\n uint256 dkgResultChallengePeriodLength,\\n uint256 timestamp\\n );\\n event DkgResultChallengePeriodLengthUpdated(\\n uint256 dkgResultChallengePeriodLength\\n );\\n\\n event DkgResultChallengeExtraGasUpdateStarted(\\n uint256 dkgResultChallengeExtraGas,\\n uint256 timestamp\\n );\\n event DkgResultChallengeExtraGasUpdated(uint256 dkgResultChallengeExtraGas);\\n\\n event DkgResultSubmissionTimeoutUpdateStarted(\\n uint256 dkgResultSubmissionTimeout,\\n uint256 timestamp\\n );\\n event DkgResultSubmissionTimeoutUpdated(uint256 dkgResultSubmissionTimeout);\\n\\n event DkgSubmitterPrecedencePeriodLengthUpdateStarted(\\n uint256 submitterPrecedencePeriodLength,\\n uint256 timestamp\\n );\\n event DkgSubmitterPrecedencePeriodLengthUpdated(\\n uint256 submitterPrecedencePeriodLength\\n );\\n\\n event RelayEntrySubmissionFailureSlashingAmountUpdateStarted(\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint256 timestamp\\n );\\n event RelayEntrySubmissionFailureSlashingAmountUpdated(\\n uint96 relayEntrySubmissionFailureSlashingAmount\\n );\\n\\n event MaliciousDkgResultSlashingAmountUpdateStarted(\\n uint96 maliciousDkgResultSlashingAmount,\\n uint256 timestamp\\n );\\n event MaliciousDkgResultSlashingAmountUpdated(\\n uint96 maliciousDkgResultSlashingAmount\\n );\\n\\n event UnauthorizedSigningSlashingAmountUpdateStarted(\\n uint96 unauthorizedSigningSlashingAmount,\\n uint256 timestamp\\n );\\n event UnauthorizedSigningSlashingAmountUpdated(\\n uint96 unauthorizedSigningSlashingAmount\\n );\\n\\n event SortitionPoolRewardsBanDurationUpdateStarted(\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 timestamp\\n );\\n event SortitionPoolRewardsBanDurationUpdated(\\n uint256 sortitionPoolRewardsBanDuration\\n );\\n\\n event RelayEntryTimeoutNotificationRewardMultiplierUpdateStarted(\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 timestamp\\n );\\n event RelayEntryTimeoutNotificationRewardMultiplierUpdated(\\n uint256 relayEntryTimeoutNotificationRewardMultiplier\\n );\\n\\n event UnauthorizedSigningNotificationRewardMultiplierUpdateStarted(\\n uint256 unauthorizedSigningTimeoutNotificationRewardMultiplier,\\n uint256 timestamp\\n );\\n event UnauthorizedSigningNotificationRewardMultiplierUpdated(\\n uint256 unauthorizedSigningTimeoutNotificationRewardMultiplier\\n );\\n\\n event MinimumAuthorizationUpdateStarted(\\n uint96 minimumAuthorization,\\n uint256 timestamp\\n );\\n event MinimumAuthorizationUpdated(uint96 minimumAuthorization);\\n\\n event AuthorizationDecreaseDelayUpdateStarted(\\n uint64 authorizationDecreaseDelay,\\n uint256 timestamp\\n );\\n event AuthorizationDecreaseDelayUpdated(uint64 authorizationDecreaseDelay);\\n\\n event AuthorizationDecreaseChangePeriodUpdateStarted(\\n uint64 authorizationDecreaseChangePeriod,\\n uint256 timestamp\\n );\\n\\n event AuthorizationDecreaseChangePeriodUpdated(\\n uint64 authorizationDecreaseChangePeriod\\n );\\n\\n event DkgMaliciousResultNotificationRewardMultiplierUpdateStarted(\\n uint256 dkgMaliciousResultNotificationRewardMultiplier,\\n uint256 timestamp\\n );\\n event DkgMaliciousResultNotificationRewardMultiplierUpdated(\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n );\\n\\n event DkgResultSubmissionGasUpdateStarted(\\n uint256 dkgResultSubmissionGas,\\n uint256 timestamp\\n );\\n event DkgResultSubmissionGasUpdated(uint256 dkgResultSubmissionGas);\\n\\n event DkgResultApprovalGasOffsetUpdateStarted(\\n uint256 dkgResultApprovalGasOffset,\\n uint256 timestamp\\n );\\n event DkgResultApprovalGasOffsetUpdated(uint256 dkgResultApprovalGasOffset);\\n\\n event NotifyOperatorInactivityGasOffsetUpdateStarted(\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 timestamp\\n );\\n event NotifyOperatorInactivityGasOffsetUpdated(\\n uint256 notifyOperatorInactivityGasOffset\\n );\\n\\n event RelayEntrySubmissionGasOffsetUpdateStarted(\\n uint256 relayEntrySubmissionGasOffset,\\n uint256 timestamp\\n );\\n event RelayEntrySubmissionGasOffsetUpdated(\\n uint256 relayEntrySubmissionGasOffset\\n );\\n\\n /// @notice Reverts if called before the governance delay elapses.\\n /// @param changeInitiatedTimestamp Timestamp indicating the beginning\\n /// of the change.\\n modifier onlyAfterGovernanceDelay(uint256 changeInitiatedTimestamp) {\\n /* solhint-disable not-rely-on-time */\\n require(changeInitiatedTimestamp > 0, \\\"Change not initiated\\\");\\n require(\\n block.timestamp - changeInitiatedTimestamp >= governanceDelay,\\n \\\"Governance delay has not elapsed\\\"\\n );\\n _;\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n constructor(RandomBeacon _randomBeacon, uint256 _governanceDelay) {\\n require(address(_randomBeacon) != address(0), \\\"Zero-address reference\\\");\\n require(_governanceDelay != 0, \\\"No governance delay\\\");\\n\\n randomBeacon = _randomBeacon;\\n governanceDelay = _governanceDelay;\\n }\\n\\n /// @notice Begins the governance delay update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newGovernanceDelay New governance delay\\n function beginGovernanceDelayUpdate(uint256 _newGovernanceDelay)\\n external\\n onlyOwner\\n {\\n newGovernanceDelay = _newGovernanceDelay;\\n /* solhint-disable not-rely-on-time */\\n governanceDelayChangeInitiated = block.timestamp;\\n emit GovernanceDelayUpdateStarted(_newGovernanceDelay, block.timestamp);\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the governance delay update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeGovernanceDelayUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(governanceDelayChangeInitiated)\\n {\\n emit GovernanceDelayUpdated(newGovernanceDelay);\\n governanceDelay = newGovernanceDelay;\\n governanceDelayChangeInitiated = 0;\\n newGovernanceDelay = 0;\\n }\\n\\n /// @notice Begins the random beacon governance transfer process.\\n /// @dev Can be called only by the current contract governance.\\n function beginRandomBeaconGovernanceTransfer(\\n address _newRandomBeaconGovernance\\n ) external onlyOwner {\\n require(\\n address(_newRandomBeaconGovernance) != address(0),\\n \\\"New random beacon governance address cannot be zero\\\"\\n );\\n newRandomBeaconGovernance = _newRandomBeaconGovernance;\\n /* solhint-disable not-rely-on-time */\\n randomBeaconGovernanceTransferInitiated = block.timestamp;\\n emit RandomBeaconGovernanceTransferStarted(\\n _newRandomBeaconGovernance,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the random beacon governance transfer process.\\n /// @dev Can be called only by the current contract governance, after the\\n /// governance delay elapses.\\n function finalizeRandomBeaconGovernanceTransfer()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(randomBeaconGovernanceTransferInitiated)\\n {\\n emit RandomBeaconGovernanceTransferred(newRandomBeaconGovernance);\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.transferGovernance(newRandomBeaconGovernance);\\n randomBeaconGovernanceTransferInitiated = 0;\\n newRandomBeaconGovernance = address(0);\\n }\\n\\n /// @notice Begins the relay entry soft timeout update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntrySoftTimeout New relay entry submission timeout in blocks\\n function beginRelayEntrySoftTimeoutUpdate(uint256 _newRelayEntrySoftTimeout)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newRelayEntrySoftTimeout > 0,\\n \\\"Relay entry soft timeout must be > 0\\\"\\n );\\n newRelayEntrySoftTimeout = _newRelayEntrySoftTimeout;\\n relayEntrySoftTimeoutChangeInitiated = block.timestamp;\\n emit RelayEntrySoftTimeoutUpdateStarted(\\n _newRelayEntrySoftTimeout,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the relay entry soft timeout update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntrySoftTimeoutUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(relayEntrySoftTimeoutChangeInitiated)\\n {\\n emit RelayEntrySoftTimeoutUpdated(newRelayEntrySoftTimeout);\\n (\\n ,\\n uint256 relayEntryHardTimeout,\\n uint256 callbackGasLimit\\n ) = randomBeacon.relayEntryParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRelayEntryParameters(\\n newRelayEntrySoftTimeout,\\n relayEntryHardTimeout,\\n callbackGasLimit\\n );\\n relayEntrySoftTimeoutChangeInitiated = 0;\\n newRelayEntrySoftTimeout = 0;\\n }\\n\\n /// @notice Begins the relay entry hard timeout update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntryHardTimeout New relay entry hard timeout in blocks\\n function beginRelayEntryHardTimeoutUpdate(uint256 _newRelayEntryHardTimeout)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n newRelayEntryHardTimeout = _newRelayEntryHardTimeout;\\n relayEntryHardTimeoutChangeInitiated = block.timestamp;\\n emit RelayEntryHardTimeoutUpdateStarted(\\n _newRelayEntryHardTimeout,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the relay entry hard timeout update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntryHardTimeoutUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(relayEntryHardTimeoutChangeInitiated)\\n {\\n emit RelayEntryHardTimeoutUpdated(newRelayEntryHardTimeout);\\n (\\n uint256 relayEntrySoftTimeout,\\n ,\\n uint256 callbackGasLimit\\n ) = randomBeacon.relayEntryParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRelayEntryParameters(\\n relayEntrySoftTimeout,\\n newRelayEntryHardTimeout,\\n callbackGasLimit\\n );\\n relayEntryHardTimeoutChangeInitiated = 0;\\n newRelayEntryHardTimeout = 0;\\n }\\n\\n /// @notice Begins the callback gas limit update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newCallbackGasLimit New callback gas limit\\n function beginCallbackGasLimitUpdate(uint256 _newCallbackGasLimit)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n // slither-disable-next-line too-many-digits\\n require(\\n _newCallbackGasLimit > 0 && _newCallbackGasLimit <= 1e6,\\n \\\"Callback gas limit must be > 0 and <= 1000000\\\"\\n );\\n newCallbackGasLimit = _newCallbackGasLimit;\\n callbackGasLimitChangeInitiated = block.timestamp;\\n emit CallbackGasLimitUpdateStarted(\\n _newCallbackGasLimit,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the callback gas limit update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeCallbackGasLimitUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(callbackGasLimitChangeInitiated)\\n {\\n emit CallbackGasLimitUpdated(newCallbackGasLimit);\\n (\\n uint256 relayEntrySoftTimeout,\\n uint256 relayEntryHardTimeout,\\n\\n ) = randomBeacon.relayEntryParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRelayEntryParameters(\\n relayEntrySoftTimeout,\\n relayEntryHardTimeout,\\n newCallbackGasLimit\\n );\\n callbackGasLimitChangeInitiated = 0;\\n newCallbackGasLimit = 0;\\n }\\n\\n /// @notice Begins the group creation frequency update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newGroupCreationFrequency New group creation frequency\\n function beginGroupCreationFrequencyUpdate(\\n uint256 _newGroupCreationFrequency\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newGroupCreationFrequency > 0,\\n \\\"Group creation frequency must be > 0\\\"\\n );\\n newGroupCreationFrequency = _newGroupCreationFrequency;\\n groupCreationFrequencyChangeInitiated = block.timestamp;\\n emit GroupCreationFrequencyUpdateStarted(\\n _newGroupCreationFrequency,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the group creation frequency update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeGroupCreationFrequencyUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(groupCreationFrequencyChangeInitiated)\\n {\\n emit GroupCreationFrequencyUpdated(newGroupCreationFrequency);\\n (\\n ,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n newGroupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n groupCreationFrequencyChangeInitiated = 0;\\n newGroupCreationFrequency = 0;\\n }\\n\\n /// @notice Begins the group lifetime update process. Group lifetime needs to\\n /// be shorter than the authorization decrease delay to ensure every\\n /// active group is backed by enough stake. A new group lifetime value\\n /// is in blocks and has to be calculated based on the average block\\n /// time and authorization decrease delay which value is in seconds.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newGroupLifetime New group lifetime in blocks\\n function beginGroupLifetimeUpdate(uint256 _newGroupLifetime)\\n external\\n onlyOwner\\n {\\n require(_newGroupLifetime > 0, \\\"Group lifetime must be greater than 0\\\");\\n /* solhint-disable not-rely-on-time */\\n newGroupLifetime = _newGroupLifetime;\\n groupLifetimeChangeInitiated = block.timestamp;\\n emit GroupLifetimeUpdateStarted(_newGroupLifetime, block.timestamp);\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the group creation frequency update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeGroupLifetimeUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(groupLifetimeChangeInitiated)\\n {\\n emit GroupLifetimeUpdated(newGroupLifetime);\\n (\\n uint256 groupCreationFrequency,\\n ,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n newGroupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n groupLifetimeChangeInitiated = 0;\\n newGroupLifetime = 0;\\n }\\n\\n /// @notice Begins the DKG result challenge period length update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultChallengePeriodLength New DKG result challenge\\n /// period length in blocks\\n function beginDkgResultChallengePeriodLengthUpdate(\\n uint256 _newDkgResultChallengePeriodLength\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgResultChallengePeriodLength >= 10,\\n \\\"DKG result challenge period length must be >= 10\\\"\\n );\\n newDkgResultChallengePeriodLength = _newDkgResultChallengePeriodLength;\\n dkgResultChallengePeriodLengthChangeInitiated = block.timestamp;\\n emit DkgResultChallengePeriodLengthUpdateStarted(\\n _newDkgResultChallengePeriodLength,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result challenge period length update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultChallengePeriodLengthUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultChallengePeriodLengthChangeInitiated)\\n {\\n emit DkgResultChallengePeriodLengthUpdated(\\n newDkgResultChallengePeriodLength\\n );\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n ,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n newDkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n dkgResultChallengePeriodLengthChangeInitiated = 0;\\n newDkgResultChallengePeriodLength = 0;\\n }\\n\\n /// @notice Begins the DKG result challenge extra gas update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultChallengeExtraGas New DKG result challenge extra gas\\n function beginDkgResultChallengeExtraGasUpdate(\\n uint256 _newDkgResultChallengeExtraGas\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newDkgResultChallengeExtraGas = _newDkgResultChallengeExtraGas;\\n dkgResultChallengeExtraGasChangeInitiated = block.timestamp;\\n emit DkgResultChallengeExtraGasUpdateStarted(\\n _newDkgResultChallengeExtraGas,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result challenge extra gas update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultChallengeExtraGasUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultChallengeExtraGasChangeInitiated)\\n {\\n emit DkgResultChallengeExtraGasUpdated(newDkgResultChallengeExtraGas);\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n ,\\n uint256 dkgResultSubmissionTimeout,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n newDkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n dkgResultChallengeExtraGasChangeInitiated = 0;\\n newDkgResultChallengeExtraGas = 0;\\n }\\n\\n /// @notice Begins the DKG result submission timeout update\\n /// process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultSubmissionTimeout New DKG result submission\\n /// timeout in blocks\\n function beginDkgResultSubmissionTimeoutUpdate(\\n uint256 _newDkgResultSubmissionTimeout\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgResultSubmissionTimeout > 0,\\n \\\"DKG result submission timeout must be > 0\\\"\\n );\\n newDkgResultSubmissionTimeout = _newDkgResultSubmissionTimeout;\\n dkgResultSubmissionTimeoutChangeInitiated = block.timestamp;\\n emit DkgResultSubmissionTimeoutUpdateStarted(\\n _newDkgResultSubmissionTimeout,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result submission timeout update\\n /// process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultSubmissionTimeoutUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultSubmissionTimeoutChangeInitiated)\\n {\\n emit DkgResultSubmissionTimeoutUpdated(newDkgResultSubmissionTimeout);\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n ,\\n uint256 dkgSubmitterPrecedencePeriodLength\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n newDkgResultSubmissionTimeout,\\n dkgSubmitterPrecedencePeriodLength\\n );\\n dkgResultSubmissionTimeoutChangeInitiated = 0;\\n newDkgResultSubmissionTimeout = 0;\\n }\\n\\n /// @notice Begins the DKG submitter precedence period length.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgSubmitterPrecedencePeriodLength New DKG submitter precedence\\n /// period length in blocks\\n function beginDkgSubmitterPrecedencePeriodLengthUpdate(\\n uint256 _newDkgSubmitterPrecedencePeriodLength\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgSubmitterPrecedencePeriodLength > 0,\\n \\\"DKG submitter precedence period length must be > 0\\\"\\n );\\n newDkgSubmitterPrecedencePeriodLength = _newDkgSubmitterPrecedencePeriodLength;\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated = block.timestamp;\\n emit DkgSubmitterPrecedencePeriodLengthUpdateStarted(\\n _newDkgSubmitterPrecedencePeriodLength,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG submitter precedence period length.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgSubmitterPrecedencePeriodLengthUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated\\n )\\n {\\n emit DkgSubmitterPrecedencePeriodLengthUpdated(\\n newDkgSubmitterPrecedencePeriodLength\\n );\\n (\\n uint256 groupCreationFrequency,\\n uint256 groupLifetime,\\n uint256 dkgResultChallengePeriodLength,\\n uint256 dkgResultChallengeExtraGas,\\n uint256 dkgResultSubmissionTimeout,\\n\\n ) = randomBeacon.groupCreationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGroupCreationParameters(\\n groupCreationFrequency,\\n groupLifetime,\\n dkgResultChallengePeriodLength,\\n dkgResultChallengeExtraGas,\\n dkgResultSubmissionTimeout,\\n newDkgSubmitterPrecedencePeriodLength\\n );\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated = 0;\\n newDkgSubmitterPrecedencePeriodLength = 0;\\n }\\n\\n /// @notice Begins the sortition pool rewards ban duration update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newSortitionPoolRewardsBanDuration New sortition pool rewards\\n /// ban duration.\\n function beginSortitionPoolRewardsBanDurationUpdate(\\n uint256 _newSortitionPoolRewardsBanDuration\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newSortitionPoolRewardsBanDuration = _newSortitionPoolRewardsBanDuration;\\n sortitionPoolRewardsBanDurationChangeInitiated = block.timestamp;\\n emit SortitionPoolRewardsBanDurationUpdateStarted(\\n _newSortitionPoolRewardsBanDuration,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the sortition pool rewards ban duration update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeSortitionPoolRewardsBanDurationUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(sortitionPoolRewardsBanDurationChangeInitiated)\\n {\\n emit SortitionPoolRewardsBanDurationUpdated(\\n newSortitionPoolRewardsBanDuration\\n );\\n (\\n ,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n newSortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n sortitionPoolRewardsBanDurationChangeInitiated = 0;\\n newSortitionPoolRewardsBanDuration = 0;\\n }\\n\\n /// @notice Begins the relay entry timeout notification reward multiplier\\n /// update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntryTimeoutNotificationRewardMultiplier New relay\\n /// entry timeout notification reward multiplier.\\n function beginRelayEntryTimeoutNotificationRewardMultiplierUpdate(\\n uint256 _newRelayEntryTimeoutNotificationRewardMultiplier\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newRelayEntryTimeoutNotificationRewardMultiplier <= 100,\\n \\\"Maximum value is 100\\\"\\n );\\n\\n newRelayEntryTimeoutNotificationRewardMultiplier = _newRelayEntryTimeoutNotificationRewardMultiplier;\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated = block\\n .timestamp;\\n emit RelayEntryTimeoutNotificationRewardMultiplierUpdateStarted(\\n _newRelayEntryTimeoutNotificationRewardMultiplier,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Begins the unauthorized signing notification reward multiplier\\n /// update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newUnauthorizedSigningNotificationRewardMultiplier New unauthorized\\n /// signing notification reward multiplier.\\n function beginUnauthorizedSigningNotificationRewardMultiplierUpdate(\\n uint256 _newUnauthorizedSigningNotificationRewardMultiplier\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newUnauthorizedSigningNotificationRewardMultiplier <= 100,\\n \\\"Maximum value is 100\\\"\\n );\\n\\n newUnauthorizedSigningNotificationRewardMultiplier = _newUnauthorizedSigningNotificationRewardMultiplier;\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated = block\\n .timestamp;\\n emit UnauthorizedSigningNotificationRewardMultiplierUpdateStarted(\\n _newUnauthorizedSigningNotificationRewardMultiplier,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the unauthorized signing notification reward\\n /// multiplier update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeUnauthorizedSigningNotificationRewardMultiplierUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated\\n )\\n {\\n emit UnauthorizedSigningNotificationRewardMultiplierUpdated(\\n newUnauthorizedSigningNotificationRewardMultiplier\\n );\\n (\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n ,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n sortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n newUnauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated = 0;\\n newUnauthorizedSigningNotificationRewardMultiplier = 0;\\n }\\n\\n /// @notice Finalizes the relay entry timeout notification reward\\n /// multiplier update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntryTimeoutNotificationRewardMultiplierUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated\\n )\\n {\\n emit RelayEntryTimeoutNotificationRewardMultiplierUpdated(\\n newRelayEntryTimeoutNotificationRewardMultiplier\\n );\\n (\\n uint256 sortitionPoolRewardsBanDuration,\\n ,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n uint256 dkgMaliciousResultNotificationRewardMultiplier\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n sortitionPoolRewardsBanDuration,\\n newRelayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n dkgMaliciousResultNotificationRewardMultiplier\\n );\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated = 0;\\n newRelayEntryTimeoutNotificationRewardMultiplier = 0;\\n }\\n\\n /// @notice Begins the DKG malicious result notification reward multiplier\\n /// update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgMaliciousResultNotificationRewardMultiplier New DKG\\n /// malicious result notification reward multiplier.\\n function beginDkgMaliciousResultNotificationRewardMultiplierUpdate(\\n uint256 _newDkgMaliciousResultNotificationRewardMultiplier\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n require(\\n _newDkgMaliciousResultNotificationRewardMultiplier <= 100,\\n \\\"Maximum value is 100\\\"\\n );\\n\\n newDkgMaliciousResultNotificationRewardMultiplier = _newDkgMaliciousResultNotificationRewardMultiplier;\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated = block\\n .timestamp;\\n emit DkgMaliciousResultNotificationRewardMultiplierUpdateStarted(\\n _newDkgMaliciousResultNotificationRewardMultiplier,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG malicious result notification reward\\n /// multiplier update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgMaliciousResultNotificationRewardMultiplierUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated\\n )\\n {\\n emit DkgMaliciousResultNotificationRewardMultiplierUpdated(\\n newDkgMaliciousResultNotificationRewardMultiplier\\n );\\n (\\n uint256 sortitionPoolRewardsBanDuration,\\n uint256 relayEntryTimeoutNotificationRewardMultiplier,\\n uint256 unauthorizedSigningNotificationRewardMultiplier,\\n\\n ) = randomBeacon.rewardParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateRewardParameters(\\n sortitionPoolRewardsBanDuration,\\n relayEntryTimeoutNotificationRewardMultiplier,\\n unauthorizedSigningNotificationRewardMultiplier,\\n newDkgMaliciousResultNotificationRewardMultiplier\\n );\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated = 0;\\n newDkgMaliciousResultNotificationRewardMultiplier = 0;\\n }\\n\\n /// @notice Begins the relay entry submission failure slashing amount update\\n /// process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntrySubmissionFailureSlashingAmount New relay entry\\n /// submission failure slashing amount\\n function beginRelayEntrySubmissionFailureSlashingAmountUpdate(\\n uint96 _newRelayEntrySubmissionFailureSlashingAmount\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newRelayEntrySubmissionFailureSlashingAmount = _newRelayEntrySubmissionFailureSlashingAmount;\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated = block\\n .timestamp;\\n emit RelayEntrySubmissionFailureSlashingAmountUpdateStarted(\\n _newRelayEntrySubmissionFailureSlashingAmount,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the relay entry submission failure slashing amount\\n /// update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntrySubmissionFailureSlashingAmountUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated\\n )\\n {\\n emit RelayEntrySubmissionFailureSlashingAmountUpdated(\\n newRelayEntrySubmissionFailureSlashingAmount\\n );\\n (\\n ,\\n uint96 maliciousDkgResultSlashingAmount,\\n uint96 unauthorizedSigningSlashingAmount\\n ) = randomBeacon.slashingParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateSlashingParameters(\\n newRelayEntrySubmissionFailureSlashingAmount,\\n maliciousDkgResultSlashingAmount,\\n unauthorizedSigningSlashingAmount\\n );\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated = 0;\\n newRelayEntrySubmissionFailureSlashingAmount = 0;\\n }\\n\\n /// @notice Begins the DKG result submission gas update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultSubmissionGas New relay entry submission gas offset\\n function beginDkgResultSubmissionGasUpdate(\\n uint256 _newDkgResultSubmissionGas\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newDkgResultSubmissionGas = _newDkgResultSubmissionGas;\\n dkgResultSubmissionGasChangeInitiated = block.timestamp;\\n emit DkgResultSubmissionGasUpdateStarted(\\n _newDkgResultSubmissionGas,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes DKG result submission gas update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultSubmissionGasUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultSubmissionGasChangeInitiated)\\n {\\n emit DkgResultSubmissionGasUpdated(newDkgResultSubmissionGas);\\n (\\n ,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n newDkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n dkgResultSubmissionGasChangeInitiated = 0;\\n newDkgResultSubmissionGas = 0;\\n }\\n\\n /// @notice Begins the DKG result approval gas offset update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newDkgResultApprovalGasOffset New DKG approval gas offset\\n function beginDkgResultApprovalGasOffsetUpdate(\\n uint256 _newDkgResultApprovalGasOffset\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newDkgResultApprovalGasOffset = _newDkgResultApprovalGasOffset;\\n dkgResultApprovalGasOffsetChangeInitiated = block.timestamp;\\n emit DkgResultApprovalGasOffsetUpdateStarted(\\n _newDkgResultApprovalGasOffset,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the DKG result approval gas offset update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeDkgResultApprovalGasOffsetUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(dkgResultApprovalGasOffsetChangeInitiated)\\n {\\n emit DkgResultApprovalGasOffsetUpdated(newDkgResultApprovalGasOffset);\\n (\\n uint256 dkgResultSubmissionGas,\\n ,\\n uint256 notifyOperatorInactivityGasOffset,\\n uint256 relayEntrySubmissionGasOffset\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n dkgResultSubmissionGas,\\n newDkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n dkgResultApprovalGasOffsetChangeInitiated = 0;\\n newDkgResultApprovalGasOffset = 0;\\n }\\n\\n /// @notice Begins the notify operator inactivity gas offset update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newNotifyOperatorInactivityGasOffset New operator inactivity\\n /// notification gas offset\\n function beginNotifyOperatorInactivityGasOffsetUpdate(\\n uint256 _newNotifyOperatorInactivityGasOffset\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newNotifyOperatorInactivityGasOffset = _newNotifyOperatorInactivityGasOffset;\\n notifyOperatorInactivityGasOffsetChangeInitiated = block.timestamp;\\n emit NotifyOperatorInactivityGasOffsetUpdateStarted(\\n _newNotifyOperatorInactivityGasOffset,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the notify operator inactivity gas offset update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeNotifyOperatorInactivityGasOffsetUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n notifyOperatorInactivityGasOffsetChangeInitiated\\n )\\n {\\n emit NotifyOperatorInactivityGasOffsetUpdated(\\n newNotifyOperatorInactivityGasOffset\\n );\\n (\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n ,\\n uint256 relayEntrySubmissionGasOffset\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n dkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n newNotifyOperatorInactivityGasOffset,\\n relayEntrySubmissionGasOffset\\n );\\n notifyOperatorInactivityGasOffsetChangeInitiated = 0;\\n newNotifyOperatorInactivityGasOffset = 0;\\n }\\n\\n /// @notice Begins the relay entry submission gas offset update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newRelayEntrySubmissionGasOffset New relay entry submission gas offset\\n function beginRelayEntrySubmissionGasOffsetUpdate(\\n uint256 _newRelayEntrySubmissionGasOffset\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newRelayEntrySubmissionGasOffset = _newRelayEntrySubmissionGasOffset;\\n relayEntrySubmissionGasOffsetChangeInitiated = block.timestamp;\\n emit RelayEntrySubmissionGasOffsetUpdateStarted(\\n _newRelayEntrySubmissionGasOffset,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes relay entry submission gas offset update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeRelayEntrySubmissionGasOffsetUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(relayEntrySubmissionGasOffsetChangeInitiated)\\n {\\n emit RelayEntrySubmissionGasOffsetUpdated(\\n newRelayEntrySubmissionGasOffset\\n );\\n (\\n uint256 dkgResultSubmissionGas,\\n uint256 dkgResultApprovalGasOffset,\\n uint256 notifyOperatorInactivityGasOffset,\\n\\n ) = randomBeacon.gasParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateGasParameters(\\n dkgResultSubmissionGas,\\n dkgResultApprovalGasOffset,\\n notifyOperatorInactivityGasOffset,\\n newRelayEntrySubmissionGasOffset\\n );\\n relayEntrySubmissionGasOffsetChangeInitiated = 0;\\n newRelayEntrySubmissionGasOffset = 0;\\n }\\n\\n /// @notice Begins the malicious DKG result slashing amount update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newMaliciousDkgResultSlashingAmount New malicious DKG result\\n /// slashing amount\\n function beginMaliciousDkgResultSlashingAmountUpdate(\\n uint96 _newMaliciousDkgResultSlashingAmount\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newMaliciousDkgResultSlashingAmount = _newMaliciousDkgResultSlashingAmount;\\n maliciousDkgResultSlashingAmountChangeInitiated = block.timestamp;\\n emit MaliciousDkgResultSlashingAmountUpdateStarted(\\n _newMaliciousDkgResultSlashingAmount,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the malicious DKG result slashing amount update\\n /// process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeMaliciousDkgResultSlashingAmountUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n maliciousDkgResultSlashingAmountChangeInitiated\\n )\\n {\\n emit MaliciousDkgResultSlashingAmountUpdated(\\n newMaliciousDkgResultSlashingAmount\\n );\\n (\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n ,\\n uint96 unauthorizedSigningSlashingAmount\\n ) = randomBeacon.slashingParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateSlashingParameters(\\n relayEntrySubmissionFailureSlashingAmount,\\n newMaliciousDkgResultSlashingAmount,\\n unauthorizedSigningSlashingAmount\\n );\\n maliciousDkgResultSlashingAmountChangeInitiated = 0;\\n newMaliciousDkgResultSlashingAmount = 0;\\n }\\n\\n /// @notice Begins the unauthorized signing slashing amount update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newUnauthorizedSigningSlashingAmount New unauthorized signing\\n /// slashing amount\\n function beginUnauthorizedSigningSlashingAmountUpdate(\\n uint96 _newUnauthorizedSigningSlashingAmount\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newUnauthorizedSigningSlashingAmount = _newUnauthorizedSigningSlashingAmount;\\n unauthorizedSigningSlashingAmountChangeInitiated = block.timestamp;\\n emit UnauthorizedSigningSlashingAmountUpdateStarted(\\n _newUnauthorizedSigningSlashingAmount,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the unauthorized signing slashing amount update\\n /// process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeUnauthorizedSigningSlashingAmountUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n unauthorizedSigningSlashingAmountChangeInitiated\\n )\\n {\\n emit UnauthorizedSigningSlashingAmountUpdated(\\n newUnauthorizedSigningSlashingAmount\\n );\\n (\\n uint96 relayEntrySubmissionFailureSlashingAmount,\\n uint96 maliciousDkgResultSlashingAmount,\\n\\n ) = randomBeacon.slashingParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateSlashingParameters(\\n relayEntrySubmissionFailureSlashingAmount,\\n maliciousDkgResultSlashingAmount,\\n newUnauthorizedSigningSlashingAmount\\n );\\n unauthorizedSigningSlashingAmountChangeInitiated = 0;\\n newUnauthorizedSigningSlashingAmount = 0;\\n }\\n\\n /// @notice Begins the minimum authorization amount update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newMinimumAuthorization New minimum authorization amount.\\n function beginMinimumAuthorizationUpdate(uint96 _newMinimumAuthorization)\\n external\\n onlyOwner\\n {\\n /* solhint-disable not-rely-on-time */\\n newMinimumAuthorization = _newMinimumAuthorization;\\n minimumAuthorizationChangeInitiated = block.timestamp;\\n emit MinimumAuthorizationUpdateStarted(\\n _newMinimumAuthorization,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the minimum authorization amount update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeMinimumAuthorizationUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(minimumAuthorizationChangeInitiated)\\n {\\n emit MinimumAuthorizationUpdated(newMinimumAuthorization);\\n (\\n ,\\n uint64 authorizationDecreaseDelay,\\n uint64 authorizationDecreaseChangePeriod\\n ) = randomBeacon.authorizationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateAuthorizationParameters(\\n newMinimumAuthorization,\\n authorizationDecreaseDelay,\\n authorizationDecreaseChangePeriod\\n );\\n minimumAuthorizationChangeInitiated = 0;\\n newMinimumAuthorization = 0;\\n }\\n\\n /// @notice Begins the authorization decrease delay update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newAuthorizationDecreaseDelay New authorization decrease delay\\n function beginAuthorizationDecreaseDelayUpdate(\\n uint64 _newAuthorizationDecreaseDelay\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newAuthorizationDecreaseDelay = _newAuthorizationDecreaseDelay;\\n authorizationDecreaseDelayChangeInitiated = block.timestamp;\\n emit AuthorizationDecreaseDelayUpdateStarted(\\n _newAuthorizationDecreaseDelay,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the authorization decrease delay update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeAuthorizationDecreaseDelayUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(authorizationDecreaseDelayChangeInitiated)\\n {\\n emit AuthorizationDecreaseDelayUpdated(newAuthorizationDecreaseDelay);\\n (\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseChangePeriod,\\n\\n ) = randomBeacon.authorizationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateAuthorizationParameters(\\n minimumAuthorization,\\n newAuthorizationDecreaseDelay,\\n authorizationDecreaseChangePeriod\\n );\\n authorizationDecreaseDelayChangeInitiated = 0;\\n newAuthorizationDecreaseDelay = 0;\\n }\\n\\n /// @notice Begins the authorization decrease change period update process.\\n /// @dev Can be called only by the contract owner.\\n /// @param _newAuthorizationDecreaseChangePeriod New authorization decrease change period\\n function beginAuthorizationDecreaseChangePeriodUpdate(\\n uint64 _newAuthorizationDecreaseChangePeriod\\n ) external onlyOwner {\\n /* solhint-disable not-rely-on-time */\\n newAuthorizationDecreaseChangePeriod = _newAuthorizationDecreaseChangePeriod;\\n authorizationDecreaseChangePeriodChangeInitiated = block.timestamp;\\n emit AuthorizationDecreaseChangePeriodUpdateStarted(\\n _newAuthorizationDecreaseChangePeriod,\\n block.timestamp\\n );\\n /* solhint-enable not-rely-on-time */\\n }\\n\\n /// @notice Finalizes the authorization decrease change period update process.\\n /// @dev Can be called only by the contract owner, after the governance\\n /// delay elapses.\\n function finalizeAuthorizationDecreaseChangePeriodUpdate()\\n external\\n onlyOwner\\n onlyAfterGovernanceDelay(\\n authorizationDecreaseChangePeriodChangeInitiated\\n )\\n {\\n emit AuthorizationDecreaseChangePeriodUpdated(\\n newAuthorizationDecreaseChangePeriod\\n );\\n (\\n uint96 minimumAuthorization,\\n uint64 authorizationDecreaseDelay,\\n\\n ) = randomBeacon.authorizationParameters();\\n // slither-disable-next-line reentrancy-no-eth\\n randomBeacon.updateAuthorizationParameters(\\n minimumAuthorization,\\n authorizationDecreaseDelay,\\n newAuthorizationDecreaseChangePeriod\\n );\\n authorizationDecreaseChangePeriodChangeInitiated = 0;\\n newAuthorizationDecreaseChangePeriod = 0;\\n }\\n\\n /// @notice Set authorization for requesters that can request a relay\\n /// entry. It can be done by the governance only.\\n /// @param requester Requester, can be a contract or EOA\\n /// @param isAuthorized True or false\\n function setRequesterAuthorization(address requester, bool isAuthorized)\\n external\\n onlyOwner\\n {\\n randomBeacon.setRequesterAuthorization(requester, isAuthorized);\\n }\\n\\n /// @notice Withdraws rewards belonging to operators marked as ineligible\\n /// for sortition pool rewards.\\n /// @dev Can be called only by the contract owner.\\n /// @param recipient Recipient of withdrawn rewards.\\n function withdrawIneligibleRewards(address recipient) external onlyOwner {\\n randomBeacon.withdrawIneligibleRewards(recipient);\\n }\\n\\n /// @notice Get the time remaining until the governance delay can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingGovernanceDelayUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(governanceDelayChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the random beacon governance can\\n /// be transferred.\\n /// @return Remaining time in seconds.\\n function getRemainingRandomBeaconGovernanceTransferDelayTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(randomBeaconGovernanceTransferInitiated);\\n }\\n\\n /// @notice Get the time remaining until the relay entry submission soft\\n /// timeout can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntrySoftTimeoutUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(relayEntrySoftTimeoutChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the relay entry hard timeout can be\\n /// updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntryHardTimeoutUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(relayEntryHardTimeoutChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the callback gas limit can be\\n /// updated.\\n /// @return Remaining time in seconds.\\n function getRemainingCallbackGasLimitUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(callbackGasLimitChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the group creation frequency can be\\n /// updated.\\n /// @return Remaining time in seconds.\\n function getRemainingGroupCreationFrequencyUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(groupCreationFrequencyChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the group lifetime can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingGroupLifetimeUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(groupLifetimeChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the DKG result challenge period\\n /// length can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultChallengePeriodLengthUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n dkgResultChallengePeriodLengthChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the DKG result challenge extra\\n /// gas can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultChallengeExtraGasUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(dkgResultChallengeExtraGasChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the DKG result submission timeout\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultSubmissionTimeoutUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(dkgResultSubmissionTimeoutChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the wallet owner can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgSubmitterPrecedencePeriodLengthUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n dkgSubmitterPrecedencePeriodLengthChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the relay entry submission failure\\n /// slashing amount can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntrySubmissionFailureSlashingAmountUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n relayEntrySubmissionFailureSlashingAmountChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the malicious DKG result\\n /// slashing amount can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingMaliciousDkgResultSlashingAmountUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n maliciousDkgResultSlashingAmountChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the unauthorized signing\\n /// slashing amount can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingUnauthorizedSigningSlashingAmountUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n unauthorizedSigningSlashingAmountChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the minimum authorization amount\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingMimimumAuthorizationUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(minimumAuthorizationChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the authorization decrease delay\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingAuthorizationDecreaseDelayUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(authorizationDecreaseDelayChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the authorization decrease change\\n /// period can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingAuthorizationDecreaseChangePeriodUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n authorizationDecreaseChangePeriodChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the sortition pool rewards ban\\n /// duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingSortitionPoolRewardsBanDurationUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n sortitionPoolRewardsBanDurationChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the relay entry timeout\\n /// notification reward multiplier duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntryTimeoutNotificationRewardMultiplierUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n relayEntryTimeoutNotificationRewardMultiplierChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the unauthorized signing\\n /// notification reward multiplier duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingUnauthorizedSigningNotificationRewardMultiplierUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n unauthorizedSigningNotificationRewardMultiplierChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the DKG malicious result\\n /// notification reward multiplier duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgMaliciousResultNotificationRewardMultiplierUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n dkgMaliciousResultNotificationRewardMultiplierChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the DKG result submission gas\\n /// duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultSubmissionGasUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return getRemainingChangeTime(dkgResultSubmissionGasChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the DKG approval gas offset duration\\n /// can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingDkgResultApprovalGasOffsetUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(dkgResultApprovalGasOffsetChangeInitiated);\\n }\\n\\n /// @notice Get the time remaining until the operator inactivity notification\\n /// gas offset duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingNotifyOperatorInactivityGasOffsetUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n notifyOperatorInactivityGasOffsetChangeInitiated\\n );\\n }\\n\\n /// @notice Get the time remaining until the relay entry submission gas offset\\n /// duration can be updated.\\n /// @return Remaining time in seconds.\\n function getRemainingRelayEntrySubmissionGasOffsetUpdateTime()\\n external\\n view\\n returns (uint256)\\n {\\n return\\n getRemainingChangeTime(\\n relayEntrySubmissionGasOffsetChangeInitiated\\n );\\n }\\n\\n /// @notice Gets the time remaining until the governable parameter update\\n /// can be committed.\\n /// @param changeTimestamp Timestamp indicating the beginning of the change.\\n /// @return Remaining time in seconds.\\n function getRemainingChangeTime(uint256 changeTimestamp)\\n internal\\n view\\n returns (uint256)\\n {\\n require(changeTimestamp > 0, \\\"Change not initiated\\\");\\n /* solhint-disable-next-line not-rely-on-time */\\n uint256 elapsed = block.timestamp - changeTimestamp;\\n if (elapsed >= governanceDelay) {\\n return 0;\\n } else {\\n return governanceDelay - elapsed;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4da22ccc2350264caa1093a03cc44f43d080385bafb7b77b244faf8462549b36\",\"license\":\"GPL-3.0-only\"},\"contracts/Reimbursable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./ReimbursementPool.sol\\\";\\n\\nabstract contract Reimbursable {\\n // The variable should be initialized by the implementing contract.\\n // slither-disable-next-line uninitialized-state\\n ReimbursementPool public reimbursementPool;\\n\\n // Reserved storage space in case we need to add more variables,\\n // since there are upgradeable contracts that inherit from this one.\\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n // slither-disable-next-line unused-state\\n uint256[49] private __gap;\\n\\n event ReimbursementPoolUpdated(address newReimbursementPool);\\n\\n modifier refundable(address receiver) {\\n uint256 gasStart = gasleft();\\n _;\\n reimbursementPool.refund(gasStart - gasleft(), receiver);\\n }\\n\\n modifier onlyReimbursableAdmin() virtual {\\n _;\\n }\\n\\n function updateReimbursementPool(ReimbursementPool _reimbursementPool)\\n external\\n onlyReimbursableAdmin\\n {\\n emit ReimbursementPoolUpdated(address(_reimbursementPool));\\n\\n reimbursementPool = _reimbursementPool;\\n }\\n}\\n\",\"keccak256\":\"0x6b01344c1ec13aaab1dc432d3afabe08d6dd0d1a9248be8b36a0747ac22e5d9f\",\"license\":\"GPL-3.0-only\"},\"contracts/ReimbursementPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\n\\ncontract ReimbursementPool is Ownable, ReentrancyGuard {\\n /// @notice Authorized contracts that can interact with the reimbursment pool.\\n /// Authorization can be granted and removed by the owner.\\n mapping(address => bool) public isAuthorized;\\n\\n /// @notice Static gas includes:\\n /// - cost of the refund function\\n /// - base transaction cost\\n uint256 public staticGas;\\n\\n /// @notice Max gas price used to reimburse a transaction submitter. Protects\\n /// against malicious operator-miners.\\n uint256 public maxGasPrice;\\n\\n event StaticGasUpdated(uint256 newStaticGas);\\n\\n event MaxGasPriceUpdated(uint256 newMaxGasPrice);\\n\\n event SendingEtherFailed(uint256 refundAmount, address receiver);\\n\\n event AuthorizedContract(address thirdPartyContract);\\n\\n event UnauthorizedContract(address thirdPartyContract);\\n\\n event FundsWithdrawn(uint256 withdrawnAmount, address receiver);\\n\\n constructor(uint256 _staticGas, uint256 _maxGasPrice) {\\n staticGas = _staticGas;\\n maxGasPrice = _maxGasPrice;\\n }\\n\\n /// @notice Receive ETH\\n receive() external payable {}\\n\\n /// @notice Refunds ETH to a spender for executing specific transactions.\\n /// @dev Ignoring the result of sending ETH to a receiver is made on purpose.\\n /// For EOA receiving ETH should always work. If a receiver is a smart\\n /// contract, then we do not want to fail a transaction, because in some\\n /// cases the refund is done at the very end of multiple calls where all\\n /// the previous calls were already paid off. It is a receiver's smart\\n /// contract resposibility to make sure it can receive ETH.\\n /// @dev Only authorized contracts are allowed calling this function.\\n /// @param gasSpent Gas spent on a transaction that needs to be reimbursed.\\n /// @param receiver Address where the reimbursment is sent.\\n function refund(uint256 gasSpent, address receiver) external nonReentrant {\\n require(\\n isAuthorized[msg.sender],\\n \\\"Contract is not authorized for a refund\\\"\\n );\\n require(receiver != address(0), \\\"Receiver's address cannot be zero\\\");\\n\\n uint256 gasPrice = tx.gasprice < maxGasPrice\\n ? tx.gasprice\\n : maxGasPrice;\\n\\n uint256 refundAmount = (gasSpent + staticGas) * gasPrice;\\n\\n /* solhint-disable avoid-low-level-calls */\\n // slither-disable-next-line low-level-calls,unchecked-lowlevel\\n (bool sent, ) = receiver.call{value: refundAmount}(\\\"\\\");\\n /* solhint-enable avoid-low-level-calls */\\n if (!sent) {\\n // slither-disable-next-line reentrancy-events\\n emit SendingEtherFailed(refundAmount, receiver);\\n }\\n }\\n\\n /// @notice Authorize a contract that can interact with this reimbursment pool.\\n /// Can be authorized by the owner only.\\n /// @param _contract Authorized contract.\\n function authorize(address _contract) external onlyOwner {\\n isAuthorized[_contract] = true;\\n\\n emit AuthorizedContract(_contract);\\n }\\n\\n /// @notice Unauthorize a contract that was previously authorized to interact\\n /// with this reimbursment pool. Can be unauthorized by the\\n /// owner only.\\n /// @param _contract Authorized contract.\\n function unauthorize(address _contract) external onlyOwner {\\n delete isAuthorized[_contract];\\n\\n emit UnauthorizedContract(_contract);\\n }\\n\\n /// @notice Setting a static gas cost for executing a transaction. Can be set\\n /// by the owner only.\\n /// @param _staticGas Static gas cost.\\n function setStaticGas(uint256 _staticGas) external onlyOwner {\\n staticGas = _staticGas;\\n\\n emit StaticGasUpdated(_staticGas);\\n }\\n\\n /// @notice Setting a max gas price for transactions. Can be set by the\\n /// owner only.\\n /// @param _maxGasPrice Max gas price used to reimburse tx submitters.\\n function setMaxGasPrice(uint256 _maxGasPrice) external onlyOwner {\\n maxGasPrice = _maxGasPrice;\\n\\n emit MaxGasPriceUpdated(_maxGasPrice);\\n }\\n\\n /// @notice Withdraws all ETH from this pool which are sent to a given\\n /// address. Can be set by the owner only.\\n /// @param receiver An address where ETH is sent.\\n function withdrawAll(address receiver) external onlyOwner {\\n withdraw(address(this).balance, receiver);\\n }\\n\\n /// @notice Withdraws ETH amount from this pool which are sent to a given\\n /// address. Can be set by the owner only.\\n /// @param amount Amount to withdraw from the pool.\\n /// @param receiver An address where ETH is sent.\\n function withdraw(uint256 amount, address receiver) public onlyOwner {\\n require(\\n address(this).balance >= amount,\\n \\\"Insufficient contract balance\\\"\\n );\\n require(receiver != address(0), \\\"Receiver's address cannot be zero\\\");\\n\\n emit FundsWithdrawn(amount, receiver);\\n\\n /* solhint-disable avoid-low-level-calls */\\n // slither-disable-next-line low-level-calls,arbitrary-send\\n (bool sent, ) = receiver.call{value: amount}(\\\"\\\");\\n /* solhint-enable avoid-low-level-calls */\\n require(sent, \\\"Failed to send Ether\\\");\\n }\\n}\\n\",\"keccak256\":\"0xd6c24368cc4c6349b8b614e878ca961cad8254b8e8db1cc0abe452a70022ce50\",\"license\":\"GPL-3.0-only\"},\"contracts/api/IRandomBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./IRandomBeaconConsumer.sol\\\";\\n\\n/// @title Random Beacon interface\\ninterface IRandomBeacon {\\n /// @notice Creates a request to generate a new relay entry. Requires a\\n /// request fee denominated in T token.\\n /// @param callbackContract Beacon consumer callback contract.\\n function requestRelayEntry(IRandomBeaconConsumer callbackContract) external;\\n}\\n\",\"keccak256\":\"0xc5f6ddbf69b2f2e2c03fe78b3857a1f038982e858679f520101f53c4ebe2f4bf\",\"license\":\"GPL-3.0-only\"},\"contracts/api/IRandomBeaconConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\ninterface IRandomBeaconConsumer {\\n /// @notice Receives relay entry produced by Keep Random Beacon. This function\\n /// should be called only by Keep Random Beacon.\\n ///\\n /// @param relayEntry Relay entry (random number) produced by Keep Random\\n /// Beacon.\\n /// @param blockNumber Block number at which the relay entry was submitted\\n /// to the chain.\\n function __beaconCallback(uint256 relayEntry, uint256 blockNumber) external;\\n}\\n\",\"keccak256\":\"0x84ce236b4eeb664ccb02782777a05c6ebb410be9b9e586a123a1205437a2ed9f\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/AltBn128.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./ModUtils.sol\\\";\\n\\n/// @title Operations on alt_bn128\\n/// @dev Implementations of common elliptic curve operations on Ethereum's\\n/// (poorly named) alt_bn128 curve. Whenever possible, use post-Byzantium\\n/// pre-compiled contracts to offset gas costs. Note that these\\n/// pre-compiles might not be available on all (eg private) chains.\\nlibrary AltBn128 {\\n using ModUtils for uint256;\\n\\n // G1Point implements a point in G1 group.\\n struct G1Point {\\n uint256 x;\\n uint256 y;\\n }\\n\\n // gfP2 implements a field of size p\\u00b2 as a quadratic extension of the base\\n // field.\\n struct gfP2 {\\n uint256 x;\\n uint256 y;\\n }\\n\\n // G2Point implements a point in G2 group.\\n struct G2Point {\\n gfP2 x;\\n gfP2 y;\\n }\\n\\n // p is a prime over which we form a basic field\\n // Taken from go-ethereum/crypto/bn256/cloudflare/constants.go\\n uint256 internal constant p =\\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n\\n /// @dev Gets generator of G1 group.\\n /// Taken from go-ethereum/crypto/bn256/cloudflare/curve.go\\n uint256 internal constant g1x = 1;\\n uint256 internal constant g1y = 2;\\n\\n /// @dev Gets generator of G2 group.\\n /// Taken from go-ethereum/crypto/bn256/cloudflare/twist.go\\n uint256 internal constant g2xx =\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634;\\n uint256 internal constant g2xy =\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781;\\n uint256 internal constant g2yx =\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531;\\n uint256 internal constant g2yy =\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930;\\n\\n /// @dev Gets twist curve B constant.\\n /// Taken from go-ethereum/crypto/bn256/cloudflare/twist.go\\n uint256 internal constant twistBx =\\n 266929791119991161246907387137283842545076965332900288569378510910307636690;\\n uint256 internal constant twistBy =\\n 19485874751759354771024239261021720505790618469301721065564631296452457478373;\\n\\n /// @dev Gets root of the point where x and y are equal.\\n uint256 internal constant hexRootX =\\n 21573744529824266246521972077326577680729363968861965890554801909984373949499;\\n uint256 internal constant hexRootY =\\n 16854739155576650954933913186877292401521110422362946064090026408937773542853;\\n\\n /// @dev g1YFromX computes a Y value for a G1 point based on an X value.\\n /// This computation is simply evaluating the curve equation for Y on a\\n /// given X, and allows a point on the curve to be represented by just\\n /// an X value + a sign bit.\\n function g1YFromX(uint256 x) internal view returns (uint256) {\\n return ((x.modExp(3, p) + 3) % p).modSqrt(p);\\n }\\n\\n /// @dev Hash a byte array message, m, and map it deterministically to a\\n /// point on G1. Note that this approach was chosen for its simplicity\\n /// and lower gas cost on the EVM, rather than good distribution of\\n /// points on G1.\\n function g1HashToPoint(bytes memory m)\\n internal\\n view\\n returns (G1Point memory)\\n {\\n unchecked {\\n bytes32 h = sha256(m);\\n uint256 x = uint256(h) % p;\\n uint256 y;\\n\\n while (true) {\\n y = g1YFromX(x);\\n if (y > 0) {\\n return G1Point(x, y);\\n }\\n x += 1;\\n }\\n }\\n }\\n\\n /// @dev Decompress a point on G1 from a single uint256.\\n function g1Decompress(bytes32 m) internal view returns (G1Point memory) {\\n unchecked {\\n bytes32 mX = bytes32(0);\\n bytes1 leadX = m[0] & 0x7f;\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n mX = (m & ~bytes32(mask)) | (leadX >> 0);\\n\\n uint256 x = uint256(mX);\\n uint256 y = g1YFromX(x);\\n\\n if (parity(y) != (m[0] & 0x80) >> 7) {\\n y = p - y;\\n }\\n\\n require(\\n isG1PointOnCurve(G1Point(x, y)),\\n \\\"Malformed bn256.G1 point.\\\"\\n );\\n\\n return G1Point(x, y);\\n }\\n }\\n\\n /// @dev Wraps the point addition pre-compile introduced in Byzantium.\\n /// Returns the sum of two points on G1. Revert if the provided points\\n /// are not on the curve.\\n function g1Add(G1Point memory a, G1Point memory b)\\n internal\\n view\\n returns (G1Point memory c)\\n {\\n assembly {\\n let arg := mload(0x40)\\n mstore(arg, mload(a))\\n mstore(add(arg, 0x20), mload(add(a, 0x20)))\\n mstore(add(arg, 0x40), mload(b))\\n mstore(add(arg, 0x60), mload(add(b, 0x20)))\\n // 0x60 is the ECADD precompile address\\n if iszero(staticcall(not(0), 0x06, arg, 0x80, c, 0x40)) {\\n revert(0, 0)\\n }\\n }\\n }\\n\\n /// @dev Returns true if G1 point is on the curve.\\n function isG1PointOnCurve(G1Point memory point)\\n internal\\n view\\n returns (bool)\\n {\\n return point.y.modExp(2, p) == (point.x.modExp(3, p) + 3) % p;\\n }\\n\\n /// @dev Wraps the scalar point multiplication pre-compile introduced in\\n /// Byzantium. The result of a point from G1 multiplied by a scalar\\n /// should match the point added to itself the same number of times.\\n /// Revert if the provided point isn't on the curve.\\n function scalarMultiply(G1Point memory p_1, uint256 scalar)\\n internal\\n view\\n returns (G1Point memory p_2)\\n {\\n assembly {\\n let arg := mload(0x40)\\n mstore(arg, mload(p_1))\\n mstore(add(arg, 0x20), mload(add(p_1, 0x20)))\\n mstore(add(arg, 0x40), scalar)\\n // 0x07 is the ECMUL precompile address\\n if iszero(staticcall(not(0), 0x07, arg, 0x60, p_2, 0x40)) {\\n revert(0, 0)\\n }\\n }\\n }\\n\\n /// @dev Wraps the pairing check pre-compile introduced in Byzantium.\\n /// Returns the result of a pairing check of 2 pairs\\n /// (G1 p1, G2 p2) (G1 p3, G2 p4)\\n function pairing(\\n G1Point memory p1,\\n G2Point memory p2,\\n G1Point memory p3,\\n G2Point memory p4\\n ) internal view returns (bool result) {\\n uint256 _c;\\n assembly {\\n let c := mload(0x40)\\n let arg := add(c, 0x20)\\n\\n mstore(arg, mload(p1))\\n mstore(add(arg, 0x20), mload(add(p1, 0x20)))\\n\\n let p2x := mload(p2)\\n mstore(add(arg, 0x40), mload(p2x))\\n mstore(add(arg, 0x60), mload(add(p2x, 0x20)))\\n\\n let p2y := mload(add(p2, 0x20))\\n mstore(add(arg, 0x80), mload(p2y))\\n mstore(add(arg, 0xa0), mload(add(p2y, 0x20)))\\n\\n mstore(add(arg, 0xc0), mload(p3))\\n mstore(add(arg, 0xe0), mload(add(p3, 0x20)))\\n\\n let p4x := mload(p4)\\n mstore(add(arg, 0x100), mload(p4x))\\n mstore(add(arg, 0x120), mload(add(p4x, 0x20)))\\n\\n let p4y := mload(add(p4, 0x20))\\n mstore(add(arg, 0x140), mload(p4y))\\n mstore(add(arg, 0x160), mload(add(p4y, 0x20)))\\n\\n // call(gasLimit, to, value, inputOffset, inputSize, outputOffset, outputSize)\\n if iszero(staticcall(not(0), 0x08, arg, 0x180, c, 0x20)) {\\n revert(0, 0)\\n }\\n _c := mload(c)\\n }\\n return _c != 0;\\n }\\n\\n function getP() internal pure returns (uint256) {\\n return p;\\n }\\n\\n function g1() internal pure returns (G1Point memory) {\\n return G1Point(g1x, g1y);\\n }\\n\\n function g2() internal pure returns (G2Point memory) {\\n return G2Point(gfP2(g2xx, g2xy), gfP2(g2yx, g2yy));\\n }\\n\\n /// @dev g2YFromX computes a Y value for a G2 point based on an X value.\\n /// This computation is simply evaluating the curve equation for Y on a\\n /// given X, and allows a point on the curve to be represented by just\\n /// an X value + a sign bit.\\n function g2YFromX(gfP2 memory _x) internal pure returns (gfP2 memory y) {\\n (uint256 xx, uint256 xy) = _gfP2CubeAddTwistB(_x.x, _x.y);\\n\\n // Using formula y = x ^ (p^2 + 15) / 32 from\\n // https://github.com/ethereum/beacon_chain/blob/master/beacon_chain/utils/bls.py\\n // (p^2 + 15) / 32 results into a big 512bit value, so breaking it to two uint256 as (a * a + b)\\n uint256 a = 3869331240733915743250440106392954448556483137451914450067252501901456824595;\\n uint256 b = 146360017852723390495514512480590656176144969185739259173561346299185050597;\\n\\n (uint256 xbx, uint256 xby) = _gfP2Pow(xx, xy, b);\\n (uint256 yax, uint256 yay) = _gfP2Pow(xx, xy, a);\\n (uint256 ya2x, uint256 ya2y) = _gfP2Pow(yax, yay, a);\\n (y.x, y.y) = _gfP2Multiply(ya2x, ya2y, xbx, xby);\\n\\n // Multiply y by hexRoot constant to find correct y.\\n while (!_g2X2y(xx, xy, y.x, y.y)) {\\n (y.x, y.y) = _gfP2Multiply(y.x, y.y, hexRootX, hexRootY);\\n }\\n }\\n\\n /// @dev Compress a point on G1 to a single uint256 for serialization.\\n function g1Compress(G1Point memory point) internal pure returns (bytes32) {\\n bytes32 m = bytes32(point.x);\\n\\n bytes1 leadM = m[0] | (parity(point.y) << 7);\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n m = (m & ~bytes32(mask)) | (leadM >> 0);\\n\\n return m;\\n }\\n\\n /// @dev Compress a point on G2 to a pair of uint256 for serialization.\\n function g2Compress(G2Point memory point)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes32 m = bytes32(point.x.x);\\n\\n bytes1 leadM = m[0] | (parity(point.y.x) << 7);\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n m = (m & ~bytes32(mask)) | (leadM >> 0);\\n\\n return abi.encodePacked(m, bytes32(point.x.y));\\n }\\n\\n /// @dev Unmarshals a point on G1 from bytes in an uncompressed form.\\n function g1Unmarshal(bytes memory m)\\n internal\\n pure\\n returns (G1Point memory)\\n {\\n require(m.length == 64, \\\"Invalid G1 bytes length\\\");\\n\\n bytes32 x;\\n bytes32 y;\\n\\n assembly {\\n x := mload(add(m, 0x20))\\n y := mload(add(m, 0x40))\\n }\\n\\n return G1Point(uint256(x), uint256(y));\\n }\\n\\n /// @dev Marshals a point on G1 to bytes form.\\n function g1Marshal(G1Point memory point)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes memory m = new bytes(64);\\n bytes32 x = bytes32(point.x);\\n bytes32 y = bytes32(point.y);\\n\\n assembly {\\n mstore(add(m, 32), x)\\n mstore(add(m, 64), y)\\n }\\n\\n return m;\\n }\\n\\n /// @dev Unmarshals a point on G2 from bytes in an uncompressed form.\\n function g2Unmarshal(bytes memory m)\\n internal\\n pure\\n returns (G2Point memory)\\n {\\n require(m.length == 128, \\\"Invalid G2 bytes length\\\");\\n\\n uint256 xx;\\n uint256 xy;\\n uint256 yx;\\n uint256 yy;\\n\\n assembly {\\n xx := mload(add(m, 0x20))\\n xy := mload(add(m, 0x40))\\n yx := mload(add(m, 0x60))\\n yy := mload(add(m, 0x80))\\n }\\n\\n return G2Point(gfP2(xx, xy), gfP2(yx, yy));\\n }\\n\\n /// @dev Decompress a point on G2 from a pair of uint256.\\n function g2Decompress(bytes memory m)\\n internal\\n pure\\n returns (G2Point memory)\\n {\\n require(m.length == 64, \\\"Invalid G2 compressed bytes length\\\");\\n\\n bytes32 x1;\\n bytes32 x2;\\n uint256 temp;\\n\\n // Extract two bytes32 from bytes array\\n assembly {\\n temp := add(m, 32)\\n x1 := mload(temp)\\n temp := add(m, 64)\\n x2 := mload(temp)\\n }\\n\\n bytes32 mX = bytes32(0);\\n bytes1 leadX = x1[0] & 0x7f;\\n // slither-disable-next-line incorrect-shift\\n uint256 mask = 0xff << (31 * 8);\\n mX = (x1 & ~bytes32(mask)) | (leadX >> 0);\\n\\n gfP2 memory x = gfP2(uint256(mX), uint256(x2));\\n gfP2 memory y = g2YFromX(x);\\n\\n if (parity(y.x) != (m[0] & 0x80) >> 7) {\\n y.x = p - y.x;\\n y.y = p - y.y;\\n }\\n\\n return G2Point(x, y);\\n }\\n\\n /// @dev Returns the sum of two gfP2 field elements.\\n function gfP2Add(gfP2 memory a, gfP2 memory b)\\n internal\\n pure\\n returns (gfP2 memory)\\n {\\n return gfP2(addmod(a.x, b.x, p), addmod(a.y, b.y, p));\\n }\\n\\n /// @dev Returns multiplication of two gfP2 field elements.\\n function gfP2Multiply(gfP2 memory a, gfP2 memory b)\\n internal\\n pure\\n returns (gfP2 memory)\\n {\\n return\\n gfP2(\\n addmod(mulmod(a.x, b.y, p), mulmod(b.x, a.y, p), p),\\n addmod(mulmod(a.y, b.y, p), p - mulmod(a.x, b.x, p), p)\\n );\\n }\\n\\n /// @dev Returns gfP2 element to the power of the provided exponent.\\n function gfP2Pow(gfP2 memory _a, uint256 _exp)\\n internal\\n pure\\n returns (gfP2 memory result)\\n {\\n (uint256 x, uint256 y) = _gfP2Pow(_a.x, _a.y, _exp);\\n return gfP2(x, y);\\n }\\n\\n function gfP2Square(gfP2 memory a) internal pure returns (gfP2 memory) {\\n return gfP2Multiply(a, a);\\n }\\n\\n function gfP2Cube(gfP2 memory a) internal pure returns (gfP2 memory) {\\n return gfP2Multiply(a, gfP2Square(a));\\n }\\n\\n function gfP2CubeAddTwistB(gfP2 memory a)\\n internal\\n pure\\n returns (gfP2 memory)\\n {\\n (uint256 x, uint256 y) = _gfP2CubeAddTwistB(a.x, a.y);\\n return gfP2(x, y);\\n }\\n\\n /// @dev Returns true if G2 point's y^2 equals x.\\n function g2X2y(gfP2 memory x, gfP2 memory y) internal pure returns (bool) {\\n gfP2 memory y2;\\n y2 = gfP2Square(y);\\n\\n return (y2.x == x.x && y2.y == x.y);\\n }\\n\\n /// @dev Returns true if G2 point is on the curve.\\n function isG2PointOnCurve(G2Point memory point)\\n internal\\n pure\\n returns (bool)\\n {\\n (uint256 y2x, uint256 y2y) = _gfP2Square(point.y.x, point.y.y);\\n (uint256 x3x, uint256 x3y) = _gfP2CubeAddTwistB(point.x.x, point.x.y);\\n\\n return (y2x == x3x && y2y == x3y);\\n }\\n\\n function twistB() private pure returns (gfP2 memory) {\\n return gfP2(twistBx, twistBy);\\n }\\n\\n function hexRoot() private pure returns (gfP2 memory) {\\n return gfP2(hexRootX, hexRootY);\\n }\\n\\n /// @dev Calculates whether the provided number is even or odd.\\n /// @return 0x01 if y is an even number and 0x00 if it's odd.\\n function parity(uint256 value) private pure returns (bytes1) {\\n return bytes32(value)[31] & 0x01;\\n }\\n\\n function _gfP2Add(\\n uint256 ax,\\n uint256 ay,\\n uint256 bx,\\n uint256 by\\n ) private pure returns (uint256 x, uint256 y) {\\n x = addmod(ax, bx, p);\\n y = addmod(ay, by, p);\\n }\\n\\n function _gfP2Multiply(\\n uint256 ax,\\n uint256 ay,\\n uint256 bx,\\n uint256 by\\n ) private pure returns (uint256 x, uint256 y) {\\n x = addmod(mulmod(ax, by, p), mulmod(bx, ay, p), p);\\n y = addmod(mulmod(ay, by, p), p - mulmod(ax, bx, p), p);\\n }\\n\\n function _gfP2CubeAddTwistB(uint256 ax, uint256 ay)\\n private\\n pure\\n returns (uint256 x, uint256 y)\\n {\\n (uint256 a3x, uint256 a3y) = _gfP2Cube(ax, ay);\\n return _gfP2Add(a3x, a3y, twistBx, twistBy);\\n }\\n\\n function _gfP2Pow(\\n uint256 _ax,\\n uint256 _ay,\\n uint256 _exp\\n ) private pure returns (uint256 x, uint256 y) {\\n uint256 exp = _exp;\\n x = 0;\\n y = 1;\\n uint256 ax = _ax;\\n uint256 ay = _ay;\\n\\n // Reduce exp dividing by 2 gradually to 0 while computing final\\n // result only when exp is an odd number.\\n while (exp > 0) {\\n if (parity(exp) == 0x01) {\\n (x, y) = _gfP2Multiply(x, y, ax, ay);\\n }\\n\\n unchecked {\\n exp = exp / 2;\\n }\\n (ax, ay) = _gfP2Multiply(ax, ay, ax, ay);\\n }\\n }\\n\\n function _gfP2Square(uint256 _ax, uint256 _ay)\\n private\\n pure\\n returns (uint256 x, uint256 y)\\n {\\n return _gfP2Multiply(_ax, _ay, _ax, _ay);\\n }\\n\\n function _gfP2Cube(uint256 _ax, uint256 _ay)\\n private\\n pure\\n returns (uint256 x, uint256 y)\\n {\\n (uint256 _bx, uint256 _by) = _gfP2Square(_ax, _ay);\\n return _gfP2Multiply(_ax, _ay, _bx, _by);\\n }\\n\\n function _g2X2y(\\n uint256 xx,\\n uint256 xy,\\n uint256 yx,\\n uint256 yy\\n ) private pure returns (bool) {\\n (uint256 y2x, uint256 y2y) = _gfP2Square(yx, yy);\\n\\n return (y2x == xx && y2y == xy);\\n }\\n}\\n\",\"keccak256\":\"0x8a100028820ff5c424f4bb780fbedec1da2576fbc6d5aa4e7309d986b730a319\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BLS.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./AltBn128.sol\\\";\\n\\n/// @title BLS signatures verification\\n/// @dev Library for verification of 2-pairing-check BLS signatures, including\\n/// basic, aggregated, or reconstructed threshold BLS signatures, generated\\n/// using the AltBn128 curve.\\nlibrary BLS {\\n /// @dev Creates a signature over message using the provided secret key.\\n function sign(bytes memory message, uint256 secretKey)\\n external\\n view\\n returns (bytes memory)\\n {\\n AltBn128.G1Point memory p_1 = AltBn128.g1HashToPoint(message);\\n AltBn128.G1Point memory p_2 = AltBn128.scalarMultiply(p_1, secretKey);\\n\\n return AltBn128.g1Marshal(p_2);\\n }\\n\\n /// @dev Wraps the functionality of BLS.verify, but hashes a message to\\n /// a point on G1 and marshal to bytes first to allow raw bytes\\n /// verification.\\n function verifyBytes(\\n bytes memory publicKey,\\n bytes memory message,\\n bytes memory signature\\n ) external view returns (bool) {\\n AltBn128.G1Point memory point = AltBn128.g1HashToPoint(message);\\n bytes memory messageAsPoint = AltBn128.g1Marshal(point);\\n\\n return verify(publicKey, messageAsPoint, signature);\\n }\\n\\n /// @dev Verify performs the pairing operation to check if the signature\\n /// is correct for the provided message and the corresponding public\\n /// key. Public key must be a valid point on G2 curve in an\\n /// uncompressed format. Message must be a valid point on G1 curve in\\n /// an uncompressed format. Signature must be a valid point on G1\\n /// curve in an uncompressed format.\\n function verify(\\n bytes memory publicKey,\\n bytes memory message,\\n bytes memory signature\\n ) public view returns (bool) {\\n AltBn128.G1Point memory _signature = AltBn128.g1Unmarshal(signature);\\n\\n return\\n _verify(\\n AltBn128.g2Unmarshal(publicKey),\\n AltBn128.g1Unmarshal(message),\\n _signature\\n );\\n }\\n\\n function _verify(\\n AltBn128.G2Point memory publicKey,\\n AltBn128.G1Point memory message,\\n AltBn128.G1Point memory signature\\n ) public view returns (bool) {\\n return\\n AltBn128.pairing(\\n AltBn128.G1Point(signature.x, AltBn128.getP() - signature.y),\\n AltBn128.g2(),\\n message,\\n publicKey\\n );\\n }\\n}\\n\",\"keccak256\":\"0x08c7e739c63c31f5f45fb390695eca9e98a9525589ace41526f25060f46e43d4\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BeaconAuthorization.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\n// Initial version copied from Keep Network ECDSA Wallets:\\n// https://github.com/keep-network/keep-core/blob/5286ebc8ff99b2aa6569f9dd97fd6995f25b4630/solidity/ecdsa/contracts/libraries/EcdsaAuthorization.sol\\n//\\n// With the following differences:\\n// - functions' visibility was changed to public/external to deploy it as a linked\\n// library.\\n// - documentation was updated to be more generic.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"@threshold-network/solidity-contracts/contracts/staking/IStaking.sol\\\";\\n\\n/// @notice Library managing the state of stake authorizations for the operator\\n/// contract and the presence of operators in the sortition\\n/// pool based on the stake authorized for them.\\nlibrary BeaconAuthorization {\\n struct Parameters {\\n // The minimum authorization required by the beacon so that\\n // operator can join the sortition pool and do the work.\\n uint96 minimumAuthorization;\\n // Authorization decrease delay in seconds between the time\\n // authorization decrease is requested and the time the authorization\\n // decrease can be approved. It is always the same value, no matter if\\n // authorization decrease amount is small, significant, or if it is\\n // a decrease to zero.\\n uint64 authorizationDecreaseDelay;\\n // The time period before the authorization decrease delay end,\\n // during which the authorization decrease request can be overwritten.\\n //\\n // When the request is overwritten, the authorization decrease delay is\\n // reset.\\n //\\n // For example, if `authorizationDecraseChangePeriod` is set to 4\\n // days, `authorizationDecreaseDelay` is set to 14 days, and someone\\n // requested authorization decrease, it means they can not\\n // request another decrease for the first 10 days. After 10 days pass,\\n // they can request again and overwrite the previous authorization\\n // decrease request. The delay time will reset for them and they\\n // will have to wait another 10 days to alter it and 14 days to\\n // approve it.\\n //\\n // This value protects against malicious operators who manipulate\\n // their weight by overwriting authorization decrease request, and\\n // lowering or increasing their eligible stake this way.\\n //\\n // If set to a value equal to `authorizationDecreaseDelay, it means\\n // that authorization decrease request can be always overwritten.\\n // If set to zero, it means authorization decrease request can not be\\n // overwritten until the delay end, and one needs to wait for the entire\\n // authorization decrease delay to approve their decrease and request\\n // for another one or to overwrite the pending one.\\n //\\n // (1) authorization decrease requested timestamp\\n // (2) from this moment authorization decrease request can be\\n // overwritten\\n // (3) from this moment authorization decrease request can be\\n // approved, assuming it was NOT overwritten in (2)\\n //\\n // (1) (2) (3)\\n // --x------------------------------x--------------------------x---->\\n // | \\\\________________________/\\n // | authorizationDecreaseChangePeriod\\n // \\\\______________________________________________________/\\n // authorizationDecreaseDelay\\n //\\n uint64 authorizationDecreaseChangePeriod;\\n }\\n\\n struct AuthorizationDecrease {\\n uint96 decreasingBy; // amount\\n uint64 decreasingAt; // timestamp\\n }\\n\\n struct Data {\\n Parameters parameters;\\n mapping(address => address) stakingProviderToOperator;\\n mapping(address => address) operatorToStakingProvider;\\n mapping(address => AuthorizationDecrease) pendingDecreases;\\n }\\n\\n event OperatorRegistered(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event AuthorizationIncreased(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event AuthorizationDecreaseRequested(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount,\\n uint64 decreasingAt\\n );\\n\\n event AuthorizationDecreaseApproved(address indexed stakingProvider);\\n\\n event InvoluntaryAuthorizationDecreaseFailed(\\n address indexed stakingProvider,\\n address indexed operator,\\n uint96 fromAmount,\\n uint96 toAmount\\n );\\n\\n event OperatorJoinedSortitionPool(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n event OperatorStatusUpdated(\\n address indexed stakingProvider,\\n address indexed operator\\n );\\n\\n /// @notice Updates authorization-related parameters.\\n /// @param _minimumAuthorization New value of the minimum authorization for\\n /// the beacon. Without at least the minimum authorization, staking\\n /// provider is not eligible to join and operate in the network.\\n /// @param _authorizationDecreaseDelay New value of the authorization\\n /// decrease delay. It is the time in seconds that needs to pass\\n /// between the time authorization decrease is requested and the time\\n /// the authorization decrease can be approved, no matter the\\n /// authorization decrease amount.\\n /// @param _authorizationDecreaseChangePeriod New value of the authorization\\n /// decrease change period. It is the time in seconds, before\\n /// authorization decrease delay end, during which the pending\\n /// authorization decrease request can be overwritten.\\n /// If set to 0, pending authorization decrease request can not be\\n /// overwritten until the entire `authorizationDecreaseDelay` ends.\\n /// If set to value equal `authorizationDecreaseDelay`, request can\\n /// always be overwritten.\\n function setParameters(\\n Data storage self,\\n uint96 _minimumAuthorization,\\n uint64 _authorizationDecreaseDelay,\\n uint64 _authorizationDecreaseChangePeriod\\n ) external {\\n self.parameters.minimumAuthorization = _minimumAuthorization;\\n self\\n .parameters\\n .authorizationDecreaseDelay = _authorizationDecreaseDelay;\\n self\\n .parameters\\n .authorizationDecreaseChangePeriod = _authorizationDecreaseChangePeriod;\\n }\\n\\n /// @notice Used by staking provider to set operator address that will\\n /// operate a node. The given staking provider can set operator\\n /// address only one time. The operator address can not be changed\\n /// and must be unique. Reverts if the operator is already set for\\n /// the staking provider or if the operator address is already in\\n /// use. Reverts if there is a pending authorization decrease for\\n /// the staking provider.\\n function registerOperator(Data storage self, address operator) public {\\n address stakingProvider = msg.sender;\\n\\n require(operator != address(0), \\\"Operator can not be zero address\\\");\\n require(\\n self.stakingProviderToOperator[stakingProvider] == address(0),\\n \\\"Operator already set for the staking provider\\\"\\n );\\n require(\\n self.operatorToStakingProvider[operator] == address(0),\\n \\\"Operator address already in use\\\"\\n );\\n\\n // Authorization request for a staking provider who has not yet\\n // registered their operator can be approved immediately.\\n // We need to make sure that the approval happens before operator\\n // is registered to do not let the operator join the sortition pool\\n // with an unresolved authorization decrease request that can be\\n // approved at any point.\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n require(\\n decrease.decreasingAt == 0,\\n \\\"There is a pending authorization decrease request\\\"\\n );\\n\\n emit OperatorRegistered(stakingProvider, operator);\\n\\n self.stakingProviderToOperator[stakingProvider] = operator;\\n self.operatorToStakingProvider[operator] = stakingProvider;\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorized stake amount for the given staking provider increased.\\n ///\\n /// Reverts if the authorization amount is below the minimum.\\n ///\\n /// The function is not updating the sortition pool. Sortition pool\\n /// state needs to be updated by the operator with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`.\\n ///\\n /// @dev Should only be callable by T staking contract.\\n function authorizationIncreased(\\n Data storage self,\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external {\\n require(\\n toAmount >= self.parameters.minimumAuthorization,\\n \\\"Authorization below the minimum\\\"\\n );\\n\\n // Note that this function does not require the operator address to be\\n // set for the given staking provider. This allows the stake owner\\n // who is also an authorizer to increase the authorization before the\\n // staking provider sets the operator. This allows delegating stake\\n // and increasing authorization immediately one after another without\\n // having to wait for the staking provider to do their part.\\n\\n address operator = self.stakingProviderToOperator[stakingProvider];\\n emit AuthorizationIncreased(\\n stakingProvider,\\n operator,\\n fromAmount,\\n toAmount\\n );\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon that the\\n /// authorization decrease for the given staking provider has been\\n /// requested.\\n ///\\n /// Reverts if the amount after deauthorization would be non-zero\\n /// and lower than the minimum authorization.\\n ///\\n /// Reverts if another authorization decrease request is pending for\\n /// the staking provider and not enough time passed since the\\n /// original request (see `authorizationDecreaseChangePeriod`).\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// it lets to `approveAuthorizationDecrease` immediately. If the\\n /// operator is known (`registerOperator` was called), the operator\\n /// needs to update state of the sortition pool with a call to\\n /// `joinSortitionPool` or `updateOperatorStatus`. After the\\n /// sortition pool state is in sync, authorization decrease delay\\n /// starts.\\n ///\\n /// After authorization decrease delay passes, authorization\\n /// decrease request needs to be approved with a call to\\n /// `approveAuthorizationDecrease` function.\\n ///\\n /// If there is a pending authorization decrease request, it is\\n /// overwritten, but only if enough time passed since the original\\n /// request. Otherwise, the function reverts.\\n ///\\n /// @dev Should only be callable by T staking contract.\\n function authorizationDecreaseRequested(\\n Data storage self,\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) public {\\n require(\\n toAmount == 0 || toAmount >= self.parameters.minimumAuthorization,\\n \\\"Authorization amount should be 0 or above the minimum\\\"\\n );\\n\\n address operator = self.stakingProviderToOperator[stakingProvider];\\n\\n uint64 decreasingAt;\\n\\n if (operator == address(0)) {\\n // Operator is not known. It means `registerOperator` was not\\n // called yet, and there is no chance the operator could\\n // call `joinSortitionPool`. We can let to approve authorization\\n // decrease immediately because that operator was never in the\\n // sortition pool.\\n\\n // solhint-disable-next-line not-rely-on-time\\n decreasingAt = uint64(block.timestamp);\\n } else {\\n // Operator is known. It means that this operator is or was in\\n // the sortition pool. Before authorization decrease delay starts,\\n // the operator needs to update the state of the sortition pool\\n // with a call to `joinSortitionPool` or `updateOperatorStatus`.\\n // For now, we set `decreasingAt` as \\\"never decreasing\\\" and let\\n // it be updated by `joinSortitionPool` or `updateOperatorStatus`\\n // once we know the sortition pool is in sync.\\n decreasingAt = type(uint64).max;\\n }\\n\\n uint96 decreasingBy = fromAmount - toAmount;\\n\\n AuthorizationDecrease storage decreaseRequest = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n uint64 pendingDecreaseAt = decreaseRequest.decreasingAt;\\n if (pendingDecreaseAt != 0 && pendingDecreaseAt != type(uint64).max) {\\n // If there is already a pending authorization decrease request for\\n // this staking provider and that request has been activated\\n // (sortition pool was updated), require enough time to pass before\\n // it can be overwritten.\\n require(\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp >=\\n pendingDecreaseAt -\\n self.parameters.authorizationDecreaseChangePeriod,\\n \\\"Not enough time passed since the original request\\\"\\n );\\n }\\n\\n decreaseRequest.decreasingBy = decreasingBy;\\n decreaseRequest.decreasingAt = decreasingAt;\\n\\n emit AuthorizationDecreaseRequested(\\n stakingProvider,\\n operator,\\n fromAmount,\\n toAmount,\\n decreasingAt\\n );\\n }\\n\\n /// @notice Approves the previously registered authorization decrease\\n /// request. Reverts if authorization decrease delay have not passed\\n /// yet or if the authorization decrease was not requested for the\\n /// given staking provider.\\n function approveAuthorizationDecrease(\\n Data storage self,\\n IStaking tokenStaking,\\n address stakingProvider\\n ) public {\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n require(\\n decrease.decreasingAt > 0,\\n \\\"Authorization decrease not requested\\\"\\n );\\n require(\\n decrease.decreasingAt != type(uint64).max,\\n \\\"Authorization decrease request not activated\\\"\\n );\\n require(\\n // solhint-disable-next-line not-rely-on-time\\n block.timestamp >= decrease.decreasingAt,\\n \\\"Authorization decrease delay not passed\\\"\\n );\\n\\n emit AuthorizationDecreaseApproved(stakingProvider);\\n\\n // slither-disable-next-line unused-return\\n tokenStaking.approveAuthorizationDecrease(stakingProvider);\\n delete self.pendingDecreases[stakingProvider];\\n }\\n\\n /// @notice Used by T staking contract to inform the beacon the\\n /// authorization has been decreased for the given staking provider\\n /// involuntarily, as a result of slashing.\\n ///\\n /// If the operator is not known (`registerOperator` was not called)\\n /// the function does nothing. The operator was never in a sortition\\n /// pool so there is nothing to update.\\n ///\\n /// If the operator is known, sortition pool is unlocked, and the\\n /// operator is in the sortition pool, the sortition pool state is\\n /// updated. If the sortition pool is locked, update needs to be\\n /// postponed. Every other staker is incentivized to call\\n /// `updateOperatorStatus` for the problematic operator to increase\\n /// their own rewards in the pool.\\n ///\\n /// @dev Should only be callable by T staking contract.\\n function involuntaryAuthorizationDecrease(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool,\\n address stakingProvider,\\n uint96 fromAmount,\\n uint96 toAmount\\n ) external {\\n address operator = self.stakingProviderToOperator[stakingProvider];\\n\\n if (operator == address(0)) {\\n // Operator is not known. It means `registerOperator` was not\\n // called yet, and there is no chance the operator could\\n // call `joinSortitionPool`. We can just ignore this update because\\n // operator was never in the sortition pool.\\n return;\\n } else {\\n // Operator is known. It means that this operator is or was in the\\n // sortition pool and the sortition pool may need to be updated.\\n //\\n // If the sortition pool is not locked and the operator is in the\\n // sortition pool, we are updating it.\\n //\\n // To keep stakes synchronized between applications when staking\\n // providers are slashed, without the risk of running out of gas,\\n // the staking contract queues up slashings and let users process\\n // the transactions. When an application slashes one or more staking\\n // providers, it adds them to the slashing queue on the staking\\n // contract. A queue entry contains the staking provider\\u2019s address\\n // and the amount they are due to be slashed.\\n //\\n // When there is at least one staking provider in the slashing\\n // queue, any account can submit a transaction processing one or\\n // more staking providers' slashings, and collecting a reward for\\n // doing so. A queued slashing is processed by updating the staking\\n // provider\\u2019s stake to the post-slashing amount, updating authorized\\n // amount for each affected application, and notifying all affected\\n // applications that the staking provider\\u2019s authorized stake has\\n // been reduced due to slashing.\\n //\\n // The entire idea is that the process transaction is expensive\\n // because each application needs to be updated, so the reward for\\n // the processor is hefty and comes from the slashed tokens.\\n // Practically, it means that if the sortition pool is unlocked, and\\n // can be updated, it should be updated because we already paid\\n // someone for updating it.\\n //\\n // If the sortition pool is locked, update needs to wait. Other\\n // sortition pool members are incentivized to call\\n // `updateOperatorStatus` for the problematic operator because they\\n // will increase their rewards this way.\\n if (sortitionPool.isOperatorInPool(operator)) {\\n if (sortitionPool.isLocked()) {\\n emit InvoluntaryAuthorizationDecreaseFailed(\\n stakingProvider,\\n operator,\\n fromAmount,\\n toAmount\\n );\\n } else {\\n updateOperatorStatus(\\n self,\\n tokenStaking,\\n sortitionPool,\\n operator\\n );\\n }\\n }\\n }\\n }\\n\\n /// @notice Lets the operator join the sortition pool. The operator address\\n /// must be known - before calling this function, it has to be\\n /// appointed by the staking provider by calling `registerOperator`.\\n /// Also, the operator must have the minimum authorization required\\n /// by the beacon. Function reverts if there is no minimum stake\\n /// authorized or if the operator is not known. If there was an\\n /// authorization decrease requested, it is activated by starting\\n /// the authorization decrease delay.\\n function joinSortitionPool(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool\\n ) public {\\n address operator = msg.sender;\\n\\n address stakingProvider = self.operatorToStakingProvider[operator];\\n require(stakingProvider != address(0), \\\"Unknown operator\\\");\\n\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n uint96 _eligibleStake = eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n decrease.decreasingBy\\n );\\n\\n require(_eligibleStake != 0, \\\"Authorization below the minimum\\\");\\n\\n emit OperatorJoinedSortitionPool(stakingProvider, operator);\\n\\n sortitionPool.insertOperator(operator, _eligibleStake);\\n\\n // If there is a pending authorization decrease request, activate it.\\n // At this point, the sortition pool state is up to date so the\\n // authorization decrease delay can start counting.\\n if (decrease.decreasingAt == type(uint64).max) {\\n decrease.decreasingAt =\\n // solhint-disable-next-line not-rely-on-time\\n uint64(block.timestamp) +\\n self.parameters.authorizationDecreaseDelay;\\n }\\n }\\n\\n /// @notice Updates status of the operator in the sortition pool. If there\\n /// was an authorization decrease requested, it is activated by\\n /// starting the authorization decrease delay.\\n /// Function reverts if the operator is not known.\\n function updateOperatorStatus(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool,\\n address operator\\n ) public {\\n address stakingProvider = self.operatorToStakingProvider[operator];\\n require(stakingProvider != address(0), \\\"Unknown operator\\\");\\n\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n emit OperatorStatusUpdated(stakingProvider, operator);\\n\\n if (sortitionPool.isOperatorInPool(operator)) {\\n uint96 _eligibleStake = eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n decrease.decreasingBy\\n );\\n\\n sortitionPool.updateOperatorStatus(operator, _eligibleStake);\\n }\\n\\n // If there is a pending authorization decrease request, activate it.\\n // At this point, the sortition pool state is up to date so the\\n // authorization decrease delay can start counting.\\n if (decrease.decreasingAt == type(uint64).max) {\\n decrease.decreasingAt =\\n // solhint-disable-next-line not-rely-on-time\\n uint64(block.timestamp) +\\n self.parameters.authorizationDecreaseDelay;\\n }\\n }\\n\\n /// @notice Checks if the operator's authorized stake is in sync with\\n /// operator's weight in the sortition pool.\\n /// If the operator is not in the sortition pool and their\\n /// authorized stake is non-zero, function returns false.\\n function isOperatorUpToDate(\\n Data storage self,\\n IStaking tokenStaking,\\n SortitionPool sortitionPool,\\n address operator\\n ) external view returns (bool) {\\n address stakingProvider = self.operatorToStakingProvider[operator];\\n require(stakingProvider != address(0), \\\"Unknown operator\\\");\\n\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n uint96 _eligibleStake = eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n decrease.decreasingBy\\n );\\n\\n if (!sortitionPool.isOperatorInPool(operator)) {\\n return _eligibleStake == 0;\\n } else {\\n return sortitionPool.isOperatorUpToDate(operator, _eligibleStake);\\n }\\n }\\n\\n /// @notice Returns the current value of the staking provider's eligible\\n /// stake. Eligible stake is defined as the currently authorized\\n /// stake minus the pending authorization decrease. Eligible stake\\n /// is what is used for operator's weight in the pool. If the\\n /// authorized stake minus the pending authorization decrease is\\n /// below the minimum authorization, eligible stake is 0.\\n /// @dev This function can be exposed to the public in contrast to the\\n /// second variant accepting `decreasingBy` as a parameter.\\n function eligibleStake(\\n Data storage self,\\n IStaking tokenStaking,\\n address stakingProvider\\n ) external view returns (uint96) {\\n return\\n eligibleStake(\\n self,\\n tokenStaking,\\n stakingProvider,\\n pendingAuthorizationDecrease(self, stakingProvider)\\n );\\n }\\n\\n /// @notice Returns the current value of the staking provider's eligible\\n /// stake. Eligible stake is defined as the currently authorized\\n /// stake minus the pending authorization decrease. Eligible stake\\n /// is what is used for operator's weight in the pool. If the\\n /// authorized stake minus the pending authorization decrease is\\n /// below the minimum authorization, eligible stake is 0.\\n /// @dev This function is not intended to be exposes to the public.\\n /// `decreasingBy` must be fetched from `pendingDecreases` mapping and\\n /// it is passed as a parameter to optimize gas usage of functions that\\n /// call `eligibleStake` and need to use `AuthorizationDecrease`\\n /// fetched from `pendingDecreases` for some additional logic.\\n function eligibleStake(\\n Data storage self,\\n IStaking tokenStaking,\\n address stakingProvider,\\n uint96 decreasingBy\\n ) public view returns (uint96) {\\n uint96 authorizedStake = tokenStaking.authorizedStake(\\n stakingProvider,\\n address(this)\\n );\\n\\n uint96 _eligibleStake = authorizedStake > decreasingBy\\n ? authorizedStake - decreasingBy\\n : 0;\\n\\n if (_eligibleStake < self.parameters.minimumAuthorization) {\\n return 0;\\n } else {\\n return _eligibleStake;\\n }\\n }\\n\\n /// @notice Returns the amount of stake that is pending authorization\\n /// decrease for the given staking provider. If no authorization\\n /// decrease has been requested, returns zero.\\n function pendingAuthorizationDecrease(\\n Data storage self,\\n address stakingProvider\\n ) public view returns (uint96) {\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n return decrease.decreasingBy;\\n }\\n\\n /// @notice Returns the remaining time in seconds that needs to pass before\\n /// the requested authorization decrease can be approved.\\n /// If the sortition pool state was not updated yet by the operator\\n /// after requesting the authorization decrease, returns\\n /// `type(uint64).max`.\\n function remainingAuthorizationDecreaseDelay(\\n Data storage self,\\n address stakingProvider\\n ) external view returns (uint64) {\\n AuthorizationDecrease storage decrease = self.pendingDecreases[\\n stakingProvider\\n ];\\n\\n if (decrease.decreasingAt == type(uint64).max) {\\n return type(uint64).max;\\n }\\n\\n // solhint-disable-next-line not-rely-on-time\\n uint64 _now = uint64(block.timestamp);\\n return _now > decrease.decreasingAt ? 0 : decrease.decreasingAt - _now;\\n }\\n}\\n\",\"keccak256\":\"0xe146f4a3c662e971317d0189b2fca613f9f83a163ef682ed1e536e6c1f919a08\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BeaconDkg.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\nimport \\\"./BytesLib.sol\\\";\\nimport {BeaconDkgValidator as DKGValidator} from \\\"../BeaconDkgValidator.sol\\\";\\n\\nlibrary BeaconDkg {\\n using BytesLib for bytes;\\n using ECDSA for bytes32;\\n\\n struct Parameters {\\n // Time in blocks during which a submitted result can be challenged.\\n uint256 resultChallengePeriodLength;\\n // Extra gas required to be left at the end of the challenge DKG result\\n // transaction.\\n uint256 resultChallengeExtraGas;\\n // Time in blocks during which a result is expected to be submitted.\\n uint256 resultSubmissionTimeout;\\n // Time in blocks during which only the result submitter is allowed to\\n // approve it. Once this period ends and the submitter have not approved\\n // the result, anyone can do it.\\n uint256 submitterPrecedencePeriodLength;\\n }\\n\\n struct Data {\\n // Address of the Sortition Pool contract.\\n SortitionPool sortitionPool;\\n // Address of the DKGValidator contract.\\n DKGValidator dkgValidator;\\n // DKG parameters. The parameters should persist between DKG executions.\\n // They should be updated with dedicated set functions only when DKG is not\\n // in progress.\\n Parameters parameters;\\n // Time in blocks at which DKG started.\\n uint256 startBlock;\\n // Seed used to start DKG.\\n uint256 seed;\\n // Time in blocks that should be added to result submission period calculation.\\n // It is used in case of a challenge to adjust DKG timeout calculation.\\n uint256 resultSubmissionStartBlockOffset;\\n // Hash of submitted DKG result.\\n bytes32 submittedResultHash;\\n // Block number from the moment of the DKG result submission.\\n uint256 submittedResultBlock;\\n }\\n\\n /// @notice DKG result.\\n struct Result {\\n // Claimed submitter candidate group member index.\\n // Must be in range [1, groupSize].\\n uint256 submitterMemberIndex;\\n // Generated candidate group public key\\n bytes groupPubKey;\\n // Array of misbehaved members indices (disqualified or inactive).\\n // Indices must be in range [1, groupSize], unique, and sorted in ascending\\n // order.\\n uint8[] misbehavedMembersIndices;\\n // Concatenation of signatures from members supporting the result.\\n // The message to be signed by each member is keccak256 hash of the\\n // calculated group public key, misbehaved members indices and DKG\\n // start block. The calculated hash should be prefixed with prefixed with\\n // `\\\\x19Ethereum signed message:\\\\n` before signing, so the message to\\n // sign is:\\n // `\\\\x19Ethereum signed message:\\\\n${keccak256(\\n // groupPubKey, misbehavedMembersIndices, dkgStartBlock\\n // )}`\\n bytes signatures;\\n // Indices of members corresponding to each signature. Indices must be\\n // be in range [1, groupSize], unique, and sorted in ascending order.\\n uint256[] signingMembersIndices;\\n // Identifiers of candidate group members as outputted by the group\\n // selection protocol.\\n uint32[] members;\\n // Keccak256 hash of group members identifiers that actively took part\\n // in DKG (excluding IA/DQ members).\\n bytes32 membersHash;\\n }\\n\\n /// @notice States for phases of group creation. The states doesn't include\\n /// timeouts which should be tracked and notified individually.\\n enum State {\\n // Group creation is not in progress. It is a state set after group creation\\n // completion either by timeout or by a result approval.\\n IDLE,\\n // Group creation is awaiting the seed and sortition pool is locked.\\n AWAITING_SEED,\\n // Off-chain DKG protocol execution is in progress. A result is being calculated\\n // by the clients in this state. It's not yet possible to submit the result.\\n KEY_GENERATION,\\n // After off-chain DKG protocol execution the contract awaits result submission.\\n // This is a state to which group creation returns in case of a result\\n // challenge notification.\\n AWAITING_RESULT,\\n // DKG result was submitted and awaits an approval or a challenge. If a result\\n // gets challenge the state returns to `AWAITING_RESULT`. If a result gets\\n // approval the state changes to `IDLE`.\\n CHALLENGE\\n }\\n\\n /// @dev Size of a group in the threshold relay.\\n uint256 public constant groupSize = 64;\\n\\n /// @notice Time in blocks after which DKG result is complete and ready to be\\n // published by clients.\\n uint256 public constant offchainDkgTime = 5 * (1 + 5) + 2 * (1 + 10) + 20;\\n\\n event DkgStarted(uint256 indexed seed);\\n\\n // To recreate the members that actively took part in dkg, the selected members\\n // array should be filtered out from misbehavedMembersIndices.\\n event DkgResultSubmitted(\\n bytes32 indexed resultHash,\\n uint256 indexed seed,\\n Result result\\n );\\n\\n event DkgTimedOut();\\n\\n event DkgResultApproved(\\n bytes32 indexed resultHash,\\n address indexed approver\\n );\\n\\n event DkgResultChallenged(\\n bytes32 indexed resultHash,\\n address indexed challenger,\\n string reason\\n );\\n\\n event DkgStateLocked();\\n\\n event DkgSeedTimedOut();\\n\\n /// @notice Initializes SortitionPool and DKGValidator addresses.\\n /// Can be performed only once.\\n /// @param _sortitionPool Sortition Pool reference\\n /// @param _dkgValidator DKGValidator reference\\n function init(\\n Data storage self,\\n SortitionPool _sortitionPool,\\n DKGValidator _dkgValidator\\n ) internal {\\n require(\\n address(self.sortitionPool) == address(0),\\n \\\"Sortition Pool address already set\\\"\\n );\\n\\n require(\\n address(self.dkgValidator) == address(0),\\n \\\"DKG Validator address already set\\\"\\n );\\n\\n self.sortitionPool = _sortitionPool;\\n self.dkgValidator = _dkgValidator;\\n }\\n\\n /// @notice Determines the current state of group creation. It doesn't take\\n /// timeouts into consideration. The timeouts should be tracked and\\n /// notified separately.\\n function currentState(Data storage self)\\n internal\\n view\\n returns (State state)\\n {\\n state = State.IDLE;\\n\\n if (self.sortitionPool.isLocked()) {\\n state = State.AWAITING_SEED;\\n\\n if (self.startBlock > 0) {\\n state = State.KEY_GENERATION;\\n\\n if (block.number > self.startBlock + offchainDkgTime) {\\n state = State.AWAITING_RESULT;\\n\\n if (self.submittedResultBlock > 0) {\\n state = State.CHALLENGE;\\n }\\n }\\n }\\n }\\n }\\n\\n /// @notice Locks the sortition pool and starts awaiting for the\\n /// group creation seed.\\n function lockState(Data storage self) internal {\\n require(currentState(self) == State.IDLE, \\\"Current state is not IDLE\\\");\\n\\n emit DkgStateLocked();\\n\\n self.sortitionPool.lock();\\n }\\n\\n function start(Data storage self, uint256 seed) internal {\\n require(\\n currentState(self) == State.AWAITING_SEED,\\n \\\"Current state is not AWAITING_SEED\\\"\\n );\\n\\n emit DkgStarted(seed);\\n\\n self.startBlock = block.number;\\n self.seed = seed;\\n }\\n\\n /// @notice Allows to submit a DKG result. The submitted result does not go\\n /// through a validation and before it gets accepted, it needs to\\n /// wait through the challenge period during which everyone has\\n /// a chance to challenge the result as invalid one. Submitter of\\n /// the result needs to be in the sortition pool and if the result\\n /// gets challenged, the submitter will get slashed.\\n function submitResult(Data storage self, Result calldata result) external {\\n require(\\n currentState(self) == State.AWAITING_RESULT,\\n \\\"Current state is not AWAITING_RESULT\\\"\\n );\\n require(!hasDkgTimedOut(self), \\\"DKG timeout already passed\\\");\\n\\n SortitionPool sortitionPool = self.sortitionPool;\\n\\n // Submitter must be an operator in the sortition pool.\\n // Declared submitter's member index in the DKG result needs to match\\n // the address calling this function.\\n require(\\n sortitionPool.isOperatorInPool(msg.sender),\\n \\\"Submitter not in the sortition pool\\\"\\n );\\n require(\\n sortitionPool.getIDOperator(\\n result.members[result.submitterMemberIndex - 1]\\n ) == msg.sender,\\n \\\"Unexpected submitter index\\\"\\n );\\n\\n self.submittedResultHash = keccak256(abi.encode(result));\\n self.submittedResultBlock = block.number;\\n\\n emit DkgResultSubmitted(self.submittedResultHash, self.seed, result);\\n }\\n\\n /// @notice Checks if DKG timed out. The DKG timeout period includes time required\\n /// for off-chain protocol execution and time for the result publication.\\n /// After this time a result cannot be submitted and DKG can be notified\\n /// about the timeout. DKG period is adjusted by result submission\\n /// offset that include blocks that were mined while invalid result\\n /// has been registered until it got challenged.\\n /// @return True if DKG timed out, false otherwise.\\n function hasDkgTimedOut(Data storage self) internal view returns (bool) {\\n return\\n currentState(self) == State.AWAITING_RESULT &&\\n block.number >\\n (self.startBlock +\\n offchainDkgTime +\\n self.resultSubmissionStartBlockOffset +\\n self.parameters.resultSubmissionTimeout);\\n }\\n\\n /// @notice Notifies about DKG timeout.\\n function notifyTimeout(Data storage self) internal {\\n require(hasDkgTimedOut(self), \\\"DKG has not timed out\\\");\\n\\n emit DkgTimedOut();\\n\\n complete(self);\\n }\\n\\n /// @notice Notifies about the seed was not delivered and restores the\\n /// initial DKG state (IDLE).\\n function notifySeedTimedOut(Data storage self) internal {\\n require(\\n currentState(self) == State.AWAITING_SEED,\\n \\\"Current state is not AWAITING_SEED\\\"\\n );\\n\\n emit DkgSeedTimedOut();\\n\\n complete(self);\\n }\\n\\n /// @notice Approves DKG result. Can be called when the challenge period for\\n /// the submitted result is finished. Considers the submitted result\\n /// as valid. For the first `submitterPrecedencePeriodLength`\\n /// blocks after the end of the challenge period can be called only\\n /// by the DKG result submitter. After that time, can be called by\\n /// anyone.\\n /// @dev Can be called after a challenge period for the submitted result.\\n /// @param result Result to approve. Must match the submitted result stored\\n /// during `submitResult`.\\n /// @return misbehavedMembers Identifiers of members who misbehaved during DKG.\\n function approveResult(Data storage self, Result calldata result)\\n external\\n returns (uint32[] memory misbehavedMembers)\\n {\\n require(\\n currentState(self) == State.CHALLENGE,\\n \\\"Current state is not CHALLENGE\\\"\\n );\\n\\n uint256 challengePeriodEnd = self.submittedResultBlock +\\n self.parameters.resultChallengePeriodLength;\\n\\n require(\\n block.number > challengePeriodEnd,\\n \\\"Challenge period has not passed yet\\\"\\n );\\n\\n require(\\n keccak256(abi.encode(result)) == self.submittedResultHash,\\n \\\"Result under approval is different than the submitted one\\\"\\n );\\n\\n // Extract submitter member address. Submitter member index is in\\n // range [1, groupSize] so we need to -1 when fetching identifier from members\\n // array.\\n address submitterMember = self.sortitionPool.getIDOperator(\\n result.members[result.submitterMemberIndex - 1]\\n );\\n\\n require(\\n msg.sender == submitterMember ||\\n block.number >\\n challengePeriodEnd +\\n self.parameters.submitterPrecedencePeriodLength,\\n \\\"Only the DKG result submitter can approve the result at this moment\\\"\\n );\\n\\n // Extract misbehaved members identifiers. Misbehaved members indices\\n // are in range [1, groupSize], so we need to -1 when fetching identifiers from\\n // members array.\\n misbehavedMembers = new uint32[](\\n result.misbehavedMembersIndices.length\\n );\\n for (uint256 i = 0; i < result.misbehavedMembersIndices.length; i++) {\\n misbehavedMembers[i] = result.members[\\n result.misbehavedMembersIndices[i] - 1\\n ];\\n }\\n\\n emit DkgResultApproved(self.submittedResultHash, msg.sender);\\n\\n return misbehavedMembers;\\n }\\n\\n /// @notice Challenges DKG result. If the submitted result is proved to be\\n /// invalid it reverts the DKG back to the result submission phase.\\n /// @dev Can be called during a challenge period for the submitted result.\\n /// @param result Result to challenge. Must match the submitted result\\n /// stored during `submitResult`.\\n /// @return maliciousResultHash Hash of the malicious result.\\n /// @return maliciousSubmitter Identifier of the malicious submitter.\\n function challengeResult(Data storage self, Result calldata result)\\n external\\n returns (bytes32 maliciousResultHash, uint32 maliciousSubmitter)\\n {\\n require(\\n currentState(self) == State.CHALLENGE,\\n \\\"Current state is not CHALLENGE\\\"\\n );\\n\\n require(\\n block.number <=\\n self.submittedResultBlock +\\n self.parameters.resultChallengePeriodLength,\\n \\\"Challenge period has already passed\\\"\\n );\\n\\n require(\\n keccak256(abi.encode(result)) == self.submittedResultHash,\\n \\\"Result under challenge is different than the submitted one\\\"\\n );\\n\\n // https://github.com/crytic/slither/issues/982\\n // slither-disable-next-line unused-return\\n try\\n self.dkgValidator.validate(result, self.seed, self.startBlock)\\n returns (\\n // slither-disable-next-line uninitialized-local,variable-scope\\n bool isValid,\\n // slither-disable-next-line uninitialized-local,variable-scope\\n string memory errorMsg\\n ) {\\n if (isValid) {\\n revert(\\\"unjustified challenge\\\");\\n }\\n\\n emit DkgResultChallenged(\\n self.submittedResultHash,\\n msg.sender,\\n errorMsg\\n );\\n } catch {\\n // if the validation reverted we consider the DKG result as invalid\\n emit DkgResultChallenged(\\n self.submittedResultHash,\\n msg.sender,\\n \\\"validation reverted\\\"\\n );\\n }\\n\\n // Consider result hash as malicious.\\n maliciousResultHash = self.submittedResultHash;\\n maliciousSubmitter = result.members[result.submitterMemberIndex - 1];\\n\\n // Adjust DKG result submission block start, so submission stage starts\\n // from the beginning.\\n self.resultSubmissionStartBlockOffset =\\n block.number -\\n self.startBlock -\\n offchainDkgTime;\\n\\n submittedResultCleanup(self);\\n\\n return (maliciousResultHash, maliciousSubmitter);\\n }\\n\\n /// @notice Due to EIP150, 1/64 of the gas is not forwarded to the call, and\\n /// will be kept to execute the remaining operations in the function\\n /// after the call inside the try-catch.\\n ///\\n /// To ensure there is no way for the caller to manipulate gas limit\\n /// in such a way that the call inside try-catch fails with out-of-gas\\n /// and the rest of the function is executed with the remaining\\n /// 1/64 of gas, we require an extra gas amount to be left at the\\n /// end of the call to the function challenging DKG result and\\n /// wrapping the call to BeaconDkgValidator and TokenStaking\\n /// contracts inside a try-catch.\\n function requireChallengeExtraGas(Data storage self) internal view {\\n require(\\n gasleft() >= self.parameters.resultChallengeExtraGas,\\n \\\"Not enough extra gas left\\\"\\n );\\n }\\n\\n /// @notice Updates DKG-related parameters\\n /// @param _resultChallengePeriodLength New value of the result challenge\\n /// period length. It is the number of blocks for which a DKG result\\n /// can be challenged.\\n /// @param _resultChallengeExtraGas New value of the result challenge extra\\n /// gas. It is the extra gas required to be left at the end of the\\n /// challenge DKG result transaction.\\n /// @param _resultSubmissionTimeout New value of the result submission\\n /// timeout in seconds. It is a timeout for a group to provide a DKG\\n /// result.\\n /// @param _submitterPrecedencePeriodLength New value of the submitter\\n /// precedence period length in blocks. It is the time during which\\n /// only the original DKG result submitter can approve it.\\n function setParameters(\\n Data storage self,\\n uint256 _resultChallengePeriodLength,\\n uint256 _resultChallengeExtraGas,\\n uint256 _resultSubmissionTimeout,\\n uint256 _submitterPrecedencePeriodLength\\n ) internal {\\n require(currentState(self) == State.IDLE, \\\"Current state is not IDLE\\\");\\n\\n require(\\n _resultChallengePeriodLength > 0,\\n \\\"Result challenge period length should be greater than zero\\\"\\n );\\n require(\\n _resultSubmissionTimeout > 0,\\n \\\"Result submission timeout should be greater than zero\\\"\\n );\\n require(\\n _submitterPrecedencePeriodLength < _resultSubmissionTimeout,\\n \\\"Submitter precedence period length should be less than the result submission timeout\\\"\\n );\\n\\n self\\n .parameters\\n .resultChallengePeriodLength = _resultChallengePeriodLength;\\n self.parameters.resultChallengeExtraGas = _resultChallengeExtraGas;\\n self.parameters.resultSubmissionTimeout = _resultSubmissionTimeout;\\n self\\n .parameters\\n .submitterPrecedencePeriodLength = _submitterPrecedencePeriodLength;\\n }\\n\\n /// @notice Completes DKG by cleaning up state.\\n /// @dev Should be called after DKG times out or a result is approved.\\n function complete(Data storage self) internal {\\n delete self.startBlock;\\n delete self.seed;\\n delete self.resultSubmissionStartBlockOffset;\\n submittedResultCleanup(self);\\n self.sortitionPool.unlock();\\n }\\n\\n /// @notice Cleans up submitted result state either after DKG completion\\n /// (as part of `complete` method) or after justified challenge.\\n function submittedResultCleanup(Data storage self) private {\\n delete self.submittedResultHash;\\n delete self.submittedResultBlock;\\n }\\n}\\n\",\"keccak256\":\"0x86bea35ab775ec969bc91208305f6f85aa9dd49bb74f8e57e7d453797e8ad98e\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BeaconInactivity.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./BytesLib.sol\\\";\\nimport \\\"./Groups.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@keep-network/sortition-pools/contracts/SortitionPool.sol\\\";\\n\\nlibrary BeaconInactivity {\\n using BytesLib for bytes;\\n using ECDSA for bytes32;\\n\\n struct Claim {\\n // ID of the group raising the inactivity claim.\\n uint64 groupId;\\n // Indices of members accused of being inactive. Indices must be in\\n // range [1, groupMembers.length], unique, and sorted in ascending order.\\n uint256[] inactiveMembersIndices;\\n // Concatenation of signatures from members supporting the claim.\\n // The message to be signed by each member is keccak256 hash of the\\n // concatenation of the chain ID, inactivity claim nonce for the given\\n // group, group public key, and inactive members indices. The calculated\\n // hash should be prefixed with `\\\\x19Ethereum signed message:\\\\n` before\\n // signing, so the message to sign is:\\n // `\\\\x19Ethereum signed message:\\\\n${keccak256(\\n // chainID | nonce | groupPubKey | inactiveMembersIndices\\n // )}`\\n bytes signatures;\\n // Indices of members corresponding to each signature. Indices must be\\n // in range [1, groupMembers.length], unique, and sorted in ascending\\n // order.\\n uint256[] signingMembersIndices;\\n }\\n\\n /// @notice The minimum number of group members needed to interact according\\n /// to the protocol to produce a valid inactivity claim.\\n uint256 public constant groupThreshold = 33;\\n\\n /// @notice Size in bytes of a single signature produced by member\\n /// supporting the inactivity claim.\\n uint256 public constant signatureByteSize = 65;\\n\\n /// @notice Verifies the inactivity claim according to the rules defined in\\n /// `Claim` struct documentation. Reverts if verification fails.\\n /// @dev Group members hash is validated upstream in\\n /// RandomBeacon.notifyOperatorInactivity()\\n /// @param sortitionPool Sortition pool reference\\n /// @param claim Inactivity claim\\n /// @param groupPubKey Public key of the group raising the claim\\n /// @param nonce Current nonce for group used in the claim\\n /// @param groupMembers Identifiers of group members\\n /// @return inactiveMembers Identifiers of members who are inactive\\n function verifyClaim(\\n SortitionPool sortitionPool,\\n Claim calldata claim,\\n bytes memory groupPubKey,\\n uint256 nonce,\\n uint32[] calldata groupMembers\\n ) external view returns (uint32[] memory inactiveMembers) {\\n // Validate inactive members indices. Maximum indices count is equal to\\n // the group size and is not limited deliberately to leave a theoretical\\n // possibility to accuse more members than `groupSize - groupThreshold`.\\n validateMembersIndices(\\n claim.inactiveMembersIndices,\\n groupMembers.length\\n );\\n\\n // Validate signatures array is properly formed and number of\\n // signatures and signers is correct.\\n uint256 signaturesCount = claim.signatures.length / signatureByteSize;\\n require(claim.signatures.length != 0, \\\"No signatures provided\\\");\\n require(\\n claim.signatures.length % signatureByteSize == 0,\\n \\\"Malformed signatures array\\\"\\n );\\n require(\\n signaturesCount == claim.signingMembersIndices.length,\\n \\\"Unexpected signatures count\\\"\\n );\\n require(signaturesCount >= groupThreshold, \\\"Too few signatures\\\");\\n require(signaturesCount <= groupMembers.length, \\\"Too many signatures\\\");\\n\\n // Validate signing members indices. Note that `signingMembersIndices`\\n // were already partially validated during `signatures` parameter\\n // validation.\\n validateMembersIndices(\\n claim.signingMembersIndices,\\n groupMembers.length\\n );\\n\\n // Usage of group public key and not group ID is important because it\\n // provides uniqueness of signed messages and prevent against reusing\\n // them in future in case some other application has a group with the\\n // same ID and subset of members.\\n bytes32 signedMessageHash = keccak256(\\n abi.encode(\\n block.chainid,\\n nonce,\\n groupPubKey,\\n claim.inactiveMembersIndices\\n )\\n ).toEthSignedMessageHash();\\n\\n address[] memory groupMembersAddresses = sortitionPool.getIDOperators(\\n groupMembers\\n );\\n\\n // Verify each signature.\\n bytes memory checkedSignature;\\n bool senderSignatureExists = false;\\n for (uint256 i = 0; i < signaturesCount; i++) {\\n uint256 memberIndex = claim.signingMembersIndices[i];\\n checkedSignature = claim.signatures.slice(\\n signatureByteSize * i,\\n signatureByteSize\\n );\\n address recoveredAddress = signedMessageHash.recover(\\n checkedSignature\\n );\\n\\n require(\\n groupMembersAddresses[memberIndex - 1] == recoveredAddress,\\n \\\"Invalid signature\\\"\\n );\\n\\n if (!senderSignatureExists && msg.sender == recoveredAddress) {\\n senderSignatureExists = true;\\n }\\n }\\n\\n require(senderSignatureExists, \\\"Sender must be claim signer\\\");\\n\\n inactiveMembers = new uint32[](claim.inactiveMembersIndices.length);\\n for (uint256 i = 0; i < claim.inactiveMembersIndices.length; i++) {\\n uint256 memberIndex = claim.inactiveMembersIndices[i];\\n inactiveMembers[i] = groupMembers[memberIndex - 1];\\n }\\n\\n return inactiveMembers;\\n }\\n\\n /// @notice Validates members indices array. Array is considered valid\\n /// if its size and each single index are in [1, groupSize] range,\\n /// indexes are unique, and sorted in an ascending order.\\n /// Reverts if validation fails.\\n /// @param indices Array to validate\\n /// @param groupSize Group size used as reference\\n function validateMembersIndices(\\n uint256[] calldata indices,\\n uint256 groupSize\\n ) internal pure {\\n require(\\n indices.length > 0 && indices.length <= groupSize,\\n \\\"Corrupted members indices\\\"\\n );\\n\\n // Check if first and last indices are in range [1, groupSize].\\n // This check combined with the loop below makes sure every single\\n // index is in the correct range.\\n require(\\n indices[0] > 0 && indices[indices.length - 1] <= groupSize,\\n \\\"Corrupted members indices\\\"\\n );\\n\\n for (uint256 i = 0; i < indices.length - 1; i++) {\\n // Check whether given index is smaller than the next one. This\\n // way we are sure indexes are ordered in the ascending order\\n // and there are no duplicates.\\n require(indices[i] < indices[i + 1], \\\"Corrupted members indices\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8dffb20eb4ffd2e388080c5fbcb648e33480aca3dab4be2254cf30c5e72413bf\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/BytesLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\n/*\\nVersion pulled from keep-core v1:\\nhttps://github.com/keep-network/keep-core/blob/f297202db00c027978ad8e7103a356503de5773c/solidity-v1/contracts/utils/BytesLib.sol\\n\\nTo compile it with solidity 0.8 `_preBytes_slot` was replaced with `_preBytes.slot`.\\n*/\\n\\n/*\\nhttps://github.com/GNSPS/solidity-bytes-utils/\\nThis is free and unencumbered software released into the public domain.\\nAnyone is free to copy, modify, publish, use, compile, sell, or\\ndistribute this software, either in source code form or as a compiled\\nbinary, for any purpose, commercial or non-commercial, and by any\\nmeans.\\nIn jurisdictions that recognize copyright laws, the author or authors\\nof this software dedicate any and all copyright interest in the\\nsoftware to the public domain. We make this dedication for the benefit\\nof the public at large and to the detriment of our heirs and\\nsuccessors. We intend this dedication to be an overt act of\\nrelinquishment in perpetuity of all present and future rights to this\\nsoftware under copyright law.\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND,\\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\\nOTHER DEALINGS IN THE SOFTWARE.\\nFor more information, please refer to <https://unlicense.org>\\n*/\\n\\n/** @title BytesLib **/\\n/** @author https://github.com/GNSPS **/\\n\\nlibrary BytesLib {\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes)\\n internal\\n {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(\\n and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),\\n 2\\n )\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(\\n fslot,\\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\\n ),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes)\\n internal\\n view\\n returns (bool)\\n {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(\\n and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),\\n 2\\n )\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n for {\\n\\n } eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function concat(bytes memory _preBytes, bytes memory _postBytes)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(\\n 0x40,\\n and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n )\\n )\\n }\\n\\n return tempBytes;\\n }\\n\\n function slice(\\n bytes memory _bytes,\\n uint256 _start,\\n uint256 _length\\n ) internal pure returns (bytes memory res) {\\n uint256 _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n // Alloc bytes array with additional 32 bytes afterspace and assign it's size\\n res := mload(0x40)\\n mstore(0x40, add(add(res, 64), _length))\\n mstore(res, _length)\\n\\n // Compute distance between source and destination pointers\\n let diff := sub(res, add(_bytes, _start))\\n\\n for {\\n let src := add(add(_bytes, 32), _start)\\n let end := add(src, _length)\\n } lt(src, end) {\\n src := add(src, 32)\\n } {\\n mstore(add(src, diff), mload(src))\\n }\\n }\\n }\\n\\n function toAddress(bytes memory _bytes, uint256 _start)\\n internal\\n pure\\n returns (address)\\n {\\n uint256 _totalLen = _start + 20;\\n require(\\n _totalLen > _start && _bytes.length >= _totalLen,\\n \\\"Address conversion out of bounds.\\\"\\n );\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(\\n mload(add(add(_bytes, 0x20), _start)),\\n 0x1000000000000000000000000\\n )\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint8(bytes memory _bytes, uint256 _start)\\n internal\\n pure\\n returns (uint8)\\n {\\n require(\\n _bytes.length >= (_start + 1),\\n \\\"Uint8 conversion out of bounds.\\\"\\n );\\n uint8 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x1), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint(bytes memory _bytes, uint256 _start)\\n internal\\n pure\\n returns (uint256)\\n {\\n uint256 _totalLen = _start + 32;\\n require(\\n _totalLen > _start && _bytes.length >= _totalLen,\\n \\\"Uint conversion out of bounds.\\\"\\n );\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes)\\n internal\\n pure\\n returns (bool)\\n {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function toBytes32(bytes memory _source)\\n internal\\n pure\\n returns (bytes32 result)\\n {\\n if (_source.length == 0) {\\n return 0x0;\\n }\\n\\n assembly {\\n result := mload(add(_source, 32))\\n }\\n }\\n\\n function keccak256Slice(\\n bytes memory _bytes,\\n uint256 _start,\\n uint256 _length\\n ) internal pure returns (bytes32 result) {\\n uint256 _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n result := keccak256(add(add(_bytes, 32), _start), _length)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b76e2fe36eb777440250dcf2ea7a689375e8af22f3cc33521095ff6954becdb\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/Callback.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"../api/IRandomBeaconConsumer.sol\\\";\\n\\n/// @title Callback library\\n/// @dev Library for handling calls to random beacon consumer.\\nlibrary Callback {\\n struct Data {\\n IRandomBeaconConsumer callbackContract;\\n }\\n\\n event CallbackFailed(uint256 entry, uint256 entrySubmittedBlock);\\n\\n /// @notice Sets callback contract.\\n /// @param callbackContract Callback contract.\\n function setCallbackContract(\\n Data storage self,\\n IRandomBeaconConsumer callbackContract\\n ) internal {\\n self.callbackContract = callbackContract;\\n }\\n\\n /// @notice Executes consumer specified callback for the relay entry request.\\n /// @param entry The generated random number.\\n /// @param callbackGasLimit Callback gas limit.\\n function executeCallback(\\n Data storage self,\\n uint256 entry,\\n uint256 callbackGasLimit\\n ) internal {\\n if (address(self.callbackContract) != address(0)) {\\n try\\n self.callbackContract.__beaconCallback{gas: callbackGasLimit}(\\n entry,\\n block.number\\n )\\n {} catch {\\n // slither-disable-next-line reentrancy-events\\n emit CallbackFailed(entry, block.number);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x258d635d74d8906c73d1c2d0929f033c7e548cdaf9c9a71a7e82b4ab70e5ad29\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/Groups.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\n/// @notice This library is used as a registry of created groups.\\n/// @dev This library should be used along with DKG library that ensures linear\\n/// groups creation (only one group creation happens at a time). A candidate\\n/// group has to be popped or activated before adding a new candidate group.\\nlibrary Groups {\\n struct Group {\\n bytes groupPubKey;\\n uint256 registrationBlockNumber;\\n // Keccak256 hash of group members identifiers array. Group members do not\\n // include operators selected by the sortition pool that misbehaved during DKG.\\n // See how `misbehavedMembersIndices` are used in `hashGroupMembers` function.\\n bytes32 membersHash;\\n // When selected group does not create a relay entry on-time it should\\n // be marked as terminated.\\n bool terminated;\\n }\\n\\n struct Data {\\n // Mapping of keccak256 hashes of group public keys to groups details.\\n mapping(bytes32 => Group) groupsData;\\n // Holds keccak256 hashes of group public keys in the order of registration.\\n bytes32[] groupsRegistry;\\n // Group ids that were active but failed creating a relay entry. When an\\n // active-terminated group qualifies to become 'expired', then it will\\n // be removed from this array.\\n uint64[] activeTerminatedGroups;\\n // Points to the first active group, it is also the expired groups counter.\\n uint64 expiredGroupOffset;\\n // Group lifetime in blocks. When a group reached its lifetime, it\\n // is no longer selected for new relay requests but may still be\\n // responsible for submitting relay entry if relay request assigned\\n // to that group is still pending.\\n uint256 groupLifetime;\\n }\\n\\n event GroupRegistered(uint64 indexed groupId, bytes indexed groupPubKey);\\n\\n /// @notice Performs preliminary validation of a new group public key.\\n /// The group public key must be unique and have 128 bytes in length.\\n /// If the validation fails, the function reverts. This function\\n /// must be called first for a public key of a group added with\\n /// `addGroup` function.\\n /// @param groupPubKey Candidate group public key\\n function validatePublicKey(Data storage self, bytes calldata groupPubKey)\\n internal\\n view\\n {\\n require(groupPubKey.length == 128, \\\"Invalid length of the public key\\\");\\n\\n bytes32 groupPubKeyHash = keccak256(groupPubKey);\\n\\n require(\\n self.groupsData[groupPubKeyHash].registrationBlockNumber == 0,\\n \\\"Group with this public key was already registered\\\"\\n );\\n }\\n\\n /// @notice Adds a new candidate group. The group is stored with group public\\n /// key and group members, but is not yet activated.\\n /// @dev The group members list is stored with all misbehaved members filtered out.\\n /// The code calling this function should ensure that the number of\\n /// candidate (not activated) groups is never more than one.\\n /// @param groupPubKey Generated candidate group public key\\n /// @param membersHash Keccak256 hash of members that actively took part in DKG.\\n function addGroup(\\n Data storage self,\\n bytes calldata groupPubKey,\\n bytes32 membersHash\\n ) internal {\\n bytes32 groupPubKeyHash = keccak256(groupPubKey);\\n\\n // We use group from storage that is assumed to be a struct set to the\\n // default values. We need to remember to overwrite fields in case a\\n // candidate group was already registered before and popped.\\n Group storage group = self.groupsData[groupPubKeyHash];\\n group.groupPubKey = groupPubKey;\\n group.membersHash = membersHash;\\n group.registrationBlockNumber = block.number;\\n\\n self.groupsRegistry.push(groupPubKeyHash);\\n\\n emit GroupRegistered(\\n uint64(self.groupsRegistry.length - 1),\\n groupPubKey\\n );\\n }\\n\\n /// @notice Goes through groups starting from the oldest one that is still\\n /// active and checks if it hasn't expired. If so, updates the information\\n /// about expired groups so that all expired groups are marked as such.\\n function expireOldGroups(Data storage self) internal {\\n // Move expiredGroupOffset as long as there are some groups that should\\n // be marked as expired. It is possible that expired group offset will\\n // move out of the groups array by one position. It means that all groups\\n // are expired (it points to the first active group) and that place in\\n // groups array - currently empty - will be possibly filled later by\\n // a new group.\\n while (\\n self.expiredGroupOffset < self.groupsRegistry.length &&\\n groupLifetimeOf(\\n self,\\n self.groupsRegistry[self.expiredGroupOffset]\\n ) <\\n block.number\\n ) {\\n self.expiredGroupOffset++;\\n }\\n\\n // Go through all activeTerminatedGroups and if some of the terminated\\n // groups are expired, remove them from activeTerminatedGroups collection\\n // and rearrange the array to preserve the original order.\\n // This is needed because we evaluate the shift of selected group index\\n // based on how many non-expired groups have been terminated. Hence it is\\n // important that a number of terminated groups matches the length of\\n // activeTerminatedGroups[].\\n uint256 i = 0;\\n while (i < self.activeTerminatedGroups.length) {\\n if (self.expiredGroupOffset > self.activeTerminatedGroups[i]) {\\n // When 'i'th group qualifies for expiration, we need to remove\\n // it from the activeTerminatedGroups array manually by rearranging\\n // the order starting from 'i'th group.\\n for (\\n uint256 j = i;\\n j < self.activeTerminatedGroups.length - 1;\\n j++\\n ) {\\n self.activeTerminatedGroups[j] = self\\n .activeTerminatedGroups[j + 1];\\n }\\n // Resizing the array length by 1. The last element was copied\\n // over in the loop above to an index \\\"second to last\\\". This is\\n // why we can safely remove it from here.\\n self.activeTerminatedGroups.pop();\\n } else {\\n i++;\\n }\\n }\\n }\\n\\n /// @notice Terminates group with the provided index. Reverts if the group\\n /// is already terminated.\\n /// @param groupId Index in the groupRegistry array.\\n function terminateGroup(Data storage self, uint64 groupId) internal {\\n require(\\n !isGroupTerminated(self, groupId),\\n \\\"Group has been already terminated\\\"\\n );\\n self.groupsData[self.groupsRegistry[groupId]].terminated = true;\\n // Expanding array for a new terminated group that is added below during\\n // sortition in ascending order.\\n self.activeTerminatedGroups.push();\\n\\n // Sorting activeTerminatedGroups by groupId in ascending order so a\\n // non-terminated group is properly selected.\\n uint256 i;\\n for (\\n i = self.activeTerminatedGroups.length - 1;\\n i > 0 && self.activeTerminatedGroups[i - 1] > groupId;\\n i--\\n ) {\\n self.activeTerminatedGroups[i] = self.activeTerminatedGroups[i - 1];\\n }\\n self.activeTerminatedGroups[i] = groupId;\\n }\\n\\n /// @notice Returns an index of a randomly selected active group. Terminated\\n /// and expired groups are not considered as active.\\n /// Before new group is selected, information about expired groups\\n /// is updated. At least one active group needs to be present for this\\n /// function to succeed.\\n /// @param seed Random number used as a group selection seed.\\n function selectGroup(Data storage self, uint256 seed)\\n internal\\n returns (uint64)\\n {\\n expireOldGroups(self);\\n\\n require(numberOfActiveGroups(self) > 0, \\\"No active groups\\\");\\n\\n uint64 selectedGroup = uint64(seed % numberOfActiveGroups(self));\\n uint64 result = shiftByTerminatedGroups(\\n self,\\n shiftByExpiredGroups(self, selectedGroup)\\n );\\n return result;\\n }\\n\\n /// @notice Setter for group lifetime.\\n /// @param lifetime Lifetime of a group in blocks.\\n function setGroupLifetime(Data storage self, uint256 lifetime) internal {\\n self.groupLifetime = lifetime;\\n }\\n\\n /// @notice Checks if group with the given index is terminated.\\n function isGroupTerminated(Data storage self, uint64 groupId)\\n internal\\n view\\n returns (bool)\\n {\\n return self.groupsData[self.groupsRegistry[groupId]].terminated;\\n }\\n\\n /// @notice Gets the cutoff time until which the given group is considered\\n /// to be active assuming it hasn't been terminated before.\\n function groupLifetimeOf(Data storage self, bytes32 groupPubKeyHash)\\n internal\\n view\\n returns (uint256)\\n {\\n return\\n self.groupsData[groupPubKeyHash].registrationBlockNumber +\\n self.groupLifetime;\\n }\\n\\n /// @notice Checks if group with the given index is active and non-terminated.\\n function isGroupActive(Data storage self, uint64 groupId)\\n internal\\n view\\n returns (bool)\\n {\\n return\\n groupLifetimeOf(self, self.groupsRegistry[groupId]) >=\\n block.number &&\\n !isGroupTerminated(self, groupId);\\n }\\n\\n function getGroup(Data storage self, uint64 groupId)\\n internal\\n view\\n returns (Group storage)\\n {\\n return self.groupsData[self.groupsRegistry[groupId]];\\n }\\n\\n function getGroup(Data storage self, bytes memory groupPubKey)\\n internal\\n view\\n returns (Group storage)\\n {\\n return self.groupsData[keccak256(groupPubKey)];\\n }\\n\\n /// @notice Gets the number of active groups. Expired and terminated\\n /// groups are not counted as active.\\n function numberOfActiveGroups(Data storage self)\\n internal\\n view\\n returns (uint64)\\n {\\n if (self.groupsRegistry.length == 0) {\\n return 0;\\n }\\n\\n uint256 activeGroups = self.groupsRegistry.length -\\n self.expiredGroupOffset -\\n self.activeTerminatedGroups.length;\\n\\n return uint64(activeGroups);\\n }\\n\\n /// @notice Evaluates the shift of a selected group index based on the number\\n /// of expired groups.\\n function shiftByExpiredGroups(Data storage self, uint64 selectedIndex)\\n internal\\n view\\n returns (uint64)\\n {\\n return self.expiredGroupOffset + selectedIndex;\\n }\\n\\n /// @notice Evaluates the shift of a selected group index based on the number\\n /// of non-expired but terminated groups.\\n function shiftByTerminatedGroups(Data storage self, uint64 selectedIndex)\\n internal\\n view\\n returns (uint64)\\n {\\n uint64 shiftedIndex = selectedIndex;\\n for (uint64 i = 0; i < self.activeTerminatedGroups.length; i++) {\\n if (self.activeTerminatedGroups[i] <= shiftedIndex) {\\n shiftedIndex++;\\n }\\n }\\n\\n return shiftedIndex;\\n }\\n}\\n\",\"keccak256\":\"0x27a3cee268e5afa5ee3a00089aa82faffff7c3882aa94919499de4ef55dcfb0c\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/ModUtils.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n//\\n\\npragma solidity 0.8.17;\\n\\nlibrary ModUtils {\\n /// @dev Wraps the modular exponent pre-compile introduced in Byzantium.\\n /// Returns base^exponent mod p.\\n function modExp(\\n uint256 base,\\n uint256 exponent,\\n uint256 p\\n ) internal view returns (uint256 o) {\\n assembly {\\n // Args for the precompile: [<length_of_BASE> <length_of_EXPONENT>\\n // <length_of_MODULUS> <BASE> <EXPONENT> <MODULUS>]\\n let output := mload(0x40)\\n let args := add(output, 0x20)\\n mstore(args, 0x20)\\n mstore(add(args, 0x20), 0x20)\\n mstore(add(args, 0x40), 0x20)\\n mstore(add(args, 0x60), base)\\n mstore(add(args, 0x80), exponent)\\n mstore(add(args, 0xa0), p)\\n\\n // 0x05 is the modular exponent contract address\\n if iszero(staticcall(not(0), 0x05, args, 0xc0, output, 0x20)) {\\n revert(0, 0)\\n }\\n o := mload(output)\\n }\\n }\\n\\n /// @dev Calculates and returns the square root of a mod p if such a square\\n /// root exists. The modulus p must be an odd prime. If a square root\\n /// does not exist, function returns 0.\\n function modSqrt(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n if (legendre(a, p) != 1) {\\n return 0;\\n }\\n\\n if (a == 0) {\\n return 0;\\n }\\n\\n if (p % 4 == 3) {\\n return modExp(a, (p + 1) / 4, p);\\n }\\n\\n uint256 s = p - 1;\\n uint256 e = 0;\\n\\n while (s % 2 == 0) {\\n s = s / 2;\\n e = e + 1;\\n }\\n\\n // Note the smaller int- finding n with Legendre symbol or -1\\n // should be quick\\n uint256 n = 2;\\n while (legendre(n, p) != -1) {\\n n = n + 1;\\n }\\n\\n uint256 x = modExp(a, (s + 1) / 2, p);\\n uint256 b = modExp(a, s, p);\\n uint256 g = modExp(n, s, p);\\n uint256 r = e;\\n uint256 gs = 0;\\n uint256 m = 0;\\n uint256 t = b;\\n\\n while (true) {\\n t = b;\\n m = 0;\\n\\n for (m = 0; m < r; m++) {\\n if (t == 1) {\\n break;\\n }\\n t = modExp(t, 2, p);\\n }\\n\\n if (m == 0) {\\n return x;\\n }\\n\\n gs = modExp(g, uint256(2)**(r - m - 1), p);\\n g = (gs * gs) % p;\\n x = (x * gs) % p;\\n b = (b * g) % p;\\n r = m;\\n }\\n }\\n }\\n\\n /// @dev Calculates the Legendre symbol of the given a mod p.\\n /// @return Returns 1 if a is a quadratic residue mod p, -1 if it is\\n /// a non-quadratic residue, and 0 if a is 0.\\n function legendre(uint256 a, uint256 p) internal view returns (int256) {\\n unchecked {\\n uint256 raised = modExp(a, (p - 1) / uint256(2), p);\\n\\n if (raised == 0 || raised == 1) {\\n return int256(raised);\\n } else if (raised == p - 1) {\\n return -1;\\n }\\n\\n require(false, \\\"Failed to calculate legendre.\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x57bb4ab4f257715c6daafa1a4e4bc6dd9edfe45afca797e5b8e98db577826505\",\"license\":\"GPL-3.0-only\"},\"contracts/libraries/Relay.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"./AltBn128.sol\\\";\\nimport \\\"./BLS.sol\\\";\\nimport \\\"./Groups.sol\\\";\\n\\nlibrary Relay {\\n using SafeERC20 for IERC20;\\n\\n struct Data {\\n // Total count of all requests.\\n uint64 requestCount;\\n // Data of current request.\\n // Request identifier.\\n uint64 currentRequestID;\\n // Identifier of group responsible for signing.\\n uint64 currentRequestGroupID;\\n // Request start block.\\n uint64 currentRequestStartBlock;\\n // Previous entry value.\\n AltBn128.G1Point previousEntry;\\n // Time in blocks during which a result is expected to be submitted.\\n uint32 relayEntrySoftTimeout;\\n // Hard timeout in blocks for a group to submit the relay entry.\\n uint32 relayEntryHardTimeout;\\n // Slashing amount for not submitting relay entry\\n uint96 relayEntrySubmissionFailureSlashingAmount;\\n }\\n\\n /// @notice Seed used as the first relay entry value.\\n /// It's a G1 point G * PI =\\n /// G * 31415926535897932384626433832795028841971693993751058209749445923078164062862\\n /// Where G is the generator of G1 abstract cyclic group.\\n bytes public constant relaySeed =\\n hex\\\"15c30f4b6cf6dbbcbdcc10fe22f54c8170aea44e198139b776d512d8f027319a1b9e8bfaf1383978231ce98e42bafc8129f473fc993cf60ce327f7d223460663\\\";\\n\\n event RelayEntryRequested(\\n uint256 indexed requestId,\\n uint64 groupId,\\n bytes previousEntry\\n );\\n\\n event RelayEntrySubmitted(\\n uint256 indexed requestId,\\n address submitter,\\n bytes entry\\n );\\n\\n event RelayEntryTimedOut(\\n uint256 indexed requestId,\\n uint64 terminatedGroupId\\n );\\n\\n /// @notice Initializes the very first `previousEntry` with an initial\\n /// `relaySeed` value. Can be performed only once.\\n function initSeedEntry(Data storage self) internal {\\n require(\\n self.previousEntry.x == 0 && self.previousEntry.y == 0,\\n \\\"Seed entry already initialized\\\"\\n );\\n self.previousEntry = AltBn128.g1Unmarshal(relaySeed);\\n }\\n\\n /// @notice Creates a request to generate a new relay entry, which will\\n /// include a random number (by signing the previous entry's\\n /// random number).\\n /// @param groupId Identifier of the group chosen to handle the request.\\n function requestEntry(Data storage self, uint64 groupId) internal {\\n require(\\n !isRequestInProgress(self),\\n \\\"Another relay request in progress\\\"\\n );\\n\\n uint64 currentRequestId = ++self.requestCount;\\n\\n self.currentRequestID = currentRequestId;\\n self.currentRequestGroupID = groupId;\\n self.currentRequestStartBlock = uint64(block.number);\\n\\n emit RelayEntryRequested(\\n currentRequestId,\\n groupId,\\n AltBn128.g1Marshal(self.previousEntry)\\n );\\n }\\n\\n /// @notice Creates a new relay entry. Gas-optimized version that can be\\n /// called only before the soft timeout. This should be the majority\\n /// of cases.\\n /// @param entry Group BLS signature over the previous entry.\\n /// @param groupPubKey Public key of the group which signed the relay entry.\\n function submitEntryBeforeSoftTimeout(\\n Data storage self,\\n bytes calldata entry,\\n bytes storage groupPubKey\\n ) internal {\\n require(\\n block.number < softTimeoutBlock(self),\\n \\\"Relay entry soft timeout passed\\\"\\n );\\n _submitEntry(self, entry, groupPubKey);\\n }\\n\\n /// @notice Creates a new relay entry. Can be called at any time.\\n /// In case the soft timeout has not been exceeded, it is more\\n /// gas-efficient to call the second variation of `submitEntry`.\\n /// @param entry Group BLS signature over the previous entry.\\n /// @param groupPubKey Public key of the group which signed the relay entry.\\n /// @return slashingAmount Amount by which group members should be slashed\\n /// in case the relay entry was submitted after the soft timeout.\\n /// The value is zero if entry was submitted on time.\\n function submitEntry(\\n Data storage self,\\n bytes calldata entry,\\n bytes storage groupPubKey\\n ) internal returns (uint96) {\\n // If the soft timeout has been exceeded apply stake slashing for\\n // all group members. Otherwise, no slashing.\\n uint96 slashingAmount = calculateSlashingAmount(self);\\n\\n _submitEntry(self, entry, groupPubKey);\\n\\n return slashingAmount;\\n }\\n\\n function _submitEntry(\\n Data storage self,\\n bytes calldata entry,\\n bytes storage groupPubKey\\n ) internal {\\n require(isRequestInProgress(self), \\\"No relay request in progress\\\");\\n require(!hasRequestTimedOut(self), \\\"Relay request timed out\\\");\\n\\n require(\\n BLS._verify(\\n AltBn128.g2Unmarshal(groupPubKey),\\n self.previousEntry,\\n AltBn128.g1Unmarshal(entry)\\n ),\\n \\\"Invalid entry\\\"\\n );\\n\\n emit RelayEntrySubmitted(self.currentRequestID, msg.sender, entry);\\n\\n self.previousEntry = AltBn128.g1Unmarshal(entry);\\n self.currentRequestID = 0;\\n self.currentRequestGroupID = 0;\\n self.currentRequestStartBlock = 0;\\n }\\n\\n /// @notice Calculates the slashing amount for all group members.\\n /// @dev Must be used when a soft timeout was hit.\\n /// @return Amount by which group members should be slashed\\n /// in case the relay entry was submitted after the soft timeout.\\n function calculateSlashingAmount(Data storage self)\\n internal\\n view\\n returns (uint96)\\n {\\n uint256 softTimeout = softTimeoutBlock(self);\\n\\n if (block.number > softTimeout) {\\n uint256 submissionDelay = block.number - softTimeout;\\n // The slashing amount is a result of a calculated portion of the submission\\n // delay blocks. The max delay can be set up to relayEntryHardTimeout, which\\n // in consequence sets the max slashing amount.\\n if (submissionDelay > self.relayEntryHardTimeout) {\\n submissionDelay = self.relayEntryHardTimeout;\\n }\\n\\n return\\n uint96(\\n (submissionDelay *\\n self.relayEntrySubmissionFailureSlashingAmount) /\\n self.relayEntryHardTimeout\\n );\\n }\\n\\n return 0;\\n }\\n\\n /// @notice Updates relay-related parameters\\n /// @param _relayEntrySoftTimeout New relay entry soft timeout value.\\n /// It is the time in blocks during which a result is expected to be\\n /// submitted so that the group is not slashed.\\n /// @param _relayEntryHardTimeout New relay entry hard timeout value.\\n /// It is the time in blocks for a group to submit the relay entry\\n /// before slashing for the full slashing amount happens.\\n function setTimeouts(\\n Data storage self,\\n uint256 _relayEntrySoftTimeout,\\n uint256 _relayEntryHardTimeout\\n ) internal {\\n require(!isRequestInProgress(self), \\\"Relay request in progress\\\");\\n\\n self.relayEntrySoftTimeout = uint32(_relayEntrySoftTimeout);\\n self.relayEntryHardTimeout = uint32(_relayEntryHardTimeout);\\n }\\n\\n /// @notice Set relayEntrySubmissionFailureSlashingAmount parameter.\\n /// @param newRelayEntrySubmissionFailureSlashingAmount New value of\\n /// the parameter.\\n function setRelayEntrySubmissionFailureSlashingAmount(\\n Data storage self,\\n uint96 newRelayEntrySubmissionFailureSlashingAmount\\n ) internal {\\n require(!isRequestInProgress(self), \\\"Relay request in progress\\\");\\n\\n self\\n .relayEntrySubmissionFailureSlashingAmount = newRelayEntrySubmissionFailureSlashingAmount;\\n }\\n\\n /// @notice Retries the current relay request in case a relay entry\\n /// timeout was reported.\\n /// @param newGroupId ID of the group chosen to retry the current request.\\n function retryOnEntryTimeout(Data storage self, uint64 newGroupId)\\n internal\\n {\\n require(hasRequestTimedOut(self), \\\"Relay request did not time out\\\");\\n\\n uint64 currentRequestId = self.currentRequestID;\\n uint64 previousGroupId = self.currentRequestGroupID;\\n\\n emit RelayEntryTimedOut(currentRequestId, previousGroupId);\\n\\n self.currentRequestGroupID = newGroupId;\\n self.currentRequestStartBlock = uint64(block.number);\\n\\n emit RelayEntryRequested(\\n currentRequestId,\\n newGroupId,\\n AltBn128.g1Marshal(self.previousEntry)\\n );\\n }\\n\\n /// @notice Cleans up the current relay request in case a relay entry\\n /// timeout was reported.\\n function cleanupOnEntryTimeout(Data storage self) internal {\\n require(hasRequestTimedOut(self), \\\"Relay request did not time out\\\");\\n\\n emit RelayEntryTimedOut(\\n self.currentRequestID,\\n self.currentRequestGroupID\\n );\\n\\n self.currentRequestID = 0;\\n self.currentRequestGroupID = 0;\\n self.currentRequestStartBlock = 0;\\n }\\n\\n /// @notice Returns whether a relay entry request is currently in progress.\\n /// @return True if there is a request in progress. False otherwise.\\n function isRequestInProgress(Data storage self)\\n internal\\n view\\n returns (bool)\\n {\\n return self.currentRequestID != 0;\\n }\\n\\n /// @notice Returns whether the current relay request has timed out.\\n /// @return True if the request timed out. False otherwise.\\n function hasRequestTimedOut(Data storage self)\\n internal\\n view\\n returns (bool)\\n {\\n uint256 _relayEntryTimeout = self.relayEntrySoftTimeout +\\n self.relayEntryHardTimeout;\\n\\n return\\n isRequestInProgress(self) &&\\n block.number > self.currentRequestStartBlock + _relayEntryTimeout;\\n }\\n\\n /// @notice Calculates soft timeout block for the pending relay request.\\n /// @return The soft timeout block\\n function softTimeoutBlock(Data storage self)\\n internal\\n view\\n returns (uint256)\\n {\\n return self.currentRequestStartBlock + self.relayEntrySoftTimeout;\\n }\\n}\\n\",\"keccak256\":\"0x0ff1513ef6dceda503d19d1798d9de97510ec3c033b9a59aa240ce2a3052e6d3\",\"license\":\"GPL-3.0-only\"}},\"version\":1}",
2442
+ "bytecode": "0x60a06040523480156200001157600080fd5b5060405162004efa38038062004efa833981016040819052620000349162000154565b6200003f3362000104565b6001600160a01b0382166200009b5760405162461bcd60e51b815260206004820152601660248201527f5a65726f2d61646472657373207265666572656e63650000000000000000000060448201526064015b60405180910390fd5b80600003620000ed5760405162461bcd60e51b815260206004820152601360248201527f4e6f20676f7665726e616e63652064656c617900000000000000000000000000604482015260640162000092565b6001600160a01b0390911660805260335562000190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156200016857600080fd5b82516001600160a01b03811681146200018057600080fd5b6020939093015192949293505050565b608051614bf7620003036000396000818161080501528181610eba01528181610f7a015281816110a10152818161114f0152818161136c0152818161143f0152818161154801528181611607015281816118ac0152818161196101528181611acb01528181611b9f01528181611eb101528181611f6901528181612073015281816121cb015281816122a0015281816123c001528181612479015281816125880152818161264001528181612802015281816128c1015281816129d601528181612aa801528181612c6301528181612d2201528181612e2e01528181612f510152818161301101528181613126015281816131d4015281816132ef015281816133a6015281816135dc015281816136950152818161387f0152818161395201528181613a7801528181613c1a01528181613cda01528181613f5001528181614010015281816141770152818161422f0152818161434801528181614400015281816145bb015261468f0152614bf76000f3fe608060405234801561001057600080fd5b50600436106107bb5760003560e01c80638b63cc22116103f5578063af21b29011610215578063d24521aa11610130578063e731cc53116100c3578063ee8e6e5e11610092578063ee8e6e5e14610dd5578063f0bb6ce814610dde578063f2fde38b14610de6578063fb5ccedc14610df9578063fe3bb37014610e0257600080fd5b8063e731cc5314610da9578063e79b8c4614610db1578063e8507b0614610dba578063ec9d1d9614610dcd57600080fd5b8063dde37ab8116100ff578063dde37ab814610d88578063de0ce4c914610d90578063df5ee8f614610d98578063e259b55114610da157600080fd5b8063d24521aa14610d67578063d31121de14610d6f578063d57da0b814610d77578063dbc439c714610d7f57600080fd5b8063c17a1471116101a8578063cb1ec15311610177578063cb1ec15314610d3a578063ccc5488a14610d43578063cdfaeb9814610d4b578063ce123d2814610d5457600080fd5b8063c17a147114610d03578063c1b2ba9714610d16578063c268650e14610d1f578063c97e8feb14610d3257600080fd5b8063ba5c9e7e116101e4578063ba5c9e7e14610ccc578063bba3293914610cd4578063bcc5d20414610cdd578063c16d606f14610cf057600080fd5b8063af21b29014610c94578063b0ed20bb14610c9d578063b1fae48b14610cb0578063b392e3be14610cb957600080fd5b80639de6bc9d11610310578063a72aedae116102a3578063ac21f57c11610272578063ac21f57c14610c5f578063aceb164814610c72578063ae1a332514610c7b578063ae98cbf014610c83578063aea6933914610c8c57600080fd5b8063a72aedae14610c29578063a7b9a7a014610c3c578063a955b3f314610c44578063a9b32c3d14610c5757600080fd5b8063a01bc828116102df578063a01bc82814610bfd578063a0a94bbb14610c05578063a5b9ab4d14610c0d578063a6d025f114610c1657600080fd5b80639de6bc9d14610bd05780639ec67b3114610bd85780639f40edf014610bec5780639fc3da9614610bf557600080fd5b8063914f512f11610388578063985e648711610357578063985e648714610ba55780639949d70e14610bb85780639b849b9214610bc05780639cde7da914610bc857600080fd5b8063914f512f14610b6e57806395ba105d14610b7657806396fd955e14610b7f5780639810f32714610b9257600080fd5b80638d2e0c3c116103c45780638d2e0c3c14610b395780638da5cb5b14610b425780638e0442f814610b53578063914adf8f14610b6657600080fd5b80638b63cc2214610b0e5780638bc32f3314610b215780638c5f0d6714610b295780638cdb432914610b3157600080fd5b80634885b171116105e057806364e32d74116104fb578063785180e71161048e57806382e70cb81161045d57806382e70cb814610ae4578063863b45a414610aec5780638837037714610af5578063894ee96814610afe5780638a4f77ef14610b0657600080fd5b8063785180e714610ab8578063798f022314610acb5780637ab18adf14610ad35780637b81ef5214610adc57600080fd5b8063692be745116104ca578063692be74514610a95578063715018a614610a9e578063765a783214610aa657806377bf781414610aaf57600080fd5b806364e32d7414610a54578063660f903114610a5c578063663032cd14610a6f5780636795afe614610a8257600080fd5b8063542ced771161057357806361038b911161054257806361038b9114610a2857806361d4b5ef14610a3157806362c78d0914610a39578063648392ac14610a4157600080fd5b8063542ced77146109f15780635b6bd01714610a045780635c07405614610a0c5780635f735a1014610a1f57600080fd5b80634ca107cc116105af5780634ca107cc146109c45780634cf11abc146109cd5780634ed05ade146109d557806352f1bf14146109de57600080fd5b80634885b17114610996578063488a4b261461099f578063495cb121146109a85780634b928642146109bb57600080fd5b80632d318efc116106db578063363388331161066e5780633bf8a5381161063d5780633bf8a5381461093d5780633edf74e71461096a578063412bd7b41461097d578063429cdaa814610985578063481d021f1461098e57600080fd5b8063363388331461091057806337f547901461091957806337fa5d51146109215780633b7b1b081461093457600080fd5b80632ff8aa33116106aa5780632ff8aa33146108e357806333a17f98146108f6578063345cdef5146108fe5780633611f0021461090757600080fd5b80632d318efc146108c15780632d340433146108c95780632f006f4e146108d25780632f505f1f146108db57600080fd5b80631937c64711610753578063209e80ea11610722578063209e80ea14610895578063260b5a85146108a857806326825a9d146108b15780632b702150146108b957600080fd5b80631937c6471461087257806319f1103f1461087a5780631e44a72c146108835780631ff566c71461088c57600080fd5b8063152ba58f1161078f578063152ba58f146107f8578063153622b314610800578063154028f41461083f5780631722dd291461086a57600080fd5b80626b050c146107c0578063040215af146107dc57806306201e1c146107e557806314385adb146107ef575b600080fd5b6107c960315481565b6040519081526020015b60405180910390f35b6107c9600c5481565b6107ed610e15565b005b6107c960205481565b6107c9610ff9565b6108277f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016107d3565b601b54610852906001600160601b031681565b6040516001600160601b0390911681526020016107d3565b6107ed61100b565b6107c96111c2565b6107c9601e5481565b6107c960085481565b6107c960025481565b6107ed6108a33660046148db565b6111cf565b6107c960225481565b6107ed611220565b6107c96112c4565b6107ed6112d1565b6107c9600d5481565b6107c960105481565b6107ed6114ad565b6107ed6108f13660046148db565b611686565b6107c96116f0565b6107c9602f5481565b6107c960135481565b6107c960165481565b6107c96116fd565b6107ed61092f3660046148db565b61170a565b6107c960155481565b6025546109519067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016107d3565b6107ed6109783660046148db565b611754565b6107c9611809565b6107c9600f5481565b6107ed611816565b6107c960095481565b6107c960285481565b6107ed6109b6366004614909565b6119cd565b6107c960215481565b6107c960265481565b6107ed611a30565b6107c960185481565b6107ed6109ec3660046148db565b611c0d565b6107ed6109ff3660046148db565b611cb3565b6107c9611cfd565b6107ed610a1a3660046148db565b611d0a565b6107c9602d5481565b6107c960305481565b6107c9611db2565b6107c9611dbf565b6107ed610a4f3660046148db565b611dcc565b6107ed611e16565b6107ed610a6a36600461493c565b611fe7565b6107ed610a7d366004614975565b61204c565b6107ed610a903660046148db565b6120d2565b6107c9601d5481565b6107ed61211c565b6107c960075481565b6107c960295481565b601954610852906001600160601b031681565b6107ed612130565b6107c9601a5481565b6107c961230e565b6107c961231b565b6107c960065481565b6107c960245481565b6107ed612328565b6107ed6124ed565b6107ed610b1c3660046148db565b6126be565b6107ed61276a565b6107c961292e565b6107ed61293b565b6107c9600a5481565b6000546001600160a01b0316610827565b6107ed610b613660046148db565b612b17565b6107ed612bcb565b6107c9612d8f565b6107c960015481565b602354610852906001600160601b031681565b6107ed610ba0366004614909565b612d9c565b6107ed610bb3366004614990565b612dff565b6107c9612e8e565b6107c9612e9b565b6107c9612ea8565b6107ed612eb5565b6027546109519067ffffffffffffffff1681565b6107c9601c5481565b6107ed613090565b6107c9613247565b6107ed613254565b6107c960145481565b6107ed610c243660046148db565b613425565b6107ed610c37366004614975565b61346f565b6107ed613544565b6107ed610c523660046148db565b613709565b6107c9613774565b6107ed610c6d366004614909565b613781565b6107c960045481565b6107ed6137e4565b6107c960055481565b6107ed6139c0565b6107c9602a5481565b6107ed610cab3660046148db565b613aee565b6107c9602c5481565b6107ed610cc73660046148db565b613b38565b6107ed613b82565b6107c960335481565b601754610852906001600160601b031681565b6107ed610cfe3660046148db565b613d46565b600354610827906001600160a01b031681565b6107c9602e5481565b6107ed610d2d3660046148db565b613e05565b6107c9613eab565b6107c9601f5481565b6107ed613eb8565b6107c9602b5481565b6107ed610d62366004614909565b61407c565b6107ed6140df565b6107c96142a3565b6107ed6142b0565b6107c960115481565b6107c9614474565b6107c9614481565b6107c960125481565b6107c961448e565b6107c961449b565b6107c9600e5481565b6107ed610dc83660046148db565b6144a8565b6107c9614513565b6107c9600b5481565b6107ed614520565b6107ed610df4366004614975565b6146fd565b6107c960325481565b6107ed610e1036600461493c565b614776565b610e1d6147db565b60285460008111610e495760405162461bcd60e51b8152600401610e40906149cc565b60405180910390fd5b603354610e5682426149fa565b1015610e745760405162461bcd60e51b8152600401610e4090614a21565b60275460405167ffffffffffffffff90911681527f6a7551372930a2bc4aec844a266609ca90cf9b805f875e92680e901b43d5273f9060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190614a56565b506027546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff8084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b158015610fc657600080fd5b505af1158015610fda573d6000803e3d6000fd5b5050600060285550506027805467ffffffffffffffff19169055505050565b6000611006601454614835565b905090565b6110136147db565b600854600081116110365760405162461bcd60e51b8152600401610e40906149cc565b60335461104382426149fa565b10156110615760405162461bcd60e51b8152600401610e4090614a21565b7f1aa56185678cf82df5663d3bf97731024fc6da8f9ab832de58fe6411bb7aacad60075460405161109491815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa1580156110fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111219190614aa3565b600754604051639a7d093560e01b8152600481018590526024810191909152604481018290529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b5050600060088190556007555050505050565b6000611006600654614835565b6111d76147db565b601d81905542601e8190556040805183815260208101929092527f523803e7f157ab532da5ae1e1d19b71f16b18376cf65a301ef8e3f07076d6bfd91015b60405180910390a150565b6112286147db565b6002546000811161124b5760405162461bcd60e51b8152600401610e40906149cc565b60335461125882426149fa565b10156112765760405162461bcd60e51b8152600401610e4090614a21565b7f657e578b1ed229f1e01ab5ce4700399f19ddd24b09b071ab9e72122f18aa72976001546040516112a991815260200190565b60405180910390a15060018054603355600060028190559055565b6000611006601054614835565b6112d96147db565b600e54600081116112fc5760405162461bcd60e51b8152600401610e40906149cc565b60335461130982426149fa565b10156113275760405162461bcd60e51b8152600401610e4090614a21565b7fc2b1fc49f84728c2be30441ba73a73fe63ff40017b462dca6045e8b5933dfd97600d5460405161135a91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156113c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ec9190614ad1565b600d546040516377a5a7bd60e01b815260048101889052602481019190915260448101859052606481018490526084810183905260a48101829052959a5092985090965094509250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561148357600080fd5b505af1158015611497573d6000803e3d6000fd5b50506000600e819055600d555050505050505050565b6114b56147db565b602454600081116114d85760405162461bcd60e51b8152600401610e40906149cc565b6033546114e582426149fa565b10156115035760405162461bcd60e51b8152600401610e4090614a21565b6023546040516001600160601b0390911681527fca5de5c00e5da52e22f64b23ecfa308e487441bcbd0f4b84657799102e3ee3719060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156115a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c89190614a56565b6023546040516301409c5360e71b81526001600160601b03909116600482015267ffffffffffffffff80841660248301528216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063a04e298090606401600060405180830381600087803b15801561165457600080fd5b505af1158015611668573d6000803e3d6000fd5b505060006024555050602380546001600160601b0319169055505050565b61168e6147db565b60648111156116af5760405162461bcd60e51b8152600401610e4090614b1b565b601f81905542602081815560408051848152918201929092527f236b3b5a701c1727d0ddd01db13475e0da9be45561decb6f0d3d958c18e09e8b9101611215565b6000611006603254614835565b6000611006602054614835565b6117126147db565b60018190554260028190556040805183815260208101929092527f1ed485551399b30c188ed4d426c6c62d7b703b9fec6b486c70a3fe616c2707c89101611215565b61175c6147db565b600081116117c75760405162461bcd60e51b815260206004820152603260248201527f444b47207375626d697474657220707265636564656e636520706572696f642060448201527106c656e677468206d757374206265203e20360741b6064820152608401610e40565b60158190554260168190556040805183815260208101929092527f69f992e32ba993676818a20dfe808b5d41e0db4bdd3a52917701443500a423ca9101611215565b6000611006602c54614835565b61181e6147db565b600654600081116118415760405162461bcd60e51b8152600401610e40906149cc565b60335461184e82426149fa565b101561186c5760405162461bcd60e51b8152600401610e4090614a21565b7f63db42a2e13b78bf39d9f3c14718c3c925ccdf3e30a0477d5a7626914164620260055460405161189f91815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192c9190614aa3565b600554604051639a7d093560e01b81526004810191909152602481018390526044810182905291945092506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169150639a7d093590606401600060405180830381600087803b1580156119a657600080fd5b505af11580156119ba573d6000803e3d6000fd5b5050600060068190556005555050505050565b6119d56147db565b601980546001600160601b0319166001600160601b03831690811790915542601a8190556040805192835260208301919091527f8087387fa6bcbf89a9e273adcf21735f21e89ae8024417df321d8ccc106123089101611215565b611a386147db565b60105460008111611a5b5760405162461bcd60e51b8152600401610e40906149cc565b603354611a6882426149fa565b1015611a865760405162461bcd60e51b8152600401610e4090614a21565b7f54eb240e49fe7d2dc26863f9a2682d5834812e39417dbac77797c3b01b97395c600f54604051611ab991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015611b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4b9190614ad1565b600f546040516377a5a7bd60e01b815260048101889052602481018790526044810191909152606481018490526084810183905260a48101829052959a509398509096509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b158015611be357600080fd5b505af1158015611bf7573d6000803e3d6000fd5b505060006010819055600f555050505050505050565b611c156147db565b60008111611c715760405162461bcd60e51b8152602060048201526024808201527f47726f7570206372656174696f6e206672657175656e6379206d7573742062656044820152630203e20360e41b6064820152608401610e40565b600b81905542600c8190556040805183815260208101929092527f9356f2202b7c2dd20837653ce617753f36c435d28464b7f8c4c4c174acecec3d9101611215565b611cbb6147db565b602b81905542602c8190556040805183815260208101929092527fe7f67ed355ceb941da1b6600c508f5493967c944c9fee75936aaa986b9e0344c9101611215565b6000611006601e54614835565b611d126147db565b60008111611d705760405162461bcd60e51b815260206004820152602560248201527f47726f7570206c69666574696d65206d75737420626520677265617465722074604482015264068616e20360dc1b6064820152608401610e40565b600d81905542600e8190556040805183815260208101929092527f2061f522ba42a34f2907b875dca3bf5f0d999cacbbb635e894ee3c5792727e649101611215565b6000611006602854614835565b6000611006600854614835565b611dd46147db565b602f8190554260308190556040805183815260208101929092527f6ff3903999be3f8c1262f638998917b6d6c6f8097cb7cb9e60edaa1a5f2a66719101611215565b611e1e6147db565b601c5460008111611e415760405162461bcd60e51b8152600401610e40906149cc565b603354611e4e82426149fa565b1015611e6c5760405162461bcd60e51b8152600401610e4090614a21565b601b546040516001600160601b0390911681527f13f3e65295154bda4919d5f46898c2284edbf9283ee94654515cec984e767c809060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa158015611f0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f319190614b49565b50601b54604051630519e99160e01b81526001600160601b0380851660048301528084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b158015611fb557600080fd5b505af1158015611fc9573d6000803e3d6000fd5b50506000601c555050601b80546001600160601b0319169055505050565b611fef6147db565b6027805467ffffffffffffffff191667ffffffffffffffff83169081179091554260288190556040805192835260208301919091527f979c18cc9822195c2af34f89e0713a14edbd9713b32932c60471951cc1fa02db9101611215565b6120546147db565b60405163663032cd60e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063663032cd90602401600060405180830381600087803b1580156120b757600080fd5b505af11580156120cb573d6000803e3d6000fd5b5050505050565b6120da6147db565b60118190554260128190556040805183815260208101929092527fff34014c09b30234094b14f309369c4b204ab5f24daa98f6922ac40a04768bf09101611215565b6121246147db565b61212e600061488b565b565b6121386147db565b6012546000811161215b5760405162461bcd60e51b8152600401610e40906149cc565b60335461216882426149fa565b10156121865760405162461bcd60e51b8152600401610e4090614a21565b7ffc489bb20492c4590e5a1edb8e096301dd7e9c24843a5af9221ddafff010f0f06011546040516121b991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224b9190614ad1565b6011546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101919091526084810183905260a48101829052959a50939850919650909450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156122e457600080fd5b505af11580156122f8573d6000803e3d6000fd5b5050600060128190556011555050505050505050565b6000611006602454614835565b6000611006602654614835565b6123306147db565b603054600081116123535760405162461bcd60e51b8152600401610e40906149cc565b60335461236082426149fa565b101561237e5760405162461bcd60e51b8152600401610e4090614a21565b7fc02f8fddd9d337adf38d4f97d3ab8c91b69075b48db9bc25c461b0d02c3d4092602f546040516123b191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190614b8b565b602f54604051635868086b60e11b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b1580156124c557600080fd5b505af11580156124d9573d6000803e3d6000fd5b505060006030819055602f55505050505050565b6124f56147db565b601a54600081116125185760405162461bcd60e51b8152600401610e40906149cc565b60335461252582426149fa565b10156125435760405162461bcd60e51b8152600401610e4090614a21565b6019546040516001600160601b0390911681527fe1adae42a74e6bb380e06f34e96abe3134e824a1a152a8e6a7458be153404d179060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa1580156125e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126089190614b49565b601954604051630519e99160e01b81526001600160601b038086166004830152918216602482015290821660448201529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b15801561268c57600080fd5b505af11580156126a0573d6000803e3d6000fd5b50506000601a555050601980546001600160601b0319169055505050565b6126c66147db565b600081116127285760405162461bcd60e51b815260206004820152602960248201527f444b4720726573756c74207375626d697373696f6e2074696d656f7574206d7560448201526807374206265203e20360bc1b6064820152608401610e40565b60138190554260148190556040805183815260208101929092527f77bd6dceb389516c704e337d2e53bab8397e3fd1de7e3b852090742804ba13b49101611215565b6127726147db565b602c54600081116127955760405162461bcd60e51b8152600401610e40906149cc565b6033546127a282426149fa565b10156127c05760405162461bcd60e51b8152600401610e4090614a21565b7ff71bf0b76dcaef665875c3a1d4959efda6ea75c7171f5fae1bd305f7c8509283602b546040516127f391815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561285e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128829190614b8b565b602b54604051635868086b60e11b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063b0d010d690608401600060405180830381600087803b15801561290657600080fd5b505af115801561291a573d6000803e3d6000fd5b50506000602c819055602b55505050505050565b6000611006601854614835565b6129436147db565b600c54600081116129665760405162461bcd60e51b8152600401610e40906149cc565b60335461297382426149fa565b10156129915760405162461bcd60e51b8152600401610e4090614a21565b7fe3daa3940e1269d029800f83e889021793ccd69dd79a7152b9171a3071eb45a3600b546040516129c491815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a569190614ad1565b600b546040516377a5a7bd60e01b815260048101919091526024810186905260448101859052606481018490526084810183905260a48101829052949a50929850909650945092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506377a5a7bd9060c401600060405180830381600087803b158015612aed57600080fd5b505af1158015612b01573d6000803e3d6000fd5b50506000600c819055600b555050505050505050565b612b1f6147db565b600a811015612b895760405162461bcd60e51b815260206004820152603060248201527f444b4720726573756c74206368616c6c656e676520706572696f64206c656e6760448201526f07468206d757374206265203e3d2031360841b6064820152608401610e40565b600f8190554260108190556040805183815260208101929092527f4bc54f06db7242d34e1d1cdd7b4b33807a8210c54fc440ba45e6e5ffa04e083d9101611215565b612bd36147db565b601e5460008111612bf65760405162461bcd60e51b8152600401610e40906149cc565b603354612c0382426149fa565b1015612c215760405162461bcd60e51b8152600401610e4090614a21565b7f0945b46b311d9dd20cdadf139b3449fe2e50026e619f33cabedbd7461c429076601d54604051612c5491815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015612cbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce39190614b8b565b601d54604051630ce591ab60e21b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063339646ac90608401600060405180830381600087803b158015612d6757600080fd5b505af1158015612d7b573d6000803e3d6000fd5b50506000601e819055601d55505050505050565b6000611006602a54614835565b612da46147db565b601b80546001600160601b0319166001600160601b03831690811790915542601c8190556040805192835260208301919091527f060327865259e01939f90eed5ad911c6e0509663b7671bccd0f6382f56aba4d39101611215565b612e076147db565b60405163985e648760e01b81526001600160a01b03838116600483015282151560248301527f0000000000000000000000000000000000000000000000000000000000000000169063985e648790604401600060405180830381600087803b158015612e7257600080fd5b505af1158015612e86573d6000803e3d6000fd5b505050505050565b6000611006601a54614835565b6000611006600c54614835565b6000611006601254614835565b612ebd6147db565b60265460008111612ee05760405162461bcd60e51b8152600401610e40906149cc565b603354612eed82426149fa565b1015612f0b5760405162461bcd60e51b8152600401610e4090614a21565b60255460405167ffffffffffffffff90911681527fcc354ece588e8fa730a65a72ebb90039caf81a2a9efedf80e8124566d42a75e89060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd19190614a56565b506025546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff9182166024820152908216604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b15801561305d57600080fd5b505af1158015613071573d6000803e3d6000fd5b5050600060265550506025805467ffffffffffffffff19169055505050565b6130986147db565b600a54600081116130bb5760405162461bcd60e51b8152600401610e40906149cc565b6033546130c882426149fa565b10156130e65760405162461bcd60e51b8152600401610e4090614a21565b7f01e43c4ca2dc8df5a6c64198b1ad31e61ff7584833e5a7933892dd79d8eb905260095460405161311991815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015613182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a69190614aa3565b50600954604051639a7d093560e01b81526004810184905260248101839052604481019190915291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561322057600080fd5b505af1158015613234573d6000803e3d6000fd5b50506000600a8190556009555050505050565b6000611006600254614835565b61325c6147db565b6018546000811161327f5760405162461bcd60e51b8152600401610e40906149cc565b60335461328c82426149fa565b10156132aa5760405162461bcd60e51b8152600401610e4090614a21565b6017546040516001600160601b0390911681527f5e7ca6fb8d090a2753e006c53b0aab79da28ab5e198b62cc105bda8f96caa6a09060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa15801561334b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061336f9190614b49565b601754604051630519e99160e01b81526001600160601b0391821660048201528184166024820152908216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169150630519e99190606401600060405180830381600087803b1580156133f357600080fd5b505af1158015613407573d6000803e3d6000fd5b505060006018555050601780546001600160601b0319169055505050565b61342d6147db565b602d81905542602e8190556040805183815260208101929092527f8ff92b4fa51728d3b3bebd82f5bcfa8904b0278abbce025a1e33aaf9719fdb0d9101611215565b6134776147db565b6001600160a01b0381166134e95760405162461bcd60e51b815260206004820152603360248201527f4e65772072616e646f6d20626561636f6e20676f7665726e616e636520616464604482015272726573732063616e6e6f74206265207a65726f60681b6064820152608401610e40565b600380546001600160a01b0319166001600160a01b0383169081179091554260048190556040805192835260208301919091527fcda4dd0dbaee4278532e4689e026f08f707ec8602188caa303750b225cde00789101611215565b61354c6147db565b6022546000811161356f5760405162461bcd60e51b8152600401610e40906149cc565b60335461357c82426149fa565b101561359a5760405162461bcd60e51b8152600401610e4090614a21565b7f32aac559d8ae735853362fec3c6751b37b45f12097c074ee06d51b10180c68626021546040516135cd91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365c9190614b8b565b602154604051630ce591ab60e21b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b1580156136e157600080fd5b505af11580156136f5573d6000803e3d6000fd5b505060006022819055602155505050505050565b6137116147db565b60648111156137325760405162461bcd60e51b8152600401610e4090614b1b565b60218190554260228190556040805183815260208101929092527fb62064224fade801c12ce2e348d8fff15f8e451792137664811b44b6ffe37d919101611215565b6000611006600e54614835565b6137896147db565b601780546001600160601b0319166001600160601b0383169081179091554260188190556040805192835260208301919091527fb5da59c72c3f617da3620449ee7c88d5b8a81e1f98e9f61fc62207ecab6b099f9101611215565b6137ec6147db565b6016546000811161380f5760405162461bcd60e51b8152600401610e40906149cc565b60335461381c82426149fa565b101561383a5760405162461bcd60e51b8152600401610e4090614a21565b7ffc88a5167b8569e72b62f4b76b3caae7699e46c7f6f16a8d011b135ac613acc460155460405161386d91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156138db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138ff9190614ad1565b506015546040516377a5a7bd60e01b8152600481018790526024810186905260448101859052606481018490526084810183905260a4810191909152949950929750909550935091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561399657600080fd5b505af11580156139aa573d6000803e3d6000fd5b5050600060168190556015555050505050505050565b6139c86147db565b600454600081116139eb5760405162461bcd60e51b8152600401610e40906149cc565b6033546139f882426149fa565b1015613a165760405162461bcd60e51b8152600401610e4090614a21565b6003546040516001600160a01b0390911681527f2682a33c437aa00b19b3e527d140e9800f735bc8fab66653e6ae22c8d07b4a909060200160405180910390a16003546040516334e2fffd60e21b81526001600160a01b0391821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063d38bfff490602401600060405180830381600087803b158015613abe57600080fd5b505af1158015613ad2573d6000803e3d6000fd5b505060006004555050600380546001600160a01b031916905550565b613af66147db565b60318190554260328190556040805183815260208101929092527f9eeb84ca445446640c66e65b8036794dd92ad3c3b9177714c8802c2644ab79e59101611215565b613b406147db565b60078190554260088190556040805183815260208101929092527f9cd90f9d45b916da6108ff464eaded2b92aa41867f12437a20b57247298086979101611215565b613b8a6147db565b60325460008111613bad5760405162461bcd60e51b8152600401610e40906149cc565b603354613bba82426149fa565b1015613bd85760405162461bcd60e51b8152600401610e4090614a21565b7f274cf9dfd48eeb8969817e347b3a2951ff7b3127772bd70827012266466ae229603154604051613c0b91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa158015613c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9a9190614b8b565b50603154604051635868086b60e11b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b0d010d690608401600060405180830381600087803b158015613d1e57600080fd5b505af1158015613d32573d6000803e3d6000fd5b505060006032819055603155505050505050565b613d4e6147db565b600081118015613d615750620f42408111155b613dc35760405162461bcd60e51b815260206004820152602d60248201527f43616c6c6261636b20676173206c696d6974206d757374206265203e2030206160448201526c06e64203c3d203130303030303609c1b6064820152608401610e40565b600981905542600a8190556040805183815260208101929092527f0aeac6506f5606a033c22dd1659065c5f75e5ea933fd3b49948ea79a59759b239101611215565b613e0d6147db565b60008111613e695760405162461bcd60e51b8152602060048201526024808201527f52656c617920656e74727920736f66742074696d656f7574206d7573742062656044820152630203e20360e41b6064820152608401610e40565b60058190554260068190556040805183815260208101929092527fb4c6d786da48691c308faaf332c8a4ccaa952d2145eb5798624c60548ce4b8a39101611215565b6000611006603054614835565b613ec06147db565b602a5460008111613ee35760405162461bcd60e51b8152600401610e40906149cc565b603354613ef082426149fa565b1015613f0e5760405162461bcd60e51b8152600401610e4090614a21565b7f8ad0f1f70b7c422ad8dee17b865a5118d91bc633151cdf66293f7827fea7164c602954604051613f4191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fd09190614b8b565b50602954604051630ce591ab60e21b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063339646ac90608401600060405180830381600087803b15801561405457600080fd5b505af1158015614068573d6000803e3d6000fd5b50506000602a819055602955505050505050565b6140846147db565b602380546001600160601b0319166001600160601b0383169081179091554260248190556040805192835260208301919091527f456911403e756f0141f9a154095c7495b7002db4f6b26a7ff03c4f09335abc4b9101611215565b6140e76147db565b602e546000811161410a5760405162461bcd60e51b8152600401610e40906149cc565b60335461411782426149fa565b10156141355760405162461bcd60e51b8152600401610e4090614a21565b7f9eb4413d73f3cae81d9e8ab119d94a8d2cd6b2564117c30f2112b972dcf84f96602d5460405161416891815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa1580156141d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f79190614b8b565b602d54604051635868086b60e11b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b15801561427b57600080fd5b505af115801561428f573d6000803e3d6000fd5b50506000602e819055602d55505050505050565b6000611006600454614835565b6142b86147db565b602054600081116142db5760405162461bcd60e51b8152600401610e40906149cc565b6033546142e882426149fa565b10156143065760405162461bcd60e51b8152600401610e4090614a21565b7f3114ff9b112e2012da7dadf3d620cfd5af0546afe8cd887c052f0166fddb0004601f5460405161433991815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa1580156143a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143c89190614b8b565b601f54604051630ce591ab60e21b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b15801561444c57600080fd5b505af1158015614460573d6000803e3d6000fd5b505060006020819055601f55505050505050565b6000611006601c54614835565b6000611006601654614835565b6000611006602254614835565b6000611006600a54614835565b6144b06147db565b60648111156144d15760405162461bcd60e51b8152600401610e4090614b1b565b602981905542602a8190556040805183815260208101929092527f363de88db002648ead34367d7bc43c7eb86051555a3e29ff3d6ab2cd12f880569101611215565b6000611006602e54614835565b6145286147db565b6014546000811161454b5760405162461bcd60e51b8152600401610e40906149cc565b60335461455882426149fa565b10156145765760405162461bcd60e51b8152600401610e4090614a21565b7ff0db347eb933ec2636808975682b1fd63249be20775411ced58d2fd61e0fe7426013546040516145a991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015614617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061463b9190614ad1565b6013546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101859052608481019190915260a48101829052959a509398509196509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156146d357600080fd5b505af11580156146e7573d6000803e3d6000fd5b5050600060148190556013555050505050505050565b6147056147db565b6001600160a01b03811661476a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e40565b6147738161488b565b50565b61477e6147db565b6025805467ffffffffffffffff191667ffffffffffffffff83169081179091554260268190556040805192835260208301919091527f98f756aaf5ba8f60be58f0b035a3a5f54bdfbc5d1ada450c235b9e500625df389101611215565b6000546001600160a01b0316331461212e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e40565b60008082116148565760405162461bcd60e51b8152600401610e40906149cc565b600061486283426149fa565b905060335481106148765750600092915050565b8060335461488491906149fa565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156148ed57600080fd5b5035919050565b6001600160601b038116811461477357600080fd5b60006020828403121561491b57600080fd5b8135614884816148f4565b67ffffffffffffffff8116811461477357600080fd5b60006020828403121561494e57600080fd5b813561488481614926565b80356001600160a01b038116811461497057600080fd5b919050565b60006020828403121561498757600080fd5b61488482614959565b600080604083850312156149a357600080fd5b6149ac83614959565b9150602083013580151581146149c157600080fd5b809150509250929050565b60208082526014908201527310da185b99d9481b9bdd081a5b9a5d1a585d195960621b604082015260600190565b81810381811115614a1b57634e487b7160e01b600052601160045260246000fd5b92915050565b6020808252818101527f476f7665726e616e63652064656c617920686173206e6f7420656c6170736564604082015260600190565b600080600060608486031215614a6b57600080fd5b8351614a76816148f4565b6020850151909350614a8781614926565b6040850151909250614a9881614926565b809150509250925092565b600080600060608486031215614ab857600080fd5b8351925060208401519150604084015190509250925092565b60008060008060008060c08789031215614aea57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60208082526014908201527304d6178696d756d2076616c7565206973203130360641b604082015260600190565b600080600060608486031215614b5e57600080fd5b8351614b69816148f4565b6020850151909350614b7a816148f4565b6040850151909250614a98816148f4565b60008060008060808587031215614ba157600080fd5b50508251602084015160408501516060909501519196909550909250905056fea2646970667358221220dbd8081e14f054632d2a93a00aa4d4b88c9783c165a4568fe3e1db029acc2e7764736f6c63430008110033",
2443
+ "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106107bb5760003560e01c80638b63cc22116103f5578063af21b29011610215578063d24521aa11610130578063e731cc53116100c3578063ee8e6e5e11610092578063ee8e6e5e14610dd5578063f0bb6ce814610dde578063f2fde38b14610de6578063fb5ccedc14610df9578063fe3bb37014610e0257600080fd5b8063e731cc5314610da9578063e79b8c4614610db1578063e8507b0614610dba578063ec9d1d9614610dcd57600080fd5b8063dde37ab8116100ff578063dde37ab814610d88578063de0ce4c914610d90578063df5ee8f614610d98578063e259b55114610da157600080fd5b8063d24521aa14610d67578063d31121de14610d6f578063d57da0b814610d77578063dbc439c714610d7f57600080fd5b8063c17a1471116101a8578063cb1ec15311610177578063cb1ec15314610d3a578063ccc5488a14610d43578063cdfaeb9814610d4b578063ce123d2814610d5457600080fd5b8063c17a147114610d03578063c1b2ba9714610d16578063c268650e14610d1f578063c97e8feb14610d3257600080fd5b8063ba5c9e7e116101e4578063ba5c9e7e14610ccc578063bba3293914610cd4578063bcc5d20414610cdd578063c16d606f14610cf057600080fd5b8063af21b29014610c94578063b0ed20bb14610c9d578063b1fae48b14610cb0578063b392e3be14610cb957600080fd5b80639de6bc9d11610310578063a72aedae116102a3578063ac21f57c11610272578063ac21f57c14610c5f578063aceb164814610c72578063ae1a332514610c7b578063ae98cbf014610c83578063aea6933914610c8c57600080fd5b8063a72aedae14610c29578063a7b9a7a014610c3c578063a955b3f314610c44578063a9b32c3d14610c5757600080fd5b8063a01bc828116102df578063a01bc82814610bfd578063a0a94bbb14610c05578063a5b9ab4d14610c0d578063a6d025f114610c1657600080fd5b80639de6bc9d14610bd05780639ec67b3114610bd85780639f40edf014610bec5780639fc3da9614610bf557600080fd5b8063914f512f11610388578063985e648711610357578063985e648714610ba55780639949d70e14610bb85780639b849b9214610bc05780639cde7da914610bc857600080fd5b8063914f512f14610b6e57806395ba105d14610b7657806396fd955e14610b7f5780639810f32714610b9257600080fd5b80638d2e0c3c116103c45780638d2e0c3c14610b395780638da5cb5b14610b425780638e0442f814610b53578063914adf8f14610b6657600080fd5b80638b63cc2214610b0e5780638bc32f3314610b215780638c5f0d6714610b295780638cdb432914610b3157600080fd5b80634885b171116105e057806364e32d74116104fb578063785180e71161048e57806382e70cb81161045d57806382e70cb814610ae4578063863b45a414610aec5780638837037714610af5578063894ee96814610afe5780638a4f77ef14610b0657600080fd5b8063785180e714610ab8578063798f022314610acb5780637ab18adf14610ad35780637b81ef5214610adc57600080fd5b8063692be745116104ca578063692be74514610a95578063715018a614610a9e578063765a783214610aa657806377bf781414610aaf57600080fd5b806364e32d7414610a54578063660f903114610a5c578063663032cd14610a6f5780636795afe614610a8257600080fd5b8063542ced771161057357806361038b911161054257806361038b9114610a2857806361d4b5ef14610a3157806362c78d0914610a39578063648392ac14610a4157600080fd5b8063542ced77146109f15780635b6bd01714610a045780635c07405614610a0c5780635f735a1014610a1f57600080fd5b80634ca107cc116105af5780634ca107cc146109c45780634cf11abc146109cd5780634ed05ade146109d557806352f1bf14146109de57600080fd5b80634885b17114610996578063488a4b261461099f578063495cb121146109a85780634b928642146109bb57600080fd5b80632d318efc116106db578063363388331161066e5780633bf8a5381161063d5780633bf8a5381461093d5780633edf74e71461096a578063412bd7b41461097d578063429cdaa814610985578063481d021f1461098e57600080fd5b8063363388331461091057806337f547901461091957806337fa5d51146109215780633b7b1b081461093457600080fd5b80632ff8aa33116106aa5780632ff8aa33146108e357806333a17f98146108f6578063345cdef5146108fe5780633611f0021461090757600080fd5b80632d318efc146108c15780632d340433146108c95780632f006f4e146108d25780632f505f1f146108db57600080fd5b80631937c64711610753578063209e80ea11610722578063209e80ea14610895578063260b5a85146108a857806326825a9d146108b15780632b702150146108b957600080fd5b80631937c6471461087257806319f1103f1461087a5780631e44a72c146108835780631ff566c71461088c57600080fd5b8063152ba58f1161078f578063152ba58f146107f8578063153622b314610800578063154028f41461083f5780631722dd291461086a57600080fd5b80626b050c146107c0578063040215af146107dc57806306201e1c146107e557806314385adb146107ef575b600080fd5b6107c960315481565b6040519081526020015b60405180910390f35b6107c9600c5481565b6107ed610e15565b005b6107c960205481565b6107c9610ff9565b6108277f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016107d3565b601b54610852906001600160601b031681565b6040516001600160601b0390911681526020016107d3565b6107ed61100b565b6107c96111c2565b6107c9601e5481565b6107c960085481565b6107c960025481565b6107ed6108a33660046148db565b6111cf565b6107c960225481565b6107ed611220565b6107c96112c4565b6107ed6112d1565b6107c9600d5481565b6107c960105481565b6107ed6114ad565b6107ed6108f13660046148db565b611686565b6107c96116f0565b6107c9602f5481565b6107c960135481565b6107c960165481565b6107c96116fd565b6107ed61092f3660046148db565b61170a565b6107c960155481565b6025546109519067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016107d3565b6107ed6109783660046148db565b611754565b6107c9611809565b6107c9600f5481565b6107ed611816565b6107c960095481565b6107c960285481565b6107ed6109b6366004614909565b6119cd565b6107c960215481565b6107c960265481565b6107ed611a30565b6107c960185481565b6107ed6109ec3660046148db565b611c0d565b6107ed6109ff3660046148db565b611cb3565b6107c9611cfd565b6107ed610a1a3660046148db565b611d0a565b6107c9602d5481565b6107c960305481565b6107c9611db2565b6107c9611dbf565b6107ed610a4f3660046148db565b611dcc565b6107ed611e16565b6107ed610a6a36600461493c565b611fe7565b6107ed610a7d366004614975565b61204c565b6107ed610a903660046148db565b6120d2565b6107c9601d5481565b6107ed61211c565b6107c960075481565b6107c960295481565b601954610852906001600160601b031681565b6107ed612130565b6107c9601a5481565b6107c961230e565b6107c961231b565b6107c960065481565b6107c960245481565b6107ed612328565b6107ed6124ed565b6107ed610b1c3660046148db565b6126be565b6107ed61276a565b6107c961292e565b6107ed61293b565b6107c9600a5481565b6000546001600160a01b0316610827565b6107ed610b613660046148db565b612b17565b6107ed612bcb565b6107c9612d8f565b6107c960015481565b602354610852906001600160601b031681565b6107ed610ba0366004614909565b612d9c565b6107ed610bb3366004614990565b612dff565b6107c9612e8e565b6107c9612e9b565b6107c9612ea8565b6107ed612eb5565b6027546109519067ffffffffffffffff1681565b6107c9601c5481565b6107ed613090565b6107c9613247565b6107ed613254565b6107c960145481565b6107ed610c243660046148db565b613425565b6107ed610c37366004614975565b61346f565b6107ed613544565b6107ed610c523660046148db565b613709565b6107c9613774565b6107ed610c6d366004614909565b613781565b6107c960045481565b6107ed6137e4565b6107c960055481565b6107ed6139c0565b6107c9602a5481565b6107ed610cab3660046148db565b613aee565b6107c9602c5481565b6107ed610cc73660046148db565b613b38565b6107ed613b82565b6107c960335481565b601754610852906001600160601b031681565b6107ed610cfe3660046148db565b613d46565b600354610827906001600160a01b031681565b6107c9602e5481565b6107ed610d2d3660046148db565b613e05565b6107c9613eab565b6107c9601f5481565b6107ed613eb8565b6107c9602b5481565b6107ed610d62366004614909565b61407c565b6107ed6140df565b6107c96142a3565b6107ed6142b0565b6107c960115481565b6107c9614474565b6107c9614481565b6107c960125481565b6107c961448e565b6107c961449b565b6107c9600e5481565b6107ed610dc83660046148db565b6144a8565b6107c9614513565b6107c9600b5481565b6107ed614520565b6107ed610df4366004614975565b6146fd565b6107c960325481565b6107ed610e1036600461493c565b614776565b610e1d6147db565b60285460008111610e495760405162461bcd60e51b8152600401610e40906149cc565b60405180910390fd5b603354610e5682426149fa565b1015610e745760405162461bcd60e51b8152600401610e4090614a21565b60275460405167ffffffffffffffff90911681527f6a7551372930a2bc4aec844a266609ca90cf9b805f875e92680e901b43d5273f9060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190614a56565b506027546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff8084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b158015610fc657600080fd5b505af1158015610fda573d6000803e3d6000fd5b5050600060285550506027805467ffffffffffffffff19169055505050565b6000611006601454614835565b905090565b6110136147db565b600854600081116110365760405162461bcd60e51b8152600401610e40906149cc565b60335461104382426149fa565b10156110615760405162461bcd60e51b8152600401610e4090614a21565b7f1aa56185678cf82df5663d3bf97731024fc6da8f9ab832de58fe6411bb7aacad60075460405161109491815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa1580156110fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111219190614aa3565b600754604051639a7d093560e01b8152600481018590526024810191909152604481018290529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b5050600060088190556007555050505050565b6000611006600654614835565b6111d76147db565b601d81905542601e8190556040805183815260208101929092527f523803e7f157ab532da5ae1e1d19b71f16b18376cf65a301ef8e3f07076d6bfd91015b60405180910390a150565b6112286147db565b6002546000811161124b5760405162461bcd60e51b8152600401610e40906149cc565b60335461125882426149fa565b10156112765760405162461bcd60e51b8152600401610e4090614a21565b7f657e578b1ed229f1e01ab5ce4700399f19ddd24b09b071ab9e72122f18aa72976001546040516112a991815260200190565b60405180910390a15060018054603355600060028190559055565b6000611006601054614835565b6112d96147db565b600e54600081116112fc5760405162461bcd60e51b8152600401610e40906149cc565b60335461130982426149fa565b10156113275760405162461bcd60e51b8152600401610e4090614a21565b7fc2b1fc49f84728c2be30441ba73a73fe63ff40017b462dca6045e8b5933dfd97600d5460405161135a91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156113c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ec9190614ad1565b600d546040516377a5a7bd60e01b815260048101889052602481019190915260448101859052606481018490526084810183905260a48101829052959a5092985090965094509250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561148357600080fd5b505af1158015611497573d6000803e3d6000fd5b50506000600e819055600d555050505050505050565b6114b56147db565b602454600081116114d85760405162461bcd60e51b8152600401610e40906149cc565b6033546114e582426149fa565b10156115035760405162461bcd60e51b8152600401610e4090614a21565b6023546040516001600160601b0390911681527fca5de5c00e5da52e22f64b23ecfa308e487441bcbd0f4b84657799102e3ee3719060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156115a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c89190614a56565b6023546040516301409c5360e71b81526001600160601b03909116600482015267ffffffffffffffff80841660248301528216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063a04e298090606401600060405180830381600087803b15801561165457600080fd5b505af1158015611668573d6000803e3d6000fd5b505060006024555050602380546001600160601b0319169055505050565b61168e6147db565b60648111156116af5760405162461bcd60e51b8152600401610e4090614b1b565b601f81905542602081815560408051848152918201929092527f236b3b5a701c1727d0ddd01db13475e0da9be45561decb6f0d3d958c18e09e8b9101611215565b6000611006603254614835565b6000611006602054614835565b6117126147db565b60018190554260028190556040805183815260208101929092527f1ed485551399b30c188ed4d426c6c62d7b703b9fec6b486c70a3fe616c2707c89101611215565b61175c6147db565b600081116117c75760405162461bcd60e51b815260206004820152603260248201527f444b47207375626d697474657220707265636564656e636520706572696f642060448201527106c656e677468206d757374206265203e20360741b6064820152608401610e40565b60158190554260168190556040805183815260208101929092527f69f992e32ba993676818a20dfe808b5d41e0db4bdd3a52917701443500a423ca9101611215565b6000611006602c54614835565b61181e6147db565b600654600081116118415760405162461bcd60e51b8152600401610e40906149cc565b60335461184e82426149fa565b101561186c5760405162461bcd60e51b8152600401610e4090614a21565b7f63db42a2e13b78bf39d9f3c14718c3c925ccdf3e30a0477d5a7626914164620260055460405161189f91815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192c9190614aa3565b600554604051639a7d093560e01b81526004810191909152602481018390526044810182905291945092506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169150639a7d093590606401600060405180830381600087803b1580156119a657600080fd5b505af11580156119ba573d6000803e3d6000fd5b5050600060068190556005555050505050565b6119d56147db565b601980546001600160601b0319166001600160601b03831690811790915542601a8190556040805192835260208301919091527f8087387fa6bcbf89a9e273adcf21735f21e89ae8024417df321d8ccc106123089101611215565b611a386147db565b60105460008111611a5b5760405162461bcd60e51b8152600401610e40906149cc565b603354611a6882426149fa565b1015611a865760405162461bcd60e51b8152600401610e4090614a21565b7f54eb240e49fe7d2dc26863f9a2682d5834812e39417dbac77797c3b01b97395c600f54604051611ab991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015611b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4b9190614ad1565b600f546040516377a5a7bd60e01b815260048101889052602481018790526044810191909152606481018490526084810183905260a48101829052959a509398509096509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b158015611be357600080fd5b505af1158015611bf7573d6000803e3d6000fd5b505060006010819055600f555050505050505050565b611c156147db565b60008111611c715760405162461bcd60e51b8152602060048201526024808201527f47726f7570206372656174696f6e206672657175656e6379206d7573742062656044820152630203e20360e41b6064820152608401610e40565b600b81905542600c8190556040805183815260208101929092527f9356f2202b7c2dd20837653ce617753f36c435d28464b7f8c4c4c174acecec3d9101611215565b611cbb6147db565b602b81905542602c8190556040805183815260208101929092527fe7f67ed355ceb941da1b6600c508f5493967c944c9fee75936aaa986b9e0344c9101611215565b6000611006601e54614835565b611d126147db565b60008111611d705760405162461bcd60e51b815260206004820152602560248201527f47726f7570206c69666574696d65206d75737420626520677265617465722074604482015264068616e20360dc1b6064820152608401610e40565b600d81905542600e8190556040805183815260208101929092527f2061f522ba42a34f2907b875dca3bf5f0d999cacbbb635e894ee3c5792727e649101611215565b6000611006602854614835565b6000611006600854614835565b611dd46147db565b602f8190554260308190556040805183815260208101929092527f6ff3903999be3f8c1262f638998917b6d6c6f8097cb7cb9e60edaa1a5f2a66719101611215565b611e1e6147db565b601c5460008111611e415760405162461bcd60e51b8152600401610e40906149cc565b603354611e4e82426149fa565b1015611e6c5760405162461bcd60e51b8152600401610e4090614a21565b601b546040516001600160601b0390911681527f13f3e65295154bda4919d5f46898c2284edbf9283ee94654515cec984e767c809060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa158015611f0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f319190614b49565b50601b54604051630519e99160e01b81526001600160601b0380851660048301528084166024830152909116604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b158015611fb557600080fd5b505af1158015611fc9573d6000803e3d6000fd5b50506000601c555050601b80546001600160601b0319169055505050565b611fef6147db565b6027805467ffffffffffffffff191667ffffffffffffffff83169081179091554260288190556040805192835260208301919091527f979c18cc9822195c2af34f89e0713a14edbd9713b32932c60471951cc1fa02db9101611215565b6120546147db565b60405163663032cd60e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063663032cd90602401600060405180830381600087803b1580156120b757600080fd5b505af11580156120cb573d6000803e3d6000fd5b5050505050565b6120da6147db565b60118190554260128190556040805183815260208101929092527fff34014c09b30234094b14f309369c4b204ab5f24daa98f6922ac40a04768bf09101611215565b6121246147db565b61212e600061488b565b565b6121386147db565b6012546000811161215b5760405162461bcd60e51b8152600401610e40906149cc565b60335461216882426149fa565b10156121865760405162461bcd60e51b8152600401610e4090614a21565b7ffc489bb20492c4590e5a1edb8e096301dd7e9c24843a5af9221ddafff010f0f06011546040516121b991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224b9190614ad1565b6011546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101919091526084810183905260a48101829052959a50939850919650909450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156122e457600080fd5b505af11580156122f8573d6000803e3d6000fd5b5050600060128190556011555050505050505050565b6000611006602454614835565b6000611006602654614835565b6123306147db565b603054600081116123535760405162461bcd60e51b8152600401610e40906149cc565b60335461236082426149fa565b101561237e5760405162461bcd60e51b8152600401610e4090614a21565b7fc02f8fddd9d337adf38d4f97d3ab8c91b69075b48db9bc25c461b0d02c3d4092602f546040516123b191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561241c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124409190614b8b565b602f54604051635868086b60e11b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b1580156124c557600080fd5b505af11580156124d9573d6000803e3d6000fd5b505060006030819055602f55505050505050565b6124f56147db565b601a54600081116125185760405162461bcd60e51b8152600401610e40906149cc565b60335461252582426149fa565b10156125435760405162461bcd60e51b8152600401610e4090614a21565b6019546040516001600160601b0390911681527fe1adae42a74e6bb380e06f34e96abe3134e824a1a152a8e6a7458be153404d179060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa1580156125e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126089190614b49565b601954604051630519e99160e01b81526001600160601b038086166004830152918216602482015290821660448201529294509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630519e99190606401600060405180830381600087803b15801561268c57600080fd5b505af11580156126a0573d6000803e3d6000fd5b50506000601a555050601980546001600160601b0319169055505050565b6126c66147db565b600081116127285760405162461bcd60e51b815260206004820152602960248201527f444b4720726573756c74207375626d697373696f6e2074696d656f7574206d7560448201526807374206265203e20360bc1b6064820152608401610e40565b60138190554260148190556040805183815260208101929092527f77bd6dceb389516c704e337d2e53bab8397e3fd1de7e3b852090742804ba13b49101611215565b6127726147db565b602c54600081116127955760405162461bcd60e51b8152600401610e40906149cc565b6033546127a282426149fa565b10156127c05760405162461bcd60e51b8152600401610e4090614a21565b7ff71bf0b76dcaef665875c3a1d4959efda6ea75c7171f5fae1bd305f7c8509283602b546040516127f391815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa15801561285e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128829190614b8b565b602b54604051635868086b60e11b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063b0d010d690608401600060405180830381600087803b15801561290657600080fd5b505af115801561291a573d6000803e3d6000fd5b50506000602c819055602b55505050505050565b6000611006601854614835565b6129436147db565b600c54600081116129665760405162461bcd60e51b8152600401610e40906149cc565b60335461297382426149fa565b10156129915760405162461bcd60e51b8152600401610e4090614a21565b7fe3daa3940e1269d029800f83e889021793ccd69dd79a7152b9171a3071eb45a3600b546040516129c491815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015612a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a569190614ad1565b600b546040516377a5a7bd60e01b815260048101919091526024810186905260448101859052606481018490526084810183905260a48101829052949a50929850909650945092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506377a5a7bd9060c401600060405180830381600087803b158015612aed57600080fd5b505af1158015612b01573d6000803e3d6000fd5b50506000600c819055600b555050505050505050565b612b1f6147db565b600a811015612b895760405162461bcd60e51b815260206004820152603060248201527f444b4720726573756c74206368616c6c656e676520706572696f64206c656e6760448201526f07468206d757374206265203e3d2031360841b6064820152608401610e40565b600f8190554260108190556040805183815260208101929092527f4bc54f06db7242d34e1d1cdd7b4b33807a8210c54fc440ba45e6e5ffa04e083d9101611215565b612bd36147db565b601e5460008111612bf65760405162461bcd60e51b8152600401610e40906149cc565b603354612c0382426149fa565b1015612c215760405162461bcd60e51b8152600401610e4090614a21565b7f0945b46b311d9dd20cdadf139b3449fe2e50026e619f33cabedbd7461c429076601d54604051612c5491815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015612cbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce39190614b8b565b601d54604051630ce591ab60e21b8152600481019190915260248101849052604481018390526064810182905292965090945092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915063339646ac90608401600060405180830381600087803b158015612d6757600080fd5b505af1158015612d7b573d6000803e3d6000fd5b50506000601e819055601d55505050505050565b6000611006602a54614835565b612da46147db565b601b80546001600160601b0319166001600160601b03831690811790915542601c8190556040805192835260208301919091527f060327865259e01939f90eed5ad911c6e0509663b7671bccd0f6382f56aba4d39101611215565b612e076147db565b60405163985e648760e01b81526001600160a01b03838116600483015282151560248301527f0000000000000000000000000000000000000000000000000000000000000000169063985e648790604401600060405180830381600087803b158015612e7257600080fd5b505af1158015612e86573d6000803e3d6000fd5b505050505050565b6000611006601a54614835565b6000611006600c54614835565b6000611006601254614835565b612ebd6147db565b60265460008111612ee05760405162461bcd60e51b8152600401610e40906149cc565b603354612eed82426149fa565b1015612f0b5760405162461bcd60e51b8152600401610e4090614a21565b60255460405167ffffffffffffffff90911681527fcc354ece588e8fa730a65a72ebb90039caf81a2a9efedf80e8124566d42a75e89060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637b14729e6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd19190614a56565b506025546040516301409c5360e71b81526001600160601b038416600482015267ffffffffffffffff9182166024820152908216604482015291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a04e298090606401600060405180830381600087803b15801561305d57600080fd5b505af1158015613071573d6000803e3d6000fd5b5050600060265550506025805467ffffffffffffffff19169055505050565b6130986147db565b600a54600081116130bb5760405162461bcd60e51b8152600401610e40906149cc565b6033546130c882426149fa565b10156130e65760405162461bcd60e51b8152600401610e4090614a21565b7f01e43c4ca2dc8df5a6c64198b1ad31e61ff7584833e5a7933892dd79d8eb905260095460405161311991815260200190565b60405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374024ab76040518163ffffffff1660e01b8152600401606060405180830381865afa158015613182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a69190614aa3565b50600954604051639a7d093560e01b81526004810184905260248101839052604481019190915291935091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7d093590606401600060405180830381600087803b15801561322057600080fd5b505af1158015613234573d6000803e3d6000fd5b50506000600a8190556009555050505050565b6000611006600254614835565b61325c6147db565b6018546000811161327f5760405162461bcd60e51b8152600401610e40906149cc565b60335461328c82426149fa565b10156132aa5760405162461bcd60e51b8152600401610e4090614a21565b6017546040516001600160601b0390911681527f5e7ca6fb8d090a2753e006c53b0aab79da28ab5e198b62cc105bda8f96caa6a09060200160405180910390a16000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631d35fa636040518163ffffffff1660e01b8152600401606060405180830381865afa15801561334b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061336f9190614b49565b601754604051630519e99160e01b81526001600160601b0391821660048201528184166024820152908216604482015291945092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169150630519e99190606401600060405180830381600087803b1580156133f357600080fd5b505af1158015613407573d6000803e3d6000fd5b505060006018555050601780546001600160601b0319169055505050565b61342d6147db565b602d81905542602e8190556040805183815260208101929092527f8ff92b4fa51728d3b3bebd82f5bcfa8904b0278abbce025a1e33aaf9719fdb0d9101611215565b6134776147db565b6001600160a01b0381166134e95760405162461bcd60e51b815260206004820152603360248201527f4e65772072616e646f6d20626561636f6e20676f7665726e616e636520616464604482015272726573732063616e6e6f74206265207a65726f60681b6064820152608401610e40565b600380546001600160a01b0319166001600160a01b0383169081179091554260048190556040805192835260208301919091527fcda4dd0dbaee4278532e4689e026f08f707ec8602188caa303750b225cde00789101611215565b61354c6147db565b6022546000811161356f5760405162461bcd60e51b8152600401610e40906149cc565b60335461357c82426149fa565b101561359a5760405162461bcd60e51b8152600401610e4090614a21565b7f32aac559d8ae735853362fec3c6751b37b45f12097c074ee06d51b10180c68626021546040516135cd91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365c9190614b8b565b602154604051630ce591ab60e21b81526004810186905260248101859052604481019190915260648101829052939650919450909250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b1580156136e157600080fd5b505af11580156136f5573d6000803e3d6000fd5b505060006022819055602155505050505050565b6137116147db565b60648111156137325760405162461bcd60e51b8152600401610e4090614b1b565b60218190554260228190556040805183815260208101929092527fb62064224fade801c12ce2e348d8fff15f8e451792137664811b44b6ffe37d919101611215565b6000611006600e54614835565b6137896147db565b601780546001600160601b0319166001600160601b0383169081179091554260188190556040805192835260208301919091527fb5da59c72c3f617da3620449ee7c88d5b8a81e1f98e9f61fc62207ecab6b099f9101611215565b6137ec6147db565b6016546000811161380f5760405162461bcd60e51b8152600401610e40906149cc565b60335461381c82426149fa565b101561383a5760405162461bcd60e51b8152600401610e4090614a21565b7ffc88a5167b8569e72b62f4b76b3caae7699e46c7f6f16a8d011b135ac613acc460155460405161386d91815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa1580156138db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138ff9190614ad1565b506015546040516377a5a7bd60e01b8152600481018790526024810186905260448101859052606481018490526084810183905260a4810191909152949950929750909550935091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b15801561399657600080fd5b505af11580156139aa573d6000803e3d6000fd5b5050600060168190556015555050505050505050565b6139c86147db565b600454600081116139eb5760405162461bcd60e51b8152600401610e40906149cc565b6033546139f882426149fa565b1015613a165760405162461bcd60e51b8152600401610e4090614a21565b6003546040516001600160a01b0390911681527f2682a33c437aa00b19b3e527d140e9800f735bc8fab66653e6ae22c8d07b4a909060200160405180910390a16003546040516334e2fffd60e21b81526001600160a01b0391821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063d38bfff490602401600060405180830381600087803b158015613abe57600080fd5b505af1158015613ad2573d6000803e3d6000fd5b505060006004555050600380546001600160a01b031916905550565b613af66147db565b60318190554260328190556040805183815260208101929092527f9eeb84ca445446640c66e65b8036794dd92ad3c3b9177714c8802c2644ab79e59101611215565b613b406147db565b60078190554260088190556040805183815260208101929092527f9cd90f9d45b916da6108ff464eaded2b92aa41867f12437a20b57247298086979101611215565b613b8a6147db565b60325460008111613bad5760405162461bcd60e51b8152600401610e40906149cc565b603354613bba82426149fa565b1015613bd85760405162461bcd60e51b8152600401610e4090614a21565b7f274cf9dfd48eeb8969817e347b3a2951ff7b3127772bd70827012266466ae229603154604051613c0b91815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa158015613c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9a9190614b8b565b50603154604051635868086b60e11b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b0d010d690608401600060405180830381600087803b158015613d1e57600080fd5b505af1158015613d32573d6000803e3d6000fd5b505060006032819055603155505050505050565b613d4e6147db565b600081118015613d615750620f42408111155b613dc35760405162461bcd60e51b815260206004820152602d60248201527f43616c6c6261636b20676173206c696d6974206d757374206265203e2030206160448201526c06e64203c3d203130303030303609c1b6064820152608401610e40565b600981905542600a8190556040805183815260208101929092527f0aeac6506f5606a033c22dd1659065c5f75e5ea933fd3b49948ea79a59759b239101611215565b613e0d6147db565b60008111613e695760405162461bcd60e51b8152602060048201526024808201527f52656c617920656e74727920736f66742074696d656f7574206d7573742062656044820152630203e20360e41b6064820152608401610e40565b60058190554260068190556040805183815260208101929092527fb4c6d786da48691c308faaf332c8a4ccaa952d2145eb5798624c60548ce4b8a39101611215565b6000611006603054614835565b613ec06147db565b602a5460008111613ee35760405162461bcd60e51b8152600401610e40906149cc565b603354613ef082426149fa565b1015613f0e5760405162461bcd60e51b8152600401610e4090614a21565b7f8ad0f1f70b7c422ad8dee17b865a5118d91bc633151cdf66293f7827fea7164c602954604051613f4191815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa158015613fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fd09190614b8b565b50602954604051630ce591ab60e21b8152600481018590526024810184905260448101839052606481019190915292955090935091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063339646ac90608401600060405180830381600087803b15801561405457600080fd5b505af1158015614068573d6000803e3d6000fd5b50506000602a819055602955505050505050565b6140846147db565b602380546001600160601b0319166001600160601b0383169081179091554260248190556040805192835260208301919091527f456911403e756f0141f9a154095c7495b7002db4f6b26a7ff03c4f09335abc4b9101611215565b6140e76147db565b602e546000811161410a5760405162461bcd60e51b8152600401610e40906149cc565b60335461411782426149fa565b10156141355760405162461bcd60e51b8152600401610e4090614a21565b7f9eb4413d73f3cae81d9e8ab119d94a8d2cd6b2564117c30f2112b972dcf84f96602d5460405161416891815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a595906040518163ffffffff1660e01b8152600401608060405180830381865afa1580156141d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f79190614b8b565b602d54604051635868086b60e11b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b0d010d690608401600060405180830381600087803b15801561427b57600080fd5b505af115801561428f573d6000803e3d6000fd5b50506000602e819055602d55505050505050565b6000611006600454614835565b6142b86147db565b602054600081116142db5760405162461bcd60e51b8152600401610e40906149cc565b6033546142e882426149fa565b10156143065760405162461bcd60e51b8152600401610e4090614a21565b7f3114ff9b112e2012da7dadf3d620cfd5af0546afe8cd887c052f0166fddb0004601f5460405161433991815260200190565b60405180910390a160008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663529023016040518163ffffffff1660e01b8152600401608060405180830381865afa1580156143a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143c89190614b8b565b601f54604051630ce591ab60e21b815260048101869052602481019190915260448101839052606481018290529396509094509250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063339646ac90608401600060405180830381600087803b15801561444c57600080fd5b505af1158015614460573d6000803e3d6000fd5b505060006020819055601f55505050505050565b6000611006601c54614835565b6000611006601654614835565b6000611006602254614835565b6000611006600a54614835565b6144b06147db565b60648111156144d15760405162461bcd60e51b8152600401610e4090614b1b565b602981905542602a8190556040805183815260208101929092527f363de88db002648ead34367d7bc43c7eb86051555a3e29ff3d6ab2cd12f880569101611215565b6000611006602e54614835565b6145286147db565b6014546000811161454b5760405162461bcd60e51b8152600401610e40906149cc565b60335461455882426149fa565b10156145765760405162461bcd60e51b8152600401610e4090614a21565b7ff0db347eb933ec2636808975682b1fd63249be20775411ced58d2fd61e0fe7426013546040516145a991815260200190565b60405180910390a160008060008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b142f85c6040518163ffffffff1660e01b815260040160c060405180830381865afa158015614617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061463b9190614ad1565b6013546040516377a5a7bd60e01b815260048101889052602481018790526044810186905260648101859052608481019190915260a48101829052959a509398509196509450909250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906377a5a7bd9060c401600060405180830381600087803b1580156146d357600080fd5b505af11580156146e7573d6000803e3d6000fd5b5050600060148190556013555050505050505050565b6147056147db565b6001600160a01b03811661476a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e40565b6147738161488b565b50565b61477e6147db565b6025805467ffffffffffffffff191667ffffffffffffffff83169081179091554260268190556040805192835260208301919091527f98f756aaf5ba8f60be58f0b035a3a5f54bdfbc5d1ada450c235b9e500625df389101611215565b6000546001600160a01b0316331461212e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e40565b60008082116148565760405162461bcd60e51b8152600401610e40906149cc565b600061486283426149fa565b905060335481106148765750600092915050565b8060335461488491906149fa565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156148ed57600080fd5b5035919050565b6001600160601b038116811461477357600080fd5b60006020828403121561491b57600080fd5b8135614884816148f4565b67ffffffffffffffff8116811461477357600080fd5b60006020828403121561494e57600080fd5b813561488481614926565b80356001600160a01b038116811461497057600080fd5b919050565b60006020828403121561498757600080fd5b61488482614959565b600080604083850312156149a357600080fd5b6149ac83614959565b9150602083013580151581146149c157600080fd5b809150509250929050565b60208082526014908201527310da185b99d9481b9bdd081a5b9a5d1a585d195960621b604082015260600190565b81810381811115614a1b57634e487b7160e01b600052601160045260246000fd5b92915050565b6020808252818101527f476f7665726e616e63652064656c617920686173206e6f7420656c6170736564604082015260600190565b600080600060608486031215614a6b57600080fd5b8351614a76816148f4565b6020850151909350614a8781614926565b6040850151909250614a9881614926565b809150509250925092565b600080600060608486031215614ab857600080fd5b8351925060208401519150604084015190509250925092565b60008060008060008060c08789031215614aea57600080fd5b865195506020870151945060408701519350606087015192506080870151915060a087015190509295509295509295565b60208082526014908201527304d6178696d756d2076616c7565206973203130360641b604082015260600190565b600080600060608486031215614b5e57600080fd5b8351614b69816148f4565b6020850151909350614b7a816148f4565b6040850151909250614a98816148f4565b60008060008060808587031215614ba157600080fd5b50508251602084015160408501516060909501519196909550909250905056fea2646970667358221220dbd8081e14f054632d2a93a00aa4d4b88c9783c165a4568fe3e1db029acc2e7764736f6c63430008110033",
2444
2444
  "devdoc": {
2445
2445
  "kind": "dev",
2446
2446
  "methods": {
@@ -3065,7 +3065,7 @@
3065
3065
  "type": "t_address"
3066
3066
  },
3067
3067
  {
3068
- "astId": 12266,
3068
+ "astId": 12208,
3069
3069
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3070
3070
  "label": "newGovernanceDelay",
3071
3071
  "offset": 0,
@@ -3073,7 +3073,7 @@
3073
3073
  "type": "t_uint256"
3074
3074
  },
3075
3075
  {
3076
- "astId": 12268,
3076
+ "astId": 12210,
3077
3077
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3078
3078
  "label": "governanceDelayChangeInitiated",
3079
3079
  "offset": 0,
@@ -3081,7 +3081,7 @@
3081
3081
  "type": "t_uint256"
3082
3082
  },
3083
3083
  {
3084
- "astId": 12270,
3084
+ "astId": 12212,
3085
3085
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3086
3086
  "label": "newRandomBeaconGovernance",
3087
3087
  "offset": 0,
@@ -3089,7 +3089,7 @@
3089
3089
  "type": "t_address"
3090
3090
  },
3091
3091
  {
3092
- "astId": 12272,
3092
+ "astId": 12214,
3093
3093
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3094
3094
  "label": "randomBeaconGovernanceTransferInitiated",
3095
3095
  "offset": 0,
@@ -3097,7 +3097,7 @@
3097
3097
  "type": "t_uint256"
3098
3098
  },
3099
3099
  {
3100
- "astId": 12274,
3100
+ "astId": 12216,
3101
3101
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3102
3102
  "label": "newRelayEntrySoftTimeout",
3103
3103
  "offset": 0,
@@ -3105,7 +3105,7 @@
3105
3105
  "type": "t_uint256"
3106
3106
  },
3107
3107
  {
3108
- "astId": 12276,
3108
+ "astId": 12218,
3109
3109
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3110
3110
  "label": "relayEntrySoftTimeoutChangeInitiated",
3111
3111
  "offset": 0,
@@ -3113,7 +3113,7 @@
3113
3113
  "type": "t_uint256"
3114
3114
  },
3115
3115
  {
3116
- "astId": 12278,
3116
+ "astId": 12220,
3117
3117
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3118
3118
  "label": "newRelayEntryHardTimeout",
3119
3119
  "offset": 0,
@@ -3121,7 +3121,7 @@
3121
3121
  "type": "t_uint256"
3122
3122
  },
3123
3123
  {
3124
- "astId": 12280,
3124
+ "astId": 12222,
3125
3125
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3126
3126
  "label": "relayEntryHardTimeoutChangeInitiated",
3127
3127
  "offset": 0,
@@ -3129,7 +3129,7 @@
3129
3129
  "type": "t_uint256"
3130
3130
  },
3131
3131
  {
3132
- "astId": 12282,
3132
+ "astId": 12224,
3133
3133
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3134
3134
  "label": "newCallbackGasLimit",
3135
3135
  "offset": 0,
@@ -3137,7 +3137,7 @@
3137
3137
  "type": "t_uint256"
3138
3138
  },
3139
3139
  {
3140
- "astId": 12284,
3140
+ "astId": 12226,
3141
3141
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3142
3142
  "label": "callbackGasLimitChangeInitiated",
3143
3143
  "offset": 0,
@@ -3145,7 +3145,7 @@
3145
3145
  "type": "t_uint256"
3146
3146
  },
3147
3147
  {
3148
- "astId": 12286,
3148
+ "astId": 12228,
3149
3149
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3150
3150
  "label": "newGroupCreationFrequency",
3151
3151
  "offset": 0,
@@ -3153,7 +3153,7 @@
3153
3153
  "type": "t_uint256"
3154
3154
  },
3155
3155
  {
3156
- "astId": 12288,
3156
+ "astId": 12230,
3157
3157
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3158
3158
  "label": "groupCreationFrequencyChangeInitiated",
3159
3159
  "offset": 0,
@@ -3161,7 +3161,7 @@
3161
3161
  "type": "t_uint256"
3162
3162
  },
3163
3163
  {
3164
- "astId": 12290,
3164
+ "astId": 12232,
3165
3165
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3166
3166
  "label": "newGroupLifetime",
3167
3167
  "offset": 0,
@@ -3169,7 +3169,7 @@
3169
3169
  "type": "t_uint256"
3170
3170
  },
3171
3171
  {
3172
- "astId": 12292,
3172
+ "astId": 12234,
3173
3173
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3174
3174
  "label": "groupLifetimeChangeInitiated",
3175
3175
  "offset": 0,
@@ -3177,7 +3177,7 @@
3177
3177
  "type": "t_uint256"
3178
3178
  },
3179
3179
  {
3180
- "astId": 12294,
3180
+ "astId": 12236,
3181
3181
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3182
3182
  "label": "newDkgResultChallengePeriodLength",
3183
3183
  "offset": 0,
@@ -3185,7 +3185,7 @@
3185
3185
  "type": "t_uint256"
3186
3186
  },
3187
3187
  {
3188
- "astId": 12296,
3188
+ "astId": 12238,
3189
3189
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3190
3190
  "label": "dkgResultChallengePeriodLengthChangeInitiated",
3191
3191
  "offset": 0,
@@ -3193,7 +3193,7 @@
3193
3193
  "type": "t_uint256"
3194
3194
  },
3195
3195
  {
3196
- "astId": 12298,
3196
+ "astId": 12240,
3197
3197
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3198
3198
  "label": "newDkgResultChallengeExtraGas",
3199
3199
  "offset": 0,
@@ -3201,7 +3201,7 @@
3201
3201
  "type": "t_uint256"
3202
3202
  },
3203
3203
  {
3204
- "astId": 12300,
3204
+ "astId": 12242,
3205
3205
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3206
3206
  "label": "dkgResultChallengeExtraGasChangeInitiated",
3207
3207
  "offset": 0,
@@ -3209,7 +3209,7 @@
3209
3209
  "type": "t_uint256"
3210
3210
  },
3211
3211
  {
3212
- "astId": 12302,
3212
+ "astId": 12244,
3213
3213
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3214
3214
  "label": "newDkgResultSubmissionTimeout",
3215
3215
  "offset": 0,
@@ -3217,7 +3217,7 @@
3217
3217
  "type": "t_uint256"
3218
3218
  },
3219
3219
  {
3220
- "astId": 12304,
3220
+ "astId": 12246,
3221
3221
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3222
3222
  "label": "dkgResultSubmissionTimeoutChangeInitiated",
3223
3223
  "offset": 0,
@@ -3225,7 +3225,7 @@
3225
3225
  "type": "t_uint256"
3226
3226
  },
3227
3227
  {
3228
- "astId": 12306,
3228
+ "astId": 12248,
3229
3229
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3230
3230
  "label": "newDkgSubmitterPrecedencePeriodLength",
3231
3231
  "offset": 0,
@@ -3233,7 +3233,7 @@
3233
3233
  "type": "t_uint256"
3234
3234
  },
3235
3235
  {
3236
- "astId": 12308,
3236
+ "astId": 12250,
3237
3237
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3238
3238
  "label": "dkgSubmitterPrecedencePeriodLengthChangeInitiated",
3239
3239
  "offset": 0,
@@ -3241,7 +3241,7 @@
3241
3241
  "type": "t_uint256"
3242
3242
  },
3243
3243
  {
3244
- "astId": 12310,
3244
+ "astId": 12252,
3245
3245
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3246
3246
  "label": "newRelayEntrySubmissionFailureSlashingAmount",
3247
3247
  "offset": 0,
@@ -3249,7 +3249,7 @@
3249
3249
  "type": "t_uint96"
3250
3250
  },
3251
3251
  {
3252
- "astId": 12312,
3252
+ "astId": 12254,
3253
3253
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3254
3254
  "label": "relayEntrySubmissionFailureSlashingAmountChangeInitiated",
3255
3255
  "offset": 0,
@@ -3257,7 +3257,7 @@
3257
3257
  "type": "t_uint256"
3258
3258
  },
3259
3259
  {
3260
- "astId": 12314,
3260
+ "astId": 12256,
3261
3261
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3262
3262
  "label": "newMaliciousDkgResultSlashingAmount",
3263
3263
  "offset": 0,
@@ -3265,7 +3265,7 @@
3265
3265
  "type": "t_uint96"
3266
3266
  },
3267
3267
  {
3268
- "astId": 12316,
3268
+ "astId": 12258,
3269
3269
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3270
3270
  "label": "maliciousDkgResultSlashingAmountChangeInitiated",
3271
3271
  "offset": 0,
@@ -3273,7 +3273,7 @@
3273
3273
  "type": "t_uint256"
3274
3274
  },
3275
3275
  {
3276
- "astId": 12318,
3276
+ "astId": 12260,
3277
3277
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3278
3278
  "label": "newUnauthorizedSigningSlashingAmount",
3279
3279
  "offset": 0,
@@ -3281,7 +3281,7 @@
3281
3281
  "type": "t_uint96"
3282
3282
  },
3283
3283
  {
3284
- "astId": 12320,
3284
+ "astId": 12262,
3285
3285
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3286
3286
  "label": "unauthorizedSigningSlashingAmountChangeInitiated",
3287
3287
  "offset": 0,
@@ -3289,7 +3289,7 @@
3289
3289
  "type": "t_uint256"
3290
3290
  },
3291
3291
  {
3292
- "astId": 12322,
3292
+ "astId": 12264,
3293
3293
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3294
3294
  "label": "newSortitionPoolRewardsBanDuration",
3295
3295
  "offset": 0,
@@ -3297,7 +3297,7 @@
3297
3297
  "type": "t_uint256"
3298
3298
  },
3299
3299
  {
3300
- "astId": 12324,
3300
+ "astId": 12266,
3301
3301
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3302
3302
  "label": "sortitionPoolRewardsBanDurationChangeInitiated",
3303
3303
  "offset": 0,
@@ -3305,7 +3305,7 @@
3305
3305
  "type": "t_uint256"
3306
3306
  },
3307
3307
  {
3308
- "astId": 12326,
3308
+ "astId": 12268,
3309
3309
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3310
3310
  "label": "newRelayEntryTimeoutNotificationRewardMultiplier",
3311
3311
  "offset": 0,
@@ -3313,7 +3313,7 @@
3313
3313
  "type": "t_uint256"
3314
3314
  },
3315
3315
  {
3316
- "astId": 12328,
3316
+ "astId": 12270,
3317
3317
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3318
3318
  "label": "relayEntryTimeoutNotificationRewardMultiplierChangeInitiated",
3319
3319
  "offset": 0,
@@ -3321,7 +3321,7 @@
3321
3321
  "type": "t_uint256"
3322
3322
  },
3323
3323
  {
3324
- "astId": 12330,
3324
+ "astId": 12272,
3325
3325
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3326
3326
  "label": "newUnauthorizedSigningNotificationRewardMultiplier",
3327
3327
  "offset": 0,
@@ -3329,7 +3329,7 @@
3329
3329
  "type": "t_uint256"
3330
3330
  },
3331
3331
  {
3332
- "astId": 12332,
3332
+ "astId": 12274,
3333
3333
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3334
3334
  "label": "unauthorizedSigningNotificationRewardMultiplierChangeInitiated",
3335
3335
  "offset": 0,
@@ -3337,7 +3337,7 @@
3337
3337
  "type": "t_uint256"
3338
3338
  },
3339
3339
  {
3340
- "astId": 12334,
3340
+ "astId": 12276,
3341
3341
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3342
3342
  "label": "newMinimumAuthorization",
3343
3343
  "offset": 0,
@@ -3345,7 +3345,7 @@
3345
3345
  "type": "t_uint96"
3346
3346
  },
3347
3347
  {
3348
- "astId": 12336,
3348
+ "astId": 12278,
3349
3349
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3350
3350
  "label": "minimumAuthorizationChangeInitiated",
3351
3351
  "offset": 0,
@@ -3353,7 +3353,7 @@
3353
3353
  "type": "t_uint256"
3354
3354
  },
3355
3355
  {
3356
- "astId": 12338,
3356
+ "astId": 12280,
3357
3357
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3358
3358
  "label": "newAuthorizationDecreaseDelay",
3359
3359
  "offset": 0,
@@ -3361,7 +3361,7 @@
3361
3361
  "type": "t_uint64"
3362
3362
  },
3363
3363
  {
3364
- "astId": 12340,
3364
+ "astId": 12282,
3365
3365
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3366
3366
  "label": "authorizationDecreaseDelayChangeInitiated",
3367
3367
  "offset": 0,
@@ -3369,7 +3369,7 @@
3369
3369
  "type": "t_uint256"
3370
3370
  },
3371
3371
  {
3372
- "astId": 12342,
3372
+ "astId": 12284,
3373
3373
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3374
3374
  "label": "newAuthorizationDecreaseChangePeriod",
3375
3375
  "offset": 0,
@@ -3377,7 +3377,7 @@
3377
3377
  "type": "t_uint64"
3378
3378
  },
3379
3379
  {
3380
- "astId": 12344,
3380
+ "astId": 12286,
3381
3381
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3382
3382
  "label": "authorizationDecreaseChangePeriodChangeInitiated",
3383
3383
  "offset": 0,
@@ -3385,7 +3385,7 @@
3385
3385
  "type": "t_uint256"
3386
3386
  },
3387
3387
  {
3388
- "astId": 12346,
3388
+ "astId": 12288,
3389
3389
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3390
3390
  "label": "newDkgMaliciousResultNotificationRewardMultiplier",
3391
3391
  "offset": 0,
@@ -3393,7 +3393,7 @@
3393
3393
  "type": "t_uint256"
3394
3394
  },
3395
3395
  {
3396
- "astId": 12348,
3396
+ "astId": 12290,
3397
3397
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3398
3398
  "label": "dkgMaliciousResultNotificationRewardMultiplierChangeInitiated",
3399
3399
  "offset": 0,
@@ -3401,7 +3401,7 @@
3401
3401
  "type": "t_uint256"
3402
3402
  },
3403
3403
  {
3404
- "astId": 12350,
3404
+ "astId": 12292,
3405
3405
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3406
3406
  "label": "newDkgResultSubmissionGas",
3407
3407
  "offset": 0,
@@ -3409,7 +3409,7 @@
3409
3409
  "type": "t_uint256"
3410
3410
  },
3411
3411
  {
3412
- "astId": 12352,
3412
+ "astId": 12294,
3413
3413
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3414
3414
  "label": "dkgResultSubmissionGasChangeInitiated",
3415
3415
  "offset": 0,
@@ -3417,7 +3417,7 @@
3417
3417
  "type": "t_uint256"
3418
3418
  },
3419
3419
  {
3420
- "astId": 12354,
3420
+ "astId": 12296,
3421
3421
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3422
3422
  "label": "newDkgResultApprovalGasOffset",
3423
3423
  "offset": 0,
@@ -3425,7 +3425,7 @@
3425
3425
  "type": "t_uint256"
3426
3426
  },
3427
3427
  {
3428
- "astId": 12356,
3428
+ "astId": 12298,
3429
3429
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3430
3430
  "label": "dkgResultApprovalGasOffsetChangeInitiated",
3431
3431
  "offset": 0,
@@ -3433,7 +3433,7 @@
3433
3433
  "type": "t_uint256"
3434
3434
  },
3435
3435
  {
3436
- "astId": 12358,
3436
+ "astId": 12300,
3437
3437
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3438
3438
  "label": "newNotifyOperatorInactivityGasOffset",
3439
3439
  "offset": 0,
@@ -3441,7 +3441,7 @@
3441
3441
  "type": "t_uint256"
3442
3442
  },
3443
3443
  {
3444
- "astId": 12360,
3444
+ "astId": 12302,
3445
3445
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3446
3446
  "label": "notifyOperatorInactivityGasOffsetChangeInitiated",
3447
3447
  "offset": 0,
@@ -3449,7 +3449,7 @@
3449
3449
  "type": "t_uint256"
3450
3450
  },
3451
3451
  {
3452
- "astId": 12362,
3452
+ "astId": 12304,
3453
3453
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3454
3454
  "label": "newRelayEntrySubmissionGasOffset",
3455
3455
  "offset": 0,
@@ -3457,7 +3457,7 @@
3457
3457
  "type": "t_uint256"
3458
3458
  },
3459
3459
  {
3460
- "astId": 12364,
3460
+ "astId": 12306,
3461
3461
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3462
3462
  "label": "relayEntrySubmissionGasOffsetChangeInitiated",
3463
3463
  "offset": 0,
@@ -3465,7 +3465,7 @@
3465
3465
  "type": "t_uint256"
3466
3466
  },
3467
3467
  {
3468
- "astId": 12369,
3468
+ "astId": 12311,
3469
3469
  "contract": "contracts/RandomBeaconGovernance.sol:RandomBeaconGovernance",
3470
3470
  "label": "governanceDelay",
3471
3471
  "offset": 0,