-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore(zkgm): virtualize tokenfactory #3631
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
aeryz
force-pushed
the
virtualize-tokenfactory
branch
2 times, most recently
from
January 29, 2025 06:20
a628f13
to
d9567de
Compare
benluelo
reviewed
Jan 29, 2025
Docs 🤌✨ Deployment complete! Take a peek over at https://0c5d5696.docs-ajn.pages.dev |
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
aeryz
force-pushed
the
virtualize-tokenfactory
branch
from
January 31, 2025 15:53
bd2983a
to
77f9910
Compare
Signed-off-by: aeryz <[email protected]>
Signed-off-by: aeryz <[email protected]>
benluelo
approved these changes
Jan 31, 2025
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.
cool
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intended behaviour:
transfer
:a. Minter is TF, sent wrapped token: Call
TokenFactoryMsg::BurnFrom
-> tf minter checks whether the funds are provided and burns.b. Minter is CW20, sent wrapped token: Call
TokenFactoryMsg::BurnFrom
-> cw20 minter just burns the tokens.c. Minter is TF, sent native token: Call
LocalTokenMsg::TakeFunds
-> tf minter checks whether the funds are provided and noops.d. Minter is CW20, sent CW20: Call
LocalTokenMsg::TakeFunds
-> cw20 minter callsCW20::TransferFrom
e. Minter is CW20, sent native token: Call
LocalTokenMsg::TakeFunds
-> cw20 minter sees funds are provided, saves the givendenom
as native and noops.recv_transfer
:a. Minter is TF: Nothing fancy, just delegate the messages to
TF
.b. Minter is CW20, need to create a wrapped token:
1. Call
TokenFactoryMsg::CreateDenom
: SinceCW20
doesn't have the token info yet, it just noops.2. Call
TokenFactoryMsg::SetDenomMetadata
:CW20
now has the token info, so it instantiates a contract. To save the denom to the denom to addr mapping, it saves the denom toDENOM_TO_BE_STORED
. NOTE THAT THIS IS A SINGLE VALUE STORAGE.3. Step 2 results in
reply
if success, in the reply, readDENOM_TO_BE_STORED
and save denom and addr toDENOM_TO_ADDR
mapping.4. Call
TokenFactoryMsg::MintTokens
: Read fromDENOM_TO_ADDR
mapping and mint the tokens.c. Minter is CW20, need to unescrow local token: CW20 just calls
CW20::Transfer
d. Minter is CW20, need to unescrow native token: CW20 sees that the given denom previously been saved as a native token. So it calls
BankMsg::Send
.