|
| 1 | +# __A Gas Price Oracle leveraging Oraclize__ |
| 2 | + |
| 3 | + |
| 4 | +## :computer: __What this is:__ |
| 5 | + |
| 6 | +Designed for the ethereum community, this is an Oraclize-powered and Oraclize-funded ethereum gas-price oracle for providing ate on-chain gas prices. The smart-contract allows anyone to query the EthGasStation.info for up-to-date gas prices at any time - other smart-contracts can make queries too! In addition, an ongoing recursive query funded by Oraclize will ensure the latest gas prices are updated in the contract every six hours - enjoy! |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +### :fuelpump: __Gas Prices__: |
| 16 | + |
| 17 | +**❍** Requires ~ 3,600,000 gas for deployment. |
| 18 | + |
| 19 | +**❍** Gas for normal query to gas station is ~ 111,000. |
| 20 | + |
| 21 | +**❍** Gas for restarting the recursive chain is ~~170,000~~ 111,000 too now. |
| 22 | + |
| 23 | +**❍** _Recursive_ callbacks cost ~170409 so limit is 171000. |
| 24 | + |
| 25 | +**❍** _Non recursive_ callbacks cost ~ 85,350 so their limit is set at 87,000. |
| 26 | + |
| 27 | +**❍** Recursive restarting queries also refund excess ETH, meaning if the recursions stopped due to insufficient ETH balance, it should be topped up first. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +*** |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +### :mortar_board: __Instructions to test:__ |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +**Pre-flight.** Make sure you have Truffle 5 installed globally: |
| 42 | + |
| 43 | +**`❍ npm install -g truffle@beta`** |
| 44 | + |
| 45 | +**1.** Clone the ethereum-examples repo: |
| 46 | + |
| 47 | +**`❍ git clone https://github.com/oraclize/ethereum-examples.git`** |
| 48 | + |
| 49 | +**2.** Switch into the gas-price-oracle directory: |
| 50 | + |
| 51 | +**`❍ cd ethereum-examples/solidity/gas-price-oracle`** |
| 52 | + |
| 53 | +**3.** Install dependencies: |
| 54 | + |
| 55 | +**`❍ npm install`** |
| 56 | + |
| 57 | +**4.** Start Truffle via: |
| 58 | + |
| 59 | +**`❍ truffle develop`** |
| 60 | + |
| 61 | +**5.** Start the Ethereum bridge in a new console via: |
| 62 | + |
| 63 | +**`❍ npm run bridge`** |
| 64 | + |
| 65 | +**6.** Once bridge is spooled up, back to first console to run the tests via: |
| 66 | + |
| 67 | +**`❍ truffle_develop> test`** |
0 commit comments