Fully Decentralized ERC-20 Token, Wallet, Exchange & Price Chart. React frontend deployed to IPFS, Solidity Smartcontracts deployed to Ethereum Mainnet & Price Chart with CoinGecko RESTful API integration. Unit tested with the Jest and Truffle frameworks. I set out to build my own real-world cryptocurrency, wallet and exchange and so it is.
- Setup Initial App
- Style, React Animations & Update Text Data
- Fetch & Display waviii Price / Minify SCSS
- Re-factor & Fetch waviii Price and Chart Data Directly
- Stylize, IPFS Routing & Handle Errors
- Media Queries / Locked Views
- Unit Test, Create Readme & Deploy
waviii.io's main components consist of two Smartcontracts and a Web3 ERC-20 Token wallet. Both Smartcontracts are deployed to the Ethereum Mainnet blockchain and the wallet component can be reviewed here.
- The first is the waviii ERC-20 Token itself. The live Token Smartcontract can be viewed on Etherscan and its Source Code on GitHub.
- The second contract is the Token Swap, the single source for buying and selling the waviii token in exchange for ETH. Most of the one million originally minted waviii Tokens still reside on this contract, they can be traded at any time and posess real world value pegged to a fraction of ETH. The live Token Swap Smartcontract can be viewed on Etherscan and its Source Code on GitHub.
- The Web3 ERC-20 Token Wallet for the waviii Ethereum Token.
waviii.io's codebase is setup with continuous deployment to three platforms: Heroku, GitHub Pages and Fleek (IPFS). On Fleek, the images, text, styles and javascript are all hosted on the InterPlanetary FileSystem (IPFS) in a fully decentralized way. In connjunction with the Ethereum SmartContract backend, waviii.io is a dApp (Decentralized Application). As there is no central point of failure or central point of management, the dApp is highly redundant as well as highly censorship resistant. I have plans to deploy waviii.io as waviii.crypto to decentralize it's DNS as well thgough unstoppable domains.
I decided to use the CoinGecko's cryptocurrency API through RapidAPI for my chart data and current waviii price. Since waviii has a 100/1 fixed exchange rate with ETH, I simply performed this calculation inline while defining the datapoints as shown below.
getCurrentPrice = () => {
var options = {
method: "GET",
url: "https://coingecko.p.rapidapi.com/simple/price",
params: { ids: "ethereum", vs_currencies: "usd" },
headers: {
"x-rapidapi-key": "RAPID_API_KEY",
"x-rapidapi-host": "coingecko.p.rapidapi.com",
},
};
axios
.request(options)
.then((response) => {
this.setState({ loading: true });
const ETH = response.data.ethereum.usd;
const raw = ETH / 100;
const waviii = raw.toFixed(2);
const max_num = waviii * 1.1 ;
this.setState({ max: max_num });
this.setState({ price: waviii });
const month = `${moment().format("MMM")}`;
this.setState({ month: month.toUpperCase() });
this.setState({ loading: false });
})
.catch(function (error) {
console.error(error);
});
};
node
npm
npm i
npm run start
npm run test (optional)
browse: localhost:3001/
🌀 Click the image(s) below to view the live wabapplication
Contact me at matt@brassey.io with any questions or comments.
waviii.io
is published under the CC0_1.0_Universal license.
The Creative Commons CC0 Public Domain Dedication waives copyright interest in a work you've created and dedicates it to the world-wide public domain. Use CC0 to opt out of copyright entirely and ensure your work has the widest reach. As with the Unlicense and typical software licenses, CC0 disclaims warranties. CC0 is very similar to the Unlicense.