I have this token code

pragma solidity ^0.4.19;

contract MyToken {

   mapping (address => uint256) public balanceOf;

   function MyToken(uint256 _supply) public {

     balanceOf[msg.sender] = _supply;  
    //ф-ция должна так называться по ERC20
    function transfer(address _to, uint _value) public
    //проверка, хватает ли токенов у того, кто хочет отправить  
    require(balanceOf[msg.sender]) >= _value;

    //проверка, не произошло ли переполнение
   require(balanceOf[_to] + _value >= balanceOf[_to]);

   //забираем токены у отправителя
    balanceOf[msg.sender] -= _value;

   //передаем токены получателю
      balanceOf[_to] += _value; 

And there is an error in the line = _value;>


The right line is:

require(balanceOf[msg.sender] >= _value);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.