Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fetch URI using IERC1155Metadata for new tokens #14

Merged
merged 3 commits into from Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/deploy.sh
Expand Up @@ -13,7 +13,7 @@ npx graph build \
${SUBGRAPH:-generated/sample.subgraph.yaml} &&

npx graph deploy \
--product hosted-service
--product hosted-service \
${NAME:-amxx/sandbox} \
${SUBGRAPH:-generated/sample.subgraph.yaml} &&

Expand Down
2 changes: 1 addition & 1 deletion src/datasources/erc1155.ts
Expand Up @@ -146,6 +146,6 @@ export function handleURI(event: URIEvent): void
{
let contract = fetchERC1155(event.address)
let token = fetchERC1155Token(contract, event.params.id)
token.uri = event.params.value
token.uri = event.params.value.replaceAll('{id}', event.params.id.toString());
Amxx marked this conversation as resolved.
Show resolved Hide resolved
token.save()
}
2 changes: 1 addition & 1 deletion src/fetch/erc1155.ts
Expand Up @@ -45,7 +45,7 @@ export function fetchERC1155Token(contract: ERC1155Contract, identifier: BigInt)
token.contract = contract.id
token.identifier = identifier
token.totalSupply = fetchERC1155Balance(token as ERC1155Token, null).id
token.uri = try_uri.reverted ? null : try_uri.value
token.uri = try_uri.reverted ? null : try_uri.value.replaceAll('{id}', identifier.toString())
Amxx marked this conversation as resolved.
Show resolved Hide resolved
token.save()
}

Expand Down