pub fn transfer<E>(destination: E::AccountId, value: E::Balance) -> Result<()>where E: Environment,
Transfers value from the contract to the destination account ID.
This is more efficient and simpler than the alternative to make a no-op contract call or invoke a runtime function that performs the transaction.
- If the contract does not have sufficient free funds.
- If the transfer had brought the sender’s total balance below the minimum balance.
You need to use
terminate_contractin case this is your intention.