Changes ERC777 external functions to public for allowing overrides #1994 (#2001)

* Changes ERC777 external functions to public for allowing overrides #1994

* Changes ERC777 external functions to public for allowing overrides (#1994)
This commit is contained in:
Arindam Ghosh
2019-11-28 03:59:05 +05:30
committed by Francisco Giordano
parent cc0f89e331
commit ca6a5dc8a2

View File

@ -134,7 +134,7 @@ contract ERC777 is Context, IERC777, IERC20 {
* *
* Also emits a {IERC20-Transfer} event for ERC20 compatibility. * Also emits a {IERC20-Transfer} event for ERC20 compatibility.
*/ */
function send(address recipient, uint256 amount, bytes calldata data) external { function send(address recipient, uint256 amount, bytes memory data) public {
_send(_msgSender(), _msgSender(), recipient, amount, data, "", true); _send(_msgSender(), _msgSender(), recipient, amount, data, "", true);
} }
@ -146,7 +146,7 @@ contract ERC777 is Context, IERC777, IERC20 {
* *
* Also emits a {Sent} event. * Also emits a {Sent} event.
*/ */
function transfer(address recipient, uint256 amount) external returns (bool) { function transfer(address recipient, uint256 amount) public returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address"); require(recipient != address(0), "ERC777: transfer to the zero address");
address from = _msgSender(); address from = _msgSender();
@ -165,7 +165,7 @@ contract ERC777 is Context, IERC777, IERC20 {
* *
* Also emits a {IERC20-Transfer} event for ERC20 compatibility. * Also emits a {IERC20-Transfer} event for ERC20 compatibility.
*/ */
function burn(uint256 amount, bytes calldata data) external { function burn(uint256 amount, bytes memory data) public {
_burn(_msgSender(), _msgSender(), amount, data, ""); _burn(_msgSender(), _msgSender(), amount, data, "");
} }
@ -184,7 +184,7 @@ contract ERC777 is Context, IERC777, IERC20 {
/** /**
* @dev See {IERC777-authorizeOperator}. * @dev See {IERC777-authorizeOperator}.
*/ */
function authorizeOperator(address operator) external { function authorizeOperator(address operator) public {
require(_msgSender() != operator, "ERC777: authorizing self as operator"); require(_msgSender() != operator, "ERC777: authorizing self as operator");
if (_defaultOperators[operator]) { if (_defaultOperators[operator]) {
@ -199,7 +199,7 @@ contract ERC777 is Context, IERC777, IERC20 {
/** /**
* @dev See {IERC777-revokeOperator}. * @dev See {IERC777-revokeOperator}.
*/ */
function revokeOperator(address operator) external { function revokeOperator(address operator) public {
require(operator != _msgSender(), "ERC777: revoking self as operator"); require(operator != _msgSender(), "ERC777: revoking self as operator");
if (_defaultOperators[operator]) { if (_defaultOperators[operator]) {
@ -227,10 +227,10 @@ contract ERC777 is Context, IERC777, IERC20 {
address sender, address sender,
address recipient, address recipient,
uint256 amount, uint256 amount,
bytes calldata data, bytes memory data,
bytes calldata operatorData bytes memory operatorData
) )
external public
{ {
require(isOperatorFor(_msgSender(), sender), "ERC777: caller is not an operator for holder"); require(isOperatorFor(_msgSender(), sender), "ERC777: caller is not an operator for holder");
_send(_msgSender(), sender, recipient, amount, data, operatorData, true); _send(_msgSender(), sender, recipient, amount, data, operatorData, true);
@ -241,7 +241,7 @@ contract ERC777 is Context, IERC777, IERC20 {
* *
* Emits {Burned} and {IERC20-Transfer} events. * Emits {Burned} and {IERC20-Transfer} events.
*/ */
function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData) external { function operatorBurn(address account, uint256 amount, bytes memory data, bytes memory operatorData) public {
require(isOperatorFor(_msgSender(), account), "ERC777: caller is not an operator for holder"); require(isOperatorFor(_msgSender(), account), "ERC777: caller is not an operator for holder");
_burn(_msgSender(), account, amount, data, operatorData); _burn(_msgSender(), account, amount, data, operatorData);
} }
@ -262,7 +262,7 @@ contract ERC777 is Context, IERC777, IERC20 {
* *
* Note that accounts cannot have allowance issued by their operators. * Note that accounts cannot have allowance issued by their operators.
*/ */
function approve(address spender, uint256 value) external returns (bool) { function approve(address spender, uint256 value) public returns (bool) {
address holder = _msgSender(); address holder = _msgSender();
_approve(holder, spender, value); _approve(holder, spender, value);
return true; return true;
@ -277,7 +277,7 @@ contract ERC777 is Context, IERC777, IERC20 {
* *
* Emits {Sent}, {IERC20-Transfer} and {IERC20-Approval} events. * Emits {Sent}, {IERC20-Transfer} and {IERC20-Approval} events.
*/ */
function transferFrom(address holder, address recipient, uint256 amount) external returns (bool) { function transferFrom(address holder, address recipient, uint256 amount) public returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address"); require(recipient != address(0), "ERC777: transfer to the zero address");
require(holder != address(0), "ERC777: transfer from the zero address"); require(holder != address(0), "ERC777: transfer from the zero address");