K. Fichter
  • Member for 4 years, 2 months
  • Last seen this week
Getting ABI data for ERC20 tokens programatically with Web3
8 votes

If you're interacting with a standard ERC20 token, all of the contracts will share the same base ABI. This ABI is available online but can also be retrieved by implementing your own standard ERC20 ...

View answer
What is the unit for measuring difficulty
Accepted answer
3 votes

TL;DR: hash/solution Difficulty units are basically "hash/solution" (sort of). It's a measure of how much work is required to find a hash with some # of leading 0s. Your calculations are correct, ...

View answer
How to read the current program counter (PC) in Solidity or Yul?
Accepted answer
2 votes

The ability to use the PC opcode directly in Solidity was removed in Solidity 0.7. However, you may be able to use PC again in the future via the verbatim assembly builtin. Currently, you can only use ...

View answer
Mathematical Limit of a Call
2 votes

The answer to this question is actually much more interesting than it seems :-). If you're doing this call on-chain then you're limited by the block gas limit minus the amount of gas that you need to ...

View answer
Storing immutable state in contract data
2 votes

This is a wonderful question! The problem you're running into is that in Ethereum the code that you provide to CREATE is executed. We call this code "init code" and it's expected to return ...

View answer
Where does Ether come from on a private network
2 votes

Blocks don't necessarily have to have transactions in them. You can actually have a completely valid block that doesn't mine a single transaction. This is relatively unusual, but it does happen. ...

View answer
Combine multiple event filters in EthersJS
1 votes

It's not well documented but you can indeed do this: const filter1 = contract.filters.MyEvent() const filter2 = contract.filters.MyOtherEvent() const events = await contract.queryFilter({ address: ...

View answer
Physical location of Ethereum World State Trie
1 votes

Every full node in the Ethereum network holds a copy of the Ethereum state. So to answer your question literally, it's physically located in the storage (SSD or NVMe commonly) of any full node in the ...

View answer
How to detect errors from contract calls
1 votes

If you want to break the loop when you detect an error then you should use async and await. For example: const main = async () => { // ... the rest of your code before this for (let i = 0; i &...

View answer
Value of converting million Ethereum from an ICO
1 votes

This boils down to an economics problem. Namely: how do we introduce new marketed supply without (significantly) decreasing price? Microeconomics in a nutshell states that as quantity supplied ...

View answer
Does the Ethereum source code only get updated during hard forks? What about clients?
Accepted answer
1 votes

All truly decentralized projects are considered "decentralized" because no individual (or small group of individuals) has absolute control over the protocol. The Ethereum foundation could be ...

View answer
When to specify uint size?
Accepted answer
1 votes

Your intuition on the struct is correct. It's efficient to write multiple uint<256 into a struct because of struct tight packing. According to the solidity docs, Structs and array data always ...

View answer
getting the IP address of the miner who mined a block?
1 votes

Although the IP addresses of nodes are exposed publicly, there is no built-in way to determine the IP address of a block miner. However, block data does reveal the Ethereum address of a miner. It ...

View answer
Get data using mapping from struct
Accepted answer
0 votes

Going through your user IDs one by one like that will eventually get prohibitively slow. You should almost certainly be keying your mapping on UserID if you expect there to be a 1:1 relationship ...

View answer
what is the percent of smart contract usage?
Accepted answer
0 votes

It turns out you can also get this information straight from etherscan! Here's a quick summary (as of the writing of this post): Total transactions (internal+external): 77274392 Internal ...

View answer