Skip to content

Commit

Permalink
swap and burn
Browse files Browse the repository at this point in the history
  • Loading branch information
unconst committed Jan 8, 2025
1 parent cab22e5 commit d5e8275
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pallets/subtensor/src/subnets/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ impl<T: Config> Pallet<T> {
let actual_burn_amount =
Self::remove_balance_from_coldkey_account(&coldkey, registration_cost)?;

// Tokens are not burned but instead added to the TAO side of the pool.
// This changes K and increases the price of alpha.
let _burned_alpha: u64 = Self::swap_tao_for_alpha( netuid, actual_burn_amount );
// SubnetTAO::<T>::mutate(netuid, |val| val.saturating_sub(actual_burn_amount));
// Tokens are swapped and then burned.
let burned_alpha: u64 = Self::swap_tao_for_alpha( netuid, actual_burn_amount );
SubnetAlphaOut::<T>::mutate( netuid, |total| *total = total.saturating_sub( burned_alpha ));

// --- 9. If the network account does not exist we will create it here.
Self::create_account_if_non_existent(&coldkey, &hotkey);
Expand Down

0 comments on commit d5e8275

Please sign in to comment.