0
 function transferFrom(address from, address to, uint value) public returns (bool) {
        require(balanceOf(from) => value, 'balance too low');
        require(allowance)[from][msg.sender] >= value, 'allowance too low');
        balances[to] += value;
        balances[from] -= value;
        emit Transfer(from, to, value);
        return true;
    }

1 Answer 1

1

There are some syntax error. I fixed them in this way:

Smart contract modified:

// your logic

function transferFrom(address from, address to, uint value) public returns (bool) { 
    require(balanceOf(from) >= value, "balance too low"); 
    require(allowance[from][msg.sender] >= value, "allowance too low"); 
    balances[to] += value; balances[from] -= value; 
    emit Transfer(from, to, value); 
    return true; 
}

// your logic
1
  • Thank you so much I see my error. I appreciate it
    – Johnny5
    Commented Dec 3, 2022 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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