-
Notifications
You must be signed in to change notification settings - Fork 0
docs(evm): clarify Initia ERC20 compatibility for wallet/bridge and r… #97
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,36 @@ title: Creating Standard ERC20s via ERC20Factory | |
| For developers looking to create standard ERC20 tokens on EVM rollups, we | ||
| recommend using the | ||
| [ERC20Factory](/resources/developer/contract-references/evm/erc20-factory) | ||
| contract. | ||
| contract. For most teams, this is the lowest-risk path because it deploys a | ||
| token implementation that already includes the required Initia chain integration | ||
| hooks (including `sudoTransfer`). | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think we need this sentence |
||
|
|
||
| ## Production Readiness Checklist | ||
|
|
||
| Before treating a factory-deployed token as ready for support across Initia | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Factory-deployed tokens" is unclear/not specific. It should be "Tokens deployed via ERC20Factory satisfy this requirement by default" etc. |
||
| products (for example, Initia Scan, InterwovenKit, Wallet, and Bridge): | ||
|
|
||
| 1. Deploy via | ||
| [`ERC20Factory`](/resources/developer/contract-references/evm/erc20-factory). | ||
| 2. Add token metadata to the relevant `assetlist.json` in | ||
| [Initia Registry](/developers/developer-guides/integrating-initia-apps/registry/introduction). | ||
| 3. Confirm your token is compatible with the required `sudoTransfer` hook used | ||
| in sending and bridging flows (included by default for `ERC20Factory` | ||
| deployments) by following the compatibility guidance in | ||
| [Creating ERC20s Introduction](/developers/developer-guides/vm-specific-tutorials/evm/creating-erc20s/introduction) | ||
| and | ||
| [`InitiaCustomERC20` reference](/resources/developer/contract-references/evm/initia-custom-erc20). | ||
|
Comment on lines
+14
to
+28
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is irrelevant if they're deploying the token via ERC20Factory, which is the context of this page? |
||
|
|
||
| If you need custom token logic, deploy a custom ERC20 that inherits | ||
| [`InitiaCustomERC20`](/resources/developer/contract-references/evm/initia-custom-erc20) | ||
| as the base contract (see | ||
| [Creating Custom ERC20s](/developers/developer-guides/vm-specific-tutorials/evm/creating-erc20s/creating-custom-erc20s)). | ||
|
|
||
| <Note> | ||
| Registry listing is required for tokens to appear correctly in Initia product | ||
| UIs with metadata (name, symbol, decimals, logo), and to be selectable in | ||
| flows such as balances, transfers, and bridging. | ||
| </Note> | ||
restorenode marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+36
to
+39
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unclear what registry this refers to |
||
|
|
||
| ## Project Setup | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,10 @@ Fee Token as an ERC20 token. | |
| Use validator (admin) account to update the chain parameter. | ||
|
|
||
| <Warning> | ||
| The deployed ERC20 token must inherit the `InitiaERC20` contract. | ||
| The fee token ERC20 must implement Initia-compatible chain hooks, especially | ||
| `sudoTransfer`, which is used by chain-level transfer handling. Tokens | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. grammar
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not only |
||
| deployed via `ERC20Factory` satisfy this requirement by default. For custom | ||
| ERC20 deployments, the token contract must inherit `InitiaCustomERC20`. | ||
| </Warning> | ||
|
|
||
| ```ts | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -229,6 +229,13 @@ function burn(address from, uint256 amount) external burnable(from) onlyOwner | |
| Transfers tokens from one address to another, bypassing the usual access control | ||
| checks. This function can only be called by the chain signer. | ||
|
|
||
| <Info> | ||
| For MiniEVM ERC20 tokens, `sudoTransfer` is a required hook in the token | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not just |
||
| contract. If you deploy through `ERC20Factory` or inherit `InitiaCustomERC20`, | ||
| it is included automatically. Without it, sending and bridging may fail even | ||
| if the token appears in UIs. | ||
| </Info> | ||
|
|
||
restorenode marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ```solidity | ||
| function sudoTransfer(address sender, address recipient, uint256 amount) external onlyChain | ||
| ``` | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not just
sudoTransferthat's required? Theregisterfunctions and others are also needed https://initia-labs.slack.com/archives/C08HUBCRV6Y/p1772709025874659?thread_ts=1772616413.010649&cid=C08HUBCRV6Y