0

The following deposit transaction on Mumbai test net is failing as opposed to this transaction on Polygon main net which had succeeded years ago. There are no fundamental differences from code or parameters perspective that I could think of as possible reasons to explain this behaviour.

Obs.: In Mumbai a USDC test token was deployed and is linked to the contract we want to trigger the deposit function, and in Polygon main net, Circle's USDC is used.

Why is there this behaviour mismatch?

2 Answers 2

1

You need to set allowance for the transfer back on deposit of your yieldFarmingToken. Your yieldFarming token currently deployed here.

Without looking too much into the code, if you are doing this in a dApp UI, you need to let the spender make the call to allow an amount of the yieldFarming token to transfer.

Here's the relevant increaseAllowance transaction on the mainnet that allowed the transaction you are referring to to go through https://polygonscan.com/tx/0x3d664928276661b868d00518f966a54c3ebfddf8df98d53540f8c38ffe216da9

Your failing transaction doesn't have a prior increaseAllowance transaction, so it's failing.

Relevant parts in the code:

2
  • Despite the fact that I increased the allowance (mumbai.polygonscan.com/tx/…) as per your answer, the deposit transaction (mumbai.polygonscan.com/tx/…) still failed.
    – Pulsares
    Sep 22 at 11:49
  • I do not think there would be a need to increase allowance at the yieldFarmingToken as yieldFarming is minting tokens directly to the tokenTimeLock contract address upon USDC deposit.
    – Pulsares
    Sep 22 at 12:15
0

The account trying to make a deposit (0x150c1a134941cab797c1fca4f33ec1246076c578) have no LGBC tokens (farming token - 0xC31f68Dc3aF9855fbFB679EB6463d01f051122fD) to deposit. In fact totalSupply of this token is 0. You should mint some of these and send them to the account that tries to depositenter image description here

2
  • The mint functionality happens upon USDC deposit as can be seen in the YieldFarming contract at deposit function: mumbai.polygonscan.com/address/…
    – Pulsares
    Sep 25 at 13:45
  • mint is called after super.deposit(depositor, amount), so at the time of the actual safeTransferFrom call (made in the parent's PaymentSplitter contract), no tokens had been minted yet. Also even if you switch it around (so depositor would have some tokens) you would still need to run approve transaction first, otherwise safeTramsferFrom would still fail because of no allowance being set
    – Vas Treck
    Sep 25 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.