IERC20 approve and Allowance not matching

Hey, so i'm writing a smart contract for a staking pool but i have been stuck for days with the exactly same problem. I keep getting "insufficient allowance" when trying to use my contract to transfer to another address on behalf of the client. The thing is that my contract has run IERC20.approve() method and it returns a true. I tried debugging and found that even though the approve method works. the allowance for some reason is still 0. No matter the amount i placed on the approve method.
Is there a problem of bug in the IERC20 standard that requires some extra code?

Please share all the relevant code (and only the relevant code).

IERC20 is an interface describing what the contract should do. It describes the function names with parameters and return type. It does not actually implements anything itself. You will have to write the actual code to implement that interface. If you implemented the code correctly it should work. If it’s not working then there is either something wrong with your implementation or there is something wrong with how you are calling the functions.

If you do not provide us with both your implementation and the method your are calling it we are unable to help. What you just posted comes down to saying your car is not working did the factory make a mistake without us even knowing what car you drive :slight_smile:

Hey @Dahcrown,

approve() can be called with 0 and still return true. Also, there are some other mechanisms that may affect the allowance. However, by the details of your question, I'm afraid is impossible to give you better details.

Feel free to reopen with a reproducible example.