File tree Expand file tree Collapse file tree 3 files changed +1342
-0
lines changed Expand file tree Collapse file tree 3 files changed +1342
-0
lines changed Original file line number Diff line number Diff line change @@ -137,4 +137,12 @@ module aave_pool::collector {
137137 public fun get_collector_name (): vector <u8 > {
138138 COLLECTOR_NAME
139139 }
140+
141+ #[test_only]
142+ /// @notice Returns the collector resource account signer for testing
143+ public fun get_collector_account_with_signer (): signer acquires CollectorData {
144+ // derive resource account signer
145+ let collector_data = borrow_global <CollectorData >(@aave_pool );
146+ account::create_signer_with_capability (&collector_data.resource_account)
147+ }
140148}
Original file line number Diff line number Diff line change @@ -302,6 +302,26 @@ module aave_pool::pool_token_logic {
302302 error_config::get_eunderlying_claimable_rights_not_zero ()
303303 );
304304
305+ // Check for remaining underlying assets in the resource account and transfer to treasury
306+ let remaining_underlying_balance =
307+ fungible_asset_manager::balance_of (
308+ a_token_factory::get_token_account_address (a_token_address),
309+ asset
310+ );
311+
312+ if (remaining_underlying_balance > 0 ) {
313+ // Get treasury address from aToken
314+ let treasury_address =
315+ a_token_factory::get_reserve_treasury_address (a_token_address);
316+
317+ // Transfer remaining underlying assets to treasury using a_token_factory
318+ a_token_factory::transfer_underlying_to (
319+ treasury_address,
320+ (remaining_underlying_balance as u256 ),
321+ a_token_address
322+ );
323+ };
324+
305325 // Remove the ReserveList from the smart table
306326 let active_reserve_count = pool::number_of_active_reserves ();
307327 pool::delete_reserve_data (asset);
You can’t perform that action at this time.
0 commit comments