New answers tagged

3

In Ethereum, to execute operation in EVM costs you gas. One can change any state in the blockchain which is done through making transaction. In this case, you will be charged ether. To make transaction, we have some apis like SendTransaction inside internal/ethapi/api.go When you do send transaction, you can set gas limit and gas price. Your balance is ...


0

In solidity, if a function reads state but does not modify any state, this needs to be declared as view function. If a function does not read any state and also does not modify any state, this can be declared as pure function. If a function modifies state in the blockchain, to invoke the method you need to make a transaction in the blockchain and ...


0

The contract looks fine and I confirmed with a little superficial fiddling in Remix using the JavaScript VM. A common stumbling block when transitioning to "real" chains is the need to wait for transactions to confirm. If you are setting and checking without someone first mining a block that contains the set transaction, then you will read the old value (...


0

I am not sure if this will solve it completely, but your typecasting for totalSupply is being done incorrectly. You should be casting decimals to uint256, not 10. It should be: uint256 public totalSupply = 1000000 * (10 ** uint256(decimals));


0

I didn't see where web3.eth.getAccounts() is used in your code, but this is javascript promise and you might wanna use it this way to get the accounts: web3.eth.getAccounts(function(error, accounts) { if(error) { console.log(error); } else { console.log(accounts); } });


1

I found the answer at etherscan. It is currently ~173GB.


0

Filters only work if the parameter is indexed. For example, the ERC20.Tranfer event is defined as Transfer(address indexed from, address indexed to, uint tokens), so only from and to can be used in filters. Edit: I just noticed, you're submitting the filter as a separate object. The correct format is this: instance.getPastEvents( "Transfer", { ...


5

This web3 version is a few years old you should probably use a new one. Make sure to update!


1

By default all full nodes contain every single contract and transaction on the Ethereum network. I don't know how you would filter only contracts though and there would also be far to many contracts to check them all. Mabye you could make a system where a user would post about a smart contract instead of reviewing one.


3

You can do this by querying the blockchain directly instead of using your web scraper. For this, you would need to run a node and check each block's transactions to see if the associated addresses are contracts.


2

I always use myContract.func.call(). Actuall I have never heard that myContract.func(). After all this is the recommended way of doing it!! Furthermore, the performance is better (I think). Maybe that's your perception? Read the official web3 documentation. I read every page of it. Here is the link to the correct article. I don't use truffle and it works ...


1

There are two types of transaction in Ethereum, one is simple balance transfer and the other one is making any modification in the contract(either it could be contract deployment/contract's method invocation). The 'data' field in the raw transaction json structure of Ethereum contains the code to execute a transaction in the EVM. In case of contract ...


0

No. In order to make any changes to data on the blockchain (ie, the owner of your tokens), you will need to make a transaction, and therefore pay transaction fees. Transaction fees have to be paid in Ether.


1

the value is replaced with available gas right? As a bit of a simplification, yes. IIRC, I believe the amount of gas forwarded to the callee is actually 63/64ths of the remaining gas in the transaction.


Top 50 recent answers are included