@keep-network/tbtc-v2 0.1.1-dev.112 → 0.1.1-dev.113

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 (52) hide show
  1. package/artifacts/BLS.json +223 -0
  2. package/artifacts/Bank.json +11 -11
  3. package/artifacts/BeaconAuthorization.json +273 -0
  4. package/artifacts/BeaconDkg.json +241 -0
  5. package/artifacts/BeaconDkgValidator.json +516 -0
  6. package/artifacts/BeaconInactivity.json +151 -0
  7. package/artifacts/BeaconSortitionPool.json +1004 -0
  8. package/artifacts/Bridge.json +1392 -1148
  9. package/artifacts/BridgeGovernance.json +14 -14
  10. package/artifacts/BridgeGovernanceParameters.json +6 -6
  11. package/artifacts/Deposit.json +6 -6
  12. package/artifacts/DepositSweep.json +6 -6
  13. package/artifacts/EcdsaDkgValidator.json +9 -9
  14. package/artifacts/EcdsaInactivity.json +6 -6
  15. package/artifacts/EcdsaSortitionPool.json +11 -11
  16. package/artifacts/Fraud.json +6 -6
  17. package/artifacts/KeepRegistry.json +1 -1
  18. package/artifacts/KeepStake.json +2 -2
  19. package/artifacts/KeepToken.json +2 -2
  20. package/artifacts/KeepTokenStaking.json +6 -6
  21. package/artifacts/MaintainerProxy.json +12 -12
  22. package/artifacts/MovingFunds.json +6 -6
  23. package/artifacts/NuCypherStakingEscrow.json +39 -8
  24. package/artifacts/NuCypherToken.json +2 -2
  25. package/artifacts/RandomBeacon.json +3261 -0
  26. package/artifacts/RandomBeaconGovernance.json +3382 -0
  27. package/artifacts/Redemption.json +6 -6
  28. package/artifacts/ReimbursementPool.json +5 -5
  29. package/artifacts/Relay.json +6 -6
  30. package/artifacts/T.json +2 -2
  31. package/artifacts/TBTC.json +11 -11
  32. package/artifacts/TBTCToken.json +11 -11
  33. package/artifacts/TBTCVault.json +13 -13
  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 +13 -13
  38. package/artifacts/VendingMachineKeep.json +2 -2
  39. package/artifacts/VendingMachineNuCypher.json +2 -2
  40. package/artifacts/WalletRegistry.json +989 -890
  41. package/artifacts/WalletRegistryGovernance.json +12 -12
  42. package/artifacts/Wallets.json +6 -6
  43. package/deploy/00_resolve_relay.ts +5 -2
  44. package/deploy/00_resolve_tbtc_v1_token.ts +5 -2
  45. package/deploy/05_deploy_bridge.ts +4 -1
  46. package/export/deploy/00_resolve_relay.js +9 -7
  47. package/export/deploy/00_resolve_tbtc_v1_token.js +9 -7
  48. package/export/deploy/05_deploy_bridge.js +4 -1
  49. package/export/hardhat.config.js +6 -3
  50. package/export.json +8461 -2126
  51. package/package.json +4 -3
  52. package/artifacts/RandomBeaconStub.json +0 -141
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keep-network/tbtc-v2",
3
- "version": "0.1.1-dev.112+main.942504ee5364d8fcecec856c8196cf3168785a23",
3
+ "version": "0.1.1-dev.113+main.363870f74bf400460b2d473b1073da433676d5c7",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "artifacts/",
@@ -15,6 +15,7 @@
15
15
  "clean": "hardhat clean",
16
16
  "build": "hardhat compile",
17
17
  "deploy": "hardhat deploy --export export.json",
18
+ "deploy:test": "TEST_USE_STUBS_TBTC=true npm run deploy",
18
19
  "format": "npm run lint && prettier --check .",
19
20
  "format:fix": "npm run lint:fix && prettier --write .",
20
21
  "lint": "npm run lint:eslint && npm run lint:sol",
@@ -24,7 +25,7 @@
24
25
  "lint:sol": "solhint 'contracts/**/*.sol'",
25
26
  "lint:fix:sol": "solhint 'contracts/**/*.sol' --fix",
26
27
  "test": "TEST_USE_STUBS_TBTC=true hardhat test",
27
- "test:integration": "NODE_ENV=integration-test hardhat test ./test/integration/*.test.ts",
28
+ "test:integration": "NODE_ENV=integration-test TEST_USE_STUBS_TBTC=true hardhat test ./test/integration/*.test.ts",
28
29
  "prepack": "tsc -p tsconfig.export.json && hardhat export-artifacts export/artifacts",
29
30
  "prepublishOnly": "./scripts/prepare-artifacts.sh --network $npm_config_network"
30
31
  },
@@ -40,7 +41,7 @@
40
41
  },
41
42
  "devDependencies": {
42
43
  "@defi-wonderland/smock": "^2.0.7",
43
- "@keep-network/hardhat-helpers": "^0.6.0-pre.7",
44
+ "@keep-network/hardhat-helpers": "^0.6.0-pre.9",
44
45
  "@keep-network/hardhat-local-networks-config": "^0.1.0-pre.4",
45
46
  "@nomiclabs/hardhat-ethers": "^2.0.6",
46
47
  "@nomiclabs/hardhat-etherscan": "^2.1.4",
@@ -1,141 +0,0 @@
1
- {
2
- "address": "0x1e2F4432bFeF9E9Ad39DA6d272F4aFf33629c770",
3
- "abi": [
4
- {
5
- "anonymous": false,
6
- "inputs": [
7
- {
8
- "indexed": false,
9
- "internalType": "uint256",
10
- "name": "entry",
11
- "type": "uint256"
12
- },
13
- {
14
- "indexed": false,
15
- "internalType": "uint256",
16
- "name": "entrySubmittedBlock",
17
- "type": "uint256"
18
- }
19
- ],
20
- "name": "CallbackFailed",
21
- "type": "event"
22
- },
23
- {
24
- "inputs": [],
25
- "name": "callbackGasLimit",
26
- "outputs": [
27
- {
28
- "internalType": "uint256",
29
- "name": "",
30
- "type": "uint256"
31
- }
32
- ],
33
- "stateMutability": "view",
34
- "type": "function"
35
- },
36
- {
37
- "inputs": [
38
- {
39
- "internalType": "contract IRandomBeaconConsumer",
40
- "name": "_callbackContract",
41
- "type": "address"
42
- }
43
- ],
44
- "name": "requestRelayEntry",
45
- "outputs": [],
46
- "stateMutability": "nonpayable",
47
- "type": "function"
48
- },
49
- {
50
- "inputs": [
51
- {
52
- "internalType": "bytes",
53
- "name": "entry",
54
- "type": "bytes"
55
- }
56
- ],
57
- "name": "submitRelayEntry",
58
- "outputs": [],
59
- "stateMutability": "nonpayable",
60
- "type": "function"
61
- }
62
- ],
63
- "transactionHash": "0xf9def0cb86030f6f37533d0ba5fac92e3870764d2413808e76f6cb05c647cb1b",
64
- "receipt": {
65
- "to": null,
66
- "from": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
67
- "contractAddress": "0x1e2F4432bFeF9E9Ad39DA6d272F4aFf33629c770",
68
- "transactionIndex": 0,
69
- "gasUsed": "207597",
70
- "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
71
- "blockHash": "0xe9f6927e92080e82706dc00a789d6656c6976adbd5630e47f19a71f34545d66f",
72
- "transactionHash": "0xf9def0cb86030f6f37533d0ba5fac92e3870764d2413808e76f6cb05c647cb1b",
73
- "logs": [],
74
- "blockNumber": 25,
75
- "cumulativeGasUsed": "207597",
76
- "status": 1,
77
- "byzantium": true
78
- },
79
- "args": [],
80
- "numDeployments": 1,
81
- "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"entry\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"entrySubmittedBlock\",\"type\":\"uint256\"}],\"name\":\"CallbackFailed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"callbackGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRandomBeaconConsumer\",\"name\":\"_callbackContract\",\"type\":\"address\"}],\"name\":\"requestRelayEntry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"entry\",\"type\":\"bytes\"}],\"name\":\"submitRelayEntry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/test/RandomBeaconStub.sol\":\"RandomBeaconStub\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@keep-network/random-beacon/contracts/api/IRandomBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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.9;\\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\":\"0x5fa1ef7e53c22ed98236519be157d2003b2d53f831ddb99e3a79ef0d78b6f6ca\",\"license\":\"MIT\"},\"@keep-network/random-beacon/contracts/api/IRandomBeaconConsumer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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.9;\\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\":\"0x68a514d763709ee57d42314ed36850a0baa804776464b2d43338ee85166e5943\",\"license\":\"MIT\"},\"@keep-network/random-beacon/contracts/libraries/Callback.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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.9;\\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\":\"0x7e87a7c1dd58c6039ab2d6fd42953ce143baf6d796f1b9cedd3d91d7de992fda\",\"license\":\"MIT\"},\"contracts/test/RandomBeaconStub.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.6;\\n\\nimport \\\"@keep-network/random-beacon/contracts/api/IRandomBeacon.sol\\\";\\nimport \\\"@keep-network/random-beacon/contracts/api/IRandomBeaconConsumer.sol\\\";\\nimport \\\"@keep-network/random-beacon/contracts/libraries/Callback.sol\\\";\\n\\n// TODO: get rid of this contract; use RandomBeacon implementation instead.\\n// This implementation is used to test callback's gas limit only. In most tests\\n// we use smock's FakeContract of IRandomBeacon.\\ncontract RandomBeaconStub is IRandomBeacon {\\n using Callback for Callback.Data;\\n Callback.Data internal callback;\\n\\n // This value has to reflect the one set in the Random Beacon contract!\\n uint256 public callbackGasLimit = 64000;\\n\\n event CallbackFailed(uint256 entry, uint256 entrySubmittedBlock);\\n\\n function requestRelayEntry(IRandomBeaconConsumer _callbackContract)\\n external\\n {\\n callback.setCallbackContract(_callbackContract);\\n }\\n\\n function submitRelayEntry(bytes calldata entry) external {\\n callback.executeCallback(uint256(keccak256(entry)), callbackGasLimit);\\n }\\n}\\n\",\"keccak256\":\"0x0e5c87a70a79fa68718434f9d8b37ef83221c866ff3250e8971e090cdc8f9fda\",\"license\":\"MIT\"}},\"version\":1}",
82
- "bytecode": "0x608060405261fa0060015534801561001657600080fd5b50610264806100266000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806324f74697146100465780634368ec0c146100615780635766591214610091575b600080fd5b61004f60015481565b60405190815260200160405180910390f35b61008f61006f36600461017c565b600080546001600160a01b0383166001600160a01b031990911617905550565b005b61008f61009f3660046101ac565b6100c782826040516100b292919061021e565b604051908190039020600154600091906100cb565b5050565b82546001600160a01b031615610177578254604051631bfaf51960e21b8152600481018490524360248201526001600160a01b0390911690636febd464908390604401600060405180830381600088803b15801561012857600080fd5b5087f19350505050801561013a575060015b61017757604080518381524360208201527f5e2af61e77ec91022b1cafe282abce475bb18e8cdd47083464caa06583fe3909910160405180910390a15b505050565b60006020828403121561018e57600080fd5b81356001600160a01b03811681146101a557600080fd5b9392505050565b600080602083850312156101bf57600080fd5b823567ffffffffffffffff808211156101d757600080fd5b818501915085601f8301126101eb57600080fd5b8135818111156101fa57600080fd5b86602082850101111561020c57600080fd5b60209290920196919550909350505050565b818382376000910190815291905056fea2646970667358221220c6c103b22faeee6da820aaef6b9b7681f67df3a8feb44297200881243c7606c664736f6c63430008090033",
83
- "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806324f74697146100465780634368ec0c146100615780635766591214610091575b600080fd5b61004f60015481565b60405190815260200160405180910390f35b61008f61006f36600461017c565b600080546001600160a01b0383166001600160a01b031990911617905550565b005b61008f61009f3660046101ac565b6100c782826040516100b292919061021e565b604051908190039020600154600091906100cb565b5050565b82546001600160a01b031615610177578254604051631bfaf51960e21b8152600481018490524360248201526001600160a01b0390911690636febd464908390604401600060405180830381600088803b15801561012857600080fd5b5087f19350505050801561013a575060015b61017757604080518381524360208201527f5e2af61e77ec91022b1cafe282abce475bb18e8cdd47083464caa06583fe3909910160405180910390a15b505050565b60006020828403121561018e57600080fd5b81356001600160a01b03811681146101a557600080fd5b9392505050565b600080602083850312156101bf57600080fd5b823567ffffffffffffffff808211156101d757600080fd5b818501915085601f8301126101eb57600080fd5b8135818111156101fa57600080fd5b86602082850101111561020c57600080fd5b60209290920196919550909350505050565b818382376000910190815291905056fea2646970667358221220c6c103b22faeee6da820aaef6b9b7681f67df3a8feb44297200881243c7606c664736f6c63430008090033",
84
- "devdoc": {
85
- "kind": "dev",
86
- "methods": {},
87
- "version": 1
88
- },
89
- "userdoc": {
90
- "kind": "user",
91
- "methods": {},
92
- "version": 1
93
- },
94
- "storageLayout": {
95
- "storage": [
96
- {
97
- "astId": 21606,
98
- "contract": "contracts/test/RandomBeaconStub.sol:RandomBeaconStub",
99
- "label": "callback",
100
- "offset": 0,
101
- "slot": "0",
102
- "type": "t_struct(Data)673_storage"
103
- },
104
- {
105
- "astId": 21609,
106
- "contract": "contracts/test/RandomBeaconStub.sol:RandomBeaconStub",
107
- "label": "callbackGasLimit",
108
- "offset": 0,
109
- "slot": "1",
110
- "type": "t_uint256"
111
- }
112
- ],
113
- "types": {
114
- "t_contract(IRandomBeaconConsumer)428": {
115
- "encoding": "inplace",
116
- "label": "contract IRandomBeaconConsumer",
117
- "numberOfBytes": "20"
118
- },
119
- "t_struct(Data)673_storage": {
120
- "encoding": "inplace",
121
- "label": "struct Callback.Data",
122
- "members": [
123
- {
124
- "astId": 672,
125
- "contract": "contracts/test/RandomBeaconStub.sol:RandomBeaconStub",
126
- "label": "callbackContract",
127
- "offset": 0,
128
- "slot": "0",
129
- "type": "t_contract(IRandomBeaconConsumer)428"
130
- }
131
- ],
132
- "numberOfBytes": "32"
133
- },
134
- "t_uint256": {
135
- "encoding": "inplace",
136
- "label": "uint256",
137
- "numberOfBytes": "32"
138
- }
139
- }
140
- }
141
- }