An optimization tool for lowering your gas costs during Solidity contract instantiation.
There are three main concerns Ethereum developers have when designing smart contracts: security, accuracy, and cost. We sought to tackle the problem of cost by creating a tool that automates the reordering of state variables during contract instantiation in order to lower transaction costs. We ensured efficient memory allocation by reorganizing your state variables to take up the minimal amount of storage slots necessary.
Tetrix is available as the tetrix
package on npm
Tetrix can be used on any single-contract solidity file. You can optimize contract construction cost with it, but you can also view details about your contract such as ABI, bytecode, opcode and assembly.
To install Tetrix, make sure package.json has been initiated in your project folder.
More info on how to initiate package.json go Here
To use latest stable version of Tetrix you can install it via npm:
$ npm install tetrix-sol
To use Tetrix, execute:
$ Tetrix YOUR_SOL_FILE_PATH.sol
In package.json, include a new script in scripts:
"scripts": {
"tetrixGUI": "webpack --config node_modules/tetrix/webpack.config.js && node node_modules/tetrix/server/server.js"
},
then, execute:
$ npm run tetrixGUI
- Rearranges the Smart Contract state variables in order to allocate the least memory slot possible on the blockchain to optimize gas usage.
- Parse through user Smart Contract and detect state variables
- Arrange variables based on a 32Bytes memory slot.
- Compiles user's Smart Contract using Solidity Compiler for retrieving accurate contract information.
- Deploys user's Smart Contract with trufflesuite/ganache to avoid the need for paying for the main Ethereum Blockchain
- Client-side local hosted server (PORT 8080)
- React - Used for Front-end Single Page Application
- React-Router - Route Management in a Single Page Application
- Ganache - Local Personal Blockchain Environment
- Web3 - Ethereum Javascript API
- Solc - Javascript Solidity Compiler
- Express - Web Framework for node.
- Webpack - Bundler for javascripts/React
Found a bug? Have a suggestion? Feel free to submit issues!
-
Esther Kim - https://github.com/choisiesther
-
Joseph Wu - https://github.com/jospehwu1994
-
Pauline Chang - https://github.com/pskchang
See also the list of contributors who participated in this project.
This project is licensed under the MIT License
- Support from other open source developers
- And the entire Ethereum developer community