mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
updated public to external for the functions
changed public to external for the functions
This commit is contained in:
@@ -39,14 +39,14 @@ and the sum of all balances is an invariant across the lifetime of the contract.
|
||||
event Transfer(address from, address to, uint amount);
|
||||
event Approval(address owner, address spender, uint amount);
|
||||
|
||||
function transfer(address to, uint amount) public returns (bool success) {
|
||||
function transfer(address to, uint amount) external returns (bool success) {
|
||||
balances.move(msg.sender, to, amount);
|
||||
emit Transfer(msg.sender, to, amount);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function transferFrom(address from, address to, uint amount) public returns (bool success) {
|
||||
function transferFrom(address from, address to, uint amount) external returns (bool success) {
|
||||
require(allowed[from][msg.sender] >= amount);
|
||||
allowed[from][msg.sender] -= amount;
|
||||
balances.move(from, to, amount);
|
||||
@@ -54,14 +54,14 @@ and the sum of all balances is an invariant across the lifetime of the contract.
|
||||
return true;
|
||||
}
|
||||
|
||||
function approve(address spender, uint tokens) public returns (bool success) {
|
||||
function approve(address spender, uint tokens) external returns (bool success) {
|
||||
require(allowed[msg.sender][spender] == 0, "");
|
||||
allowed[msg.sender][spender] = tokens;
|
||||
emit Approval(msg.sender, spender, tokens);
|
||||
return true;
|
||||
}
|
||||
|
||||
function balanceOf(address tokenOwner) public view returns (uint balance) {
|
||||
function balanceOf(address tokenOwner) external view returns (uint balance) {
|
||||
return balances[tokenOwner];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user