GLOBAL-02

This commit is contained in:
zhl 2022-01-27 17:36:10 +08:00
parent 69b84e8277
commit 47af426e52
5 changed files with 19 additions and 19 deletions

View File

@ -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);
}
}

View File

@ -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');

View File

@ -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;
}

View File

@ -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++) {

View File

@ -13,7 +13,7 @@ contract Migrations {
_;
}
function setCompleted(uint completed) public restricted {
function setCompleted(uint completed) external restricted {
last_completed_migration = completed;
}
}