diff --git a/CODE_STYLE.md b/CODE_STYLE.md index 3eca35f86ac..46aaa2e6bd2 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -43,8 +43,22 @@ Any exception or additions specific to our project are documented below. ``` function test() { - uint256 functionVar; - ... + uint256 functionVar; + ... + } + ``` + +* Internal and private functions should have an underscore prefix. + + ``` + function _testInternal() internal { + ... + } + ``` + + ``` + function _testPrivate() private { + ... } ``` diff --git a/contracts/access/SignatureBouncer.sol b/contracts/access/SignatureBouncer.sol index 3dc373afbc9..03ad5cca429 100644 --- a/contracts/access/SignatureBouncer.sol +++ b/contracts/access/SignatureBouncer.sol @@ -17,7 +17,7 @@ import "../cryptography/ECDSA.sol"; * valid addresses on-chain, simply sign a grant of the form * keccak256(abi.encodePacked(`:contractAddress` + `:granteeAddress`)) using a valid bouncer address. * Then restrict access to your crowdsale/whitelist/airdrop using the - * `onlyValidSignature` modifier (or implement your own using isValidSignature). + * `onlyValidSignature` modifier (or implement your own using _isValidSignature). * In addition to `onlyValidSignature`, `onlyValidSignatureAndMethod` and * `onlyValidSignatureAndData` can be used to restrict access to only a given method * or a given method with given parameters respectively. @@ -42,7 +42,7 @@ contract SignatureBouncer is Ownable, RBAC { */ modifier onlyValidSignature(bytes _signature) { - require(isValidSignature(msg.sender, _signature)); + require(_isValidSignature(msg.sender, _signature)); _; } @@ -51,7 +51,7 @@ contract SignatureBouncer is Ownable, RBAC { */ modifier onlyValidSignatureAndMethod(bytes _signature) { - require(isValidSignatureAndMethod(msg.sender, _signature)); + require(_isValidSignatureAndMethod(msg.sender, _signature)); _; } @@ -60,7 +60,7 @@ contract SignatureBouncer is Ownable, RBAC { */ modifier onlyValidSignatureAndData(bytes _signature) { - require(isValidSignatureAndData(msg.sender, _signature)); + require(_isValidSignatureAndData(msg.sender, _signature)); _; } @@ -72,7 +72,7 @@ contract SignatureBouncer is Ownable, RBAC { onlyOwner { require(_bouncer != address(0)); - addRole(_bouncer, ROLE_BOUNCER); + _addRole(_bouncer, ROLE_BOUNCER); } /** @@ -82,19 +82,19 @@ contract SignatureBouncer is Ownable, RBAC { public onlyOwner { - removeRole(_bouncer, ROLE_BOUNCER); + _removeRole(_bouncer, ROLE_BOUNCER); } /** * @dev is the signature of `this + sender` from a bouncer? * @return bool */ - function isValidSignature(address _address, bytes _signature) + function _isValidSignature(address _address, bytes _signature) internal view returns (bool) { - return isValidDataHash( + return _isValidDataHash( keccak256(abi.encodePacked(address(this), _address)), _signature ); @@ -104,7 +104,7 @@ contract SignatureBouncer is Ownable, RBAC { * @dev is the signature of `this + sender + methodId` from a bouncer? * @return bool */ - function isValidSignatureAndMethod(address _address, bytes _signature) + function _isValidSignatureAndMethod(address _address, bytes _signature) internal view returns (bool) @@ -113,7 +113,7 @@ contract SignatureBouncer is Ownable, RBAC { for (uint i = 0; i < data.length; i++) { data[i] = msg.data[i]; } - return isValidDataHash( + return _isValidDataHash( keccak256(abi.encodePacked(address(this), _address, data)), _signature ); @@ -124,7 +124,7 @@ contract SignatureBouncer is Ownable, RBAC { * @notice the _signature parameter of the method being validated must be the "last" parameter * @return bool */ - function isValidSignatureAndData(address _address, bytes _signature) + function _isValidSignatureAndData(address _address, bytes _signature) internal view returns (bool) @@ -134,7 +134,7 @@ contract SignatureBouncer is Ownable, RBAC { for (uint i = 0; i < data.length; i++) { data[i] = msg.data[i]; } - return isValidDataHash( + return _isValidDataHash( keccak256(abi.encodePacked(address(this), _address, data)), _signature ); @@ -145,7 +145,7 @@ contract SignatureBouncer is Ownable, RBAC { * and then recover the signature and check it against the bouncer role * @return bool */ - function isValidDataHash(bytes32 _hash, bytes _signature) + function _isValidDataHash(bytes32 _hash, bytes _signature) internal view returns (bool) diff --git a/contracts/access/Whitelist.sol b/contracts/access/Whitelist.sol index 50414c6848c..40a2f56638f 100644 --- a/contracts/access/Whitelist.sol +++ b/contracts/access/Whitelist.sol @@ -31,7 +31,7 @@ contract Whitelist is Ownable, RBAC { public onlyOwner { - addRole(_operator, ROLE_WHITELISTED); + _addRole(_operator, ROLE_WHITELISTED); } /** @@ -70,7 +70,7 @@ contract Whitelist is Ownable, RBAC { public onlyOwner { - removeRole(_operator, ROLE_WHITELISTED); + _removeRole(_operator, ROLE_WHITELISTED); } /** diff --git a/contracts/access/rbac/RBAC.sol b/contracts/access/rbac/RBAC.sol index 7f8196c0683..8ecefaa99f0 100644 --- a/contracts/access/rbac/RBAC.sol +++ b/contracts/access/rbac/RBAC.sol @@ -52,7 +52,7 @@ contract RBAC { * @param _operator address * @param _role the name of the role */ - function addRole(address _operator, string _role) + function _addRole(address _operator, string _role) internal { roles[_role].add(_operator); @@ -64,7 +64,7 @@ contract RBAC { * @param _operator address * @param _role the name of the role */ - function removeRole(address _operator, string _role) + function _removeRole(address _operator, string _role) internal { roles[_role].remove(_operator); diff --git a/contracts/bounties/BreakInvariantBounty.sol b/contracts/bounties/BreakInvariantBounty.sol index 1677fb5abb2..4e0df74d80b 100644 --- a/contracts/bounties/BreakInvariantBounty.sol +++ b/contracts/bounties/BreakInvariantBounty.sol @@ -28,7 +28,7 @@ contract BreakInvariantBounty is PullPayment, Destructible { * @return A target contract */ function createTarget() public returns(Target) { - Target target = Target(deployContract()); + Target target = Target(_deployContract()); researchers[target] = msg.sender; emit TargetCreated(target); return target; @@ -43,7 +43,7 @@ contract BreakInvariantBounty is PullPayment, Destructible { require(researcher != address(0)); // Check Target contract invariants require(!_target.checkInvariant()); - asyncTransfer(researcher, address(this).balance); + _asyncTransfer(researcher, address(this).balance); claimed = true; } @@ -51,7 +51,7 @@ contract BreakInvariantBounty is PullPayment, Destructible { * @dev Internal function to deploy the target contract. * @return A target contract address */ - function deployContract() internal returns(address); + function _deployContract() internal returns(address); } diff --git a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol index 39f84f1abd7..651069d41af 100644 --- a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol +++ b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol @@ -25,7 +25,7 @@ contract FinalizableCrowdsale is Ownable, TimedCrowdsale { require(!isFinalized); require(hasClosed()); - finalization(); + _finalization(); emit CrowdsaleFinalized(); isFinalized = true; @@ -33,10 +33,10 @@ contract FinalizableCrowdsale is Ownable, TimedCrowdsale { /** * @dev Can be overridden to add finalization logic. The overriding function - * should call super.finalization() to ensure the chain of finalization is + * should call super._finalization() to ensure the chain of finalization is * executed entirely. */ - function finalization() internal { + function _finalization() internal { } } diff --git a/contracts/crowdsale/distribution/RefundableCrowdsale.sol b/contracts/crowdsale/distribution/RefundableCrowdsale.sol index 83f0ae5425c..05f95ca8584 100644 --- a/contracts/crowdsale/distribution/RefundableCrowdsale.sol +++ b/contracts/crowdsale/distribution/RefundableCrowdsale.sol @@ -51,7 +51,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale { /** * @dev escrow finalization task, called when owner calls finalize() */ - function finalization() internal { + function _finalization() internal { if (goalReached()) { escrow_.close(); escrow_.beneficiaryWithdraw(); @@ -59,7 +59,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale { escrow_.enableRefunds(); } - super.finalization(); + super._finalization(); } /** diff --git a/contracts/examples/RBACWithAdmin.sol b/contracts/examples/RBACWithAdmin.sol index 479bb95ac4f..ca2d5ed3139 100644 --- a/contracts/examples/RBACWithAdmin.sol +++ b/contracts/examples/RBACWithAdmin.sol @@ -37,7 +37,7 @@ contract RBACWithAdmin is RBAC { constructor() public { - addRole(msg.sender, ROLE_ADMIN); + _addRole(msg.sender, ROLE_ADMIN); } /** @@ -49,7 +49,7 @@ contract RBACWithAdmin is RBAC { public onlyAdmin { - addRole(_account, _roleName); + _addRole(_account, _roleName); } /** @@ -61,6 +61,6 @@ contract RBACWithAdmin is RBAC { public onlyAdmin { - removeRole(_account, _roleName); + _removeRole(_account, _roleName); } } diff --git a/contracts/mocks/BouncerMock.sol b/contracts/mocks/BouncerMock.sol index e5bd31a1049..7f8f02d0538 100644 --- a/contracts/mocks/BouncerMock.sol +++ b/contracts/mocks/BouncerMock.sol @@ -9,7 +9,7 @@ contract SignatureBouncerMock is SignatureBouncer { view returns (bool) { - return isValidSignature(_address, _signature); + return _isValidSignature(_address, _signature); } function onlyWithValidSignature(bytes _signature) @@ -25,7 +25,7 @@ contract SignatureBouncerMock is SignatureBouncer { view returns (bool) { - return isValidSignatureAndMethod(_address, _signature); + return _isValidSignatureAndMethod(_address, _signature); } function onlyWithValidSignatureAndMethod(bytes _signature) @@ -46,7 +46,7 @@ contract SignatureBouncerMock is SignatureBouncer { view returns (bool) { - return isValidSignatureAndData(_address, _signature); + return _isValidSignatureAndData(_address, _signature); } function onlyWithValidSignatureAndData(uint, bytes _signature) diff --git a/contracts/mocks/ERC721Mock.sol b/contracts/mocks/ERC721Mock.sol index 8c4b0373f15..b6c138fd2cd 100644 --- a/contracts/mocks/ERC721Mock.sol +++ b/contracts/mocks/ERC721Mock.sol @@ -14,22 +14,22 @@ contract ERC721Mock is ERC721 { { } function mint(address _to, uint256 _tokenId) public { - super._mint(_to, _tokenId); + _mint(_to, _tokenId); } function burn(uint256 _tokenId) public { - super._burn(ownerOf(_tokenId), _tokenId); + _burn(ownerOf(_tokenId), _tokenId); } function exists(uint256 _tokenId) public view returns (bool) { - return super._exists(_tokenId); + return _exists(_tokenId); } function setTokenURI(uint256 _tokenId, string _uri) public { - super._setTokenURI(_tokenId, _uri); + _setTokenURI(_tokenId, _uri); } - function _removeTokenFrom(address _from, uint256 _tokenId) public { - super.removeTokenFrom(_from, _tokenId); + function removeTokenFrom(address _from, uint256 _tokenId) public { + _removeTokenFrom(_from, _tokenId); } } diff --git a/contracts/mocks/InsecureInvariantTargetBounty.sol b/contracts/mocks/InsecureInvariantTargetBounty.sol index 26ceb23b926..32d305cac0a 100644 --- a/contracts/mocks/InsecureInvariantTargetBounty.sol +++ b/contracts/mocks/InsecureInvariantTargetBounty.sol @@ -14,7 +14,7 @@ contract InsecureInvariantTargetMock is Target { contract InsecureInvariantTargetBounty is BreakInvariantBounty { - function deployContract() internal returns (address) { + function _deployContract() internal returns (address) { return new InsecureInvariantTargetMock(); } } diff --git a/contracts/mocks/PullPaymentMock.sol b/contracts/mocks/PullPaymentMock.sol index 5aa2b767fbb..639095dcbb8 100644 --- a/contracts/mocks/PullPaymentMock.sol +++ b/contracts/mocks/PullPaymentMock.sol @@ -11,7 +11,7 @@ contract PullPaymentMock is PullPayment { // test helper function to call asyncTransfer function callTransfer(address _dest, uint256 _amount) public { - asyncTransfer(_dest, _amount); + _asyncTransfer(_dest, _amount); } } diff --git a/contracts/mocks/RBACMock.sol b/contracts/mocks/RBACMock.sol index 64b174c5b98..dea62d8f85e 100644 --- a/contracts/mocks/RBACMock.sol +++ b/contracts/mocks/RBACMock.sol @@ -19,10 +19,10 @@ contract RBACMock is RBACWithAdmin { constructor(address[] _advisors) public { - addRole(msg.sender, ROLE_ADVISOR); + _addRole(msg.sender, ROLE_ADVISOR); for (uint256 i = 0; i < _advisors.length; i++) { - addRole(_advisors[i], ROLE_ADVISOR); + _addRole(_advisors[i], ROLE_ADVISOR); } } @@ -64,6 +64,6 @@ contract RBACMock is RBACWithAdmin { checkRole(_account, ROLE_ADVISOR); // remove the advisor's role - removeRole(_account, ROLE_ADVISOR); + _removeRole(_account, ROLE_ADVISOR); } } diff --git a/contracts/mocks/SecureInvariantTargetBounty.sol b/contracts/mocks/SecureInvariantTargetBounty.sol index b44dab43c35..f08fbd9b81b 100644 --- a/contracts/mocks/SecureInvariantTargetBounty.sol +++ b/contracts/mocks/SecureInvariantTargetBounty.sol @@ -14,7 +14,7 @@ contract SecureInvariantTargetMock is Target { contract SecureInvariantTargetBounty is BreakInvariantBounty { - function deployContract() internal returns (address) { + function _deployContract() internal returns (address) { return new SecureInvariantTargetMock(); } } diff --git a/contracts/ownership/Heritable.sol b/contracts/ownership/Heritable.sol index 5daa95a56d9..88e6fee62f4 100644 --- a/contracts/ownership/Heritable.sol +++ b/contracts/ownership/Heritable.sol @@ -86,7 +86,7 @@ contract Heritable is Ownable { * have to wait for `heartbeatTimeout` seconds. */ function proclaimDeath() public onlyHeir { - require(ownerLives()); + require(_ownerLives()); emit OwnerProclaimedDead(owner, heir_, timeOfDeath_); // solium-disable-next-line security/no-block-members timeOfDeath_ = block.timestamp; @@ -104,7 +104,7 @@ contract Heritable is Ownable { * @dev Allows heir to transfer ownership only if heartbeat has timed out. */ function claimHeirOwnership() public onlyHeir { - require(!ownerLives()); + require(!_ownerLives()); // solium-disable-next-line security/no-block-members require(block.timestamp >= timeOfDeath_ + heartbeatTimeout_); emit OwnershipTransferred(owner, heir_); @@ -113,7 +113,7 @@ contract Heritable is Ownable { timeOfDeath_ = 0; } - function ownerLives() internal view returns (bool) { + function _ownerLives() internal view returns (bool) { return timeOfDeath_ == 0; } } diff --git a/contracts/ownership/Superuser.sol b/contracts/ownership/Superuser.sol index ec8120d676e..afacc193455 100644 --- a/contracts/ownership/Superuser.sol +++ b/contracts/ownership/Superuser.sol @@ -15,7 +15,7 @@ contract Superuser is Ownable, RBAC { string public constant ROLE_SUPERUSER = "superuser"; constructor () public { - addRole(msg.sender, ROLE_SUPERUSER); + _addRole(msg.sender, ROLE_SUPERUSER); } /** @@ -48,8 +48,8 @@ contract Superuser is Ownable, RBAC { */ function transferSuperuser(address _newSuperuser) public onlySuperuser { require(_newSuperuser != address(0)); - removeRole(msg.sender, ROLE_SUPERUSER); - addRole(_newSuperuser, ROLE_SUPERUSER); + _removeRole(msg.sender, ROLE_SUPERUSER); + _addRole(_newSuperuser, ROLE_SUPERUSER); } /** diff --git a/contracts/payment/PullPayment.sol b/contracts/payment/PullPayment.sol index e117fc49eb6..cd10424f315 100644 --- a/contracts/payment/PullPayment.sol +++ b/contracts/payment/PullPayment.sol @@ -6,7 +6,7 @@ import "./Escrow.sol"; /** * @title PullPayment * @dev Base contract supporting async send for pull payments. Inherit from this - * contract and use asyncTransfer instead of send or transfer. + * contract and use _asyncTransfer instead of send or transfer. */ contract PullPayment { Escrow private escrow; @@ -36,7 +36,7 @@ contract PullPayment { * @param _dest The destination address of the funds. * @param _amount The amount to transfer. */ - function asyncTransfer(address _dest, uint256 _amount) internal { + function _asyncTransfer(address _dest, uint256 _amount) internal { escrow.deposit.value(_amount)(_dest); } } diff --git a/contracts/payment/SplitPayment.sol b/contracts/payment/SplitPayment.sol index 19202323fcf..04b01425683 100644 --- a/contracts/payment/SplitPayment.sol +++ b/contracts/payment/SplitPayment.sol @@ -26,7 +26,7 @@ contract SplitPayment { require(_payees.length > 0); for (uint256 i = 0; i < _payees.length; i++) { - addPayee(_payees[i], _shares[i]); + _addPayee(_payees[i], _shares[i]); } } @@ -64,7 +64,7 @@ contract SplitPayment { * @param _payee The address of the payee to add. * @param _shares The number of shares owned by the payee. */ - function addPayee(address _payee, uint256 _shares) internal { + function _addPayee(address _payee, uint256 _shares) internal { require(_payee != address(0)); require(_shares > 0); require(shares[_payee] == 0); diff --git a/contracts/token/ERC20/RBACMintableToken.sol b/contracts/token/ERC20/RBACMintableToken.sol index 6cf9f6aba4d..7a50c69f042 100644 --- a/contracts/token/ERC20/RBACMintableToken.sol +++ b/contracts/token/ERC20/RBACMintableToken.sol @@ -28,7 +28,7 @@ contract RBACMintableToken is ERC20Mintable, RBAC { * @param _minter address */ function addMinter(address _minter) public onlyOwner { - addRole(_minter, ROLE_MINTER); + _addRole(_minter, ROLE_MINTER); } /** @@ -36,6 +36,6 @@ contract RBACMintableToken is ERC20Mintable, RBAC { * @param _minter address */ function removeMinter(address _minter) public onlyOwner { - removeRole(_minter, ROLE_MINTER); + _removeRole(_minter, ROLE_MINTER); } } diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index ef6a98453c4..287555899f7 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -125,8 +125,8 @@ contract ERC721 is SupportsInterfaceWithLookup, ERC721Basic, IERC721 { * @param _to address representing the new owner of the given token ID * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address */ - function addTokenTo(address _to, uint256 _tokenId) internal { - super.addTokenTo(_to, _tokenId); + function _addTokenTo(address _to, uint256 _tokenId) internal { + super._addTokenTo(_to, _tokenId); uint256 length = ownedTokens[_to].length; ownedTokens[_to].push(_tokenId); ownedTokensIndex[_tokenId] = length; @@ -137,8 +137,8 @@ contract ERC721 is SupportsInterfaceWithLookup, ERC721Basic, IERC721 { * @param _from address representing the previous owner of the given token ID * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address */ - function removeTokenFrom(address _from, uint256 _tokenId) internal { - super.removeTokenFrom(_from, _tokenId); + function _removeTokenFrom(address _from, uint256 _tokenId) internal { + super._removeTokenFrom(_from, _tokenId); // To prevent a gap in the array, we store the last token in the index of the token to delete, and // then delete the last slot. diff --git a/contracts/token/ERC721/ERC721Basic.sol b/contracts/token/ERC721/ERC721Basic.sol index 65b748b4050..763629d4838 100644 --- a/contracts/token/ERC721/ERC721Basic.sol +++ b/contracts/token/ERC721/ERC721Basic.sol @@ -130,12 +130,12 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { ) public { - require(isApprovedOrOwner(msg.sender, _tokenId)); + require(_isApprovedOrOwner(msg.sender, _tokenId)); require(_to != address(0)); - clearApproval(_from, _tokenId); - removeTokenFrom(_from, _tokenId); - addTokenTo(_to, _tokenId); + _clearApproval(_from, _tokenId); + _removeTokenFrom(_from, _tokenId); + _addTokenTo(_to, _tokenId); emit Transfer(_from, _to, _tokenId); } @@ -185,7 +185,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { { transferFrom(_from, _to, _tokenId); // solium-disable-next-line arg-overflow - require(checkAndCallSafeTransfer(_from, _to, _tokenId, _data)); + require(_checkAndCallSafeTransfer(_from, _to, _tokenId, _data)); } /** @@ -205,7 +205,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { * @return bool whether the msg.sender is approved for the given token ID, * is an operator of the owner, or is the owner of the token */ - function isApprovedOrOwner( + function _isApprovedOrOwner( address _spender, uint256 _tokenId ) @@ -232,7 +232,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { */ function _mint(address _to, uint256 _tokenId) internal { require(_to != address(0)); - addTokenTo(_to, _tokenId); + _addTokenTo(_to, _tokenId); emit Transfer(address(0), _to, _tokenId); } @@ -242,8 +242,8 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { * @param _tokenId uint256 ID of the token being burned by the msg.sender */ function _burn(address _owner, uint256 _tokenId) internal { - clearApproval(_owner, _tokenId); - removeTokenFrom(_owner, _tokenId); + _clearApproval(_owner, _tokenId); + _removeTokenFrom(_owner, _tokenId); emit Transfer(_owner, address(0), _tokenId); } @@ -253,7 +253,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { * @param _owner owner of the token * @param _tokenId uint256 ID of the token to be transferred */ - function clearApproval(address _owner, uint256 _tokenId) internal { + function _clearApproval(address _owner, uint256 _tokenId) internal { require(ownerOf(_tokenId) == _owner); if (tokenApprovals[_tokenId] != address(0)) { tokenApprovals[_tokenId] = address(0); @@ -265,7 +265,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { * @param _to address representing the new owner of the given token ID * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address */ - function addTokenTo(address _to, uint256 _tokenId) internal { + function _addTokenTo(address _to, uint256 _tokenId) internal { require(tokenOwner[_tokenId] == address(0)); tokenOwner[_tokenId] = _to; ownedTokensCount[_to] = ownedTokensCount[_to].add(1); @@ -276,7 +276,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { * @param _from address representing the previous owner of the given token ID * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address */ - function removeTokenFrom(address _from, uint256 _tokenId) internal { + function _removeTokenFrom(address _from, uint256 _tokenId) internal { require(ownerOf(_tokenId) == _from); ownedTokensCount[_from] = ownedTokensCount[_from].sub(1); tokenOwner[_tokenId] = address(0); @@ -291,7 +291,7 @@ contract ERC721Basic is SupportsInterfaceWithLookup, IERC721Basic { * @param _data bytes optional data to send along with the call * @return whether the call correctly returned the expected magic value */ - function checkAndCallSafeTransfer( + function _checkAndCallSafeTransfer( address _from, address _to, uint256 _tokenId, diff --git a/test/token/ERC721/ERC721.test.js b/test/token/ERC721/ERC721.test.js index 1881c4b8fe3..5469c87cf28 100644 --- a/test/token/ERC721/ERC721.test.js +++ b/test/token/ERC721/ERC721.test.js @@ -76,13 +76,13 @@ contract('ERC721', function (accounts) { describe('removeTokenFrom', function () { it('reverts if the correct owner is not passed', async function () { await assertRevert( - this.token._removeTokenFrom(anyone, firstTokenId, { from: creator }) + this.token.removeTokenFrom(anyone, firstTokenId, { from: creator }) ); }); context('once removed', function () { beforeEach(async function () { - await this.token._removeTokenFrom(creator, firstTokenId, { from: creator }); + await this.token.removeTokenFrom(creator, firstTokenId, { from: creator }); }); it('has been removed', async function () {