Interacting directly with smartcontracts

Happyhippo is built to stay true to the Dapp spirit of decentralization meaning you're able to easily interact directly with the smart contracts without needing a front-end website nor any complex coding. This means that even if happyhippo.farm website goes down for some reason, you're still able to interact with the underlying smart contracts adding an extra layer of security and durability.

In this example we'll use BSC's standard block-explorer bscscan.com

To deposit into the CAKE-BNB Vault

Clicking on the contract link, will land you in the bscscan page.

A contract that allows you to interact directly with it needs to be verified, ie the green checkmark.

Moving on, before you can deposit to the contract, you’ll need to approve the tokens first. Every standard ERC2/BEP20 tokens have a standard approve function available. In this example, since it’s the cake-bnb LP, you can get LP contract addresses by clicking pair info in the vault UI or from the PCS info page. The LP token address is at

https://bscscan.com/address/0x0eD7e52944161450477ee417DE9Cd3a859b14fD0#readContract

In bscscan, click on Contract, then click Write Contract

Connect your wallet, by clicking the red button “Connect to Web 3,

Then in the approve function, enter the vault address, “0x50C0C86b150B3B16fb423A57202aBEc5e8c1EF19” and an amount, to allow you to deposit CAKE-BNB LPs into the vault. Note PCS LPs uses 18 decimal, so if in your wallet it shows 10 PCS LPs, what you need to enter in bscscan is 10,000,000,000,000,000,000 without the commas to approve 10 LPs for deposit.

There’s a lot of scam websites out there that baits you to approve their contracts in order to spend your tokens, you can check your list of approvals by using the allowance function in read contract

For the input params, the first address is your wallet address and the second address is the vault/smart contract address that you’ve given an allowance to previously. You can later revoke allowance by setting approval back to 0 via writecontract/approve.

Btw, If you’re new to providing liquidity, you can use hippo’s zap to directly convert from bnb to LP tokens.

After approving the vault to the LP tokens, we go back to the vault contract address

https://www.bscscan.com/address/0x50C0C86b150B3B16fb423A57202aBEc5e8c1EF19#writeProxyContract

and select write as proxy.

Enter the amount you wish to deposit

After you’ve deposited, to check on your deposited balance and earned rewards, click Read as Proxy

Enter your address in the balance or the earned function to check your total balance and your earned LPs to date.

To harvest or withdraw your deposit, go back to write as proxy

Last updated