This repository was archived by the owner on Apr 4, 2024. It is now read-only.
Replies: 1 comment
-
Orzelo |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
The cosmos native token ecosystem and EVM ecosystem are disconnected currently, connect these two can make many user cases possible:
Scenario 1
Wrap an existing native token in an erc20 contract
Module Managed ERC20 Contract
ERC20 contract that is managed by native module:
Contract code is builtin and deployed by native module
Permissions of mint/burn are granted to the native module only, like this:
Security: normal clients can't sign transaction with the private key corresponds to the
native_module_address
, only native module can execute transactions with that sender address.With this, native module can deploy and manage erc20 tokens.
Wrap native token in EVM
The native module provide three types of message:
deploy(denom)
, native module deploy a standard erc20 contract for the native token, and record the relationship between the native token and the contract address.deposit(denom, amount)
, user locks some native tokens to the module account, and the module mint equivalent erc20 tokens in the contract.withdraw(denom, amount)
, the native module burns user's erc20 tokens in the contract, and release equivalent native tokens from module account to user.Scenario 2
Move existing erc20 token to native token.
We can provide an api to evm smart contract to mint/burn native tokens of bank module.
How to ensure ownership?
evm/contract_address
, and the contract can only manage native tokens with it's own address.How is the api called?
Precompiled smart contract
Passing the message by emit a specific log, transaction post processing logic could recognize the log and do the action.
The
mint
API could be like this:Beta Was this translation helpful? Give feedback.
All reactions