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

Precompile for native token ERC-20 interface #765

Open
JamesHinshelwood opened this issue Mar 8, 2024 · 2 comments
Open

Precompile for native token ERC-20 interface #765

JamesHinshelwood opened this issue Mar 8, 2024 · 2 comments

Comments

@JamesHinshelwood
Copy link
Contributor

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
Copy link
Contributor Author

It probably makes sense to split this implementation into two:

  • A stateless, but incomplete version which doesn't support allowances.
  • A stateful and complete version later.

@JamesHinshelwood
Copy link
Contributor Author

#804 has started doing this.

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