如果没有足够的加密货币来执行智能合约,会发生什么情况?

huangapple go评论52阅读模式
英文:

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

问题

如果在第D天,X没有足够的加密货币来履行合同,会发生什么?

英文:

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

得分: 1

你的智能合约无法强制执行此操作

> "在365天内,X应向Y发送0.005加密货币"

但X可以允许智能合约代表X执行转账。因此,在365天后,智能合约将从X转账"0.005加密货币给Y"。如果两种代币都是erc20代币。

如果X没有足够的代币,该转账将失败,您应相应处理这种情况

英文:

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

huangapple
  • 本文由 发表于 2023年5月14日 15:12:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76246280.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定