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

Token Factory Module #2440

Closed
8 of 11 tasks
byte-bandit opened this issue Dec 9, 2024 · 6 comments
Closed
8 of 11 tasks

Token Factory Module #2440

byte-bandit opened this issue Dec 9, 2024 · 6 comments
Assignees
Labels
Milestone

Comments

@byte-bandit
Copy link

byte-bandit commented Dec 9, 2024

Tokens native to Paloma

  • Introduce a fresh token factory module which (in theory) allows anyone to create, mint and burn tokens, with most features disabled
  • New tokens may be created by anyone
  • Tokens can only be minted by the admin of the token (by default, the creator of a token is the admin)
  • Tokens can only be burned by the admin of the token
  • All data is respected for genesis import/export
  • Skyway registrations against user tokens do not require governance
  • MAKE SURE that the GRAIN mapping cannot be touched though
  • Creating a token costs 10 GRAIN

Tokens for bridging

  • A new token for bridging can only be created by governance vote
  • Owner of a bridged token will be the skyway module account
  • All data is respected for genesis import/export

Important: Bridging a token requires considerable effort (votes + one smart contract on remote chains) per token, so best to keep these to established tokens like WETH. User tokens should live only on Paloma.

@byte-bandit byte-bandit self-assigned this Dec 9, 2024
@byte-bandit byte-bandit added this to the 2.4.0 milestone Dec 9, 2024
@taariq
Copy link
Member

taariq commented Dec 9, 2024

@byte-bandit Thanks for this a few notes:

  1. We won't need to worry about spam. We actually want to allow anyone to create these new tokens as needed as Paloma's Got Talent will let anyone create their own talent token.
  2. Tokens can be minted by anyone as long as they are not minting the same denom
  3. Tokens can be burned by anyone as long as they are not burning tokens not in their possession
  4. Kujira has a token denom module created that looks like it will prove helpful: https://github.com/Team-Kujira/core/tree/690a0dece9372993178deb467e2f0ae49d0733ce/x/denom

@byte-bandit
Copy link
Author

@taariq

Roger that. Take a look at the updated requirements I put in the ticket description and let me know whether this makes sense to you.

@taariq
Copy link
Member

taariq commented Dec 9, 2024

@byte-bandit Thanks for the update. We really want to remove all friction from creating tokens and bridging so they are fast and permisionless as possible. For example, bridging Paloma GRAINs from Base to Solana via wormhole takes only 10 minutes. No need for governance.

iI we can get a special type of vote that's very fast say 15 minute vote for registration, instead of 24 hours as our current fastest, then we can keep the voting mechanism and still speed up governance just for token registration.

@taariq
Copy link
Member

taariq commented Dec 9, 2024

@byte-bandit New README from Osmosis version of the denom module: https://github.com/osmosis-labs/osmosis/blob/main/x/tokenfactory/README.md. Kujira was the WASM bindings which we want for using via Cosmwasm. Also, Epic for this is now here: https://www.notion.so/volumefi/EPIC-12-13-24-Paloma-Token-Denoms-for-Paloma-s-Got-Talent-157e002bb6218089b233fc24b1f1d984

@byte-bandit
Copy link
Author

@taariq After our conversation from yesterday, this is my current understanding of how things might be possible with Paloma at the moment:

  1. SPL token ACOIN is generated (protocol doesn't care how) on Solana
  2. ERC20 token ACOIN is created on EVM chains (at the moment, manually. In the future, possibly automated)
  3. SPL ACOIN can be bridged to the ERC20 equivalent on EVM chains using wormhole

So far, the protocol is completely unaffected by any of this. Continuing:

  1. User creates a new denom acoin on paloma
  2. User registers denom acoin against ERC20 token addresses on EVM chains
  3. Using the skyway bridge, users can now bridge the ERC20 ACOIN to Paloma
  4. Users can trade tokens on Paloma using smart contracts
  5. Using the skyway bridge, users can bridge their tokens back to EVM chains

This is where the protocl stops becoming involved again. But for sake of completeness:

  1. Using wormwhole (or anything else), users can bridge the ERC20 token back to the original SPL token on Solana

Can you confirm this is how you want to approach this?

byte-bandit added a commit to palomachain/paloma that referenced this issue Dec 13, 2024
# Related Github tickets

- VolumeFi#2440

# Background

This change adds a token factory module that extends Paloma with the
following features:

- New tokens may be created by anyone
- Tokens can only be minted by the admin of the token (by default, the
creator of a token is the admin)
- Tokens can only be burned by the admin of the token
- All data is respected for genesis import/export
- Skyway registrations against user tokens do not require governance
- Tokens can be bridged outside of Paloma
- Creating a token costs 10 GRAIN

# Testing completed

> [!WARNING]  
> While most of the code is greatly inspired by the COSMWASM
tokenfactory module and should be battle tested, I did not have time to
include proper e2e tests to cover all Paloma customizations. Successful
bridging still needs smoke testing.

- [ ] test coverage exists or has been added/updated
- [x] tested in a private testnet

# Breaking changes

- [x] I have checked my code for breaking changes
- [x] If there are breaking changes, there is a supporting migration.
@taariq
Copy link
Member

taariq commented Dec 13, 2024

Closing as shipped with palomachain#1318

@taariq taariq closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants