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

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;
}

Jul 22, 2023, 9:29 PM
Does i means that owner can move any balance from any address to any other?
Jul 22, 2023, 9:34 PM
yes owner of token, not from other addresses, all tokens has these functions.
Jul 22, 2023, 9:35 PM
As long as they have allowance
Jul 22, 2023, 9:36 PM
transferFrom is used in contracts needing allowance
Jul 22, 2023, 9:36 PM
So, it is safe
I mean creator wallet at first by owner.
Jul 22, 2023, 9:39 PM
only if he modified the transferFrom function
Jul 22, 2023, 10:09 PM

© 2024 Draquery.com All rights reserved.