From 97bc38f73ce1253e56c4409c8163e726c3b300dc Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 2 May 2024 16:46:45 +0800 Subject: [PATCH] more --- .../contracts/tokenvault/BridgedERC1155.sol | 42 +++++++++---------- .../contracts/tokenvault/BridgedERC20.sol | 2 +- .../contracts/tokenvault/BridgedERC721.sol | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol index cb2aeec63d..2cac0d77ee 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol @@ -61,33 +61,16 @@ contract BridgedERC1155 is EssentialContract, ERC1155Upgradeable { name = _name; } - /// @dev Mints tokens. - /// @param _to Address to receive the minted tokens. - /// @param _tokenId ID of the token to mint. - /// @param _amount Amount of tokens to mint. - function mint( - address _to, - uint256 _tokenId, - uint256 _amount - ) - public - whenNotPaused - onlyFromNamed(LibStrings.B_ERC1155_VAULT) - nonReentrant - { - _mint(_to, _tokenId, _amount, ""); - } - /// @dev Mints tokens. /// @param _to Address to receive the minted tokens. /// @param _tokenIds ID of the token to mint. /// @param _amounts Amount of tokens to mint. function mintBatch( address _to, - uint256[] memory _tokenIds, - uint256[] memory _amounts + uint256[] calldata _tokenIds, + uint256[] calldata _amounts ) - public + external whenNotPaused onlyFromNamed(LibStrings.B_ERC1155_VAULT) nonReentrant @@ -112,10 +95,27 @@ contract BridgedERC1155 is EssentialContract, ERC1155Upgradeable { _burnBatch(_account, _ids, _amounts); } + /// @dev Mints tokens. + /// @param _to Address to receive the minted tokens. + /// @param _tokenId ID of the token to mint. + /// @param _amount Amount of tokens to mint. + function mint( + address _to, + uint256 _tokenId, + uint256 _amount + ) + public + whenNotPaused + onlyFromNamed(LibStrings.B_ERC1155_VAULT) + nonReentrant + { + _mint(_to, _tokenId, _amount, ""); + } + /// @notice Gets the canonical token's address and chain ID. /// @return The canonical token's address. /// @return The canonical token's chain ID. - function canonical() external view returns (address, uint256) { + function canonical() public view returns (address, uint256) { return (srcToken, srcChainId); } diff --git a/packages/protocol/contracts/tokenvault/BridgedERC20.sol b/packages/protocol/contracts/tokenvault/BridgedERC20.sol index 43661f312b..e2a0ac9aa9 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC20.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC20.sol @@ -150,7 +150,7 @@ contract BridgedERC20 is EssentialContract, IBridgedERC20, ERC20Upgradeable, IER /// @notice Gets the canonical token's address and chain ID. /// @return The canonical token's address. /// @return The canonical token's chain ID. - function canonical() external view returns (address, uint256) { + function canonical() public view returns (address, uint256) { return (srcToken, srcChainId); } diff --git a/packages/protocol/contracts/tokenvault/BridgedERC721.sol b/packages/protocol/contracts/tokenvault/BridgedERC721.sol index eee34e1cb1..afca5a3209 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC721.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC721.sol @@ -103,7 +103,7 @@ contract BridgedERC721 is EssentialContract, ERC721Upgradeable { /// @notice Gets the canonical token's address and chain ID. /// @return The canonical token's address. /// @return The canonical token's chain ID. - function canonical() external view returns (address, uint256) { + function canonical() public view returns (address, uint256) { return (srcToken, srcChainId); }