texts: How to safeguard a different token stored in an ERC20 contract from unwanted withdrawal?

texts: If I want to store say a popular ERC20 (e.g. BNB) in my new ERC20 contract, how do I prevent someone from making unauthorized withdrawal of these BNBs from my contract account ? Is it possible that a person can obtain the address of my contract, invoke an instance of BNB ERC20 contract and initiate a transfer of these BNBs to their account ?


texts: Uncle blocks and their Relationship to Chain Size

texts:
How much do uncle blocks affect the overall chain size? Is the amount of added security they provide for the chain comparable to how much extra data they add to the chain?

If, for some reason, all uncle blocks were wiped from the Ethereum chain, how much smaller would an archive node's data be?

EDIT: Is there a way to estimate the size of a block based on the transactions in it? As in, can I go on etherscan and look at a block and estimate the size of it?


texts: How to use MyEtherWallet API to generate ETH Wallet Address upon signup in Laravel

texts: We have a Laravel project that is currently developed now. However, we would want to create an Ethereum Wallet Address upon signup but we don't know what to do with it. We have downloaded a GitHub repo for MyEtherWallet but we don't know how to use it with Laravel. Is there's someone who can help us out? Thank you very much.


texts: "SyntaxError: Unexpected token import" on truffle test

texts: I get an "SyntaxError: Unexpected token import" error when I do 'truffle test'. I am trying to import a function declared in another file into the java-script test file. I have been searching about this issue for quite sometime and couldn't find any solution. Is this an issue with mocha testing on truffle ?


texts: What criteria does a valid Ethereum address need to fulfill? Is it just a random number in hexadecimal? Or does it need to be derived in a specific way, according to some cryptographic algorithms? What algorithms and standards are used to generate the key-pair?


texts: How to find how many nodes are connecting to Geth?

texts: I've lunched a Geth server with default maxpeers which is 100 regarding to original documents. Now, I need to know how many nodes are connecting to my node? Is there any command to find it in Geth console?


texts: What is the cause of the error: Expected import directive or contract definition

texts:
I'm working on the tutorial at https://www.ethereum.org/dao and I'm getting the following error:

1:5: Error- Expected import directive or contract definition.
    function owned() {
    ^

When I get to "The Code" section I get:

"Could not compile source code."

Not sure how to resolve this issue. Has anyone else had this problem, and if so how did you resolve it?


texts: Changing the format of numeric output in Truffle Console

texts:
When I return a Big Number in the Truffle Console, the format of my results is something like:

truffle(development)> tokenInstance.balanceOf(accounts[2])
<BN: 64>

However, in one of the video tutorials that I'm using, the output that the video shows is something like:

truffle(development)> tokenInstance.balanceOf(accounts[2])
BigNumber { s: 1, e: 2, c: [ 100 ] }

Are there any config options in truffle so that my output can look like the latter?  (And I'm not worried about converting my results to base 10: I know that I can do that with a callback and toNumber().)


texts: I made lots of trades on Etherdelta - one came in but cant find it

texts: I made a number of trades on etherdelta - all lowball bids.  One came in but I cant remember which tokens I bid on - was about 20 but have no idea.  Is there an easy way to see all past trades?  I dont want to have to click on every coin and wait..... Went through about 40 so far no luck.


texts:
I am trying to find the actual size of the etherum blockchain.

I just found older posts that says it is around 21GB.

What are the Ethereum disk space needs?


texts: Why are blocks imported so slowly? - Geth node

texts:
I'm running a geth node on AWS and it's fully synced, but looking at the logs and the blocks mined I see that it takes a lot of time to import a new block.

For example:

Geth log

INFO [01-14|18:15:34.365] Imported new chain segment               blocks=1    txs=188  mgas=9.978   elapsed=2.180s    mgasps=4.576   number=9280706 hash=c7050a…29c316 dirty=662.81MiB

Block information

Block Number: 9280706
Timestamp: Jan-14-2020 06:14:57 PM +UTC

It took more than 30 seconds to import this block. It happens with almost all blocks.

Is it a problem with the network or size of the server? I'm using a AWS server (500GB SSD, 8GB RAM, dual core).
CPU usage never went over 85%

Is this normal?

Also, does anyone know where I can find what each term of the log means?

Many thanks in advance!


texts: Using ganache-cli provider causes "Error: Provider not set or invalid"

texts:
I'm trying to write and run tests for my smart contract and I get this error: "Error: Provider not set or invalid"

Smart contract code:

const assert = require('assert');
const ganache = require('ganache-cli');
const Web3 = require('web3');
const provider = ganache.provider();
const web3 = new Web3(provider);

const { interface, bytecode } = require('../compile');

let lottery;
let accounts;

beforeEach(async () => {
  accounts = await web3.eth.getAccounts();

  const contractJson = JSON.parse(interface);

  lottery = await new web3.eth.Contract(contractJson)
    .deploy({data: bytecode})
    .send({ from : accounts[0], gas: '1000000' })
});

describe('Lottery Contract', () => {
  it('deploys a contract', () => {
    assert.ok(lottery.options.address);
  });

  it('allows one account to enter', async () => {
    await lottery.methods.enter().send({
      from: accounts[0],
      value: web3.utils.toWei('0.02', 'ether')
    });

    const players = await lottery.methods.getPlayers().call({
      from: accounts[0]
    });

    assert.equal(accounts[0], players[0]);
    assert.equal(1, players.length);
  });
});

It fails exactly after this code:

await lottery.methods.enter().send({
          from: accounts[0],
          value: web3.utils.toWei('0.02', 'ether')
        });

Any ideas?


texts: Using Web3.js, balance is shown 0 while https://test.ether.camp/ shows different balance

texts:
I am running an ethereum node remotely using a start-up shell script. The command in the shell-script is as follows:

/usr/bin/geth --testnet --rpc --rpcport "5678" --rpcaddr "0.0.0.0" --rpccorsdomain "*" || logger "Geth not running"

Now my NodeJS app in local computer has the following code:

var express = require('express');
var router = express.Router();
var Web3 = require('web3');

if (typeof web3 !== 'undefined') {
  web3 = new Web3(web3.currentProvider);
} else {
    var web3 = new Web3(new Web3.providers.HttpProvider("http://<IP>:<PORT>"));
}

var test_address = "ad9ffbd06d27d919b2f8d08c9abb5a4a90410eb1";

router.get('/', function(req, res) {
  res.render('index', { title: 'Balance' });
});

router.get('/check', function(req, res) {

  /*var coinbase = web3.eth.coinbase;
  var balance = web3.eth.getBalance(coinbase);*/

  //var balance  = /*web3.fromWei(web3.getBalance(web3.coinbase));*/ web3.eth.checkAllBalances();

  /*var coinbase = web3.eth.coinbase;*/
  //var balance = web3.eth.getBalance(test_address);

  /*web3.eth.getCoinbase(function(error, result){

    if(error)
        res.send("Error: "+error);
    else
        res.send("Result: "+result);

  });*/

  var block = web3.eth.getBalance(test_address);
  console.log(block)

});

module.exports = router;

Issue 1: Whenever I try to use the coinbase method (it is commented in above code) to get balance, it just says:
Error: etherbase address must be explicitly specified
I have already create an account using:

geth account new

As far as I understand, the default coinbase / etherbase will always be the first account created, so I can't really understand why am I getting this error.

Issue 2:

After creating the account, I made transfer of 10000 Ether to the new account from test.ether.camp website. Whenever I check the balance of the new account from ether camp website, it shows 10000 Ether balance while the above code returns 0. Could it be that the block having the transaction information (the one I made from ether camp to my account) has not been downloaded in my node ? Or is there something wrong I am doing here?

Thanks in advance,


texts: Solidity, how can I import struct mapping in contract A from contract B?

texts:
contract B {
  struct Player {
    uint id;
  }
  mapping (uint=> Player) Players;
}

contract A {
  constructor() public {
    B.Player storage p = B.Players[1];
  }
}

Report err at B.Players[1]:Member "Players" not found or not visible after argument-dependent lookup in type(contract B).

So, how can I use mapping Players in A from B?


texts:
I am using IPFS to store media files with the address on the blockchain. I have had a lot of issues with ports and access. In the code below I have some code partly running but I get an access issue. I think this is related to the API as the IP is set to 0.0.0.0.

Error -

POST http://162.243.237.41:5001/api/v0/add?stream-channels=true 403   (Forbidden)
ClientRequest._onFinish @ request.js:130
(anonymous) @ request.js:62
EventEmitter.emit @ events.js:96
finishMaybe @ _stream_writable.js:504
endWritable @ _stream_writable.js:514
Writable.end @ _stream_writable.js:484
ClientRequest.end @ request.js:273
onend @ _stream_readable.js:499
g @ events.js:165
EventEmitter.emit @ events.js:78
endReadableNT @ _stream_readable.js:920
afterTickTwo @ index.js:27
Item.run @ browser.js:153
drainQueue @ browser.js:123
jenbil.com/:1 Fetch API cannot load http://162.243.237.41:5001/api/v0/add?stream-channels=true. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://jenbil.com:3000' is therefore not allowed access. The response had HTTP status code 403. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Code (ReactJS) in class App extends Component { -

 this.IpfsAPI = IpfsAPI('162.243.237.41', '5001')

Code in render -

var zstr = 'hello world from Zillerium2'
   this.IpfsAPI.add(new Buffer(zstr), function (err, res){
          console.log("hello");
          if(err || !res) return console.error("ipfs add error", err, res);
          else{
            console.log("no issue");
            console.log(res);
            res.forEach(function(text) {
                   console.log('successfully stored', text.hash);
                 //  console.log('successfully stored', text.path);
                 //  display(file.Hash);
                    var textaddress=text.hash;
                    console.log(textaddress);
            });
          }
        });

I have the IPFS deamon as follows -

root@ubuntu-2gb-nyc2-01:/home/zipfs# ipfs daemon
Initializing daemon...
Adjusting current ulimit to 2048...
Successfully raised file descriptor limit to 2048.
Swarm listening on /ip4/10.13.0.5/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/162.243.237.41/tcp/4001
Swarm listening on /ip4/162.243.237.41/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/0.0.0.0/tcp/5001
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8180
Daemon is ready

Is the API call assigned to this.IpsfAPI wrong? The IP address looks ok.


texts: Where can I read about the technical implementation of the Transaction / Memory Pool?

texts:
I have not been able to find specific details about how the Transaction / Memory Pool was implemented in any of the Ethereum White / Yellow papers.

I am wondering if there is somewhere I can read about the specific implementation details of this mechanic.


texts: (Solidity Browser) VM Exception: invalid opcode

texts:
I access the solidity browser from the following URL.

https://ethereum.github.io/browser-solidity/

There are one basic sample code and one "Ballot" sample code when the page is opened by default. I have compiled the original code (no change on default code) by pressing "Compile" button in "Settings" page.

And I press the "Create" button in "Contract" page. However, only "VM Exception: invalid opcode" is shown even I tried in Google Chrome and IE.

Would anyone advise in this issue?


texts: How many Ethereum contracts have been published?

texts:
Is there a place to see how many Ethereum contracts have been published?

If someone wanted to calculate that, it would just be total number of accounts minus accounts with code, right? Any suggestions on an easy way to calculate this? It seems like a meaningful metric for Ethereum.


texts: Encrypted data and digital signatures in the blockchain?

texts: Let's say that Alice publishes some data on the blokchain encrypted with Bob's public key. Bob then decrypts the data. Later Bob wants to prove that he is the owner of that data, that is he wants to prove he is the only one who could decrypt that data. Everyone in the network must be able to verify that. Is it possible to achieve this with digital signatures? If so, how should I use them?


texts: Why does geth use so much bandwidth in light mode?

texts:
So I am running latest geth 1.8 (same thing happens with geth 1.7) and I have noticed that I am always downloading at about 2 megabytes / sec and uploading 120 kilobytes / sec. This is caused by geth process.

/home/user/.config/Ethereum Wallet/binaries/Geth/unpacked/geth --syncmode light --cache 1024

I thought light mode will same me both disk space and bandwidth. What is the reasoning for SO MUCH DATA being downloaded constantly to my PC? I dont see how this can be justified since I am not supposed to be downloading whole blockchain.


texts: How do I delete the geth console history?

texts:
how do I delete the geth console history ?

I'm concerned with this, especially in light of this recent Mist hack :

  On the console you can also unlock accounts (one at a time).

  personal.unlockAccount(address, "password")

  Note that we do NOT recommend using the password argument here, since
  the console history is logged, so you may compromise your account. You
  have been warned.


texts: linking the CoreContract and the ERC20 token contract

texts:
What is the standard way of making the link between our CoreContract and the ERC20Token contract used by the Core Contract? Are people used to use inheritance like: MyCoreContract is MyERC20Contract { ... } or do they deploy an instance of the ERC20 token within the core contract like: MyCoreContract { var ERC20token = new(MyERC20token) } . Or maybe another alternative is better ?

Best Regards


texts:
To pass a long byte array,

"\x3a\x44\x3d\x83\x81\xa6\x79\x8a\x70\xc6\xff\x93\x04\xbd\xc8\xcb\x01\x63\xc2\x32\x11\xd1\x16\x28\xfa\xe5\x2e\xf9\xe0\xdc\xa1\x1a\x00\x1c\xf0\x66\xd5\x6a\x81\x56\xfc\x20\x1c\xd5\xdf\x8a\x36\xef\x69\x4e\xec\xd2\x58\x90\x3f\xca\x70\x86\xc1\xfa\xe7\x44\x1e\x1d"

as a function argument

contract messageHash {

function hashPersonalMessage(bytes _message) returns (bytes32){
    bytes32 msgHash = sha3('\x19Ethereum Signed Message:\n64', _message);
    return msgHash;
}

does not work for me in the Remix IDE

If the byte array is hard-coded in the contract, then it works,

contract messageHash {

function hashPersonalMessage() returns (bytes32){
    bytes32 msgHash = sha3('\x19Ethereum Signed Message:\n64', hex"3a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d");
    return msgHash;
}
}

outputs b08ec7b042251c745afe4b25e62edcc014a50fae0535d9ee340dd4e2b9c2fd89, a msgHash of the correct format (it gets verified with ECverify)

and this works as well,

contract messageHash {

function hashPersonalMessage() returns (bytes32){
    bytes32 msgHash = sha3('\x19Ethereum Signed Message:\n64', "\x3a\x44\x3d\x83\x81\xa6\x79\x8a\x70\xc6\xff\x93\x04\xbd\xc8\xcb\x01\x63\xc2\x32\x11\xd1\x16\x28\xfa\xe5\x2e\xf9\xe0\xdc\xa1\x1a\x00\x1c\xf0\x66\xd5\x6a\x81\x56\xfc\x20\x1c\xd5\xdf\x8a\x36\xef\x69\x4e\xec\xd2\x58\x90\x3f\xca\x70\x86\xc1\xfa\xe7\x44\x1e\x1d");
    return msgHash;
}
}


texts: What does v, r, s in eth_getTransactionByHash mean?

texts:
In Ethereum JSON-RPC I found the return is:

Returns

Object - A transaction object, or null when no transaction was found:
hash: DATA, 32 Bytes - hash of the transaction.
nonce: QUANTITY - the number of transactions made by the sender prior to this one.
blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending.
blockNumber: QUANTITY - block number where this transaction was in. null when its pending.
transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending.
from: DATA, 20 Bytes - address of the sender.
to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction.
value: QUANTITY - value transferred in Wei.
gasPrice: QUANTITY - gas price provided by the sender in Wei.
gas: QUANTITY - gas provided by the sender.
input: DATA - the data send along with the transaction.

But I type the command, the result is not same with the document above :

{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x949f40920a86f281daccbe8e30dd60a366b22ff270647815f6bfc0402ff38e42","blockNumber":"0xce3","from":"0x047347096a6dc73f8626afb520c383a02efda314","gas":"0x15f90","gasPrice":"0x4a817c800","hash":"0x70a7552c8ab8d2621c80c8a1c149012d10a823c4619cc82235cbdfad0553310b","input":"0x021df6f4000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000","nonce":"0x178","to":"0xe2412bb63a0a25d7b8973fc6764fd246ebe62c7a","transactionIndex":"0x0","value":"0x0","v":"0x1b","r":"0xd693b532a80fed6392b428604171fb32fdbf953728a3a7ecc7d4062b1652c042","s":"0x24e9c602ac800b983b035700a14b23f78a253ab762deab5dc27e3555a750b354"}}

What does r, s, v and others mean ?

And value: QUANTITY - value transferred in Wei, what does it mean?


texts: Is there a way to unit test Solidity contracts without running ethereum node?

texts: I don't want to run an ethereum node on my local machine, but for my project I need to tests solidity contracts. Are there any tools that allow such thing?


texts:
Since I upgraded to Mist 0.5.2, I get this when trying to transfer funds:

  We can't estimate your gas usage properly, as you need at least 1 ether in your account

My account has 3 ethers.


texts: How to set payout threshold and Rigname in ethminer?

texts:
I'm new to ethminer. I was just following the simple guides in ethermine.org. It says to start ethminer, we have to create a bat with the following contents, which I did:

setx GPU_FORCE_64BIT_PTR 0
setx GPU_MAX_HEAP_SIZE 100
setx GPU_USE_SYNC_OBJECTS 1
setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_SINGLE_ALLOC_PERCENT 100
ethminer.exe --farm-recheck 200 -G -S eu1.ethermine.org:4444 -FS us1.ethermine.org:4444 -O <Your_Ethereum_Address>.<RigName>

Now a few questions:

1- How to set the payout threshold? So whenever the mined amount reached that, it automatically sends it to my wallet address?

2- What is that Rigname?

3- For the address, that is my wallet address, right? e.g. my Binance ETH deposit address.


texts:
https://etherscan.io/tx/0xca244550d8d582d4e77466bc6ef3b9b9a033697ecc71f86c28745e74da354c9c

Does anyone know what does - Fail with error 'ERR_LIMIT_OUT' mean?
Thank you!


texts: Truffle: how to override compiler settings via the CLI?

texts:
This is a highly specific bottleneck encountered when using Truffle.

In my normal truffle-config.js file, I have the optimizer enabled.
I run a CI pipeline which has a coverage job.
I use 0x/sol-coverage and it seems that when enabling the Solidity optimizer some information about the source code is lost and the aggregate coverage is lower than it should be.
Therefore, I would ideally be able to run truffle compile --disable-optimizer - or some way to modify the compiler settings.

At worst, I could modify the truffle-config.js file before running the coverage job, but I feel this is not good practice.

Are there any other workarounds?


texts: Are DAG files needed for non-mining nodes

texts:
DAG files are needed for Ethereum proof-of-work system: https://github.com/ethereum/wiki/wiki/Ethash-DAG

However are these files necessary for non-mining clients e.g. geth full nodes that do not mine?


texts: Different outputs on event log subscription


texts: Geth node starts to sync from the beginning after fast sync

texts:
I have synced using the --fast command. Now how should I proceed?

I tried stopping it, and then running geth --rpc but it says:

Last Header #1311471
Last Block #0
Fast Block #1310224

What should I do to stay synced?


texts: How to cryptographically challenge a public/private address key pair?

texts: I know that in the Ethereum protocol, users submit transaction by cryptographically 'signing' their transactions using their private key to prove to the miners that they do own that key but without revealing it to the network.  How is this done?  I was doing some research and I stumbled upon such topics as RSA and homomorphic encryption but how could I build a javascript function that challenged and verified such a signature from a key pair?


texts: How do we deploy a smart contract with Oraclize to Rinkeby Network?

texts:
I have created a smart contract with Oraclize logic which I tested locally using Truffle.
Now I want to test it on Rinkeby network along with my front end, what it the process to do so ?

How do we generate the OAR OraclizeAddrResolverI that we have to mention inside contract constructor for Rinkeby Network?


texts: Memory to memory variables only create reference, but its not working with delete - Solidity 0.5.0

texts:
Learning Solidity latest version 0.5.0. And having bit confusion about data location rules.

It says that,

  Assignments from memory to memory only create references. This means
  that changes to one memory variable are also visible in all other
  memory variables that refer to the same data.

I'm trying to understand it with an example

pragma solidity ^0.5.0;

contract Locations {

    function doSomething() public pure returns (uint[] memory) {

    uint[] memory localMemoryArray1 = new uint[](3);
    localMemoryArray1[0] = 4;
    localMemoryArray1[1] = 5;
    localMemoryArray1[2] = 6;

    uint[] memory localMemoryArray2 = localMemoryArray1;
    delete localMemoryArray1;
    return localMemoryArray2;
  }
}

However, this returns value 4,5,6. As it is a reference type, it should return 0,0,0. Not sure if its my misunderstanding.

Further changes as per following code works as doc stated

pragma solidity ^0.5.0;

contract Locations {

    function doSomething() public pure returns (uint[] memory) {

    uint[] memory localMemoryArray1 = new uint[](3);
    localMemoryArray1[0] = 4;
    localMemoryArray1[1] = 5;
    localMemoryArray1[2] = 6;

    uint[] memory localMemoryArray2 = localMemoryArray1;
    localMemoryArray1[0] = 10; //<==== assigning new value
    return localMemoryArray2;
  }
}

Above code returns 10,5,6, which is right!


texts: # issue: Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?

texts:
issue:  Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? gas required exceeds allowance or always failing transaction.

already pass the Compiler, ran and deployed contract, however, when i click at address button secondly to deploy the same contract by calling buytoken function, the issue appeared.

i use openzeppelin contracts, following is my coding:

pragma solidity ^0.5.0;

//import "./ERC20Detailed.sol";
//import "./ERC20.sol";
//import "./ERC20Mintable.sol";
import "./Crowdsale.sol";
import "./TimedCrowdsale.sol";
import "./CappedCrowdsale.sol";
import "./IndividuallyCappedCrowdsale.sol";
import "./MintedCrowdsale.sol";
import "./CapperRoleMock.sol";
/**
 * @title NewsToken
 * @dev Very simple ERC20 Token with individually CappedCrowdsale
 * It is meant to be used in a crowdsale contract.
 */
//contract NewsToken is ERC20Mintable,ERC20Detailed {
  //  constructor () public ERC20Detailed("NewsToken", "News", 18)
    //{
    //_mint(msg.sender, 1000000000 * (10 ** uint256(decimals())));
       // solhint-disable-previous-line no-empty-blocks
//    }
//}

/**
 * @title Crowdsale
 * @dev This is an example of a fully fledged crowdsale.
 * The way to add new features to a base crowdsale is by multiple inheritance.
 * In this example we are providing following extensions:
 * individuallyCappedCrowdsale - sets a max boundary per users for raised funds.
 * After adding multiple features it's good practice to run integration tests
 * to ensure that subcontracts works together as intended.
 */
contract NewsTokenCrowdsale is IndividuallyCappedCrowdsale,CappedCrowdsale,MintedCrowdsale,TimedCrowdsale,CapperRoleMock {
    constructor (
        uint256 openingTime,
        uint256 closingTime,
        uint256 rate,
        address payable wallet,
        uint256 cap,
        ERC20Mintable token,
        uint256 goal
    )
        public
        Crowdsale(rate, wallet, token)
        CappedCrowdsale(cap)
        TimedCrowdsale(openingTime, closingTime)
        //RefundableCrowdsale(goal)
    {
        //As goal needs to be met for a successful crowdsale
        //the value needs to less or equal than a cap which is limit for accepted funds
        //require(goal <= cap, "NewsCrowdSale: goal is greater than cap");

    }
}


texts: Limit the number of times a static function is called

texts:
As far as I am concerned, when a function in a smart contract is defined as pure or view it is possible to invoke it without being charged for the gas consumption that its execution requires. This type of functions do not alter the state of the smart contract and thus not need to be executed and mined as a new block in the blockchain.

However, this behaviour would open the door to abuse. Anyone could try to repeatedly invoke this type of functions on a particular node to put it to work without rewarding it.

So, I would like to know if I am right or wrong in stating:

Pure & view functions can be abused because anyone can invoke them without paying for their execution.
Pure & view functions are executed off-chain since their execution does not alter the state of the contract.
When executing off-chain the function is typically executed on a single node, the one used as provider (e.g., a local geth node or a remote Infura node).

If 1. is correct, is there a way to prevent this from happening? I don't mean a way to to limit long executions but a way to limit multiple invocations of a single function by some accounts. This is something I wanted to clarify since the question was marked as a possible duplicate of View/Pure Gas usage - Cost gas if called internally by another function?

I can think of firewall-based solutions but does Ethereum clients like Geth provide any sort of countermeasure? Can this problem be tackled at solidity level? It comes to my mind making all my functions non-static but this would be detrimental for honest users.

If 2 and 3 are correct, I can think of remote dishonest nodes returning wrong results to the client. So I guess, this is not necessarily true and there is a way to force invocations to pure/view functions to be executed distributedly. In that case, would the execution of the function have any impact on the blockchain if the function is not changing anything on the contract? Would any gas be charged to the client?

Thanks for your comments!


texts: Compile Smart Contract with Solidity on Windows 10

texts:
I wanted to use solidity within geth in Windows 10. I tried the compiled version that comes with Ethereum 1.0 but it has an issue mentioned in this thread.
I'd like to get a new binary of a newer version with this issue fixed. As I didn't find it, I'm trying to compile it by myself but I found the following errors:

If I compile it standalone, just downloading the package from here I get:

  'Unknown CMake command "eth_policy"'.

If I try to compile solc (v 0.1.6) included in Ethereum 1.0 I get:

  'Cannot open include file: 'pthread.h': No such file or directory [C:\Users\pablo\Desktop\solc-build\webthree-umbrella\solidity\CMakeFiles\CMakeTmp\cmTC_24f2f.vcxproj]'

Any ideas?


texts: Why is 50+ so confirmation only needed instead of n/2 + 1 confirmation where n is the number of node in the network?

texts:
In a typical consensus algorithm like raft, it requires majority of node to agree on something, but I find ethereeum transactions to only need about 50 confirmations for a transaction to be approved in coinbase.

Is this an engineering approximation such that if there is  50+ confirmation the probability of transaction to stick is very high, or am I understanding the theory wrong?


texts: How is it possible to pay 2,100 Ether ($309,267) for a transaction fee?

texts:
Here is the transaction details that has transaction fee for
2,100 Ether ($309,267.00) only for sending 0.1 Ether.

There is no fairness for users, hence accidentally adding a zero might cause them to lose thousands of dollars.

[Q] How and why is this possible? Why Ethereum does not provide any protection mechanism for paying very high transaction fees and why there is no limit for that?

Since it is a mistake done by the user, why Ethereum does not provide any payback/refund mechanism?

From this comment, it seems like it is not an accident.

  My guess is they have their own block and they add the 300k to it as a
  fee. They DO NOT broadcast this transaction out, they are the only
  ones that know about it and are the only ones trying to mine the high
  fee transaction.

  Now they start mining that block, everytime a new block is found by
  the network(not them), they move their transaction to the new block
  and start mining it, NEVER broadcasting this 300k transaction fee,
  sooner or later they will solve this block and the 300k fee they never
  broadcast ends up inside the block as valid on the network.

  Once the block is mined, they hurry up and broadcast it to the
  network, which makes every transaction inside the block valid,
  including the secret one they kept from the network while trying to
  mine for it for days.

  This ETH address has other high fee transactions another one for 420
  ETH fee. All these blocks were mined by the SAME miner. The odds of
  this being a accident = ZERO.


texts: I have an ISP that provides 5000 GB for use between 1am and 7am. Is it possible to schedule Geth to sync only during that time?


texts: web3.utils.sha3 and web3.sha3 are not returning same hash

texts:
I am referring to example given in link. I will summarize the steps given in the example to save your time from reading.
The example used below smart contract to demonstrate the web3.eth.getStorageAt() functionality. The author is explaining how to get the value of a storage of a mapping. He explained the example for persons[1]. The index of persons[1] is 2 and key is 1.
pragma solidity ^0.4.24;

contract StoreAge{

    /*
     * state variable `ages` storing a dynamic array of ages in 8 bits
     * state variable `oldest` storing the oldest age in 8 bits
     * state variable `persons` storing a mapping of number of persons to ages
     */
    uint8 public oldest;

    uint8[] ages;

    mapping (uint8 => uint8) persons;

    constructor () public {
         oldest = 75;
         ages.push(20);
         ages.push(30);
         ages.push(56);
         persons[1] = 55; //1 person is 55
         persons[2] = 67; //2 persons are 67
    }
}

He performed following steps and received the correct value. '0x37' = 55
$ truffle(develop)> n = ‘0000000000000000000000000000000000000000000000000000000000000002’

$ truffle(develop)> p = '0000000000000000000000000000000000000000000000000000000000000001'

$ truffle(develop)> first_item_addr = web3.sha3(n + p, {encoding: 'hex'})

$ '0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0'

$ truffle(develop)> web3.eth.getStorageAt(storeAge.address, first_item_addr)

$ '0x37'

I performed the similar steps and getting 0x0.
$ truffle(develop)> n = ‘0000000000000000000000000000000000000000000000000000000000000002’

$ truffle(develop)> p = '0000000000000000000000000000000000000000000000000000000000000001'

$ truffle(develop)> first_item_addr = web3.utils.sha3(n + p, {encoding: 'hex'})

$ '0x1ccbca99b07224d036683c65d465d294a6c6f2dc5ff7f8844f276c36b2b5c988'

$ truffle(develop)> web3.eth.getStorageAt(storeAge.address, first_item_addr)

$ '0x0'

I feel the hash function web3.utils.sha3 is not returning correct output. How can I get the correct output to fetch the storage of persons[1]? I really appreciate your help.


texts:
Is it possible somehow with ethereum smart contract implement proof of identity and email check?

Is there a need to do external call or everything can be implemented in blockchain. How to add then new identity to blockchain to check it later?

I am searching this topic for a while without any success.


texts: Web3 contract transactions not showing up in Ganache

texts:
I am making a contract instance with web3 and then calling a function of the instance.

I don't know why this isn't automatically mining in the local Ganache.

var Logistics = new web3js.eth.Contract(LogisticsData.abi, LogisticsAddress);
console.log(Logistics);
var newBox = Logistics.methods._createBox("0x345ca3e014aaf5dca488057592ee47305d9b3e10", "0xf25186b5081ff5ce73482ad761db0eb0d25abfbf");
console.log(newBox);


texts: Can you get the seed phrase of a HD wallet from the private key of one of the wallets?

texts:
Let us say I have a HD wallet. Can I get it’s seed phrase from the private key of one of its wallets?
Also are seed phrases just easy to remember private keys? If so does that mean that from the seed phrase private key you can get a public key? And if this is true if I send cryptos to this public key in which HD wallet is it going to appear in? The first one?


texts:
I have created a private block chain with three Peers. Peer A is having an account which is having 20 ether. Now I am trying send 21 ether from peer A's account to peer B's Account. It is not throwing any error in geth console even though Account is having less ether.

I have used below command for sending ether:

eth.sendTransaction({from:"0x871fDd8F5896fA9a8D1389F498cc05e0752cA4fE",to:"0x9B5AC566B9c35388a27B098FA8a3407b1f81324C", value: 21})


texts: Oraclize failing to return data when using example contract

texts:
I am trying to use the example Oraclize contracts at https://github.com/oraclize/ethereum-examples/tree/master/solidity, including KrakenPriceTicker.sol. Here's my contract (modified very slightly):

pragma solidity ^0.4.0;
import "github.com/oraclize/ethereum-api/oraclizeAPI_0.4.sol";

contract KrakenPriceTicker is usingOraclize {

    string public ETHXBT;
    uint public timesCalled;
    uint public timesFailed;

    event newOraclizeQuery(string description);
    event newKrakenPriceTicker(string price);

    function KrakenPriceTicker() payable {
        oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
    }

    function __callback(bytes32 myid, string result, bytes proof) {
        ETHXBT = result;
        newKrakenPriceTicker(ETHXBT);
        update();
    }

    function update() payable {
        if (oraclize_getPrice("URL") > this.balance) {
            newOraclizeQuery("Oraclize query was NOT sent, please add some ETH to cover for the query fee");
            timesFailed++;
        } else {
            newOraclizeQuery("Oraclize query was sent, standing by for the answer..");
            oraclize_query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
            timesCalled++;
        }
    }

}

When the update() function is called and some ether and gas sent with it, it should call the kraken.com api and update the value of ETHXBT with what's returned. However, the value of ETHXBT is always blank. I know the oraclize_query is being called because the timesCalled variable does increment. So there appears to be an issue with the result returned, though going directly to https://api.kraken.com/0/public/Ticker?pair=ETHXBT shows there shouldn't be any problem.

I've deployed the above contract at https://ropsten.etherscan.io/address/0x2c51daecf702f2afe3abee2cc84570ee17f75650 (I've tried to call update() several times).


texts:
I tried to deploy the contract on my testrpc,
but I get error when my constructor using "address" type.

Here is my python code:

import json
import web3
from solc import compile_source
from web3.contract import ConciseContract
from web3 import Web3, EthereumTesterProvider
from web3.auto import w3

w3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545"))

# Solidity source code
contract_source_code = '''
pragma solidity ^0.4.23;
contract Demo2{

    address public owner = msg.sender;
    address[] user;
    address Bank1;

    constructor (string _ID ,address _addr ) {
    }
}

'''

compiled_sol = compile_source(contract_source_code) # Compiled source code
contract_interface = compiled_sol['<stdin>:Demo2']
w3.eth.defaultAccount = w3.eth.accounts[0]
a=type(w3.eth.accounts[0])
print(a)

Demo2 = w3.eth.contract(abi=contract_interface['abi'], bytecode=contract_interface['bin'])
ab=contract_interface['abi']
print(ab)
# Submit the transaction that deploys the contract
tx_hash = Demo2.constructor("abcde","0xc69d7e6739e30796f1cc7a1a01fd0c087c4e54fd").transact()

# Wait for the transaction to be mined, and get the transaction receipt
tx_receipt = w3.eth.waitForTransactionReceipt(tx_hash)

# Create the contract instance with the newly-deployed address
Demo2 = w3.eth.contract(
    address=tx_receipt.contractAddress,
    abi=contract_interface['abi'],
)


texts: When does it make sense to use `this.f()` instead of making the function public?

texts:
In external vs public best practices, Tjaden Hess says that:

  It almost never makes sense to use the this.f() pattern, as this requires a real CALL to be executed, which is expensive

So why does solidity even allow it in the first place? Wouldn't it make more sense to get warning to mark the function as public and call it as usual with f()?


texts: How can I cancel a not yet pushed transaction in Mist?

texts:
I created a transaction while not connected to any nodes in Mist wallet and I don't want to announce it to the network anymore.

How do I withdraw this transaction with 0 confirmations? My concern is that it will be pushed to the network once I restart the wallet software.


texts: What are the attributes of the `msg` object and how can I list them?

texts: I know msg.sender exists, it gives the address of the sender. What other attributes are there and how can I list them / where are they defined?


texts: Access input of a different function but in same contract

texts: Is there a way for a function B() to have access to the input given at function A(), knowing function A() and function B() belong to the same contract XPTO?


texts:
I know Token holder can send Token to other user by using Mist Or MyEthereumWallet but How it is possible by any web application?

is there any specific ethereum api's by which we can buy sell token and could check balance for running ICO Sale?
Or
there will be need of any Dapp developed by truffle framework ?

Kindly help me out it is too confusing for me.
Thanks


texts: Resource files are not not publishing in ipfs name publish

texts: I made sample dapp application for interacting with smart contract and i developed a basic ui when i am publishing it to ipfs like i did seeing a tutorial and ipfs documentation, i can get only index.html file and supporting scripts and css files are throwing error file not found. can any pls help me out in this issue.


texts:
I am running a Parity node and I have a very odd problem with transmitting some transactions. My node appears to be working fine, but when I attempt to get some basic information from the blockchain like gas prices, it inconsistently returns. This is not an issue for a similar node I run in a different geo, and my node itself is happily returning absurd things like undefined for fees on a specific transaction I'm sending.

With no errors, the only thing I can think of is that the peers I'm connected to are crappy. Is there a way to flush my current peers or ban specific peers from my node so I can try to get new ones?


texts: Visual Studio Code's Solidity extension shows unecessary warnings/errors

texts: I am using Juan Blanco's Solidity extension for VSC. I am noticing it is showing just too many warnings everywhere, including the OpenZeppelin contracts in the node_modules folder. Is there any alternative to it? Or any way to suppress all the unnecessary warnings? Having a bunch of yellow underlines and red highlighted folders everywhere is kind of distracting.


texts: Check Augur market validity in solidity contract

texts:
I'm trying to validate my market created through my node on Rinkeby Testnet.

I created some markets on Rinkeby Testnet (using Augur.js) running my own Rinkeby Augur node.
When I get the markets created by me address (using Augur.js) one of the addresses is the following contract address:

  0xac5c22dc5e67a07ba6fafd49aff8c41c810328ca

I want to check if the market is valid by using the following function:

function checkMarketValidity (
    address _augur,
    address _market
)
public
payable
    public
returns (bool)
{
    IMarket market = IMarket(_market);
    IAugur augur = IAugur(_augur);

    bool validity = augur.isValidMarket(market);
    return validity;
}

When I call this function using truffle (truffle test --network rinkeby):

const { receipt } = await contract.checkMarketValidity(AUGUR_ADDRESS_RINKEBY, MARKET_ADDRESS_RINKEBY);

The transaction gets reverted within the augur.isValidMarket function it seems like.

EDIT: My augur and market instances are able to get and verify the markets universe and this is all correct, for some reason the market transaction still reverts when trying to validate the market.


texts: function () public payable modifier can trigger actions when sending tokens or only works when sending ether?

texts:
Modifier payable triggers an action when an address sends ether to a contract.

For example:

function () public payable {
      require(msg.data.length == 0);
      DoSomething();
    }

Is this action also triggered when the msg.sender sends tokens?
My question is if it's possible to trigger actions through payable when an address send tokens too, or it's necessary another modifier or a more complex workaround to achieve this?


texts:
Let's have a look at this address on Etherscan:
https://etherscan.io/address/0xfbe0aFcd7658BA86be41922059dD879C192D4c73
First transaction is a Smart Contract creation, that costs about 15 ETH.
Can't understand where such address has this balance.


texts: How does createProxyImpl work in ProxyFactory Contract?

texts:
function createProxyImpl(address _target, bytes _data)
    internal
    returns (address proxyContract)
{
    assembly {
        let contractCode := mload(0x40) // Find empty storage location using "free memory pointer"

        mstore(add(contractCode, 0x0b), _target) // Add target address, with a 11 bytes [i.e. 23 - (32 - 20)] offset to later accomodate first part of the bytecode
        mstore(sub(contractCode, 0x09), 0x000000000000000000603160008181600b9039f3600080808080368092803773) // First part of the bytecode, shifted left by 9 bytes, overwrites left padding of target address
        mstore(add(contractCode, 0x2b), 0x5af43d828181803e808314602f57f35bfd000000000000000000000000000000) // Final part of bytecode, offset by 43 bytes

        proxyContract := create(0, contractCode, 60) // total length 60 bytes
        if iszero(extcodesize(proxyContract)) {
            revert(0, 0)
        }

        // check if the _data.length > 0 and if it is forward it to the newly created contract
        let dataLength := mload(_data)
        if iszero(iszero(dataLength)) {
            if iszero(call(gas, proxyContract, 0, add(_data, 0x20), dataLength, 0, 0)) {
                revert(0, 0)
            }
        }
    }
}

I know the code is supposed to deal with some external contract. However, I am not able to understand the flow as well as the implementation. Can someone explain?


texts: Where can I find documentation/specification for mining pool communication?

texts:
I am looking for documentation or specification of communication/protocol between client and pool. Is there some or do I have to dig into source code of geth?

(Yes, I know about the RPC documentation, I am looking for something that describes what data are transmitter, how does miner initiate communication with pool, etc.)


texts: Efficient way of checking and inserting array address that is unqiue

texts:
I have a following requirement that need to be cater in dapp.

Insert array of address
The array need to be unique. If one of the array address already exists, reject and revert entire operation.
dapp must able to retrieve the user address list
dapp must able to detect if a user address exists based on a user address input

Note:

The above requirement must be satisfied.
Full Validation checking must be done by smart contract.(cannot rely on client side checking alone).

Trying to use 3 for loop doesn't seems be a very clever way for this as it become a cost expensive operation. Unfortunately this is the only solution i can think of to satisfy above condition. Anyone have experience on dealing with this?

// probably only one of mapping or list is needed
address[] public addressList;
mapping (address => bool) public userAddr;

    function insertAddress(address[] addressUser) public returns (bool) {
        // loop addressUser and check if it is unique
        // loop addressUser and check if it exists in mapping
        // loop and push addressUser to addressList + insert addressUser to userAddr

        return true;
    }


texts: Geth is refusing to sync the last 100 blocks on the ropsten testnet, is there a way to force geth to continue syncing from the console?


texts: Is there a websocket URL in Ethereum classic like in Ethereum?

texts: Can anyone tell me whether or not there is a WebSocket URL to deal with smart contract events in Ethereum Classic especially? I know ethereum supports WebSockets and we can easily listen to events from smart-contract with web3. But how about ethereum classic?


texts:
I use rinkeby faucet to get some ether, when I check the Etherscan it successfully deposit to my account(0x0E2a77b).
I have two question to ask.
First question is, When I go to Metamask it doesn't show the balance, how can I solve it?
Second question is, I'm using the opensea marketplace, I successfully to connect to my metamask, but when I trying to buy some NFT, the metamask doesn't pop out, I'm not sure that I missed setting something in metamask or it is because I have no balance.


texts: what is the most suitable ERC token standard for non-tradable tokens?

texts: If i want to make tokens for say university grading system (ex. each grade for every student in a course is a token he got ) , what's the best ERC token standard should i follow ?


texts:
I have a program that monitors all token transfers going out from a set of addresses I have. That works fine, I get the transactions, the tokens, the amount etc. But now when I apply the whole logic to incoming transactions it doesnt work anymore and I cant find out why.
for monitoring outgoing token transactions I do these steps:

get a transaction
check if transaction "FROM" is one of the saved addresses in array
check if transaction "TO" is erc20 token by using web3.getCode !== '0x'
get the token info using contract = new web3.eth.Contract(abi, tx.to);
get transfered amount by decoding txReceipts

Now for incoming transactions I just changed the "TO" and "FROM" parameters of the steps above. For example if transaction "TO" is one of the stored addresses, or check if transaction "FROM" is erc20 with web3.eth.getCode(tx.from);
There must be something I am missing in the logic, but I assumed that using the same approach and changing the fields would work.
Anyone can help me out here please?


texts: web3.py web3.isConnected() returns false always

texts:
I am trying an tutorial on web3.py

so i created a profile in infura and used its project id.But it shows false always when i try  web3.isConnected()

PS C:\Users\HP> python
    Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from web3 import Web3
    >>> infura_url = "mainnet.infura.io/v3/******************************"
    >>> web3 = Web3(Web3.HTTPProvider(infura_url))
    >>> web3.isConnected()
    False


texts: How does the Casper proof of stake algorithm work?

texts: Ethereum plans to move to the Casper proof of stake algorithm in a future version of the network.  What are the details of that algorithm, and how does it compare to previous Proof of Stake consensus protocols?


texts: Send a transaction with value to the contract fail

texts:
I'm using Ropsten Testnet and Remix.

Is there an obvious error in this code? Why does not he accept eth.

function () payable public {
        buy();
    }

function buy () payable public whenNotPaused beforeDeadline afterStartTime saleNotClosed {
    require(msg.value >= minContribution);

    // Update the sender's balance of wei contributed and the amount raised
    uint amount = msg.value;
    uint currentBalance = balanceOf[msg.sender];
    balanceOf[msg.sender] = currentBalance.add(amount);
    amountRaised = amountRaised.add(amount);

    // Compute the number of tokens to be rewarded to the sender
    // Note: it's important for this calculation that both wei
    // and PDT have the same number of decimal places (18)
    uint numTokens = amount.mul(rate);

    // Transfer the tokens from the crowdsale supply to the sender
    if (tokenReward.transferFrom(tokenReward.owner(), msg.sender, numTokens)) {
        FundTransfer(msg.sender, amount, true);
        // Check if the funding goal or cap have been reached
        // TODO check impact on gas cost
        checkFundingGoal();
        checkFundingCap();
    }
    else {
        revert();
    }
}

The Crowdsale contract has an allowance. The gas limit has been increased in many ways. My ether wallet warning !

The full code is here:
https://ropsten.etherscan.io/address/0x500c3ff2c1a561cd0fda1cf0c77fe0d17af5fda5

What I'm missing here?.
Thank you in advance for your answer. The last question was unanswered, so I ask again !


texts: Verifying personal.sign signature with pyethereum

texts:
I'm trying to verify a signed message from Metamask with pyethereum.  I can not seem to recover the correct address from the signature.  Lack of documentation isn't helping matters.

On the client side, I have metamask signing with web3.personal.sign().

var signer = web3.eth.defaultAccount || web3.eth.accounts[0];
var original_message = "I am but a stack exchange post";
var message = "0x" + original_message.toHex();
var message_hash = web3.sha3('\u0019Ethereum Signed Message:\n' + message.length.toString() + message);
var signature;
web3.personal.sign(message, signer, function(err, res) {
    if (err) console.error(err);
    signature = res;
    console.log({
        "signer": signer,
        "message": message,
        "message_hash": message_hash,
        "signature": signature,
    })
});

{
    message: "0x4920616d20627574206120737461636b2065786368616e676520706f7374"
    message_hash: "0x1a0126ceafb4579293016a4cc3ca0ec753c7d497cda8b3e6ece095c832d92590"
    signature: "0x0cf7e2e1cbaf249175b8e004118a182eb378a0b78a7a741e72a0a34e970b59194aa4d9419352d181a4d1827abbad279ad4f5a7b60da5751b82fec4dde6f380a51b"
    signer: "0x9283099a29556fcf8fff5b2cea2d4f67cb7a7a8b"
}

Then I send the signature, hash of the message, and the address to the backend, where I have something like this:

>>> from ethereum.utils import ecrecover_to_pub, sha3
>>> from eth_utils.hexidecimal import encode_hex, decode_hex, add_0x_prefix
>>> signer = "0x9283099a29556fcf8fff5b2cea2d4f67cb7a7a8b"
>>> message_hash = "0x1a0126ceafb4579293016a4cc3ca0ec753c7d497cda8b3e6ece095c832d92590"
>>> signature = "0x0cf7e2e1cbaf249175b8e004118a182eb378a0b78a7a741e72a0a34e970b59194aa4d9419352d181a4d1827abbad279ad4f5a7b60da5751b82fec4dde6f380a51b"
>>>
>>> r = int(signature[0:66], 16)
>>> s = int(add_0x_prefix(signature[66:130]), 16)
>>> v = int(add_0x_prefix(signature[130:132]), 16)
>>> if v not in (27,28):
...     v += 27
...
>>> pubkey = ecrecover_to_pub(decode_hex(message_hash), v, r, s)
>>> assert(encode_hex(sha3(pubkey)[-20:]) == signer)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError

I've tried a few ways to mess around with encoding, but I think I'm still missing something(hopefully obvious).  Any ideas?


texts: Getting Fatal: Error starting protocol stack: Genesis not found in chain

texts:
I am getting the following error in one of the nodes, I have a quorum network running.

  Fatal: Error starting protocol stack: Genesis not found in chain
  DEBUG[02-19|08:37:08] FS scan times                            list=34.464µs set=5.249µs diff=4.779µs
  TRACE[02-19|08:37:08] Handled keystore changes                 time=60.931µs
  DEBUG[02-19|08:37:08] FS scan times                            list=18.141µs set=3.251µs diff=4.014µs
  TRACE[02-19|08:37:08] Started watching keystore folder         path=/quorum/keystore
  INFO [02-19|08:37:08] Starting peer-to-peer node               instance=Geth/v1.7.2-stable-4d015bb4/linux-amd64/go1.9.3
  INFO [02-19|08:37:08] Allocated cache and file handles         database=/quorum/geth/chaindata cache=128 handles=1024
  INFO [02-19|08:37:08] Initialised chain configuration          config="{ChainID: 2018 Homestead: 1 DAO:  DAOSupport: false EIP150: 2 EIP155: 3 EIP158: 3 Byzantium: 1 IsQuorum: true Engine: unknown}"
  WARN [02-19|08:37:08] Ethash used in full fake mode
  INFO [02-19|08:37:08] Initialising Ethereum protocol           versions="[63 62]" network=1337
  Fatal: Error starting protocol stack: Genesis not found in chain


texts: Is there an Ethereum trading website which allows overlaying of trade entry and exit points over their chart?

texts:
I am looking for a website similar to tab-trader app, one which will allow me to use the Poloniex API key and view my buy and sell points overlaid on the current chart?

Tab trader has this functionality, but I would like something which i can access from my computer browser.


texts: getting result of a method of smart contract that don't change any state variables

texts:
I know in ethereum if a method of smart contract don't change state variables we can see it's result without making any transaction.

now I want to know how can see result of this method programatically?

for example by api of an explorer website that I can send some data to it and it show me some results.

I'm using php. so please don't offer me web3.js or python and so on.

for example I want to get result of totalSupply method of a smart contract called DS2Token on ropsten network in this address: 0x53778036dce23a22303142923316af257d7ee813


texts:
I've copied the code from here. In the example below, minter's address is kept in the contract:

minter = msg.sender;

In the comments, it's said:

"This is the constructor whose code is run only when the contract is created."

Therefore, minter's address is assigned only once.

Question: When is a contract created?

Is it created when it's called, or when it's deployed (sent to the network)?

     pragma solidity ^0.4.0;

    contract Coin {
    // The keyword "public" makes those variables
    // readable from outside.
    address public minter;
    mapping (address => uint) public balances;

    // Events allow light clients to react on
    // changes efficiently.
    event Sent(address from, address to, uint amount);

    // **** This is the constructor whose code is
    // run only when the contract is created.
    function Coin() {
        minter = msg.sender;
    }

    function mint(address receiver, uint amount) {
        if (msg.sender != minter) return;
        balances[receiver] += amount;
    }

    function send(address receiver, uint amount) {
        if (balances[msg.sender] < amount) return;
        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        Sent(msg.sender, receiver, amount);
    }
}

Also, after the contract is sent to the network, can someone make the contract like:

 Coin co=new Coin();

and deploy it to the network? In this case, would co have a different address than the Coin contract?


texts: Testing in ropsten network with truffle.js gives me this error

texts:
root@ubuntu-4gb-nyc3-01:~# truffle migrate --network ropsten
(node:14686) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: this.provider.sendAsync is not a function
(node:14686) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Using network 'ropsten'.

Running migration: 1_initial_migration.js

After that it exits to root@ubuntu-4gb-nyc3-01:~#
without running 2_deploy_contracts.js

My truffle.js looks like the following :

**var bip39 = require("bip39");
var hdkey = require('ethereumjs-wallet/hdkey');
var ProviderEngine = require("web3-provider-engine");
var WalletSubprovider = require('web3-provider-engine/subproviders/wallet.js');
var Web3Subprovider = require("web3-provider-engine/subproviders/web3.js");
var Web3 = require("web3");
// Get our mnemonic and create an hdwallet
var mnemonic = "twelve words we can find in metamask settings reveal seed words blabla";
var hdwallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(mnemonic));
// Get the first account using the standard hd path.
var wallet_hdpath = "m/44'/60'/0'/0/";
var wallet = hdwallet.derivePath(wallet_hdpath + "0").getWallet();
var address = "0x" + wallet.getAddress().toString("hex");
console.log(address);
var providerUrl = "https://ropsten.infura.io/mytoken";
var engine = new ProviderEngine();
engine.addProvider(new WalletSubprovider(wallet, {}));
engine.addProvider(new Web3Subprovider(new Web3.providers.HttpProvider(providerUrl)));
engine.start(); // Required by the provider engine.
module.exports = {
  networks: {
    ropsten: {
      network_id: 3,    // Official ropsten network id
      provider: engine, // Use our custom provider
      from: address,     // Use the address we derived
      gas: 3000000
    }
  },
  rpc: {
    // Use the default host and port when not using ropsten
    host: "my-server-ip-goes-here",
    port: 8545
  }
  };**

Where will I find this.provider.sendAsync function?

I m using node : v8.2.1
and Ubuntu 16.04

I m really stuck with this. Any help would be appreciated. Thanks


texts: Is it possible to get transactions sent to a specific address now?

texts:
I did search for this question before posting it here but still no success. I do see there are certain discussions about the lack of this 'necessary' API but they were raised quite long ago (about 1 year) so I am wondering if it is now available or there is an alternate/tricky way to do this?

Is it all about using 'filters'? As for transactions which are included into blocks, using filter will be useful but for the pending transactions, it will be much trickier (and the system performance will hurt) since all I can get is a list of pending transactions and I will have to iterate through this list to see which transaction belongs to which address to see if it is the one that I'm looking for.

Any advice or suggestions/recommendation in this case?

Thank you in advance!


texts: Factory for ERC1400, deployed contract not working

texts:
Hey I have written a factory for the ERC1400 Token by https://github.com/ConsenSys/ERC1400. When I run the test for issueByPartition I get a revert Error. Other tests like isIssuable works.
If I deploy the contract without the factory the customized issueByPartition  test passed.
Why is my factory deployed contract not working?
ERC1400Factory.sol
pragma solidity ^0.5.0;

import "../../ERC1400.sol";

contract ERC1400Factory {

    ERC1400[] public deployedERC1400;
    bytes32[] public tokenDefaultPartitions;

    address public certificateSigner;

    constructor(address certificat, bytes32[] memory tokenDefaul) public {

    certificateSigner = certificat;
    tokenDefaultPartitions = tokenDefaul;
    }

    function createERC1400(string memory name, string memory symbol, uint256 granularity, address[] memory controllers) public  {

        ERC1400 newERC1400 = new ERC1400(name, symbol, granularity, controllers, certificateSigner, tokenDefaultPartitions);

        deployedERC1400.push(newERC1400);
    }

    function getDeployedERC1400() public view returns (ERC1400[] memory ) {
        return deployedERC1400;
    }
}

ERC1400Factory.test.js
const ERC1400Factory = artifacts.require('ERC1400Factory');
const ERC1400 = artifacts.require('ERC1400');

const CERTIFICATE_SIGNER = '0xe31C41f0f70C5ff39f73B4B94bcCD767b3071630';
const VALID_CERTIFICATE = '0x1000000000000000000000000000000000000000000000000000000000000000';
const issuanceAmount = 1000;

const partition1 = '0x5265736572766564000000000000000000000000000000000000000000000000'; // Reserved in hex
const partition2 = '0x4973737565640000000000000000000000000000000000000000000000000000'; // Issued in hex
const partition3 = '0x4c6f636b65640000000000000000000000000000000000000000000000000000'; // Locked in hex
const partitions = [partition1, partition2, partition3];

contract('ERC1400Factory', function ([controller, tokenHolder, owner]) {
  beforeEach(async function () {
    this.erc1400factory = await ERC1400Factory.new(CERTIFICATE_SIGNER, partitions);
    await this.erc1400factory.createERC1400('test', 'tet', 1, [controller], { from: controller });
  });

  describe('ERC1400', function () {
    it('issueERC1400', async function () {
      let address = await this.erc1400factory.getDeployedERC1400();

      let erc1400 = await ERC1400.at(address[0]);

      await erc1400.issueByPartition(partition1, tokenHolder, issuanceAmount, VALID_CERTIFICATE, { from: owner });
    });
  });
});


texts: ERC20 :: Transferring tokens without sender gas

texts:
Let's assume we have 50 ERC20 tokens that we would like to support (deposits) on our website. People are depositing tokens to the ETH adresses we've generated for them.
In the end of the day, we want to geather tokens from all the generated addresses and send it to our cold wallet.

How can we make the transfer to the cold wallet if the newly generated addresses don't have any ether on it (this means no gas) and we don't want send there any ether?

Preferably, I would like to pay all the GAS that's requried for transactions from the cold wallet address - is it possible?

How exchanges are managing such situations? Do they generate the adresses and every time they are sending there eth to have enought for gas? In the end of the day, they have to move assests to one account. That's sounds... unefficent.


texts: Is there any efficient way to compute the exponentiation of an fractional base and fractional exponent?

texts: First off - not the same question as this (which is great). I need the exponent to be fractional as well. Something like 2.5^0.75


texts: Transferring files over blockchain from ropsten-test network

texts:
I am new to blockchain and working on a university project. I am trying to simply buy and sell music over the blockchain. Currently I am using a string to act as the 'transaction', but learnt this will not work. Does anyone have ideas how I would transact mp3 files from a publicly accessible decentralised database? It is hard to find guides specific to this - this is for a small experiment and not for commercial use, thank-you.

  pragma solidity ^0.4.18;

    contract Music {

        address public buyer;
        address public seller;

        bool public buyerPlayed;
        bool public sellerPlayed;

        uint private buyerDeposit;
        uint private sellerDeposit;

        bool public transactionFinished;
        address public theNewOwner;
        string gains;

        event AuctionStartsEvent(address buyer, address seller);
        event EndOfAuctionEvent(address owner, string gains);

        function Auctioning() public {
            buyer = msg.sender;
        }

        function registerAsABuyer() public {
            require(seller == address(0));

            seller = msg.sender;

            emit AuctionStartsEvent(buyer, seller);
        }

        function auction() public payable {
            require(!transactionFinished && (msg.sender == buyer || msg.sender == seller));

            if(msg.sender == buyer) {
                require(buyerPlayed == false);
                buyerPlayed = true;
                buyerDeposit = buyerDeposit + msg.value;
            } else {
                require(sellerPlayed == false);
                sellerPlayed = true;
                sellerDeposit = sellerDeposit + msg.value;
            }
            if(buyerPlayed && sellerPlayed) {
                if(buyerDeposit >= sellerDeposit * 2) {
                    endOfAuction(buyer);
                } else if (sellerDeposit >= buyerDeposit * 2) {
                    endOfAuction(seller);
                }
            }
        }

        function endOfAuction(address owner) internal {
            transactionFinished = true;
            theNewOwner = owner;

            gains = "You have recived your song!";
            emit EndOfAuctionEvent(owner, gains);
        }

    }


texts: Client to sign transaction and deploy contracts with no chain downloaded

texts: I'd like to deploy contracts from truffle using a localhost wallet but without syncing all the chain. I think this should be possible: a lightweight client able to connect to the network and to sign transactions, like Jaxx does, but also able to listen to some localhost port and interact with truffle.


texts: Calculating a minimum entry fee for a game based on typical minimum gas requirements?

texts:
I am creating a dApp that is a game where players compete for the prize pool and that pool is built from the sum of all the entry fees payed by the player at the start of the game.  The player that creates the game is responsible for choosing the entry fee.

I want to revert attempts to create a game where the entry fee is just too low reasonably to facilitate the game.  For example, an entry fee so low that just the transaction costs of creating the game contract and then making the payouts to the players will end up with little to no funds left being available after those operations to actually give any amount of any reasonable value to the players.

I know there's no exact answer here, but if someone could give me a way to use the estimate gas functions or some other function, or even just a good "rule-of-thumb" heuristic, then I would at least have a base value I can use to reject entry fees that are just too low to be usable.  As you can see, a straight greater-than-zero check doesn't help me here.


texts: For what reasons is it insecure to use block hashes from past blocks for randomness?

texts:
I understand that using the current block hash gives the miner the ability to possibly discard the block, but my question is about using a block hash from a past block. For example, I could look 128 blocks in the past and use that hash. The miner would be all but guaranteed to mine an orphan if they attempt to mine on top of block-129 and whatever block hash they come up with for the current block has no bearing on the outcome. Specifically, they and a cartel of miners would need to censor the transaction and any block that contained it, wouldn't they?

What are some reasons this would not be a good idea for something like a high stakes lottery?


texts:
I am new to ethereum but managed to successfully start Geth on 2 of my machines , and could also install MIST.
Now, since several days, one of my machines does not sync with the testnet anymore.
I start Geth using geth --testnet console
I see these lines

0228 19:31:57.086460 eth/backend.go:191] Protocol Versions: [63 62], Network Id: 3
I0228 19:31:57.086640 eth/backend.go:219] Chain config: {ChainID: 3 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 10 EIP158: 10}
I0228 19:31:57.089224 core/blockchain.go:217] Last header: #524061 [ac6dd60d…] TD=166615159323361
I0228 19:31:57.089241 core/blockchain.go:218] Last block: #524061 [ac6dd60d…] TD=166615159323361
I0228 19:31:57.089248 core/blockchain.go:219] Fast block: #524061 [ac6dd60d…] TD=166615159323361

then starting server , the endpoint opens, but admin.peers gives me an empty answer []
It is not a time sync problem as i tried to sync with ntp but without changing the clock
The production net seems to work  as have imported blocks.

Stopping geste and starting MIST browser has the same result.

Does anybody has an idea what I could do to restart the testnet ? what do I have to save in order to not loose my test accounts ? (i guess the UTC--xxx files from testnet/geth/keystore.)

My other machine the latest block (on the testnet) is 588099. It started with

Block synchronisation started
Synchronisation failed: block download cancelled (requested)
imported block 588100 and then
Peer xxxxxx: header #596654 broke chain ancestry

would appreciate any help


texts: Async getAccounts doesn't see my account

texts:
first time using MetaMask web3

Async getAccounts does not return my Eth account which I see in MetaMask.

My fiddle https://jsfiddle.net/ysz11/qcv78h9z/1/

<!DOCTYPE html>

<meta charset="utf-8">
<title>Virtual data room</title>


texts: Frameworks or Alternatives to create smart contracts/ETH using Golang

texts:
Hi guys I'm new to smart contracts, and I'm experimenting with Ethereum. I would like to use golang in my developments so:

Are there frameworks for developing smart contracts with Ethereum using go?
If there aren't frameworks what alternative can I use with golang and Ethereum?

Thank for your answers.


texts: Transfer Ether from main account to different accounts

texts:
I want to purchase some Ether from currency exchange websites and then transfer it using an API call to different accounts. Do I need a blockchain for such scenario ?

Also, can we create wallets from any websites and receive Ether from any currency exchange website ?

Update: I am creating a game where users will be rewarded with some Ether once they complete a challenge. Before we can reward users , we will have to purchase some Ether from currency exchange like Kraken(Don't want to mine it). Once we purchase it, we want to keep it in our wallet(base account) and then transfer to different Ether accounts/wallets provided by users.


texts: How to unblock transaction set a 0 fee (mistake) on Mist wallet?

texts:
I believe I did a mistake while doing a transaction from a wallet contract on Mist wallet.

I wanted to do a transaction, but I did it with 0 fee, so of course the transaction never reached the blockchain.

I did an other transaction from the same wallet contract to same address previously used on the transaction with higher fee which went through. The first transaction is still stuck.

Is there anything I can do to cancel or fix the this transaction ?

Thank you


texts: Difference between the balance of Etherscan and wallet ethereum

texts:
I have a problem , there is a discrepancy between Etherscan and my wallet..

https://etherscan.io/address/0x9Bd1fA1B8C1D1cED42579813A7A73B30e4078E9C

https://nanopool.org/account/0x9Bd1fA1B8C1D1cED42579813A7A73B30e4078E9C

in my wallet 8.58 ether

I'm using geth 1.4.10 and wallet 0.8.0


texts: What's the minimum token contract interface to be showed in mist?

texts:
I would like to implement a contract where users can see their token balance in the mist. In the same way that The DAO does.

What's the standard interface I should implement?

Is there a standard specification of this interface?

Which are the minimal functions that should be implemented in order that the balance is shown in mist.


texts: What is the function of approveFrom method in the ERC20Token interface and how do the functions approve and allowance relate to approveFrom?


texts:
I have an array of integers like this,

uint256[] public numberArr = [0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,5,5,5]

What can be the best way to shuffle this array in solidity


texts: got my first rig coming online. 6x Sapphire R9-390. I have 2x 750w power supply. Am I good? Does anyone have these cards and know the watt draw? Thank you :-)


texts: I can not send transactions from my wallet contract

texts:
Please, somebody help me!

I created the wallet contract 0x8cBcA499884Ac91065DAa258adF66d62e3D02c85

The Contract Creator was the account 0x19aE5032bD047BC24b5817B5C7512B0EbeC6626E

I've transferred some ether's to the wallet contract, but now I can not transfer any value from it.

Can someone check in the Block Explorer what happened to help me solve the problem?


texts: I couldn't find any documentation on how to transfer GNO tokens using go-ethereum (geth). So here it is.


texts: unable to verify using ecrecover - EIP 712 Simple multisig

texts:
I am signing a random message with the private key using web3.eth.accounts.sign('test',privatekey). This is returning me v,r,s,message hash and signature. I am feeding v,r,s to "execute" function in contract.

I am able to deploy and execute transaction using EIP 712 Smart contract. However ecrecover function is returning some other address. I am not sure what need to be passed in "data" parameter in the execute function. I am passing message hash which might be the issue.

Request you to please suggest the correct approach.

EIP 712 contract - https://github.com/christianlundkvist/simple-multisig/blob/master/contracts/SimpleMultiSig.sol

Thanks much.


texts:
I have a json file with ether created before fork. Now I want to sell ETC without moving ETH. My question is how to do it properly?
What if I'll restore file into ETC wallet and spend it. Is possible to restore the same file into ETH wallet again?


texts: Transaction successful but ether not transferred to destination account


texts:
I try send transaction but i get error.
https://bscscan.com/tx/0x3e716bc5d0500e8284de39c809a0251d07b0b3648591bf09fbafbb4dea633a34
I use web3.py
tx_params = {
            'from': wallet,
            'gas': 650000,
            'value': 0,
            'nonce': w3.eth.getTransactionCount(wallet)
        }

print(tx_params)

function = router.functions.swapExactTokensForTokens(
    int(7 * 1e18),
    int(5 * 1e18),
    [Web3.toChecksumAddress('0xe9e7cea3dedca5984780bafc599bd69add087d56'),
    Web3.toChecksumAddress('0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c'),
    Web3.toChecksumAddress('0xe9e7cea3dedca5984780bafc599bd69add087d56')],
    wallet,
    int(time.time()) + 10 * 60)

transaction = function.buildTransaction(tx_params)
signed_txn = w3.eth.account.sign_transaction(
    transaction, private_key=private_key
)

txn_hash = w3.eth.send_raw_transaction(signed_txn.rawTransaction)

Tell me please, how can i solve my problem with error 'Insufficient input amount, i have 0.07bnb and 46usd in wallet


texts: Not able to claim EOS tokens through MyEtherWallet

texts:
I was following this guide to acquire EOS tokens:
https://steemit.com/eos/@sandwich/contributing-to-eos-token-sale-with-myetherwallet-and-contract-inner-workings

Did step one first. Seemed to work fine (at least the money went out of my wallet).

Then I went to Step 2: Claim EOS Tokens.
I've done all that and the token didn't show up in the "Load Tokens" section.

And then, I noticed that when I load "EOS Contribution" on MyEtherWallet contracts section it shows a different step-by-step instruction:

Generate EOS Key-pair
Register / Map your EOS Key
    Select register
    Enter your EOS Public Key <--- CAREFUL! EOS PUBLIC KEY!
    Unlock wallet
    Amount to Send: 0 · Gas Limit: at least 90000
Fund EOS Contract on Send Page
    Go to Send Ether & Tokens Page
    Unlock same wallet you are unlocking here.
    Send Amount you want to Contribute to 0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf
    Gas Limit: at least 90000
Claim EOS Tokens
    Select claimAll.
    Unlock wallet
    Amount to Send: 0 · Gas Limit: at least 90000

After seeing that I tried to turn to this different step-by-step and tried registering my EOS Key-pair.
Did as it recommended above, when I check on Etherscan, transaction was successfull.

Since the "Fund EOS Contract on Send Page" was already done, I jumped to "Claim EOS Tokens". I follow the instructions, I get a "wallet successfully decrypted" but when I try to make this 0 ETH transaction it never runs through.

So, my question is:

a) Is there a problem on the sequence of events? I should have maped my EOS Keys prior to Funding the EOS Contract? If that's a problem, what happens now? I lose my money?

b) If there is not a problem with the sequence of events, why I'm not able to claim my tokens?

Can someone shine some light on it?


texts: How to pass arguments to token smart contract generator?

texts:
I'm trying to build a 'token generator' smart contract that accepts 3 arguments to then deploy a new token smart contract with those inputs ('strings' for symbol, name, 'address' for owner). I am a total novice, building from a basic escrow example (below), so any help is highly appreciated (!).

Reference: https://medium.com/coinmonks/creating-smart-contracts-with-smart-contract-d54e21d26e00

Example Solidity snippet for 'escrow generator' function:

So, basically instead of creating a new escrow contract that carries message value everytime someone calls it, I want to make a token generator that spits out an ERC20 with string and address inputs for symbol, name, owner.

Token snippet:

So, I am wondering what I can do to tweak the generator draft below to accept the these ^^ 3 arguments (_symbol, _name, _owner) that can customize new token smart contract for callers:


texts: Getting compilation error when trying to use openzeppelin for erc20 token

texts:
I installed Openzeppelin framework and created a simple token sol file.

pragma solidity ^0.4.24;

import "node_modules/openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol";

contract SToken is MintableToken {
    string public constant name = "SS Token";
    string public constant symbol = "SKS";
    uint8 public constant decimals = 2;
}

When I tried compiling i am getting following error.

node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol:3:1: ParserError: Source "node_modules/openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol" not found: File import callback not supported
import "./BasicToken.sol";

Any idea/thoughts what can be possible reason.


texts:
I'm working on remix and I'm connected to the BSC Testnet.
I am trying to make a transaction of ERC20 tokens in an ERC721 contract by calling the ERC20 contract. However when I try to make the transaction, I get :
"Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. { "code": -32000, "message": "gas required exceeds allowance (30000000) or always failing transaction" }".
I tried to approve the transaction through the ERC721 contract and it worked...
contract RF20 is Context, IERC20 {

    //...

    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    //...
}

contract RF721 is ERC721{

    //...

    //I first set the address of ERC20 deployed contract to "connect" to it.
    address addressRF20;
    function setAdressRF20(address _addressRF20) external {
        addressRF20 = _addressRF20;
    }

    //This function works.
    function approver() public {
        RF20 contr = RF20(addressRF20);
        contr.approve(0x88849EBf42C66B86cCA7397f0E52824E6e96839a, 50);
    }

    //This function does not work.
    function send() public {
        RF20 token = RF20(addressRF20);
        token.transfer(0x88849EBf42C66B86cCA7397f0E52824E6e96839a, 50);
    }

    //...
}

Thanks for helping me !


texts: I am listening ethereum network via web3.py filters and saving some transactions to mongo. I am concerned about overflow issues, because I am receiving values in transactions in weis (10^18). Can python handle sunch big numbers correctly and can mongo handle it?


texts: How can i connect external AWS server's truffle in browser?

texts:
I have deployed geth, truffle, testrpc whichever needed in live AWS server. All the configurations are working properly. I have initiated 'truffle develop' and 'npm run dev'. Both are working fine. Now, 'npm run dev' started in http://localhost:8080, I need to connect it in browser with http://x.x.x.x:8080. x.x.x.x - which is IP of AWS server.

Question: When i am trying to connect in this way, it is not loading in the browser. What i have to do further?

Verified AWS port, it is open.

I don't know how difficult this question, but struggling with this. Any help will be appreciated.

OUTPUT from my terminal after running

Project is running at http://localhost:8081/
webpack output is served from /
Hash: 571d202a1c658d7dbdfd
Version: webpack 2.7.0
Time: 1726ms
---
---
---
webpack: Compiled successfully.

This is from my AWS server console. Now i have to connect to that ip and port with browser.


texts: SOLVED - truffle develop command doesn't return anything

texts:
I updated my node and nvm version. Then I ran truffle develop command on my project folder, this command doesn't return anything.. why?

it just stays... local blockchain dosen't start.

Versions:

Truffle v5.1.25 (core: 5.1.25)
Solidity v0.5.16 (solc-js)
Node v14.2.0
Web3.js v1.2.1

I removed the truffle on my machine and than I installed again but I get same result.

Also truffle console command result is here:

> Something went wrong while attempting to connect to the network. Check your network configuration.

Could not connect to your Ethereum client with the following parameters:
    - host       > 127.0.0.1
    - port       > 7545
    - network_id > 5777
Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle-config.js)

Truffle v5.1.25 (core: 5.1.25)
Node v14.2.0

SOLVED:

I downgrade the truffle from 5.1.x to 5.0.x and truffle develop is ran.


texts: Ethereum block chain extracter and parser like blocksci

texts: I'm new to ethereum and I would like to develop an analyzing framework for ethereum. Is there a blockchain extractor and a parser to similar to blocksci available for ethereum and support analyzing of blockchain data.


texts: I am new to this community and I have been studying ethereum for 1 month now. I have signed up @ ethethereum.org with an abstract concept (potential prototype). I would like people to sign up on my platform to earn ether. The problem is, I don't have any either. Nor am I a miner (or interested in doing do). What other way's are there to finance a project? I do know they have the crowd funding route. Are there any others?


texts: Would it be possible to loan a cryptocurrency and get interest?

texts: Would it be  possible (future) to loan a blockchain (crypto) and get interest? (Like bank would lend money to user who needs it and gives interest to who invest?)


texts:
I get this -

  ~/blockchain/digi$ geth attach http://35.197.193.182:8506 Fatal:
  Failed to start the JavaScript console: api modules: Post
  http://35.197.193.182:8506: context deadline exceeded
  ~/blockchain/digi$ geth attach http://10.154.0.3:8506 Fatal: Failed to
  start the JavaScript console: api modules: Post
  http://10.154.0.3:8506: context deadline exceeded

I want to remotely connect to a geth node.

Here is the connection instance on the cloud server -

nohup geth --datadir node6/ --syncmode 'full' --port 30316 --rpc --rpcaddr '0.0.0.0' --rpcport 8506 --rpccorsdomain "*" --rpcapi 'personal,db,eth,net,web3,txpool,miner' --bootnodes 'enode://739f2c03c2378b1335bbdff6f8fff481339224b9bb6dccf2799a8075c450871fa40057c42c10de0703e2637514537b1a7d129177f452e9d719e7832cde55fbd7@10.154.0.2:30310' --networkid 1520 --gasprice '1' -unlock 'f39995b718ae7a0075557f9781425b92fd8b28a6' --password node6/password.txt --mine &

Any ideas about the cause and solution?

This is the netstat -

  tcp        0      0 instance-3.c.inbo:53150 instance-2.c.inbo:30315
  ESTABLISHED tcp        0      0 instance-3.c.inbo:51026
  instance-2.c.inbo:30312 ESTABLISHED tcp6       0      0 [::]:30316
  [::]:*                  LISTEN      tcp6       0      0 [::]:30317
  [::]:*                  LISTEN      tcp6       0      0 [::]:http
  [::]:*                  LISTEN      tcp6       0      0 [::]:ssh
  [::]:*                  LISTEN      tcp6       0      0 [::]:8506
  [::]:*                  LISTEN      tcp6       0      0
  instance-3.c.inbo:30317 instance-3.c.inbo:34388 ESTABLISHED udp
  0      0 *:bootpc                :
  udp        0      0 instance-3.c.inboun:ntp :
  udp        0      0 localhost:ntp           :
  udp        0      0 *:ntp                   :
  udp6       0      0 [::]:30316              [::]:*
  udp6       0      0 [::]:30317              [::]:*
  udp6       0      0 fe80::4001:aff:fe9a:ntp [::]:*
  udp6       0      0 ip6-localhost:ntp       [::]:*


texts: Metamask TestRPC shows 0 Ether while connecting to Ganache- CLI

texts:
I've gone through various Q/A(s) of the problem of ganache-cli and metamask not linking but after trying all the solutions, still doesn't work for me. As soon as I type ganache-cli in windows cmd prompt and many private keys are displayed with fake accounts.

My truffle-config.js file-

  // See <http://truffleframework.com/docs/advanced/configuration>
  // for more about customizing your Truffle configuration!
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    },
    develop: {
      port: 8545
    }
  }
};

Using metamask I/ve tried various combinations of TestRPC URL, but none of them work. Also, I've tried connecting localhost:8545 given in list, still doesn't work.

I'm tryng triffle pet shop tutorial, When the GUI opens in browser and I click on adopt, nothing happens.


texts: Unable to push struct that contains an array of structs to an array

texts:
I'm aware there are some limitations on initializing empty arrays, but I can't find a solution to this issue I'm having.

I want to push a struct to an array. But since that struct itself contains an array of other structs, I'm unable to do it.

Here's my code:

pragma solidity ^0.4.23;
pragma experimental ABIEncoderV2;

contract simpleBet {

    struct Bettor {
        address wallet;
        uint betAmount;
        uint outcome;
        uint bettingTime;
    }

    struct bettingEvent {
        string name;
        string uid;
        uint startTime;
        uint endTime;
        Bettor[] bettors;
    }

    bettingEvent[] public bettingEvents;

    constructor() public {
    }

    function createBettingEvent(string _name, string _uid, uint _startTime, uint _endTime) public {

        bettingEvent memory _bettingEvent;
        _bettingEvent.name = _name;
        _bettingEvent.uid = _uid;
        _bettingEvent.startTime = _startTime;
        _bettingEvent.endTime = _endTime;
        _bettingEvent.bettors.push(Bettor(0,0,0,0));

        bettingEvents.push(_bettingEvent);
    }

}

  TypeError: Member "push" is not available in struct simpleBet.Bettor memory[] memory outside of storage.


texts:
Studying the etherscan platform and some contracts,

-->> accounts >> contract accounts >> selecting one contract,

under Contract Code there is an option to switch between Bytecodes View and Opcodes View.

What exactly is Opcodes View here and what does it represent?

There are some keywords like PUSH1, MSTORE, MLOAD, DUP1, GAS, SUB and CALLCODE in this view that repeat frequently.

What are these and what do they do?


texts: display tokens sold on a web page and eth raised

texts: I had created an ico smart contract for which is a customer sends 1 ether to the smart contract address customer will automatically receive the tokens. I want to display ether raised, tokens sold,.. details in the front end ico webpage . how can acheive this functionality??


texts: Can block chain binary been modified to read private variables / exec internal function?

texts:
As far as I know, private variables can only be access within the contract and internal function can only be called internally.

But is there a way for hacker to modify their block chain binary (of their own block chain) so that it allows the function to be called or variables be accessed?

An analogy is like private function inside C# classes can still be invoked via reflection. But instead of using reflection, we modify the mono runtime to ignore the private keyword.

Thanks in advance


texts: Async/Await problems with web3.eth.getAccounts

texts:
I'm working on a simple Ethereum project, but since I'm not certain whether the issue I'm having is to do with Web3 or Async/Await, I decided to post this question to both Stackoverflow and Ethereum Stackexchange. I'm using javascript with Web3 for this project.

Essentially, I'm running with three async functions, one of which is meant to call the others before performing some calculations and returning the results of its efforts:

async function getFounder() {
    console.log("getFounder method");
        try{
           console.log("just before whoIsFounder");
           whoIsFounder = await promisify(RegionalContract2.getFounder);
        }catch(err) {
           console.log(err)
        }

            console.log("This Election's Founder is : " + whoIsFounder);

        return whoIsFounder;

    }

async function getCurrentAccount(){   <<<<<<The problem method
console.log("getCurrentAccount method");
currentAccount = await web3.eth.getAccounts();
return currentAccount;
}

async function isItYours(){
   try{
    console.log("Inside the isItYours method");
        currentAccount = await getCurrentAccount();
        founder = await getFounder();
        console.log("The getFounder method has resolved completely");
        console.log("founder is " + founder);
      if (founder != null){
            if (founder === currentAccount) {//if the Founder is the same as the value entered.
            alert("You are in fact the owner of this Election.");
            var x = document.getElementById("hidden");
            x.style.display = "block";
            }
            else {
            alert("You are NOT the owner of this Election. The value sent in was " + currentAccount);
            }
      }
      else {
        alert("Founder can't be null. Either you're not logged into Metamask, or your account somehow isn't linked up properly.");
      }
     }catch (err) {
        console.log(err)
     }
}
isItYours();

When I tried to run this code, however, I got the following error:

Uncaught TypeError: e is not a function
    at inpage.js:1
    at inpage.js:1
    at inpage.js:1
    at inpage.js:1
    at i (inpage.js:1)
    at inpage.js:1
    at inpage.js:1
    at u (inpage.js:1)
    at s (inpage.js:1)
    at inpage.js:1

The full console log is:

The founder is:
inpage.js:1 null "0x59a09d00eb11caa5fa70484bf4d78015d10938bc"
admin.html:340 Inside the isItYours method
admin.html:331 getCurrentAccount method
admin.html:305 getFounder method
admin.html:318 just before whoIsFounder
***the aforementioned error from the previous segment***
This Election's Founder is : 0x59a09d00eb11caa5fa70484bf4d78015d10938bc
admin.html:344 The getFounder method has resolved completely
admin.html:345 founder is 0x59a09d00eb11caa5fa70484bf4d78015d10938bc

This leads me to think that the problem lies with getCurrentAccount(), since it employs web3.eth.getAccounts(), rather than a custom method, to return its value. Does anyone know why this might be happening? Thanks.


texts: Ethereum ECR721 Create JSON to upload to IPFS

texts:
I am learing about Ethereum Smart Contract, NFT and ECR721 tokens with external Metadata.
I know that you can updload a JSON file using IPFS and _setTokerURI to keep this URI.
My question is how to create that JSON File on the fly in the App.js and how to decode to send it to IPFS.
Could you guys give me some direction of what to google to leard this? Thanks :)


texts: Are all state key-value pairs saved in a big trie?

texts:
I am learning Ethereum from yellow paper, I have some questions.

The world state is talked in the paper. It seems that there is only one world state for all accounts in the whole blockchain from genesis to latest block.

  The world state (state), is a mapping between addresses (160-bit
  identifiers) and account states (a data structure serialised as RLP,
  see Appendix B).

My understanding:
States (like nonce, balance, storage root, etc) for all accounts are saved in the same merkle patricia trie. For every new block, some of the states are changed and new header will be generated based on newly updated state node in the trie. Header hash are used to verify if the state storage latest or not.

[Q1] Is my understanding correct?
[Q2] Is "world state" in quote the same thing as state storage?

Except for state storage, there are 2 other storage: transaction trie and receipt trie. Unlike state trie, they are immutable.
[Q3] Are they, like state storage, saved in their own big tries respectively?


texts: I believe it's viewed as unsafe in Bitcoin because of the way transactions are signed. Is this also true for Ether addresses?


texts: What is the compiler version of a contract created by internal transaction?

texts:
I want to be able to verify and publish a contract source code on Etherscan.io.
I have created a new contract from a factory contract, in which I successfully published and verified.
When I come to fill the corresponding form for verifying and publishing the newly created contract on Etherscan.io, it fails.
Possibly, the reason is a mismatch in the compiler version (other fields such as the contract name are surely correct).

So, what compiler version does one use for an internal transaction which created a contract?
Should it be the same one as the one used to compile the parent (factory) contract?


texts:
I came to learn alot about benefit for proof of stake on Ethereum (staking ether); however, I'm still bit unclear about how that would be applied for ERC-20 Tokens built on top of Ethereum protocol.

Lets assume I have built token called HAPI on Ethereum,

1) Who is responsible to validate transactions that happen between HAPI?

2) Is validation done by the Ethereum protocol, thus using Ether to do so?

3) If that is the case, is there such thing as "staking tokens" for HAPI? is there incentive for HAPI holders to stake their tokens?

4) I've read some article where staking token means, when you stake your token and that token is converted into Ether and is available for staking. If this is true, will the price of HAPI fall if alot of people decide to stake HAPI because HAPI is being converted to Ether to stake?


texts:
I'm trying to understand the winning contract from the Underhanded Solidity Contest.

That contract apparently caused an overflow in the ABI decoder, but I'm having a hard time understanding where in the "stack" (not literal stack, but where in the technologies that comprise Ethereum) the overflow occurred.

From reading the docs and this answer I get that the ABI is not a part of the core ethereum protocol defined in the yellow paper, but my question is this:

What takes:

     0x69f30401
     "00000000000000000000000000000000000000000000000000000000cafebabe"
     "0000000000000000000000000000000000000000000000000000000000000060"
     "00000000000000000000000000000000000000000000000000000000000000A0"
     "F000000000000000000000000000000000000000000000000000000000000001"
     "0000000000000000000000000000000000000000000000000000000000000003"
     "F000000000000000000000000000000000000000000000000000000000000001"
     "0000000000000000000000000000000000000000000000000de0b6b3a7640000"

Decodes it, and executes it on the EVM? Do transactions themselves contain the above^? How then is that not a part of the core ethereum protocol? I don't understand how you get from ABI to EVM instructions being executed and what code is doing the executing.

If the exploit relies on Solidity decoding the ABI and causing an overflow, does that mean all mining nodes are running Solidity? How can that be?

My mental model seems to be missing something fundamental here. Diagrams are appreciated if you have the time, thanks!


texts: What does 'startingBlock` mean in `eth.syncing`

texts:
First time geth user here. I'm trying to do some analysis on transactions on the mainnet and for that I need all the blocks since the beginning of time. When I just ran geth with no parameters, it looks like it is starting from only block 3280013 but I want it to start from block 1:

EDIT: I am looking for clarification of what startingBlock means, not how to download the whole blockchain and how --fast helps. This is not a duplicate.

Will it still work and will I get block data from the beginning of time?

Thanks!


texts: Remove Ethereum wallet from Mac downloaded from GitHub

texts:
I'm looking to remove the Ethereum wallet I downloaded off of GitHub, from my Mac: https://github.com/ethereum/mist/releases ...

I've pulled in the application to AppCleaner, in hopes that it would find all associated files, but it only adds up to 250MB - I was hoping the blockchain was detected by AppCleaner as i guess it takes up a large chunk of space?

How do I go about?

Some posts I've found direct to $HOME/Library/Ethereum ... but I can't find this folder...

Please help? :-)


texts:
If we stored an array of millions of objects in the blockchain and then added a getter and kept requesting the data wouldn't that overload the blockchain? Or the node that we're connecting to?

These queries don't require Gas so I'm wondering what stops this from happening? Why don't getter functions need gas? They may be doing some complicated logic still or returning a lot of data.