Surrender Oz
Surrender Oz

Reputation: 91

How to USE BUSD for making metmask transaction

I'm working on a dapp that sends BNB from wallet to wallet, as of now BNB transfer is achieved by the METAMASK send function, but now I want to send BUSD from wallet to wallet. I'm not sure how I get the BUSD asset bind with the app so it asks the user to send BUSD instead of BNB. Please help me to figure it our how I can make a BUSD transfer from metamask send function.

enter image description here

here I want to use BUSD instead BNB

enter image description here

Upvotes: 1

Views: 2368

Answers (1)

Ahmad Gorji
Ahmad Gorji

Reputation: 424

I personally use ethers.js but I saw nobody answered your question so I give you some hints.

First, code is something like bellow:

let BUSD_ABI = ABI_OF_BUSD;
let BUSD_Contract_Address = BUSD_CONTRACT_ADDRESS;

let BUSD_Contract = new web3.eth.Contract(BUSD_ABI, BUSD_Contract_Address);

function sendBUSD(to, amount){
   BUSD_Contract.transfer(to, amount);
}

Second, You should use BUSD contract to interact with it and transfer BUSD to others. For interacting with contract check web3.js official site here.

Upvotes: 2

Related Questions