2

请教:使用truffle提供的pet-shop模板,遇到一个问题

 2 years ago
source link: https://learnblockchain.cn/question/2653
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
请教:使用truffle提供的pet-shop模板,遇到一个问题 | 登链社区 | 技术问答

请教:使用truffle提供的pet-shop模板,遇到一个问题

当我领用宠物的时候,metamask弹出交易确认框,我选择拒绝,但是交易还是发送出去了,这里该如何判断
image.png
image.png
是要在调用合约方法前加上监听事件,如果用户拒绝直接不调用方法,还是在拿到结果返现错误后回滚?
谢谢~

Tiny熊 - 布道者 2天前

  擅长:智能合约,以太坊

如果用户拒绝, 链上不会产生事件。

好奇怪,之前确实是点了拒绝还会发送交易,然后我重启了一下npm又正常了

您需要登录后才可以回答问题,登录 或者 注册

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK