No way to do "delta" update
nns2009 opened this issue · comments
Igor Konyakhin commented
Update code overwrites the current state entirely:
set_data(new_data);
set_code(new_code);
This might become a problem with burn notifications after another issue (#19) is fixed: the admin must prepare the exact "new_data" taking into account the current "total_supply", but it might change after the update with "new_data" was sent to the network and before it was processed. Thus leading to inaccurate "total_supply" value on the master.
Possible solutions:
- Allow to submit custom data migration code
- Allow to pause burning functionality on master (bounce burn_notifications for the time of the update)
- (partial solution) Allow to skip data update (
ifnot (null?(new_data)) set_data(new_data);
)
sitoy99 commented
Tidak mengerti
Tolya commented
Since the mint, burn, and update function can only be called by an administrator - this avoids a race condition.