在js VM环境中没问题,部署到本地私链后,测试转账会报这个错误

image.png //转账方法 function transfer(address _to, uint256 _amount) public returns (bool success) { require( balanceMap[_to] + _amount >= balanceMap[_to], "check for overflows" ); require(balanceMap[msg.sender] >= _amount, "check money"); balanceMap[msg.sender] -= _amount; balanceMap[_to] += _amount; emit Transfer(msg.sender, _to, _amount); return true; }

请先 登录 后评论

1 个回答

Tiny熊
  擅长:智能合约,以太坊
请先 登录 后评论
  • 1 关注
  • 0 收藏,2003 浏览
  • webkubor 提出于 2021-04-13 15:38