Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not possible to use approve function with USDC token testnets #12

Closed
jbastruz opened this issue Nov 21, 2022 · 0 comments
Closed

not possible to use approve function with USDC token testnets #12

jbastruz opened this issue Nov 21, 2022 · 0 comments

Comments

@jbastruz
Copy link

Hi, i'm currently try to use USDC token to buy/sell NFT, and for that i need to approve my NFT Contract to be able to use transfer function

My wrote this part of the code :

function getApproval(uint256 _pid) public returns(bool){

    TokenInfo memory tokens = AllowedCrypto[_pid];
     IERC20 paytoken;
     paytoken = tokens.paytoken;
     uint256 cost;
     cost = tokens.costvalue;

     paytoken.approve(address(this), cost);
        
}

but it doesn't seems to work as expected, in didn't approve anything and it's impossible to use USDC this way... I con't find my mistake,

if someone as the answer

@jbastruz jbastruz closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant