Move.

Post

Share your knowledge.

Elvin CLONE .
Jan 09, 2025
Expert Q&A

Creating new currency and using Treasury Cap in one transaction?

So, I'm trying to set up a new currency and I want to use the treasury cap within the same PTB transaction, but I've hit a snag. It seems like the init function only returns 'update_cap' and not 'treasury_cap', which stops me from accessing it in the same transaction block. Is there a workaround for this, or do I need to handle it with two separate transactions?

  • Move CLI
1
1
Share
Comments
.

Answers

1
yhant3.
Jan 9 2025, 09:10

To use the TreasuryCap within the same PTB, it has to be returned in the results of a previous command. Unfortunately, since the init function cannot return a value, there’s no way to access TreasuryCap in the same transaction block it is created. You will need to perform a separate transaction for this.

1
Best Answer
Comments
.

Do you know the answer?

Please log in and share it.

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148Posts231Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignJune
We use cookies to ensure you get the best experience on our website.
More info