Skip to content

Commit 50e8e53

Browse files
Merge pull request #286 from gap-editor/main
[ISSUE-8292] added data about updating the metadata
2 parents 2aac387 + eae6e4a commit 50e8e53

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

docs/overview/features/tokenfactory.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,65 @@ To see a list of tokens created by a specific account, use the denoms-from-creat
156156
```sh
157157
osmosisd query tokenfactory denoms-from-creator osmo1c584m4lq25h83yp6ag8hh4htjr92d954vklzja
158158
```
159+
To update the metadata of a token created using Osmosis's Token Factory module, you can utilize the `osmosisd` command-line interface to execute the `tokenfactory set-denom-metadata` transaction. This operation allows the admin of a specific denomination (denom) to modify its associated metadata.
160+
161+
**Prerequisites:**
162+
163+
- **Admin Privileges:** Ensure that your account has admin rights over the denom whose metadata you intend to update.
164+
165+
- **Metadata Structure:** Prepare the new metadata in JSON format, adhering to the `Metadata` structure defined in the Cosmos SDK's bank module. This structure includes fields such as `description``denom_units``base``display``name`, and `symbol`.
166+
167+
168+
**Steps to Update Token Metadata:**
169+
170+
1. **Create a Metadata JSON File:** Define the new metadata in a JSON file, for example, `metadata.json`.
171+
172+
```
173+
{
174+
"description": "Your token description",
175+
"denom_units": [
176+
{
177+
"denom": "factory/your_creator_address/your_subdenom",
178+
"exponent": 0,
179+
"aliases": ["your_alias"]
180+
},
181+
{
182+
"denom": "your_display_denom",
183+
"exponent": 6,
184+
"aliases": []
185+
}
186+
],
187+
"base": "factory/your_creator_address/your_subdenom",
188+
"display": "your_display_denom",
189+
"name": "Your Token Name",
190+
"symbol": "YTN"
191+
}
192+
```
193+
- Replace `your_creator_address` with your Osmosis address.
194+
- Replace `your_subdenom` with the subdenomination of your token.
195+
- Customize the `description``denom_units``base``display``name`, and `symbol` fields as per your token's specifications.
196+
197+
2. **Execute the SetDenomMetadata Transaction:** Use the `osmosisd` CLI to submit the transaction.
198+
```
199+
osmosisd tx tokenfactory set-denom-metadata \
200+
--metadata="$(cat metadata.json)" \
201+
--from your_admin_account \
202+
--chain-id your_chain_id \
203+
--fees your_fee_amount \
204+
--gas auto \
205+
--gas-adjustment 1.5
206+
```
207+
1. - Ensure that `your_admin_account` is the account with admin privileges over the denom.
208+
- Replace `your_chain_id` with your target chain's ID.
209+
- Set `your_fee_amount` to an appropriate fee for the transaction.
210+
211+
**Important Considerations:**
212+
213+
- **Admin Verification:** The transaction will verify that the sender is the admin of the specified denom.
214+
215+
- **Metadata Overwrite:** Executing this transaction will overwrite the existing metadata associated with the denom.
216+
217+
218+
For more detailed information, you can refer to the [Osmosis Token Factory module documentation](/osmosis-core/modules/tokenfactory/).
219+
220+
If you encounter any issues or need further assistance, consider reaching out to the Osmosis community or checking the [Osmosis GitHub repository](https://github.com/osmosis-labs/osmosis) for additional resources.

0 commit comments

Comments
 (0)