Preparation:

  1. Install and set up the plug-in wallet MetaMask in the browser, detailed tutorial can be viewed at: https://www.yuque.com/zgryhn/duu5f7/vf14e3
    2. Deposit enough ETH to your wallet address as fee
    3. Know the related contracts of P-tokens on WePiggy-Ethereum and mainstream tokens tokens on Ethereum mainnet
    P-tokens
    0 - 0x27A94869341838D5783368a8503FdA5fbCd7987c - pETH
    1 - 0x85166b72c87697a6acfF24101B43Fd54fE28a179 - pDAI
    2 - 0x5cFad792C4Df1323188180778AeC58E00eAcE32a - pUSDT
    6 - 0xf8E5b9738BF63ADFFf36a849F9b9C9617c8D8c1f - pUSDC
    7 - 0xc12B9D620bFCB48be3e0CCbf0ea80C717333b46F - pWBTC
    10- 0xa1d0E215a23d7030842FC67cE582a6aFa3CCaB83 - YFII
    11- 0x59d4CCC94A9C4C3d3b4bA2Aa343a9bDF95145DD1 - QUSD
    12- 0xdF574c24545E5FfEcb9a659c229253D4111d87e1 - HUSD
    13- 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 - UNI
    14- 0x4161725D019690a3E0de50f6bE67b07a86A9fAe1 - TPT
    15- 0x066798d9ef0833ccc719076Dab77199eCbd178b0 - SAKE
    16- 0x0316EB71485b0Ab14103307bf65a021042c6d380 - HBTC
    17- 0x7592dC0C4Bc7CFc91Ae5A7d62dc96c949fD27193 - HOO

    18- 0xdac17f958d2ee523a2206206994597c13d831ec7- USDT
    20- 0x82413f75f0DA101e0FE7F6FF6cBa3461F7e04f29 - pUNI
    21- 0x82dE3959c09f665a82C794fAfC1eb34CFCb555Ee - pYFII
    23- 0x690Aa2591e57180cBA5A6123e9D462907A5e1c95 - pLRC

Open the browser, log in to MetaMask, and then open https://etherscan.io/ to enter the blockchain explorerE001.png

Operating contract tutorial on the explorer

Note: For which asset you want to operate, you must operate the P-token contract of that asset. P-token represents the deposit receipt of the token in WePiggy
For example:
To deposit ETH, you need to operate the P_ETH contract;
To withdraw USDC, you need to operate the P_USDC contract;
To borrow USDT, you need to operate the P_USDT contract;
To repay ETH, you need to operate the P_BNB contract;

How to deposit

Take USDT as an example

  1. Copy the contract address of pUSDT and paste it into the search box, click to search and then check if it is pUSDT

E002.png

  1. Click “Contract”, then click “Write as Proxy”

E003.png

  1. Click “Connect to web3” below, select MetaMask’s approvement and connect to the wallet

E004.png

  1. Find mint under “Write as Proxy”

E013.png

  1. Enter the amount of tokens to be deposited in the text box.
    All currencies other than ETH must be multiplied by 10 to the power of N, where N is the Decimals
    For example, to deposit100 USDT (decimal:6), enter 100 times 10 to the 6th power = 100000000

E011.png
**Note: On the Ethereum mainnet, you can directly enter the amount of ETH when operating ETH
Other tokens such as DAI, USDT, USDC, etc. need to be multiplied by the number of Decimals, the Decimals can be checked in the corresponding token contract
E006.png

  1. Click “Write”, then check the amount, gas fees and other information in the pop-up MetaMask confirmation, and then click to confirm. After confirmation, the “View your transaction” button will appear, and you can check the operation on the explorer after clicking

E012.png

  1. You can check the amount of USDT deposited and the amount of pUSDT minted

010.png
Note: If the deposit is not successful, it may be because the asset has not been approved. Except for ETH, the first deposit and withdrawal of any other tokens require an approvement operation. For details, go to the “Approvement Related Tutorial” below.

How to withdraw

Take USDT as example

  1. Copy the contract address of PUSDT and paste it into the search box, click to search and then check if it is pUSDT

E002.png

  1. Click “Contract”, then click “Write as Proxy”

E003.png

  1. Click “Connect to web3” below, select MetaMask’s approvement and connect to the wallet

E004.png

  1. Find redeemUnderlying under “Write as Proxy”

011.png

  1. Enter the amount of tokens to be withdrawed in the text box.
    All currencies other than ETH must be multiplied by 10 to the power of N, where N is the Decimals
    For example, to withdraw100 USDT (decimal:6), enter 100 times 10 to the 6th power = 100000000

012.png
**Note: On the Ethereum mainnet, you can directly enter the amount of ETH when operating ETH
Other tokens such as DAI, USDT, USDC, etc. need to be multiplied by the number of Decimals, the Decimals can be checked in the corresponding token contract
E006.png

  1. Click “Write”, then check the amount, gas fees and other information in the pop-up MetaMask confirmation, and then click to confirm
    After confirmation, the “View your transaction” button will appear, and you can check the operation on the explorer after clicking

013.png
7. You can check the amount of USDT withdrawed
014.png
**Note:

  1. If the withdrawal is not successful, it may be because you have the borrowings and the asset has been used as collateral;
  2. If you withdraw when you have borrowings, liquidation may occur because your borrowings reaches the upper limit;
  3. If you have already deposited the pToken in the mining pool, you cannot directly withdraw it.

How to Borrow

Take USDT as example

  1. Copy the contract address of PUSDT and paste it into the search box, click to search and then check if it is pUSDTE002.png
  2. Click “Contract”, then click “Write as Proxy”

E003.png

  1. Click “Connect to web3” below, select MetaMask’s approvement and connect to the wallet

E004.png

  1. Find borrow under “Write as Proxy”

015.png

  1. Enter the amount of tokens to be borrowed in the text box.
    All currencies other than ETH must be multiplied by 10 to the power of N, where N is the Decimals
    For example, to borrow 100 USDT (decimal:6), enter 100 times 10 to the 6th power = 100000000

016.png

Note: On the Ethereum mainnet, you can directly enter the amount of ETH when operating ETH
Other tokens such as DAI, USDT, USDC, etc. need to be multiplied by the number of Decimals, the Decimals can be checked in the corresponding token contract
E006.png

  1. Click “Write”, then check the amount, gas fees and other information in the pop-up MetaMask confirmation, and then click to confirm
    After confirmation, the “View your transaction” button will appear, and you can check the operation on the explorer after clicking

017.png

  1. You can view the amount of USDT borrowed

018.png
Note:

  1. If the borrow is not successful, it may be because your pledged amount is insufficient;
  2. If the borrow is not successful, it may be because you have already deposited pToken in the mining pool;
  3. If you withdraw when you have borrowings, liquidation may occur because your borrowings reaches the upper limit;

    How to Repay

    Take USDT as example

  4. Copy the contract address of PUSDT and paste it into the search box, click to search and then check if it is pUSDT

E002.png

  1. Click “Contract”, then click “Write as Proxy”

E003.png

  1. Click “Connect to web3” below, select MetaMask’s approvement and connect to the wallet

E004.png

  1. Find repayBorrow under “Write as Proxy”

019.png

  1. Enter the amount of tokens to be repayed in the text box.
    All currencies other than ETH must be multiplied by 10 to the power of N, where N is the Decimals
    For example, to borrow 100 USDT (decimal:6), enter 100 times 10 to the 6th power = 100000000

020.png
Note: On the Ethereum mainnet, you can directly enter the amount of ETH when operating ETH
Other tokens such as DAI, USDT, USDC, etc. need to be multiplied by the number of Decimals, the Decimals can be checked in the corresponding token contract
E006.png

  1. Click “Write”, then check the amount, gas fees and other information in the pop-up MetaMask confirmation, and then click to confirm
    After confirmation, the “View your transaction” button will appear, and you can check the operation on the explorer after clicking

021.png
7. You can check the amount of USDT repayed
022.png
**Note: If the repay is not successful, it may be because the asset has not been approved. Except for ETH, the first deposit and withdrawal of any other tokens require an approvement operation. For details, go to the “Approvement Related Tutorial” below.

How to stake pTokens to the mining pools

Take USDT as example
1. Copy and paste WePiggy’s mining pool contract 0x451032c55f813338b6e73c1c4b24217614165454 into the search box, click search
P001.png

  1. Click “Contract”, then click “Write as Proxy”

E003.png

  1. Click “Connect to web3” below, select MetaMask’s approvement and connect to the wallet

E004.png

  1. Find stake under “Write as Proxy”

p003.png
5. Enter the mining pool ID of the currency to be staked in the pid (Check the preparation at the beginning of this tutorial), the pUSDT mining pool ID is 2
Enter the amount of the staked token in the amount, and the staked token amount must be multiplied by 10 to the power of N, where N is the Decimals
For example, to stake 5000 USDT, enter 100 times 10 to the 8th power = 500000000000

p004.png
Note: On the Ethereum mainnet, the Decimals of pTokens are 8
Other tokens’ Decimals can be checked in the corresponding token contract (such as DAI, USDT, USDC, etc.)p002.png

  1. Click “Write”, then check the amount, gas fees and other information in the pop-up MetaMask confirmation, and then click to confirm
    After confirmation, the “View your transaction” button will appear, and you can check the operation on the explorer after clicking

p005.png
7. You can check the amount of pUSDT staked
p006.png
Note: If the deposit is not successful, it may be because the asset has not been approved.
The first deposit and withdrawal of any tokens require an approvement operation. For details, go to the “Approvement Related Tutorial” below.

How to unstake pTokens from the mining pools

Take USDT as example
1. Copy and paste WePiggy’s mining pool contract 0x451032c55f813338b6e73c1c4b24217614165454 into the search box, click search
P001.png

  1. Click “Contract”, then click “Write as Proxy”

E003.png

  1. Click “Connect to web3” below, select MetaMask’s approvement and connect to the wallet

E004.png

  1. Find unStake under “Write as Proxy”

p007.png
5. Enter the mining pool ID of the currency to be unstaked in the pid (Check the preparation at the beginning of this tutorial), the pUSDT mining pool ID is 2
Enter the amount of the unstaked token in the amount, and the unstaked token amount must be multiplied by 10 to the power of N, where N is the Decimals
For example, to unstake 5000 USDT, enter 100 times 10 to the 8th power = 500000000000
p008.png
Note: On the Ethereum mainnet, the Decimals of pTokens are 8
Other tokens’ Decimals can be checked in the corresponding token contract (such as DAI, USDT, USDC, etc.)
p002.png

  1. Click “Write”, then check the amount, gas fees and other information in the pop-up MetaMask confirmation, and then click to confirm
    After confirmation, the “View your transaction” button will appear, and you can check the operation on the explorer after clicking

p009.png
7. You can check the amount of pUSDT unstaked
p010.png

Approvement related tutorials

Note: Deposit/repay is the approvement of contract operation to the base tokens, and staking to the mining pool is the approvement of contract operation to the pTokens! ! !
Note: Deposit/repay is the approvement of contract operation to the base tokens, and staking to the mining pool is the approvement of contract operation to the pTokens! ! !
Note: Deposit/repay is the approvement of contract operation to the base tokens, and staking to the mining pool is the approvement of contract operation to the pTokens! ! !

How to check if the token is approved

  1. Enter the contract address of the corresponding token on the blockchain explorer, and then click search
    001.png

  2. Click “Contract”, then click “Read Contract”

002.png

  1. Find allowance under “Read Contract”

003.png

  1. Enter your wallet address in the <_owner> column, then enter the token address in the column and click “Query”

E009.png
View the returned results
The return result will be 0 if the token hasn’t been approved
The other numbers are the corresponding amount of approvement

How to apporve

  1. Enter the contract address of the corresponding token on the blockchain explorer, and then click search

001.png

  1. Click “Contract”, then click “Write Contract”

004.png

  1. Click “Connect to web3” below, select MetaMask’s approvement and connect to the wallet

E004.png

  1. Find approve under “Write as Proxy”

005.png

  1. Enter your contract address of the token in the column, then enter amount to be approved of the token in the column and click “Write”

006.png
Note: It is recommended to use the maximum value of approvement (18 decimals) on wepiggy: **115792089237316195423570985008687907853269984665640564039457584007913129639935

**
6. After clicking “Write”, there will be a MetaMask pop-up window, click to confirm
007.png

  1. After confirmation, the “View your transaction” button will appear, and you can click to check the operation on the blockchain browser008.png
  2. View your approvement status

033.png