gm. This is my first post here, i will do my best to be specific.
I started to work and build some python scripts to automate some operations on Polygon-PoS network.
I have the following working:(each one is a script)
- WRAP MATIC into WMATIC
- UNWRAP WMATIC into MATIC
- Check token approval
- Get token name and symbol
- Retrieve and save ABI from contracts
- APPROVE token contract to spend in our behalf
- SWAP one token in exchange to another one
The swap function(last one) I am having issues with some ERC20 tokens like:
- USDC = 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 # Metamask USDC on Polygon PoS
- USDT = 0xc2132D05D31c914a87C6611C10748AEb04B58e8F # Metamask USDT on Polygon PoS
These tokens(USDC,USDT) do not have the approve function like others:
- SFL = 0xD1f9c58e33933a993A3891F8acFe05a68E1afC05 # Metamask SFL on Polygon PoS
- WETH = 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619 # Metamask WETH on Polygon PoS
- WMATIC = 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270 # Metamask WMATIC on Polygon PoS
I can manage properly SFL, WETH and WMATIC. I can SWAP WMATIC to USDC but i can not SWAP USDC to any other token. What I am missing here? Can anyone explain to me how can i deal with these tokens that are not like the others listed here?
I tried to manage them like i did with WMATIC, WETH, SFL and others but they dont accept the same commands/functions. All transactions that i sent to blockchain fail. I can not debug deeper.
Thanks in advance.
Robert Son Hedler is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.