@venusprotocol/oracle 1.2.3 → 1.3.1

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 (50) hide show
  1. package/README.md +106 -0
  2. package/artifacts/build-info/442613ba0e31d357bb61ad07d3e9ccb5.json +1 -0
  3. package/artifacts/build-info/e79aa95060bbee82bc36063535db4019.json +1 -0
  4. package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.dbg.json +4 -0
  5. package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.json +545 -0
  6. package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.dbg.json +1 -1
  7. package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.json +130 -15
  8. package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.dbg.json +1 -1
  9. package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.json +2 -2
  10. package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +1 -1
  11. package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +2 -2
  12. package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +1 -1
  13. package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.json +22 -3
  14. package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.dbg.json +1 -1
  15. package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.json +2 -2
  16. package/artifacts/contracts/test/MockPyth.sol/MockPyth.dbg.json +1 -1
  17. package/artifacts/contracts/test/MockPyth.sol/MockPyth.json +305 -212
  18. package/contracts/interfaces/PythInterface.sol +147 -75
  19. package/contracts/oracles/PythOracle.sol +1 -1
  20. package/contracts/oracles/mocks/MockBinanceOracle.sol +5 -1
  21. package/contracts/test/MockPyth.sol +90 -55
  22. package/deploy/oracles.ts +104 -0
  23. package/deployments/localhost/.chainId +1 -0
  24. package/deployments/localhost/BinanceOracle.json +393 -0
  25. package/deployments/localhost/BinanceOracle_Implementation.json +305 -0
  26. package/deployments/localhost/BinanceOracle_Proxy.json +241 -0
  27. package/deployments/localhost/BoundValidator.json +457 -0
  28. package/deployments/localhost/BoundValidator_Implementation.json +428 -0
  29. package/deployments/localhost/BoundValidator_Proxy.json +237 -0
  30. package/deployments/localhost/ChainlinkOracle.json +370 -0
  31. package/deployments/localhost/ChainlinkOracle_Implementation.json +273 -0
  32. package/deployments/localhost/ChainlinkOracle_Proxy.json +237 -0
  33. package/deployments/localhost/DefaultProxyAdmin.json +257 -0
  34. package/deployments/localhost/PivotTwapOracle.json +393 -0
  35. package/deployments/localhost/PivotTwapOracle_Implementation.json +304 -0
  36. package/deployments/localhost/PivotTwapOracle_Proxy.json +241 -0
  37. package/deployments/localhost/PythOracle.json +393 -0
  38. package/deployments/localhost/PythOracle_Implementation.json +309 -0
  39. package/deployments/localhost/PythOracle_Proxy.json +241 -0
  40. package/deployments/localhost/ResilientOracle.json +700 -0
  41. package/deployments/localhost/ResilientOracle_Implementation.json +746 -0
  42. package/deployments/localhost/ResilientOracle_Proxy.json +241 -0
  43. package/deployments/localhost/solcInputs/0e89febeebc7444140de8e67c9067d2c.json +78 -0
  44. package/deployments/localhost/solcInputs/468ec7a31e2db8855c82fb8141193271.json +54 -0
  45. package/deployments/localhost/solcInputs/50629170e50dc9fec79dac585e95ac05.json +138 -0
  46. package/package.json +2 -2
  47. package/deploy/oracles.d.ts +0 -4
  48. package/deploy/oracles.d.ts.map +0 -1
  49. package/deploy/oracles.js +0 -90
  50. package/deploy/oracles.js.map +0 -1
package/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # Venus Oracle
2
+
3
+ ## Usage
4
+
5
+ ### Pre Requisites
6
+
7
+ Before running any command, you need to create a `.env` file and set a BIP-39 compatible mnemonic as an environment
8
+ variable. Follow the example in `.env.example`. If you don't already have a mnemonic, use this [website](https://iancoleman.io/bip39/) to generate one.
9
+
10
+ Then, proceed with installing dependencies:
11
+
12
+ ```sh
13
+ $ yarn install
14
+ ```
15
+
16
+ ### Compile
17
+
18
+ Compile the smart contracts with Hardhat:
19
+
20
+ ```sh
21
+ $ yarn compile
22
+ ```
23
+
24
+ ### TypeChain
25
+
26
+ Compile the smart contracts and generate TypeChain artifacts:
27
+
28
+ ```sh
29
+ $ yarn typechain
30
+ ```
31
+
32
+ ### Lint Solidity
33
+
34
+ Lint the Solidity code:
35
+
36
+ ```sh
37
+ $ yarn lint:sol
38
+ ```
39
+
40
+ ### Lint TypeScript
41
+
42
+ Lint the TypeScript code:
43
+
44
+ ```sh
45
+ $ yarn lint:ts
46
+ ```
47
+
48
+ ### Test
49
+
50
+ Run the Mocha tests:
51
+
52
+ ```sh
53
+ $ yarn test
54
+ ```
55
+
56
+ ### Coverage
57
+
58
+ Generate the code coverage report:
59
+
60
+ ```sh
61
+ $ yarn coverage
62
+ ```
63
+
64
+ ### Report Gas
65
+
66
+ See the gas usage per unit test and average gas per method call:
67
+
68
+ ```sh
69
+ $ REPORT_GAS=true yarn test
70
+ ```
71
+
72
+ ### Clean
73
+
74
+ Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
75
+
76
+ ```sh
77
+ $ yarn clean
78
+ ```
79
+
80
+ ### Deploy
81
+
82
+ Deploy the contracts to Hardhat Network:
83
+
84
+ ```sh
85
+ $ yarn deploy --greeting "Bonjour, le monde!" --network bsctestnet
86
+ ```
87
+
88
+ ### Verify
89
+
90
+ Verify the contracts through `hardhat-deploy`
91
+
92
+ ```sh
93
+ $ yarn etherscan-verify --network bsctestnet
94
+ ```
95
+
96
+ ## Syntax Highlighting
97
+
98
+ If you use VSCode, you can enjoy syntax highlighting for your Solidity code via the [hardhat-vscode](https://github.com/NomicFoundation/hardhat-vscode) extension.
99
+
100
+ ## Caveats
101
+
102
+ ### Ethers and Waffle
103
+
104
+ If you can't get the [Waffle matchers](https://ethereum-waffle.readthedocs.io/en/latest/matchers.html) to work, try to
105
+ make your `ethers` package version match the version used by the `@ethereum-waffle/chai` package. Seem
106
+ [#111](https://github.com/paulrberg/solidity-template/issues/111) for more details.