1

MATIC token is advertised as an ERC20 token. So why is there no approve function for MATIC token contract? https://polygonscan.com/address/0x0000000000000000000000000000000000001010#code

What is the alternative?

3 Answers 3

1

MATIC is the native gas fee token for Polygon blockchain. It is the same as ETH for Ethereum. The contract 0x0000000000000000000000000000000000001010 presents the native token. The low digit contracts are so-called precompiled contract, or harcoded to the blockchain nodes.

If you want ERC-20 compatible version of MATIC you need to look up Wrapped Matic or WMATIC contract.

More about the history of ERC-20 approve() here.

3
  • so when polygon says that MATIC is an ERC20 token, they mean on the Ethereum chain only? I am interested in ERC20 token of MATIC in Polygon chain. Would this address be it? polygonscan.com/token/…
    – user92683
    Jan 27, 2022 at 8:57
  • You can find it though Quickswap if you poke deep enough. Jan 27, 2022 at 9:21
  • quick swap doesn't show the token address
    – user92683
    Jan 27, 2022 at 9:50
0

Each blockchain has native token, ETH for ethereum ,MATIC for polygon and so on you can not interact with native token like erc20 token, for example you can not send request for approve spend some amount of ETH in ethereum blockchain, as Mikko says, you can do this with wrapped native tokens.

Also in solidity if you want to transfer native token is different with ERC20 tokens, for native token you must input amount of token as: msg.value and transfer in one func, but for transfer ERC20 tokens at first you need to approve ,then transfer

0

Tokens that are native to the network such as ETH on Ethereum, Matic on the matic chain, etc are not generated from a smart contract even though they are "ERC-20".

The ERC-20 tokens that are created from a smart contract (i.e. the ones developers create) work how they are defined in their ERC-20 contracts.

This is also the reason why contracts can recognize and use native tokens but need to be "setup" for other tokens.

If you want to convert a native token into a ERC-20 you can make a wrapped token of it where the sender sends X native and gets X wrapped from the contract.

Your Answer

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

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