-
Notifications
You must be signed in to change notification settings - Fork 375
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
fix: minting additional GNOTs #393
Conversation
|
Hey @dongwon8247, thank you. I need to dig more this one. I think there is a bug for minting, but not sure about the one for burning. |
I'm not sure but |
It seems to break the invariance of the total supply |
It breaks privileges system too since it can burn non-owned tokens not only invariance of the total supply. |
I think we need a clear direction for this.
|
Yes, it should be possible for the chain to have multiple native tokens. I.e.: IBC tokens, second native token (GNOSH, PHOTON, other dual-token approaches).
This is a complex topic that needs to be addressed differently. Maybe it will be supported with IBC2; maybe with a custom gnoland contract that will act like an escrow; maybe we won't support GRC20 IBC transfers by default. My feeling -> we'll write a
We need to technically support multiple native tokens, at least for IBC.
I'm not sure it's that hard, we're based on Tendermint core and have many Cosmos-SDK developers in the ecosystem that could help us improve this part. |
small idea.
|
After a bit more digging, I think Realm Issue Banks is used to mint native tokens from a smart contract, which the current IBC can support. Other chains do not need to integrate Gno VM to use tokens. For other chains to use GRC20, IBC needs to support message calls through the memo field or some other field; other chains probably will need to integrate Gno VM to mirror the contract. We can implement a RealmIssueBanker for the BankTypeRealmIssue instead of using the default SDKBanker. In RealmIssueBanker, we need to check OrigPkgAddress so that the issued token stays in the contract and ensure the denom is unique and owned by the contract. The denom part is not that straightforward and needs more thought. We can open an issue to spec it out. |
There is a format regexp for the denom. In Gno In Cosmos SDK. // Denominations can be 3 ~ 128 characters long and support letters, followed by either Since the main usage of RealmIssueBanker is issuing native tokens that can be used by other chains through IBC from a Smart Contract. We can do the following
As for IBC transfer, the denom is ibcDenom = "ibc/" + hash(trace path + "/" + base denom) What do you all think? |
Yep, this is the idea. If we keep the GRC20+IBC topic for later and focus on native token support improvements.
Let's fix 1. in this PR or another one, and keep 2. for a more extensive discussion. |
osmosis example:
|
Just for fun. (not serious :-)
|
maybe BankerIssue was intended to mint tokens (e.g staking rewards), in this case, a whitelist could be added initially
|
On Let's just support minting from any package with a prefix/suffix for this issue and consider extending the allowed issuer list later in another PR. |
How will the staking rewards work?
and about Slashing... tokens need to be burned here, unless GNO handles it differently. For minting new denoms, a realm could be created like TokenFactory module, and only this package would have access to |
for Smart Contracts to issue native tokens and easy IBC adoption gnolang#393
The validator tokens to secure the POS chain through BFT are defined in the genesis file. The tokens for other purposes can be issued from the BankerTypeRealmIssue, which should be permissionless, just like ERC20. The BankerTypeRealmIssue-supported contracts serve the same function as TokenFactory Module since the business logic in the module-based AppChain is implemented as realm packages in the Gno-enabled chains. It leads to another topic. Should we develop another set of token standards for Gno Native Token? ERC20 converted GRC20 is for a single native token chain like Ethereum. On the other hand, Gno supports multiple native tokens and can be transferred through IBC without other chains implementing GnoVM. |
Blockchain fees, including gas fees, will be sent into a bucket. Won't be staking. This bucket will regularly be distributed to:
|
Slashing is to be more defined, but we believe we won't have common issues because we're in a more trusted environment, kind of PoA backed by a trusted DAO. But anyway, slashing methods will probably be done by sending tokens to a bucket instead of burning them. I hope we'll have a better overview of what we can do in the future, during GoR, especially with #407. |
Not on gno.land instances. We'll only have realm-prefixed tokens. But this feature makes sense for other instances running GnoVM in the future. This PR should not make anything going in that direction, but anyone can open an issue right now, or wait that it makes more sense; when GnoVM will be more ready to be used to run new blockchains. |
Sounds great, need more details about what you've in mind. |
So, to merge this PR, we should implement this -> #393 (comment) And then, we can continue related discussions in a dedicated issue or new PRs. |
12f7055
to
24d5493
Compare
Will reopen this PR soon cc @r3v4s |
Option 1I think one of simple ways to fix this, we can just issue coin with denom with following format.
we can derive second value perhaps from this pr #667 however, as @piux2 mentioned above there are some format regexp for the denom which I think very inflexible. Lines 618 to 634 in 24d5493
I think we need new regex(or at least new standard) to fix this issue :D Option2once #384 merges then we can remove those regex conditions |
new pr #875 |
<!-- Please provide a brief summary of your changes in the Title above --> # Previous & Related PR #393 # Description ## BREAKING CHANGE: banker will not use raw(input) denom for minting Currently, there is a bug that additional coins are mintable using banker. Lots of discussing were made in #393, this PR include following. 1. It aims to use `pkg_path` that called (banker or Mint) as prefix for denom(Similar to IBC Spec) ``` ibc_denom := 'ibc/' + hash('path' + 'base_denom') denom_in_this_pr := '{pkg_path}:denom' ``` ~2. As @piux2 mentioned [here](#393 (comment)) currently gno has very inflexible format regexp for denom -- Changed to same as Cosmos's regex, but without capitals~ ~### is some issue about using `std.GetOrigCaller` or `std.PrevRealm` Some of you might be wonder why I made some packaged called `istd`, I made a issue: #876~ Update: After @thehowl's native binding PR, doesn't need this kind of work around ## Contributors Checklist - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests ## Maintainers Checklist - [ ] Checked that the author followed the guidelines in `CONTRIBUTING.md` - [ ] Checked the conventional-commit (especially PR title and verb, presence of `BREAKING CHANGE:` in the body) - [ ] Ensured that this PR is not a significant change or confirmed that the review/consideration process was appropriate for the change --------- Co-authored-by: Morgan <git@howl.moe>
<!-- Please provide a brief summary of your changes in the Title above --> # Previous & Related PR gnolang#393 # Description ## BREAKING CHANGE: banker will not use raw(input) denom for minting Currently, there is a bug that additional coins are mintable using banker. Lots of discussing were made in gnolang#393, this PR include following. 1. It aims to use `pkg_path` that called (banker or Mint) as prefix for denom(Similar to IBC Spec) ``` ibc_denom := 'ibc/' + hash('path' + 'base_denom') denom_in_this_pr := '{pkg_path}:denom' ``` ~2. As @piux2 mentioned [here](gnolang#393 (comment)) currently gno has very inflexible format regexp for denom -- Changed to same as Cosmos's regex, but without capitals~ ~### is some issue about using `std.GetOrigCaller` or `std.PrevRealm` Some of you might be wonder why I made some packaged called `istd`, I made a issue: gnolang#876~ Update: After @thehowl's native binding PR, doesn't need this kind of work around ## Contributors Checklist - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests ## Maintainers Checklist - [ ] Checked that the author followed the guidelines in `CONTRIBUTING.md` - [ ] Checked the conventional-commit (especially PR title and verb, presence of `BREAKING CHANGE:` in the body) - [ ] Ensured that this PR is not a significant change or confirmed that the review/consideration process was appropriate for the change --------- Co-authored-by: Morgan <git@howl.moe>
I found two significant issues regarding minting and burning tokens with the
package minter
.Issue Analysis
Solution
pkgs/sdk/vm/builtins.go
but It seems that it's set up to provide standard functions for common & consistent contract development. so instead I've made an exception inpkgs/std/coin.go
to solve the problem with this PR.RemoveCoin
. In the future, it would be best if we can prevent users from callingIssueCoin
,RemoveCoin
(Change to authentication & authority check or switch it to internal functions).