DEV Community

Marques Traylor
Marques Traylor

Posted on

ShadowGas - v1.1.0

ShadowGas now supports GST2 Tokens in the new update. Now it can store and transfer CHI, LGT, and GST2 gas tokens.


v1.1.0

  1. Removed unused contracts
  2. Reduced the size of the ShadowGas contract from 7.50KB to 6.39KB
  3. Added GST2 Scripts and Tasks (Tank, Refuel, Empty, EmptyTo)
  4. Updated Contract, added gstDiscount modifier, _destroy function, gst store and transfer functions
  5. Changed test directory (can test each token separately)
  6. Added GST2 tests
  7. Added GST2 configuration to shadow.config.json

shadow.config.json

`RefuelChiAmt` - Mint Chi Amount
`RefuelLgtAmt` - Mint Lgt Amount
`RefuelGstAmt` - Mint Gst Amount
`EmptyChiAmt` - Transfer Chi Amount
`EmptyLgtAmt` - Transfer Lgt Amount
`EmptyGstAmt` - Transfer Gst Amount
`EmptyChiTo` - Address to transfer Chi to
`EmptyLgtTo` - Address to transfer Lgt to
`EmptyGstTo` - Address to transfer Gst to
`GasLimit` - Gas Limit
`GasSpeed` - Gas Speed ("fast", "average", "slow") 
`TradeLimit` - The amount of trades to perform
`LgtTradeAmount` - Amount of LGT Tokens to trade
Enter fullscreen mode Exit fullscreen mode

GST2 Kovan & Mainnet

Alt Text

Be sure to use the correct address for GST2!

Default is Kovan

GST2 Examples

npx buidler tank --token Gst
Enter fullscreen mode Exit fullscreen mode

Alt Text

npx buidler refuel --token Gst
Enter fullscreen mode Exit fullscreen mode

Alt Text

npx buidler empty --token Gst
Enter fullscreen mode Exit fullscreen mode

Alt Text

npx buidler emptyTo --token Gst
Enter fullscreen mode Exit fullscreen mode

Alt Text

Tests

npx buidler test
Enter fullscreen mode Exit fullscreen mode

Run all tests

npx buidler test ./test/gst-test.js
Enter fullscreen mode Exit fullscreen mode

Test GST2 Tokens

npx buidler test ./test/chi-test.js
Enter fullscreen mode Exit fullscreen mode

Test Chi Tokens

npx buidler test ./test/lgt-test.js
Enter fullscreen mode Exit fullscreen mode

Test Lgt Tokens

Alt Text

All tests should pass, but they do require ether to run


I am now working on v2.0.0, this version will include the UI in order to interact with the contract through the DApp.

Discussion (0)