Skip to main content
16 votes
Accepted

Solidity error when encoding arguments to query public mapping

The address needs be surrounded with quotes. "0xca35b7d915458ef540ade6068dfe2f44e8fa733c" should work.
afu802's user avatar
  • 376
14 votes
Accepted

How to get metadata from ERC721

The other answer is incorrect. See the ERC721 Standard for exactly how to do this. If a token contract properly implements the ERC721 Standard and the ERC721Metadata extension, it will always ...
AnAllergyToAnalogy's user avatar
7 votes
Accepted

API to enumerate the blocks from a specific day

There is no Web API, but you can perform this using SQL. You can do it simply with "Presto Ethereum Connector" (https://github.com/xiaoyao1991/presto-ethereum) Using Presto Ethereum, you can query ...
Muhammad Altabba's user avatar
4 votes

Index and query blockchain data and levelDB

Geth does three operations on the database that you should consider when trying to find alternatives. Geth loads the entire database in levelDB (what I believe you want to do). Geth then deciphers ...
Fortune's user avatar
  • 532
4 votes

Fetching InternalType data from another contract

The "internalType" is the representation used by solidity. For example the contract contract B { struct View { uint x; } function foo(View memory bad) public view { ...
Ismael's user avatar
  • 30.3k
3 votes
Accepted

How to gather historical events emitted by any contract

Did you try using eth_getLogs. This is also exposed via the Ethers provider: https://docs.ethers.io/v5/api/providers/provider/#Provider-getLogs. The syntax for the parameter is the same as for ...
Richard's user avatar
  • 5,144
3 votes

How to get metadata from ERC721

To view ERC721 token content use: https://etherscan.io/ For example get a token address from OpenSea, input into the etherscan.io query and search. Select 'Tracker' --> 'Inventory' --> token id --> '...
Dan's user avatar
  • 31
2 votes

Index and query blockchain data and levelDB

There are inherent limitations of this approach: You can't get the world state from the underlying database since all keys are hashed there. It includes: accounts and their balances contract storage ...
medvedev1088's user avatar
2 votes

Solidity error when encoding arguments to query public mapping

The address has to be provided with quotes. Just like huafu said. Must be double qutoes "". It is not going to work with single qutoes. In Javascript it doesn't matter and I was trying to figure out ...
Rob Magier's user avatar
1 vote
Accepted

Is there a way to test whether an external contract implements (or does not implement) a given interface method?

One way is to use try-catch error handling. Here's a minimal code for the same: // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; interface IRandomMethod { function getUint() external view ...
SYED ASAD KAZMI's user avatar
1 vote
Accepted

Querying events using ethersjs provides logs with unrelated contract addresses

The issue seems to stem from the differences between how getLogs() behaves in ethers v5 and ethers v6. This change in behavior isn't well-documented, leading to confusion. For more precise and ...
0xpri's user avatar
  • 26
1 vote
Accepted

Can you fetch the whole transaction history of specific contracts somewhere?

If you like to fetch specific contracts (or to an extent general account) address history, then you can use service such as Moralis. They have Transaction API that can help you index transaction data ...
Yoseph Kurnia Soenggoro's user avatar
1 vote

Can you fetch the whole transaction history of specific contracts somewhere?

Yes, there are several services that allow you to query all transactions related to a specific smart contract. Etherscan, for example, provides a "View Contract" feature that allows you to ...
vgonearth's user avatar
  • 137
1 vote

Searching for Ethereum addresses that match a partial address?

It is generally not possible to search for partial addresses or transaction hashes using publicly available blockchain explorers like Etherscan. Most blockchain explorers only allow users to search ...
VX3's user avatar
  • 686
1 vote

How can I query the onchain data on the ethereum blockchain without using any APIs?

If you need live onchain data, you have 3 options. Using an API or providers like Alchemy etc. If the users connects his wallet you can use the users provider in his wallet (metamask for ex.) You can ...
Yetik's user avatar
  • 339
1 vote

Is there a multi-call equivalent for calls that aren't made to a smart contract?

You can use ethers.providers.JsonRpcBatchProvider, its JS API is equivalent to the JsonRpcProvider. It simply batches the requests, so that multiple requests are sent together in a single network ...
Soham Zemse's user avatar
  • 2,136
1 vote

How to query my Polygon NFTs created on Opensea?

To find items on Polygon, make sure to check "Polygon" under the "Chains" section on the left panel. If you want to access through opensea-js API, unfortunately it is not supported ...
btwiuse's user avatar
  • 176
1 vote
Accepted

How to query contract input (address) using Etherscan's API?

You cannot query the method of the smart contract actually. you should query the events/logs of the smart contracts If you are trying to query the canMint() function executions. you need to query the ...
MYANZIK shrestha's user avatar
1 vote
Accepted

Mappings inside functions to filter query

You cannot assign mappings inside a function even if the compiler seems to let you. That will lead to corrupted storage. The storage layout of persistent variables must be global. Temporary mappings ...
Rob Hitchens's user avatar
  • 55.6k
1 vote
Accepted

Error: Couldn't decode bytes32 from ABI: 0x The size doesn't match

The answer here is, that the contract was deployed, but empty! Section 7.1 of the yellow paper it states that "while the initialisation code is executing, the newly created address exists but with no ...
sunwarr10r's user avatar
1 vote

Querying the blockchain: Search transaction by data

The answer is no. The standard ethereum clients (geth and parity) maintain only a limited set of indexes for querying the blockchain. For example, you can look up a transaction by its hash (using ...
wiherek's user avatar
  • 111
1 vote

ETH blockchain reading scalability

As you said, view and pure "reading" functions are free. The reason for this is that they are only executed in your own node and not broadcasted to the blockchain to other nodes. Nobody else really ...
Lauri Peltonen's user avatar
1 vote

Solidity error when encoding arguments to query public mapping

contract MyToken mapping (address => uint256) public balances; function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } ... } ...
BokkyPooBah's user avatar
  • 40.4k

Only top scored, non community-wiki answers of a minimum length are eligible