Can we force to send assets to a contract if it does not have payable methods?

I saw this update in 0.33.0
method without this payable annotation cannot accept coins.
can we force to send assets to a contract even if it does not have payable methods?

1 Like

Unfortunately no. a non-payable method cannot accept coins. The only solution here is to update the contract method by adding #[payable] to it (both in the abi and the implementation)

Correction: while it’s not possible to forward assets with a call to a non-payable contract method, it’s still possible to force transfer assets to the contract via the library function std::token:: force_transfer_to_contract.

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.