diff --git a/packages/protocol/contracts/thirdparty/optimism/Bytes.sol b/packages/protocol/contracts/thirdparty/optimism/Bytes.sol index 3886dd59022..6a6fba86e7d 100644 --- a/packages/protocol/contracts/thirdparty/optimism/Bytes.sol +++ b/packages/protocol/contracts/thirdparty/optimism/Bytes.sol @@ -84,7 +84,7 @@ library Bytes { } /// @notice Slices a byte array with a given starting index up to the end of the original byte - /// array. Returns a new array rathern than a pointer to the original. + /// array. Returns a new array rather than a pointer to the original. /// @param _bytes Byte array to slice. /// @param _start Starting index of the slice. /// @return Slice of the input byte array. diff --git a/packages/protocol/contracts/thirdparty/optimism/trie/MerkleTrie.sol b/packages/protocol/contracts/thirdparty/optimism/trie/MerkleTrie.sol index f961c591ce2..3b883d0185e 100644 --- a/packages/protocol/contracts/thirdparty/optimism/trie/MerkleTrie.sol +++ b/packages/protocol/contracts/thirdparty/optimism/trie/MerkleTrie.sol @@ -205,11 +205,8 @@ library MerkleTrie { function _parseProof(bytes[] memory _proof) private pure returns (TrieNode[] memory proof_) { uint256 length = _proof.length; proof_ = new TrieNode[](length); - for (uint256 i = 0; i < length;) { + for (uint256 i = 0; i < length; ++i) { proof_[i] = TrieNode({ encoded: _proof[i], decoded: RLPReader.readList(_proof[i]) }); - unchecked { - ++i; - } } } diff --git a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol index d0aea03aa43..4fefb8162ec 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol @@ -51,7 +51,7 @@ contract BridgedERC1155 is EssentialContract, ERC1155Upgradeable { // The token URI here is not important as the client will have to read the URI from the // canonical contract to fetch meta data. - __ERC1155_init(LibBridgedToken.buildURI(_srcToken, _srcChainId)); + __ERC1155_init(LibBridgedToken.buildURI(_srcToken, _srcChainId, "")); srcToken = _srcToken; srcChainId = _srcChainId; diff --git a/packages/protocol/contracts/tokenvault/BridgedERC721.sol b/packages/protocol/contracts/tokenvault/BridgedERC721.sol index 9ccb44504dd..d189ae6fc63 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC721.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC721.sol @@ -107,11 +107,7 @@ contract BridgedERC721 is EssentialContract, ERC721Upgradeable { // https://github.com/crytic/slither/wiki/Detector-Documentation#abi-encodePacked-collision // The abi.encodePacked() call below takes multiple dynamic arguments. This is known and // considered acceptable in terms of risk. - return string( - abi.encodePacked( - LibBridgedToken.buildURI(srcToken, srcChainId), Strings.toString(_tokenId) - ) - ); + return LibBridgedToken.buildURI(srcToken, srcChainId, Strings.toString(_tokenId)); } /// @notice Gets the canonical token's address and chain ID. diff --git a/packages/protocol/contracts/tokenvault/LibBridgedToken.sol b/packages/protocol/contracts/tokenvault/LibBridgedToken.sol index 7578bee24d8..de28a1c1654 100644 --- a/packages/protocol/contracts/tokenvault/LibBridgedToken.sol +++ b/packages/protocol/contracts/tokenvault/LibBridgedToken.sol @@ -52,7 +52,8 @@ library LibBridgedToken { function buildURI( address _srcToken, - uint256 _srcChainId + uint256 _srcChainId, + string memory _extraParams ) internal pure @@ -66,7 +67,8 @@ library LibBridgedToken { Strings.toHexString(uint160(_srcToken), 20), "@", Strings.toString(_srcChainId), - "/tokenURI?uint256=" + "/tokenURI?uint256=", + _extraParams ) ); }