WHive Smart Contract Analysis
It's an exciting news to hear about the launch of WHIVE, which is a wrapped token on top of HIVE and making into an ERC-20 compatible token.
Announcement Post: @fbslo/introducing-wrapped-hive-hive-on-ethereum
I had been a Steem/Hive user for more than 2 years and this platform actually introduce me to the world of cryptocurrency.
When Hive launch, I actually written some code to wrapped Hive, the code is written literally in a day, but I decided not to proceed part of it is because there's not much traction of Hive to be on Ethereum during that point of time.
The code is open source https://github.com/superoo7/BSwap, I use library from OpenZeppelin and some inspiration on how custodial ERC-20 bitcoin, wBTC implementation by using the role call Merchants and Custodian
About WHIVE
$WHIVE similar to $WBTC, is a wrapped token implemented to swap from Hive blockchain into Ethereum blockchain. Currently it is implemented using a Custodian/Centralized, but the team do have a roadmap in order to build it into the blockchain soon.
How it works?
WHIVE is a custodian storage of HIVE in order to create an ERC-20 pegged token. The WHIVE is 1-to-1 backed by real HIVE token.
On Ethereum side, it is just a simple smart contract with minter role that can mint the token and anyone can burn the token (Do note that you might want to use the official website to burn the token, or else the burned token cannot bring back to Hive Blockchain)
The fee wise, you need to pay 0.25%+dynamic fee to cover gas cost in order to mint/deposit WHIVE from HIVE. Withdrawal is free, but you need to spend your gas cost in order to carry out burn method on Ethereum
Smart Contract
Since the code is not yet open source, the only place that the code is available is on Etherscan https://etherscan.io/address/0x11d147e8d39F59aF00e159C4b1fe3a31D58A2C66#code
Based on the code, it mainly used the library from OpenZeppelin
contract WHIVE is ERC20Pausable, ERC20Burnable, ERC20Mintable, ERC20Detailed {
constructor() ERC20Detailed("Wrapped Hive", "WHIVE", 3) public {}
}
So, the contract is simple and straight forward, and making use of industry standard Open Zeppelin ERC-20 library.
The token is called Wrapped Hive, and the symbol is WHIVE, and according to the contract, it is pausible, burnable and mintable.
How it works is that the Minter role are able to mint new token, and token being burned will be transfer.
I assumed the burn action need to be carried out in the website, or else the burned token will not be able to be claimed.
Final Thoughts
It's cool that HIVE user can now trade WHIVE on Ethereum blockchain and make use of other DEFI project.
Do note that currently $WHIVE is custodian based, what kind of risk it involves? You need to trust the entity that holds your token. And the smart contract is unaudited, proceed with care.
The team do however wanted to move towards building this WHIVE onchain, so stay tune to look out what they are building.
Leave WHive Smart Contract Analysis to:
Read more #whive posts
Best Posts From Johnson Lai
We have not curated any of superoo7's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Johnson Lai
- WHive Smart Contract Analysis
- Created Hive-Price-Feed
- Created Hive-Price-Feed
- Joining Steemfest 4 community
- [Tutorial] Ruby On Rails Push Notification
- Use "Do Not Track" on your web browser
- Build A Full Front End Stack with Quasar Framework and Vue
- Done my personal portfolio with Steem Blockchain and Quasar Framework
- Unexpected down time
- Side to side comparison of Digital Ocean and AWS LightSail
- What Front End Technology to use to create Steem Dapps?
- Trying out decentraland SDK v5
- Quick simple guide on making Redux-Observable works with TypeScript
- Testing latest React API: React Hook
- DRY your code with Vue.js
- A year on steem!
- Release of Vue CLI plugin generate Vue Project for Chrome Extension
- Advent of Code 2018 is available in 2 days
- Tailwind CSS - Utility-First CSS Framework
- Emoji Builder - ๐ Build your favourite combination of emoji ๐