Reputation: 91
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.
here I want to use BUSD instead BNB
Upvotes: 1
Views: 2368
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