Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion aave-core/sources/aave-tokens/token_base.move
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,21 @@ module aave_pool::token_base {
/// @notice Drops the token data from the token map
/// @dev Only callable by the a_token_factory and variable_debt_token_factory module
/// @param metadata_address The address of the token
public(friend) fun drop_token(metadata_address: address) acquires ManagedFungibleAsset {
public(friend) fun drop_token(
metadata_address: address
) acquires ManagedFungibleAsset, TokenBaseState {
assert_token_exists(metadata_address);
assert_managed_fa_exists(metadata_address);

let TokenBaseState { user_state, incentives_controller, scaled_total_supply: _ } =
move_from<TokenBaseState>(metadata_address);

smart_table::destroy(user_state);

if (option::is_some(&incentives_controller)) {
option::destroy_some(incentives_controller);
};

// detach the managed fungible asset from the metadata address
move_from<ManagedFungibleAsset>(metadata_address);
}
Expand Down
Loading