区块链小问题:the called function should be payable if you send value and the value you send should be less

编程入门 行业动态 更新时间:2024-10-23 17:37:27

<a href=https://www.elefans.com/category/jswz/34/1769670.html style=区块链小问题:the called function should be payable if you send value and the value you send should be less"/>

区块链小问题:the called function should be payable if you send value and the value you send should be less

记初学区块链时遇到的小问题

错误反馈the called function should be payable if you send value and the value you send should be less than your current balance

第一次采用的是这种转账的方式


操作为:
1.输入转账的编号(之前有存不同编号不同的价格但转账的接受地址都是一样的)
2.在value处填转账的金额
3.点击buy,转账成功

第二次我想在输入编号的同时输入金额,然后直接购买,就不用使用到msg.value了

结果出现了如下的问题,也就是开头一段英文写的问题

我将value换算成ether也还是不行

address(uint160(adminAddress)).transfer(value*10e18 wei);

最后,希望看到这篇博文的大佬能够告诉我如何解决这个问题
.
问题已解决,是传入的value的值超过了存储账户所拥有的,所以报错不可payable和should be less。

更多推荐

区块链小问题:the called function should be payable if you send value and the value you

本文发布于:2024-03-05 03:58:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1711253.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:区块   called   function   payable   send

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!