代码运行出现错误提示
来源:5-6 solidity类型讲解-地址类型

印斯茅斯调查员
2018-05-18
老师,我运行的代码跟您的一样,然后在存入10Wei的操作时,日志出现error提醒,信息是:
VM error: revert. revert The transaction has been reverted to the initial state.
Note: The constructor should be payable if you send value. Debug the transaction to get more information.
在网上搜了一圈暂时找不到能有效解决这个错误的方法,请教一下这个是什么原因?
写回答
1回答
-
contract AddrTest { constructor() payable { } function deposit() public payable { } }
加一个payable 构造函数
012018-05-19
相似问题