Skip to content

Commit

Permalink
fix: only burn flip if non zero (#3932)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandanlen committed Sep 4, 2023
1 parent a5205b9 commit d1a9ab3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions state-chain/pallets/cf-emissions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,17 @@ pub mod pallet {
if Self::should_update_supply_at(current_block) {
if T::SafeMode::get().emissions_sync_enabled {
let flip_to_burn = T::FlipToBurn::take_flip_to_burn();
T::EgressHandler::schedule_egress(
Asset::Flip,
flip_to_burn,
ForeignChainAddress::Eth(T::EthEnvironment::state_chain_gateway_address()),
None,
);
T::Issuance::burn(flip_to_burn.into());
if flip_to_burn > Zero::zero() {
T::EgressHandler::schedule_egress(
Asset::Flip,
flip_to_burn,
ForeignChainAddress::Eth(
T::EthEnvironment::state_chain_gateway_address(),
),
None,
);
T::Issuance::burn(flip_to_burn.into());
}
Self::broadcast_update_total_supply(
T::Issuance::total_issuance(),
current_block,
Expand Down

0 comments on commit d1a9ab3

Please sign in to comment.