Most Popular

1500 questions
23
votes
1 answer

What is truffle?

What is the truffle framework? Who can use it, who should use it? And what are the benefits?
q9f
  • 32,913
  • 47
  • 156
  • 395
22
votes
7 answers

Computing the Uniswap V3 pair price from Q64.96 number

I am trying to compute a Uniswap V3 pool token price in Solidity. I can get the square root price of Q64.96 number as uint160 (e.g., 1234217676608908277512433764 - value of DAI/ETH pool (price at that time around 1 ETH for 4090 DAI)). This can be…
pipip
  • 321
  • 1
  • 2
  • 5
22
votes
9 answers

Trying to use window.ethereum.request in Typescript errors out with Property 'request' does not exist on type 'EthereumProvider'

Except for one unanswered question from last November, I cannot find anything . . . . I am revamping some typescript code (in Visual Studio) for the Metamask January change. Previously, I was using web3. Now I am just trying to use…
Mark Waser
  • 381
  • 1
  • 2
  • 7
22
votes
5 answers

Is the SafeMath library obsolete in solidity 0.8.0?

SafeMath was commonly used to revert the transaction on overflow and underflow, instead of allowing the number to wrap around. The solidity 0.8.0 release notes state: Code Generator: All arithmetic is checked by default. These checks can be…
Jesbus
  • 10,478
  • 6
  • 35
  • 62
22
votes
1 answer

Is it possible to perform a try-catch in Solidity?

Does Solidity support try-catch functionality? If so, how does it work? What are the limitations?
Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82
22
votes
2 answers

In solidity, how can you set a bytes variable to empty

I tried this contract MyContract{ bytes public data = 0x3333; function clearData(){ data = 0x; } } But solc doesn't like me trying to set data to 0x
Akhil F
  • 1,928
  • 3
  • 19
  • 29
22
votes
3 answers

TheDAO hack FAQ: How did the attack happen on 17 June 2016?

Can anyone explain that how the DAO attack happened? Vitalik Buterin explained here that it was performed by splitting a DAO from the main DAO but calling the split function recursively. We know that recursive function is a kind of function that…
Kobayashi
  • 1,255
  • 1
  • 9
  • 14
22
votes
2 answers

View/Pure Gas usage - Cost gas if called internally by another function?

I know similar questions have been asked before however I could not find an good explanation for the following, In one of the tutorial it says: Pure and View functions don't cost any gas to call if they're called externally from outside the…
Mustafa Caglar
  • 223
  • 1
  • 2
  • 5
22
votes
1 answer

This image claims you can build "decentralized apps", and each computer "contributes a little to process it". Is that claim correct?

This image claims that you can put decentralized apps (say, a messaging program) on the Ethereum network. It also claims that each computer on the network contributes a little bit to the processing of that app. That claim does not seem correct.…
MaiaVictor
  • 3,177
  • 2
  • 17
  • 37
22
votes
5 answers

Prevent 'truffle test' from invoking 'truffle deploy (migrate)'

It seems that truffle test automatically invokes truffle deploy (aka truffle migrate). As far as I'm concerned, these two functionalities are completely unrelated. So I cannot quite figure out why Truffle works this way to begin with. The docs do…
goodvibration
  • 26,003
  • 5
  • 46
  • 86
22
votes
4 answers

How get Constructor Arguments ABI-encoded?

Im trying to verify an ETH contract, but I complete the etherscan form to and i receive this message: "Error! Unable to verify source code Missing Constructor Arguments for function JL(uint256 initialSupply, string tokenName, string tokenSymbol)" My…
PoetaKarate
  • 221
  • 1
  • 2
  • 3
22
votes
1 answer

What were the key assumptions and analyses that went into setting Ethereum's gas price?

Frontier was launched with a default gas price of 0.05e12 wei. In Homestead, the default was reduced to 0.02e12 wei. If this gas price is too low and operations on Ethereum are too cheap, for example, if a single ether can run all the dApps and…
eth
  • 85,679
  • 53
  • 285
  • 406
22
votes
3 answers

How to list transactions from account address?

I have a small service where people can exchange cryptocurrencies. Every user has its own Bitcoin, Litecoin, etc address for balance deposit. Now I want to add Ethereum. So I thought I will create account for every user and then check for incoming…
dmxhZGp1c2hh
  • 329
  • 1
  • 2
  • 3
22
votes
9 answers

How to Fix "Stack Too Deep" Error?

I know that this has been covered in other questions here but I'm not sure what's happening in my case. My code is returning a compiler error "Stack too deep, try removing local variables." But I only have around five function arguments and a few…
Jeffrey Liang
  • 271
  • 1
  • 2
  • 4
22
votes
6 answers

Decode input data on transaction

I have an ABI and the input value of the transaction and want to know what function has been called on a contract and with what arguments (one or multiple of different types), preferably using geth, JSON-RPC and some pseudo code that I can then…
migu
  • 941
  • 2
  • 10
  • 18