2

I have deployed a token on main net and called the create method to issue tokens. However, I would like to update the token code to add an extra feature.

I can't find any information on the best ways to do this, or if there are important things I may need to consider. I have previously been working on immutable ethereum smart contracts.

Would I need to pay the full RAM charges etc to re-deploy? Will I need to issue the token again? Will existing token holders be affected?

Can I just make code changes, compile using eosio-cpp and then call 'set contract' again without any major issues?

1

3 Answers 3

2

Everything you stored with eosio::multi_index will be preserved despite of contract upgrade. It means that if your contracts changes the struct stored in multi_index (the number of fields or the type of fields), it can cause some conflicts.

You don't need to do the thing you did such as issuing token. Token holders will not be affected. (Data is not changed, so no repeated RAM charge)

If you just add parameters for action or change some logic in action, you can feel free to compile and set contract again.

0

If you are not altering the existing multi-index table, there will be no issues. If you want to make changes to existing tables like adding extra fields to the table changing the scope of the table etc. then there will be some issues. Otherwise, you can deploy the contract normally and your token holders will not affect that

0

Besides fields the payer used in your contracts also affect who pay for the RAM, may be not yourself.

*  @post The payer is charged for the storage usage of the new object and, if the table (and secondary index tables) must be created, for the overhead of the table creation.

const_iterator emplace( uint64_t payer, Lambda&& constructor )

*  @post The payer is charged for the storage usage of the updated object.
*  @post If payer is the same as the existing payer, payer only pays for the usage difference between existing and updated object (and is refunded if this difference is negative).
*  @post If payer is different from the existing payer, the existing payer is refunded for the storage usage of the existing object.

void modify( const_iterator itr, uint64_t payer, Lambda&& updater )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.