Skip to content

Commit f0ae148

Browse files
fix(contracts): clone asset before move in deposit to fix E0382 borrow error
1 parent 459107c commit f0ae148

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl PortfolioRebalancer {
9090
}
9191

9292
let current_balance = portfolio.current_balances.get(asset.clone()).unwrap_or(0);
93-
portfolio.current_balances.set(asset, current_balance + amount);
93+
portfolio.current_balances.set(asset.clone(), current_balance + amount);
9494

9595
env.storage().persistent().set(&DataKey::Portfolio(portfolio_id), &portfolio);
9696
env.events().publish(

0 commit comments

Comments
 (0)