diff --git a/contracts/BEBase.sol b/contracts/BEBase.sol index 749451d..85ddc91 100644 --- a/contracts/BEBase.sol +++ b/contracts/BEBase.sol @@ -28,7 +28,7 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O * * - the caller must have the `MINTER_ROLE`. */ - function mint(address to, uint256 tokenId) public virtual { + function mint(address to, uint256 tokenId) external virtual { require( hasRole(MINTER_ROLE, _msgSender()), "Must have minter role to mint" @@ -58,7 +58,7 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O /** * @dev Allow operation to reduce gas fee. */ - function addApprovalWhitelist(address proxy) public onlyOwner { + function addApprovalWhitelist(address proxy) external onlyOwner { require(!approvalWhitelists[proxy], "Invalid proxy address"); approvalWhitelists[proxy] = true; @@ -67,28 +67,28 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O /** * @dev Remove operation from approval list. */ - function removeApprovalWhitelist(address proxy) public onlyOwner { + function removeApprovalWhitelist(address proxy) external onlyOwner { approvalWhitelists[proxy] = false; } /** * @dev Add factory to mint item */ - function setMintFactory(address factory) public onlyOwner { + function setMintFactory(address factory) external onlyOwner { _setupRole(MINTER_ROLE, factory); } /** * @dev Remove factory */ - function removeMintFactory(address factory) public onlyOwner { + function removeMintFactory(address factory) external onlyOwner { revokeRole(MINTER_ROLE, factory); } /** * @dev Lock token to use in game or for rental */ - function lock(uint256 tokenId) public { + function lock(uint256 tokenId) external { require( approvalWhitelists[_msgSender()], "Must be valid approval whitelist" @@ -101,7 +101,7 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O /** * @dev Unlock token to use blockchain or sale on marketplace */ - function unlock(uint256 tokenId) public { + function unlock(uint256 tokenId) external { require( approvalWhitelists[_msgSender()], "Must be valid approval whitelist" @@ -114,14 +114,14 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O /** * @dev Get lock status */ - function isLocked(uint256 tokenId) public view returns (bool) { + function isLocked(uint256 tokenId) external view returns (bool) { return lockedTokens[tokenId]; } /** * @dev Set token URI */ - function updateBaseURI(string calldata baseTokenURI) public onlyOwner { + function updateBaseURI(string calldata baseTokenURI) external onlyOwner { _baseTokenURI = baseTokenURI; } @@ -158,7 +158,7 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O * * - The caller must own `tokenId` or be an approved operator. */ - function burn(address owner, uint256 tokenId) public virtual { + function burn(address owner, uint256 tokenId) external virtual { require( hasRole(BURN_ROLE, _msgSender()), "Must have burn role to burn" @@ -174,14 +174,14 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O /** * @dev Add factory to burn item */ - function setBurnProxy(address proxy) public onlyOwner { + function setBurnProxy(address proxy) external onlyOwner { _setupRole(BURN_ROLE, proxy); } /** * @dev Remove proxy */ - function removeBurnProxy(address proxy) public onlyOwner { + function removeBurnProxy(address proxy) external onlyOwner { revokeRole(BURN_ROLE, proxy); } } \ No newline at end of file diff --git a/contracts/BEBoxMall.sol b/contracts/BEBoxMall.sol index c76f113..89a2acd 100644 --- a/contracts/BEBoxMall.sol +++ b/contracts/BEBoxMall.sol @@ -21,7 +21,7 @@ contract BEBoxMall is Ownable, HasSignature { mapping(bytes => bool) public usedSignatures; function setPaymentReceivedAddress(address _paymentReceivedAddress) - public + external onlyOwner { require(_paymentReceivedAddress != address(0), 'payment received address can not be zero'); diff --git a/contracts/EvolveProxy.sol b/contracts/EvolveProxy.sol index a3c605c..8b9b717 100644 --- a/contracts/EvolveProxy.sol +++ b/contracts/EvolveProxy.sol @@ -61,7 +61,7 @@ contract EvolveProxy is Ownable, Initializable { /** * @dev function to update allow user evolve items */ - function updatePublicEvolve(bool val) public onlyOwner { + function updatePublicEvolve(bool val) external onlyOwner { publicEvolveAllowed = val; } diff --git a/contracts/MarketPlace.sol b/contracts/MarketPlace.sol index 6f4f7dc..fa94a97 100644 --- a/contracts/MarketPlace.sol +++ b/contracts/MarketPlace.sol @@ -33,17 +33,17 @@ contract Marketplace is Ownable, HasSignature { uint256 fee ); - function setFeeToAddress(address _feeToAddress) public onlyOwner { + function setFeeToAddress(address _feeToAddress) external onlyOwner { require(_feeToAddress != address(0), 'fee received address can not be zero'); feeToAddress = _feeToAddress; } - function setTransactionFee(uint256 _transactionFee) public onlyOwner { + function setTransactionFee(uint256 _transactionFee) external onlyOwner { transactionFee = _transactionFee; } function setPaymentTokens(address[] calldata _paymentTokens) - public + external onlyOwner { for (uint256 i = 0; i < _paymentTokens.length; i++) { @@ -56,7 +56,7 @@ contract Marketplace is Ownable, HasSignature { } function removePaymentTokens(address[] calldata _removedPaymentTokens) - public + external onlyOwner { for (uint256 i = 0; i < _removedPaymentTokens.length; i++) { diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol index e3b2221..f6710bb 100644 --- a/contracts/Migrations.sol +++ b/contracts/Migrations.sol @@ -13,7 +13,7 @@ contract Migrations { _; } - function setCompleted(uint completed) public restricted { + function setCompleted(uint completed) external restricted { last_completed_migration = completed; } }