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

[Bug] eth_call constantly reverting when called from the mapping handler #5035

Closed
1 of 3 tasks
itsjerryokolo opened this issue Dec 1, 2023 · 8 comments
Closed
1 of 3 tasks
Labels
bug Something isn't working

Comments

@itsjerryokolo
Copy link
Contributor

Bug report

Calling the _badgeStore() function is constantly reverting. I tried calling the same function through our polygon RPC using etherjs and I got response.

Steps to reproduce:

  1. Deploy https://github.com/itsjerryokolo/badge-subgraph
  2. Check the logs

Relevant log output

No response

IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out

  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

OS information

None

@itsjerryokolo itsjerryokolo added the bug Something isn't working label Dec 1, 2023
@azf20
Copy link
Contributor

azf20 commented Dec 1, 2023

hey @itsjerryokolo are you calling the Polygon RPC at the specific block height?

Can you share the logs & the RPC call you're making?

@itsjerryokolo
Copy link
Contributor Author

itsjerryokolo commented Dec 1, 2023

@azf20 No, I didn't, but I tried it yesterday and got response.
I tried again today in a new, more recent, event and it also failed.
I got response again today when I tried through etherjs

This is the handler

export function handleProtocolSettingsUpdated(
	event: ProtocolSettingsUpdated
): void {
	const theBadgeAddress = event.address;
	const theBadge = Badge.bind(theBadgeAddress);
	const tbSTore = theBadge.try__badgeStore();

	if (!tbSTore.reverted) {
		let protocolConfigs = ProtocolConfig.load(tbSTore.value);

		if (!protocolConfigs) {
			protocolConfigs = new ProtocolConfig(tbSTore.value);
		}

		protocolConfigs.address = tbSTore.value;
		protocolConfigs.save();
	} else {
		log.warning("try__badgeStore reverted: {}", [
			event.transaction.hash.toHexString(),
		]);
	}

It fires in this event
https://polygonscan.com/tx/0xa88a3c1648588a005e14d1aa57159675a2c4ca61cecfcabd8604db6d821481d5#eventlog

Screenshot 2023-12-01 at 2 48 46 PM

@azf20
Copy link
Contributor

azf20 commented Dec 1, 2023

Thanks - can you share how you're calling with ethers.js?

@itsjerryokolo
Copy link
Contributor Author

Full Code

import { ethers } from "ethers";
const abi = [
	{
		inputs: [],
		stateMutability: "nonpayable",
		type: "constructor",
	},
	{
		inputs: [],
		name: "AccessControlBadConfirmation",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				internalType: "bytes32",
				name: "neededRole",
				type: "bytes32",
			},
		],
		name: "AccessControlUnauthorizedAccount",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "target",
				type: "address",
			},
		],
		name: "AddressEmptyCode",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "sender",
				type: "address",
			},
			{
				internalType: "uint256",
				name: "balance",
				type: "uint256",
			},
			{
				internalType: "uint256",
				name: "needed",
				type: "uint256",
			},
			{
				internalType: "uint256",
				name: "tokenId",
				type: "uint256",
			},
		],
		name: "ERC1155InsufficientBalance",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "approver",
				type: "address",
			},
		],
		name: "ERC1155InvalidApprover",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "idsLength",
				type: "uint256",
			},
			{
				internalType: "uint256",
				name: "valuesLength",
				type: "uint256",
			},
		],
		name: "ERC1155InvalidArrayLength",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "operator",
				type: "address",
			},
		],
		name: "ERC1155InvalidOperator",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "receiver",
				type: "address",
			},
		],
		name: "ERC1155InvalidReceiver",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "sender",
				type: "address",
			},
		],
		name: "ERC1155InvalidSender",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "operator",
				type: "address",
			},
			{
				internalType: "address",
				name: "owner",
				type: "address",
			},
		],
		name: "ERC1155MissingApprovalForAll",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "implementation",
				type: "address",
			},
		],
		name: "ERC1967InvalidImplementation",
		type: "error",
	},
	{
		inputs: [],
		name: "ERC1967NonPayable",
		type: "error",
	},
	{
		inputs: [],
		name: "EnforcedPause",
		type: "error",
	},
	{
		inputs: [],
		name: "ExpectedPause",
		type: "error",
	},
	{
		inputs: [],
		name: "FailedInnerCall",
		type: "error",
	},
	{
		inputs: [],
		name: "InvalidInitialization",
		type: "error",
	},
	{
		inputs: [],
		name: "NotInitializing",
		type: "error",
	},
	{
		inputs: [],
		name: "ReentrancyGuardReentrantCall",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__SBT",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__calculateFee_protocolFeesInvalidValues",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__mintInBatch_badgeModelsArrayEmpty",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__mintInBatch_invalidParamsLength",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__mint_creatorFeesPaymentFailed",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__mint_protocolFeesPaymentFailed",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_badgeModelIsSuspended",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_badgeModelNotFound",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_badgeNotClaimable",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_badgeNotFound",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_badgeNotMintable",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_controllerIsPaused",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_isDeprecated",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_isPaused",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_isSuspended",
		type: "error",
	},
	{
		inputs: [],
		name: "TheBadge__requestBadge_wrongValue",
		type: "error",
	},
	{
		inputs: [],
		name: "UUPSUnauthorizedCallContext",
		type: "error",
	},
	{
		inputs: [
			{
				internalType: "bytes32",
				name: "slot",
				type: "bytes32",
			},
		],
		name: "UUPSUnsupportedProxiableUUID",
		type: "error",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "operator",
				type: "address",
			},
			{
				indexed: false,
				internalType: "bool",
				name: "approved",
				type: "bool",
			},
		],
		name: "ApprovalForAll",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
			{
				indexed: true,
				internalType: "address",
				name: "origin",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "destination",
				type: "address",
			},
		],
		name: "BadgeClaimed",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "uint256",
				name: "badgeModelID",
				type: "uint256",
			},
			{
				indexed: true,
				internalType: "uint256",
				name: "badgeID",
				type: "uint256",
			},
			{
				indexed: true,
				internalType: "address",
				name: "recipient",
				type: "address",
			},
			{
				indexed: false,
				internalType: "address",
				name: "controller",
				type: "address",
			},
			{
				indexed: false,
				internalType: "uint256",
				name: "controllerBadgeId",
				type: "uint256",
			},
		],
		name: "BadgeRequested",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "address",
				name: "admin",
				type: "address",
			},
		],
		name: "Initialize",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: false,
				internalType: "uint64",
				name: "version",
				type: "uint64",
			},
		],
		name: "Initialized",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: false,
				internalType: "address",
				name: "account",
				type: "address",
			},
		],
		name: "Paused",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "address",
				name: "recipient",
				type: "address",
			},
			{
				indexed: false,
				internalType: "address",
				name: "payer",
				type: "address",
			},
			{
				indexed: false,
				internalType: "uint256",
				name: "amount",
				type: "uint256",
			},
			{
				indexed: true,
				internalType: "enum LibTheBadge.PaymentType",
				name: "paymentType",
				type: "uint8",
			},
			{
				indexed: true,
				internalType: "uint256",
				name: "badgeModelId",
				type: "uint256",
			},
			{
				indexed: false,
				internalType: "string",
				name: "controllerName",
				type: "string",
			},
		],
		name: "PaymentMade",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [],
		name: "ProtocolSettingsUpdated",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
			{
				indexed: true,
				internalType: "bytes32",
				name: "previousAdminRole",
				type: "bytes32",
			},
			{
				indexed: true,
				internalType: "bytes32",
				name: "newAdminRole",
				type: "bytes32",
			},
		],
		name: "RoleAdminChanged",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
			{
				indexed: true,
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "sender",
				type: "address",
			},
		],
		name: "RoleGranted",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
			{
				indexed: true,
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "sender",
				type: "address",
			},
		],
		name: "RoleRevoked",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "address",
				name: "operator",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "from",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "to",
				type: "address",
			},
			{
				indexed: false,
				internalType: "uint256[]",
				name: "ids",
				type: "uint256[]",
			},
			{
				indexed: false,
				internalType: "uint256[]",
				name: "values",
				type: "uint256[]",
			},
		],
		name: "TransferBatch",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "address",
				name: "operator",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "from",
				type: "address",
			},
			{
				indexed: true,
				internalType: "address",
				name: "to",
				type: "address",
			},
			{
				indexed: false,
				internalType: "uint256",
				name: "id",
				type: "uint256",
			},
			{
				indexed: false,
				internalType: "uint256",
				name: "value",
				type: "uint256",
			},
		],
		name: "TransferSingle",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: false,
				internalType: "string",
				name: "value",
				type: "string",
			},
			{
				indexed: true,
				internalType: "uint256",
				name: "id",
				type: "uint256",
			},
		],
		name: "URI",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: false,
				internalType: "address",
				name: "account",
				type: "address",
			},
		],
		name: "Unpaused",
		type: "event",
	},
	{
		anonymous: false,
		inputs: [
			{
				indexed: true,
				internalType: "address",
				name: "implementation",
				type: "address",
			},
		],
		name: "Upgraded",
		type: "event",
	},
	{
		inputs: [],
		name: "CLAIMER_ROLE",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "DEFAULT_ADMIN_ROLE",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "PAUSER_ROLE",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "UPGRADER_ROLE",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "UPGRADE_INTERFACE_VERSION",
		outputs: [
			{
				internalType: "string",
				name: "",
				type: "string",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "URI_SETTER_ROLE",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "USER_MANAGER_ROLE",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "VERIFIER_ROLE",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "_badgeStore",
		outputs: [
			{
				internalType: "contract TheBadgeStore",
				name: "",
				type: "address",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "_badgeUsers",
		outputs: [
			{
				internalType: "contract TheBadgeUsers",
				name: "",
				type: "address",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
		],
		name: "balanceOf",
		outputs: [
			{
				internalType: "uint256",
				name: "",
				type: "uint256",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				internalType: "uint256",
				name: "badgeModelId",
				type: "uint256",
			},
		],
		name: "balanceOfBadgeModel",
		outputs: [
			{
				internalType: "uint256",
				name: "",
				type: "uint256",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address[]",
				name: "accounts",
				type: "address[]",
			},
			{
				internalType: "uint256[]",
				name: "ids",
				type: "uint256[]",
			},
		],
		name: "balanceOfBatch",
		outputs: [
			{
				internalType: "uint256[]",
				name: "",
				type: "uint256[]",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "challenge",
		outputs: [],
		stateMutability: "payable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "claim",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
		],
		name: "getChallengeDepositValue",
		outputs: [
			{
				internalType: "uint256",
				name: "",
				type: "uint256",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
		],
		name: "getRemovalDepositValue",
		outputs: [
			{
				internalType: "uint256",
				name: "",
				type: "uint256",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
		],
		name: "getRoleAdmin",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
		],
		name: "grantRole",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
		],
		name: "hasRole",
		outputs: [
			{
				internalType: "bool",
				name: "",
				type: "bool",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "admin",
				type: "address",
			},
			{
				internalType: "address",
				name: "badgeStore",
				type: "address",
			},
			{
				internalType: "address",
				name: "badgeUsers",
				type: "address",
			},
		],
		name: "initialize",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				internalType: "address",
				name: "operator",
				type: "address",
			},
		],
		name: "isApprovedForAll",
		outputs: [
			{
				internalType: "bool",
				name: "",
				type: "bool",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
		],
		name: "isClaimable",
		outputs: [
			{
				internalType: "bool",
				name: "",
				type: "bool",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
		],
		name: "isExpired",
		outputs: [
			{
				internalType: "bool",
				name: "",
				type: "bool",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeModelId",
				type: "uint256",
			},
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
			{
				internalType: "string",
				name: "tokenURI",
				type: "string",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "mint",
		outputs: [],
		stateMutability: "payable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256[]",
				name: "badgeModelIds",
				type: "uint256[]",
			},
			{
				internalType: "address[]",
				name: "recipients",
				type: "address[]",
			},
			{
				internalType: "string[]",
				name: "tokenURIs",
				type: "string[]",
			},
			{
				internalType: "bytes[]",
				name: "data",
				type: "bytes[]",
			},
		],
		name: "mintInBatch",
		outputs: [],
		stateMutability: "payable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeModelId",
				type: "uint256",
			},
		],
		name: "mintValue",
		outputs: [
			{
				internalType: "uint256",
				name: "",
				type: "uint256",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "name",
		outputs: [
			{
				internalType: "string",
				name: "",
				type: "string",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "pause",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [],
		name: "paused",
		outputs: [
			{
				internalType: "bool",
				name: "",
				type: "bool",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "proxiableUUID",
		outputs: [
			{
				internalType: "bytes32",
				name: "",
				type: "bytes32",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "removeItem",
		outputs: [],
		stateMutability: "payable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
			{
				internalType: "address",
				name: "callerConfirmation",
				type: "address",
			},
		],
		name: "renounceRole",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "bytes32",
				name: "role",
				type: "bytes32",
			},
			{
				internalType: "address",
				name: "account",
				type: "address",
			},
		],
		name: "revokeRole",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "from",
				type: "address",
			},
			{
				internalType: "address",
				name: "to",
				type: "address",
			},
			{
				internalType: "uint256[]",
				name: "ids",
				type: "uint256[]",
			},
			{
				internalType: "uint256[]",
				name: "values",
				type: "uint256[]",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "safeBatchTransferFrom",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "from",
				type: "address",
			},
			{
				internalType: "address",
				name: "to",
				type: "address",
			},
			{
				internalType: "uint256",
				name: "id",
				type: "uint256",
			},
			{
				internalType: "uint256",
				name: "value",
				type: "uint256",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "safeTransferFrom",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "operator",
				type: "address",
			},
			{
				internalType: "bool",
				name: "approved",
				type: "bool",
			},
		],
		name: "setApprovalForAll",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "submitEvidence",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "bytes4",
				name: "interfaceId",
				type: "bytes4",
			},
		],
		name: "supportsInterface",
		outputs: [
			{
				internalType: "bool",
				name: "",
				type: "bool",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "symbol",
		outputs: [
			{
				internalType: "string",
				name: "",
				type: "string",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		inputs: [],
		name: "unpause",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "_claimProtocolFee",
				type: "uint256",
			},
		],
		name: "updateClaimBadgeProtocolFee",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "_createBadgeModelValue",
				type: "uint256",
			},
		],
		name: "updateCreateBadgeModelProtocolFee",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "_mintBadgeDefaultFee",
				type: "uint256",
			},
		],
		name: "updateMintBadgeDefaultProtocolFee",
		outputs: [],
		stateMutability: "nonpayable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "address",
				name: "newImplementation",
				type: "address",
			},
			{
				internalType: "bytes",
				name: "data",
				type: "bytes",
			},
		],
		name: "upgradeToAndCall",
		outputs: [],
		stateMutability: "payable",
		type: "function",
	},
	{
		inputs: [
			{
				internalType: "uint256",
				name: "badgeId",
				type: "uint256",
			},
		],
		name: "uri",
		outputs: [
			{
				internalType: "string",
				name: "",
				type: "string",
			},
		],
		stateMutability: "view",
		type: "function",
	},
	{
		stateMutability: "payable",
		type: "receive",
	},
];

const contractAddress = "0xE6c5c3174439DA7D2D60456Ca7eB97E7Dcd551e6";

const provider = new ethers.providers.JsonRpcProvider(
	"<POLYGON_RPC>"
);

const contract = new ethers.Contract(contractAddress, abi, provider);

async function getBadgeStore() {
	const result = await contract._badgeStore();
	console.log(result);
}

getBadgeStore();

@azf20
Copy link
Contributor

azf20 commented Dec 4, 2023

I can confirm that calling the function at the block returns a result as expected.

curl --location '<POLYGON-RPC>' \
--header 'Content-Type: application/json' \
--data '{
	"jsonrpc":"2.0",
	"method":"eth_call",
	"params":[{
		"to": "0xe6c5c3174439da7d2d60456ca7eb97e7dcd551e6",
		"data": "0x19b50c2a"
	}, {
        "blockHash": "0xa7cb86b9c8d68130f7003a1be9150ad25f7a113a866278d32d93ea47ab0f1910"
    }],
	"id":1
}'

@incrypto32 any idea what might be happening here which would prevent this call from returning as expected in the subgraph? Maybe something to do with the underscores?

@incrypto32
Copy link
Contributor

@azf20 i'll investigate.

@Agupane
Copy link

Agupane commented Dec 5, 2023

Hi guys, we managed to fix the deployment issue, we don't know the cause but seems to be related to the graph-cli version, we updated it to version 0.62.0 and the deployment went through. The issue was only on polygon, other chains didn't had the issue. Thanks @itsjerryokolo for reporting it

@incrypto32
Copy link
Contributor

Closing this issue as it was related to the RPC provider and not graph-node itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants