loading...

ShadowGas - Store

traylorboy profile image Marques Traylor ・2 min read

I have finished the Store feature of the ShadowGas contract.

Interaction with the contract can be done via buidler tasks and the console.

Install

git clone https://github.com/TraylorBoy/ShadowGas.git

cd ShadowGas

yarn install

After installing, you will need to create a .env file and modify the shadow.config.js and the buidler.config.js files

.env

SHADOWGAS="" - Contract Address
WALLET="" - Wallet Address
PRIVATEKEY="" - Wallet Private Key
KOVAN="" - Kovan Infura url
ROPSTEN="" - Ropsten Infura url
MAINNET="" - Mainnet Infura url
ETHERSCAN="" - Etherscan API Key
ETH_GAS_STATION="" - EthGasStation API Key

shadow.config.json

RefuelChiAmt - Mint Chi Amount
RefuelLgtAmt - Mint Lgt Amount
EmptyChiAmt - Transfer Chi Amount
EmptyLgtAmt - Transfer Lgt Amount
EmptyChiTo - Address to transfer Chi to
EmptyLgtTo - Address to transfer Lgt to
GasLimit - Gas Limit
GasSpeed - Gas Speed ("fast", "average", "slow") 

Gas Price is retrieved from:

https://ethgasstation.info/
https://etherscan.io/gastracker

I am working on a Gas Oracle which may change this feature

buidler.config.js

...

module.exports = {
  defaultNetwork: "Kovan",
  ...
 }

You may modify the exported properties in the buidler.config.js file.

Store

<GAS_TOKEN> should be either: Chi or Lgt

Refuel

npx buidler refuel --token <GAS_TOKEN>

Mints either Chi or Lgt tokens and stores them at contract's address

Tank

npx buidler tank --token <GAS_TOKEN>

Retrieves Chi or Lgt token balance at contract's address

Examples

Refuel 13 Chi and Lgt tokens

Refuel amount can be modified via the shadow.config.js file

npx buidler refuel --token Chi

Alt Text

npx buidler refuel --token Lgt

Alt Text

Retrieve Chi and Lgt tank balances

npx buidler tank --token Chi

Alt Text

npx buidler tank --token Lgt

Alt Text

I will post the Transfer feature tomorrow!

The repo for the project is located here: https://github.com/TraylorBoy/ShadowGas

Posted on by:

Discussion

pic
Editor guide