Zilliqa / zq2

Zilliqa 2.0 code base
Apache License 2.0
9 stars 0 forks source link

Precompile for native token ERC-20 interface #765

Open JamesHinshelwood opened 7 months ago

JamesHinshelwood commented 7 months ago

The native token is special and has first-class support in our account model (as in all other EVM chains that I know of). Usually, developers need to handle this special case in their contracts. For example an exchange might need functions to swap tokens for other tokens, tokens for ZIL and ZIL for tokens.

To make life easier for developers, we should add a precompile which exposes an ERC-20-compatible interface to the chain's native token.

We'll have to think about how exactly to support allowances and events.

JamesHinshelwood commented 7 months ago

It probably makes sense to split this implementation into two:

JamesHinshelwood commented 5 months ago

804 has started doing this.