Skip to content
Snippets Groups Projects
Commit 29724b5e authored by Éloïs's avatar Éloïs
Browse files

fix: monetary mass overflow

parent 257bdcc5
No related branches found
No related tags found
1 merge request!33fix: Monetary mass overflow
...@@ -197,7 +197,9 @@ pub mod pallet { ...@@ -197,7 +197,9 @@ pub mod pallet {
Self::write_ud_history(n, account_id, ud_amount); Self::write_ud_history(n, account_id, ud_amount);
} }
<MonetaryMassStorage<T>>::put(monetary_mass + (ud_amount * members_count)); <MonetaryMassStorage<T>>::put(
monetary_mass.saturating_add(ud_amount.saturating_mul(members_count)),
);
Self::deposit_event(Event::NewUdCreated(ud_amount, members_count)); Self::deposit_event(Event::NewUdCreated(ud_amount, members_count));
total_weight total_weight
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment