Daniel Luca CleanUnicorn
  • Member for 4 years, 11 months
  • Last seen this week
Solidity: How can we write a error message in "require"?
33 votes

It is included since Solidity 0.4.22. There is a merged branch adding this feature in the milestone. The documentation states There are two other ways to trigger exceptions: The revert function ...

View answer
Geth --rpcaddr doubt
Accepted answer
11 votes

--rpcaddr 127.0.0.1 starts the JSON RCP on the localhost network and only connections from your local machine reach the geth server --rpcaddr 0.0.0.0 starts the JSON RPC on all interfaces and any ...

View answer
How to get pending transactions with using geth or other client?
Accepted answer
9 votes

To get the pending transactions you need a node that you're running on your own because this type of action requires a lot of resources. You can run your own Geth node and wait until it is ...

View answer
Get the abi of contract
Accepted answer
6 votes

Save your source code in a file and use the solidity compiler to generate the ABI. You can install it with npm install -g solc or yarn global add solc and then run it against your source code ...

View answer
How long does Infura store a file on IPFS?
Accepted answer
5 votes

Got a reply from an Infura member. At the moment if you pin objects on their nodes they won't be removed. Unpinned objects are garbage collected when the data store needs to reclaim space. File size ...

View answer
why ERC20 standard doesn't have any method to remove the spender allowance?
5 votes

The ERC20 standard does not enforce any implementation. If you really want to implement a token when calling approve() with 0 value you can delete the spender. From a utility point of view, both ...

View answer
web3 Websocket connection to infura
4 votes

This is working #!/usr/bin/env node const Web3 = require('web3'); const web3 = new Web3(new Web3.providers.WebsocketProvider('wss://mainnet.infura.io/ws')); const subscription = web3.eth.subscribe('...

View answer
why does web3 have 2 different account creation method
Accepted answer
4 votes

web3.personal.newAccount() calls personal_newAccount on your node Taken from geth doc Generates a new private key and stores it in the key store directory. The key file is encrypted with the given ...

View answer
Where to place static-nodes.json for geth
3 votes

Where do we place static-nodes.json? Additionally, where do we place trusted-nodes.json? If you specify --datadir=./ when running your node, the files: static-nodes.json and trusted-nodes.json should ...

View answer
How to print value inside solidity function?
Accepted answer
3 votes

You can emit events. pragma solidity ^0.4.21; contract ShapeCalculator{ function rectangle(uint256 w, uint256 h) public returns (uint256 s, uint256 p) { //print value of w and h ...

View answer
Ethereum address URL
Accepted answer
3 votes

There is an EIP67 that proposes Sending ETH ethereum:<address>[?from=<sender_address>][?value=<ethamount>][?gas=<suggestedGas>] Sending ERC20 tokens ethereum:<address>...

View answer
Search blockchain without having own node running?
3 votes

Infura is like having a friend running a node for you https://infura.io/

View answer
reliable way to get gas price
Accepted answer
3 votes

A pretty good source is https://ethgasstation.info and they also provide an API in the form of https://ethgasstation.info/json/ethgasAPI.json Make sure to read their rules for computing the gas ...

View answer
Creating new address with web3
3 votes

You can use web3.eth.accounts.create() to generate something like this { address: "0xb8CE9ab6943e0eCED004cDe8e3bBed6568B2Fa01", privateKey: "...

View answer
What are locking and unlocking tokens?
Accepted answer
3 votes

Locking up tokens is a mechanism that does not allow some token owners (usually the founders and core team) to transact, move the tokens, or in other words sell the tokens for a specific period of ...

View answer
How to extract token transfer data from Transaction? (Web3j)
Accepted answer
3 votes

If you just want to check if the mint() function was called this is the part that you are interested in "input": "...

View answer
How can my Ethereum node accept remote connections?
Accepted answer
2 votes

First, you should make sure you are using a fairly new geth version. I tested on my recently downloaded version from the official download site My local version is $ ./geth version Geth Version: 1.9....

View answer
Get array values in Truffle console
Accepted answer
2 votes

I see you want a method to get each added number and that can be done just by specifying the variable as public, a getter is automatically created. But you also need to know how many items are in ...

View answer
how to know smart contract gas price and gas limit when deploying the contract using web3j
2 votes

Gas price needs to be defined by you not too low to be picked up by the miners. It's basically a bidding war between you and the other people who want their transactions (including contract calls and ...

View answer
Minimum theoretical hardware requirement for geth
2 votes

If you don't need to mine on the main network and you run your own private chain you can run the geth node on a Raspberry 2.

View answer
Ethereum-PHP Calling contract function with parameter
Accepted answer
2 votes

Checking the unit tests I found public function testSimpleContract() { $number = 2; $result = $this->contract->multiplyWithSeven( new EthQ($number, ['abi'=> 'uint256']) );...

View answer
Does a PoA network use gas?
Accepted answer
2 votes

Proof of Authority networks still use gas to power Contract calls and Transactions.

View answer
Truffle Framework "Block-scoped declarations not yet supported outside strict mode"
Accepted answer
2 votes

apt install npm never worked properly for me. Remove it and install as described here https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions npm uninstall -g ...

View answer
Tracing old transactions with Geth
Accepted answer
2 votes

In order to have available all of the information you need to sync your node with --syncmode full

View answer
What happens to an already existing token after I re-deploy a fork?
2 votes

If people redeploy your contract exactly as it is they will not also recreate the state of the contract. Meaning how many tokens each owner has, where they were transferred and so on. The name and ...

View answer
Rookie: How do I list accounts I've created
Accepted answer
2 votes

Attach to your running geth process either by running in your current directory (where geth.ipc exists) geth attach ./geth.ipc Or running on the same machine geth attach http://localhost:8545 And ...

View answer
Ethereum private network
Accepted answer
2 votes

Private networks are universes of their own. At protocol level your private network does not know about the existence of Ethereum (where real ETH exists). Your private network ETH only exists in ...

View answer
Given no performance penalty for maximum tokens creation. Why most tokens are not created max?
2 votes

It is a choice decided by the business design of the token. Comparing this to Bitcoin, people usually want to own a large number of Bitcoins, not a large fraction of it. When people who don't ...

View answer
Where can i find record for transactions/transfer made using smart contracts?
2 votes

Events and receipts are not saved part of the contract. However they are saved part of the blockchain. Once they are generated they become part of the blockchain forever. If you don't specifically ...

View answer
Accepting BTC for ERC20 ICO
2 votes

There are multiple ways of doing this. Trust method People will send BTC to your account and they will need to trust to that you will take each sender and give them their ERC20 tokens. This is ...

View answer