What happens if there is not enough crypto money to fulfill a smart contract?

87 Views Asked by At

Let's say a smart contract says: "In 365 days, X should send 0.005 Crypto to Y".

If the D-day X doesn't own enough Crypto to fulfill the contract, what will happen?

1

There are 1 best solutions below

0
On BEST ANSWER

your smart contract cannot force this

"In 365 days, X should send 0.005 Crypto to Y"

but X could allow the smart contract to do the transfer on behalf of X. so after 365 days, the smart contract will transfer "0.005 Crypto to Y" from X. if both tokens are erc20 tokens.

If X does not have enough coins, that transfer will fail and you should handle the case accordingly