TransferFrom function is not giving tokens to user Wallet on truffle using proxy - smartcontracts

I am facing issues to transferFrom function in ERC20 , I have approved the amount and address!

Related

metamask internal json rpc error using ganache-cli

i have used ganache cli and connected to metamask. normally everything works fine but after i get an error on metamask internal json rpc error, i am not able to use the account . even if i am not interacting with the smart contract . just normal send in metamask does not work for that account and give internal json rpc error. i had to add another account and it works fine.
is account in ganache gets blocked.
or metamask does some kind of blacklisting.
i tried web3 js to interact with those account using their private key and it works perfectly.
please let me know what is the logic here how my ganache accounts are not working and anything that i am missing.
thank you
i tried to interact with smart contract and it didn’t work for some reason. after that for any transaction on metamask i am getting internal rpc error

Pancakeswap router v2 swapExactTokensForETH function fails with Fail with error 'TransferHelper: TRANSFER_FROM_FAILED'

I'm trying swap B-Token for BNB using swapExactTokensForETH on Pancakeswap Router V2
I've also tried swapExactTokensForETHSupportingFeeOnTransferTokens without and success.
It fails with TransferHelper: TRANSFER_FROM_FAILED
When I use pancakeswap.fiance and metamask it works as in this transaction
https://bscscan.com/tx/0x76906d7733566ad9a020994dad44ac7cdddbf5c8d513c769488ae0d9ed96824a
However it fails when I call it from the nodejs script.
I'd really appreciate any help here.

BEP20 token not showing any supply and details on bscscan

I have just cloned a bep20 token and deployed on bsc test net but after successfull deploy tokens are not allocated to the admin wallet even when I add token to metamask it shows 0 value of token even though I have deployed with same wallet also when I'm checking contract on bsctestscan it shows something like this
I'm not sure how I can fix this issue if anyone knows please help me fix this issue
Thanks

Authenticating a user after metamask stopped injecting web3js into the browser

I want to create a passwordless authentication (using Metamask to sign a message; then validate the message on the server and then assign a JWT token). I want the part for signing a message to be written inside a vanilla JavaScript file.
Most of the articles I see online are from 2018 and talk about using web3.eth.personal.sign method from web3 which being injected into the browser by Metamask. However I understand this is no longer the case with Metamask. Now that web3 is not injected anymore, what functions do I call to sign a message with Metamask?
What I've attempted...
I understand there's a window.ethereum object injected into the browser but I can't seem to find an equivalent function in the Metamask documentation for web3.eth.personal.sign
I'm guessing the alternative is to use web3 without window.ethereum but how to I inject this into a vanilla JavaScript file? Also how do I ensure that the message is signed by Metamask if I just use web3 as standalone?
You could use the web3 npm package. Then you can connect it to Metamask with:
import Web3 from "web3";
window.ethereum.request({ method: "eth_requestAccounts" });
const web3 = new Web3(window.ethereum);
This will make metamask popup and ask the user to select an account.
Then to sign a message you can call web3 with:
const dataToSign = "My test message";
const accounts = await web3.eth.getAccounts();
const signature = await web3.eth.sign(dataToSign, accounts[0]);
Documentation: https://web3js.readthedocs.io/en/v1.3.4/web3-eth.html#sign
This will cause Metamask to ask the user to sign the data with their currently active account. I'm not sure how to validate if the signature is correct.

Can't get PayPal access token for live environment

I need to get a PayPal access token and use it for webhook verification. During my testing period (using sandbox environment) there weren't issues, I called https://api.sandbox.paypal.com/v1/oauth2/token with basic authentication and paypal exchanged credentials. But now I need to go into production, therefore I need a live access token (no more sandbox) and using EXACTLY THE SAME METHOD, simply changing clientId and clientSecret for live environment of course, PayPal API is answering with
{ error": "invalid_client",
"error_description": "Client Authentication failed" }
How can I do to overcome this authentication problem?
The problem actually wasn't a problem. I was calling api.SANDBOX.paypal.com for live environment. Of course it wasn't working: I need to call api.paypal.com. The previous call was for sandbox environments only.