Replace some uses of abi.encodePacked with more explicit alternatives (#4296)

Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
Hadrien Croubois
2023-06-14 21:11:12 +02:00
committed by GitHub
parent 5cc1ea0a39
commit ef103f37e4
8 changed files with 15 additions and 11 deletions

View File

@ -42,8 +42,8 @@ abstract contract ERC1155URIStorage is ERC1155 {
function uri(uint256 tokenId) public view virtual override returns (string memory) {
string memory tokenURI = _tokenURIs[tokenId];
// If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked).
return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId);
// If token URI is set, concatenate base URI and tokenURI (via string.concat).
return bytes(tokenURI).length > 0 ? string.concat(_baseURI, tokenURI) : super.uri(tokenId);
}
/**