confio / tfi

Contracts for Regulated DeFi on the Tgrade blockchain
Apache License 2.0
9 stars 0 forks source link

[tfi-factory] Add `CreateToken` and `CreateTrustedToken` endpoints #81

Open maurolacy opened 2 years ago

maurolacy commented 2 years ago

This is a proposal to delegate creation (instantiation) of tokens (cw20-base instances) and trusted tokens (trusted-token instances) to the tfi-factory contract.

The rationale being, having unified and centralised management of those assets. Currently the creation of these is being done in the frontend, which requires the frontend to have knowledge of their code ids. As code ids change during migration, a frontend change / update is currently required to enable / complete the tokens' migration process.

Also, the migrate admin is currently being set by tfi-factory for the tfi-pair instances. While these token instances require for it to be set in the frontend instead.

As part of this, or complementary to it, a number of extra query endpoints will perhaps be needed, so that the frontend can query the data that obtained previously through its knowledge of the code id. By example, to list of the instances of a given type.

Note: The tfi-factory Config query currently returns both tokens code ids. So, that can already be used to that end.