ChorusOne / solido

Lido for Solana is a Lido-DAO governed liquid staking protocol for the Solana blockchain.
https://chorusone.github.io/solido/
GNU General Public License v3.0
101 stars 43 forks source link

wrong minimum_balance in get_reserve_available_balance() #546

Closed kkonevets closed 2 years ago

kkonevets commented 2 years ago

Hi! Please excuse me if I am wrong, but why do you use

let minimum_balance = Lamports(rent.minimum_balance(0));

instead of

let minimum_balance = Lamports(rent.minimum_balance(reserve_account.data_len()));

in here?

The point is to get the minimum rent for the reserve account to be alive. And the reserve_account.data_len() could be non zero.

ruuda commented 2 years ago

The reserve account doesn’t store any data, it only holds SOL, that’s why it’s data_len() is 0.

kkonevets commented 2 years ago

Thanks