WHive Smart Contract Analysis

in #whive4 years ago

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: https://hive.blog/hive/@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.

Sort:  

It's cool that HIVE user can now trade WHIVE on Ethereum blockchain and make use of other DEFI project

Let’s keep on BUIDLing with our Hive

I am a bit lost on the burning side though. 🤔

Posted using Dapplr

Burning basically is remove your token and decrease supply

Crazy to see all this cool stuff happens in this short time period

Hi @superoo7! Good thing to know that there Hive is getting more accomplishments/milestones as time pass by. I can't think to wonder what will be the face of Hive platform next coming years. I hope more development will come to Hive.

Very useful. That's the step forward for Hive and whole community.

Hi mate, I’ve been in contact with @fbslo about a possible use case for WHIVE involving forking YFI/YFL and using WHIVE. He suggested that I contact you as you may have the solidity skills to do this. If we can pull this off, it could give huge demand for HIVE and be a great opportunity for everyone. If you’re interested, would love to chat more. You can contact me on Discord: nextgen622#9647

Congratulations @superoo7! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You received more than 3000 as payout for your posts. Your next target is to reach a total payout of 4000

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP