fix tokenURI return json
This commit is contained in:
parent
3351812acc
commit
d151b80319
|
|
@ -95,38 +95,21 @@ contract FleekERC721 is ERC721, FleekAccessControl {
|
||||||
address owner = ownerOf(tokenId);
|
address owner = ownerOf(tokenId);
|
||||||
App storage app = _apps[tokenId];
|
App storage app = _apps[tokenId];
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
bytes memory dataURI = abi.encodePacked(
|
bytes memory dataURI = abi.encodePacked(
|
||||||
"{",
|
'{',
|
||||||
'"name":"',
|
'"name":"', app.name, '",',
|
||||||
app.name,
|
'"description":"', app.description, '",',
|
||||||
'",',
|
'"owner":"', Strings.toHexString(uint160(owner), 20), '",',
|
||||||
'"description":"',
|
'"external_url":"', app.external_url, '",',
|
||||||
app.description,
|
'"image":"', app.image, '",',
|
||||||
'",',
|
'"attributes": [',
|
||||||
'"owner":"',
|
'{"trait_type": "ENS", "value":"', app.ENS,'"},',
|
||||||
Strings.toHexString(uint160(owner), 20),
|
'{"trait_type": "Commit Hash", "value":"', app.builds[app.current_build].commit_hash,'"},',
|
||||||
'",',
|
'{"trait_type": "Repository", "value":"', app.builds[app.current_build].git_repository,'"},',
|
||||||
'"external_url":"',
|
'{"trait_type": "Version", "value":"', Strings.toString(app.current_build),'"}',
|
||||||
app.external_url,
|
']',
|
||||||
'",',
|
'}'
|
||||||
'"image":"',
|
|
||||||
app.image,
|
|
||||||
'",',
|
|
||||||
'"attributes": [',
|
|
||||||
'{"trait_type": "ENS", "value":"',
|
|
||||||
app.ENS,
|
|
||||||
'"},',
|
|
||||||
'{"trait_type": "Commit Hash", "value":"',
|
|
||||||
app.builds[app.current_build].commit_hash,
|
|
||||||
'"},',
|
|
||||||
'{"trait_type": "Repository", "value":"',
|
|
||||||
app.builds[app.current_build].git_repository,
|
|
||||||
'"},',
|
|
||||||
'{"trait_type": "Version", "value":"',
|
|
||||||
Strings.toString(app.current_build),
|
|
||||||
'"}',
|
|
||||||
"]",
|
|
||||||
"}"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return string(abi.encodePacked(_baseURI(), Base64.encode((dataURI))));
|
return string(abi.encodePacked(_baseURI(), Base64.encode((dataURI))));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue