Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made ERC777 registry and private functions internal. #2048

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions contracts/token/ERC777/ERC777.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract ERC777 is Context, IERC777, IERC20 {
using SafeMath for uint256;
using Address for address;

IERC1820Registry constant private ERC1820_REGISTRY = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
IERC1820Registry constant internal ERC1820_REGISTRY = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);

mapping(address => uint256) private _balances;

Expand Down Expand Up @@ -350,7 +350,7 @@ contract ERC777 is Context, IERC777, IERC20 {
bytes memory operatorData,
bool requireReceptionAck
)
private
internal
{
require(from != address(0), "ERC777: send from the zero address");
require(to != address(0), "ERC777: send to the zero address");
Expand Down Expand Up @@ -399,7 +399,7 @@ contract ERC777 is Context, IERC777, IERC20 {
bytes memory userData,
bytes memory operatorData
)
private
internal
{
_balances[from] = _balances[from].sub(amount, "ERC777: transfer amount exceeds balance");
_balances[to] = _balances[to].add(amount);
Expand All @@ -408,7 +408,7 @@ contract ERC777 is Context, IERC777, IERC20 {
emit Transfer(from, to, amount);
}

function _approve(address holder, address spender, uint256 value) private {
function _approve(address holder, address spender, uint256 value) internal {
// TODO: restore this require statement if this function becomes internal, or is called at a new callsite. It is
// currently unnecessary.
//require(holder != address(0), "ERC777: approve from the zero address");
Expand All @@ -435,7 +435,7 @@ contract ERC777 is Context, IERC777, IERC20 {
bytes memory userData,
bytes memory operatorData
)
private
internal
{
address implementer = ERC1820_REGISTRY.getInterfaceImplementer(from, TOKENS_SENDER_INTERFACE_HASH);
if (implementer != address(0)) {
Expand Down Expand Up @@ -463,7 +463,7 @@ contract ERC777 is Context, IERC777, IERC20 {
bytes memory operatorData,
bool requireReceptionAck
)
private
internal
{
address implementer = ERC1820_REGISTRY.getInterfaceImplementer(to, TOKENS_RECIPIENT_INTERFACE_HASH);
if (implementer != address(0)) {
Expand Down