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.

H2
H3
H4
3 columns
2 columns
1 column
9 Comments
Ecency