texts:
could anybody provide request to transfer some funds from one account to another, like this, but with sending some ether:
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x712D30137644ca2a37BD0384CF0d881BB3aCbB31", "latest"],"id":1}' https://ropsten.infura.io/token
Thanks!


texts: How to force geth to use ipv4 instead of ipv6

texts:
I'm trying to configure geth on Redhat7 and facing an issue while connecting nodes from the two servers.
There are three validator nodes on each machines and ports(30303, 30304, 30305) are allowed. But when I check peerCounts, it's showing 2 instead of 5.
I'm connecting these nodes using static-nodes.json file.
After checking port details, I found that geth uses ipv6 address. In order to check the actual issue. I want to make it to run with ipv4

Is there any way to force geth to use ipv4?


texts:
I am getting this error when deploying Goerli's Medalla Beacon Contract through Remix.
execution reverted: DepositContract: reconstructed DepositData does not match supplied deposit_data_root

input (web3)
pubkey: 0x94a61e90d697a287c31d389d2389aff2523a3e677949810381f3e485d79eb07150463f2c2b2796f744874e4810e3e778
withdrawal_credentials: 0x0045fe3422a0c68e6192a3782850334ed9fe162212a9f888c31aaa67c8d34e7b
signature: 0x81c0e6d9953ba76c1d0c27162e98576019e702fd94b27269791fcf30d0afc371acc9385444cfe82dbc2b50612b1ae20416d17fa1360151209a09d66f5b615f84f0a701fe60d668d0ef4fabcb815c4fe95855c242edaa02bf5f5f9a3d7b7cc87f
deposit_data_root: 0x2467b379933a366aa89584578cfd63434769a07bec11a347a207f70862fa1a92

The tx: https://goerli.etherscan.io/tx/0x2f9118dafa84846768dcac5d66fea223729bbc22799e787f511774dfe437d211
Contract: https://goerli.etherscan.io/address/0x07b39f4fde4a38bace212b546dac87c58dfe3fdc#code
Any idea? thank you in advance


texts: Account is locked. How to unlock it using json-rpc?

texts:
When trying to send a transaction through json-rpc interface on a geth node (version 1.4.10-stable-5f55d95a, running on testnet) using eth_sendTransaction I got this error message:

  -32000 [message] => account is locked

I have tried to unlock the account using the following command:

geth --testnet --exec "personal.unlockAccount(eth.accounts[0], password, 3600)" attach true http://localhost:8545

But I get another error:

  Fatal: Unable to attach to remote geth: invalid endpoint

Trying to unlock as explained in how to unlock the account with geth?

geth --testnet --unlock 0x3b877e80b... --password password

throws this error too:

  Fatal: Could not open database: resource temporarily unavailable

Another option to unlock account according to previous URL is using the Geth interactive Javascript console. But how do I launch such console?

I've seen someone is having same problem on code -32000 message: account is locked but any command of the kind

geth --unlock

is not working on my geth node.

Is it possible to unlock accounts directly through json-rpc interface anyhow?

Why geth is not allowing me to unlock my ethereum account? Why "invalid endpoint"?


texts: What are best practices for serving a DApp over HTTPS, connecting to an Ethereum node using JSON RPC / web3.js, which by default uses HTTP?

texts:
Summary: we're serving an Ethereum DApp from a webserver through HTTPS. The DApp connects to an Ethereum node through JSON RPC using web3.js, which uses HTTP (not HTTPS). How to deal with this in a good way?

It's good practice to serve web content over HTTPS, so our app is served from e.g. https://myhost/. Browsers enforce the HTTPS practice to such an extent that when a site/app is served over HTTPS, the browser requires that any further connections made by the app (including XMLHTTPRequests as done by web3.js) are also loaded over HTTPS.

Hence when the app is served over HTTPS, the browser blocks the calls to the Ethereum node (which are always HTTP) because of a "mixed content" error. Tested this on latest Chrome/Windows, but I imagine other browsers would give the same result. Basically it's a good thing that the browser does this.

As far as I know, the current Ethereum implementations have no functionality for serving the JSON RPC endpoint through HTTPS. Hence it could be worked around by wrapping the JSON RPC connection in HTTPS, e.g. by creating a small Node.js service.

What I want to know is how do others deal with this situation, and is there perhaps a simpler solution than the suggested workaround that I overlooked?

Example "Mixed content" error message:

Mixed Content: The page at 'https://myhost/user/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://blockchain:8101/'. This request has been blocked; the content must be served over HTTPS.
HttpProvider.send @ httpprovider.js:77
finishedWithRewrite @ hooked-web3-provider.js:72
rewritePayloads @ hooked-web3-provider.js:107
next @ hooked-web3-provider.js:117
rewritePayloads @ hooked-web3-provider.js:122
send @ hooked-web3-provider.js:75
RequestManager.send @ requestmanager.js:73
Method.send @ method.js:168
SolidityFunction.call @ function.js:112
SolidityFunction.execute @ function.js:212
(anonymous function) @ VM6322:2
InjectedScript._evaluateOn @ VM6122:875
InjectedScript._evaluateAndWrap @ VM6122:808
InjectedScript.evaluate @ VM6122:664

To web3.js this presents itself as a connection error:

Uncaught Error: CONNECTION ERROR: Couldn't connect to node http://blockchain:8101, is it running?
at Object.module.exports.InvalidConnection (https://myhost/vendors/web3/dist/web3.js:3051:16)
at HookedWeb3Provider.HttpProvider.send (https://myhost/vendors/web3/dist/web3.js:4119:22)
at finishedWithRewrite (https://myhost/js/lib/hooked-web3-provider.js:72:91)
at HookedWeb3Provider.rewritePayloads (https://myhost/js/lib/hooked-web3-provider.js:107:18)
at next (https://myhost/js/lib/hooked-web3-provider.js:117:25)
at HookedWeb3Provider.rewritePayloads (https://myhost/js/lib/hooked-web3-provider.js:122:18)
at HookedWeb3Provider.send (https://myhost/js/lib/hooked-web3-provider.js:75:21)
at RequestManager.send (https://myhost/vendors/web3/dist/web3.js:5757:32)
at Method.send (https://myhost/vendors/web3/dist/web3.js:4898:59)
at SolidityFunction.call (https://myhost/vendors/web3/dist/web3.js:3915:31)

Note that I'm using a HookedWeb3Provider, but as the way the web3.js connects to the node is identical I don't expect that to make any difference.

Currently using web3.js 0.13.0.


texts:
Is that possible to develop a own ethereum wallet without metamask that should connect to main ethereum network. Just like in blockchain.info user clicks the account by just giving email address and password an account will be created in the backend and wallet address will send to the email address.
To access my accounts from metamask i am writing this code.

    const provider = new HDWalletProvider(
  '12 mnemonics',
  'https://rinkeby.infura.io/authid',
);
const web3 = new Web3(provider);
const accounts = await web3.eth.getAccounts();

  console.log('Attempting to deploy contract from ', accounts[1]);

Got the answer for my first question 12 mnemonics but

how do i call a payable function which is written in solidity without metamask? I have created new question here How to make transactions without metamask


texts: Does ethereum support something like bip32 extended public key?

texts:
Bitcoin and Litecoin have something called XPUB key or Extended Public Key that essentially allows to track all generated public addresses, so think monitor your total balance in one key.

I was trying to see if ethereum has something like this?


texts: creating a private boot node based on geth

texts:
I am trying to create a boot node for my private network, I followed a tutorial which led me to generating a boot.key and run

bootnode -nodekey boot.key -verbosity 9  --addr :30301
It is supposed to output enode url like this :

INFO [02-07|22:44:09] UDP listener up
self=enode://3ec4fef2d726c2c01f16f0a0030f15dd5a81e274067af2b2157cafbf76aa79fa9c0be52c6664e80cc5b08162ede53279bd70ee10d024fe86613b0b09e1106c40@[::]:30310

But what happened is that I don't get that and I only get something like this :
INFO [12-05|11:53:34.678] New local node record  seq=1 id=azeadad ip=<nil> udp=0 tcp =0

Am I doing something wrong ?


texts: Is the blockchain compatible between Geth and OpenEthereum(Parity)?

texts:
I'm trying to set up a full node. Being a DeGoogler I instinctively avoid Go, so I defaulted to OpenEthereum. After compiling on my maching I get 'Illegal Instruction', which seems to be because of my old processor and its lack of AESNI which is compiled as 'on'. WIP...

Meanwhile, I figured that 'the Etherum blockchain IS the Etherum blockchain' so I created a geth vm to let the syncing begin. While doing some reading on advanced configuration I stumbled upon this article which states that the blockchain is a DIFFERENT SIZE between geth and parity nodes. WTF?! Shouldn't the blockchain be identical?

Upon reflection it makes sense that the same data can be represented on disk in multiple ways... It just never occurred to me that during the parallel development of blockchain projects like geth/parity that the format would be divergent.

Does anyone have any experience with this? Has anyone migrated their node from geth to parity/openetherum? If so, is it as simple as copying the chainstate directory and resyncing as I had hoped?


texts: Smart contract update every 60 seconds with Oraclize

texts:
I am trying to create a smart contract using geth and ethereum-bridge (Oraclize) on a private network. I want to know the number of visits to a youtube video.
The first time it works correctly but I would like it to extract the number of visits every 60 seconds and the contract will be automatically updated.

How can I do this?

Thanks !!


texts: Update struct from function only if parameters exists

texts:
What's the appropriate way to update a struct via a function only if the parameters exist? For example

struct MyStruct {
  bytes32 someThing
  bytes32 someOtherThing
}

function updateStruct(bytes32 someThing, bytes32 someOtherThing) public {
  // get struct
  if (someThing) {
    struct.someThing = someThing;
  }
  if(someOtherThing) {
    struct.someOtherThing;
  }
}

I only want to update the fields of the struct if the argument is passed into the function. If it's null or undefined I don't want to update the struct with that value.


texts: web3 got duplicate events and make data in server different from blockchain

texts:
I use web3j to listen ethereum smart contract events to synchronize data for the server, but sometimes I got duplicate events in one function.
Let's consider Birth evens in CryptoKitties smart contract, if there is only one kitty given birth and should only trigger one Birth event, but  on my web3 server which is listening to my local geth node, sometimes got 2 or 3 Birth events, with different kitty data (genes, owner , birthtime ...).
I know the issue is caused by the uncle blocks, but I really want a solution so that my server can synchronize exactly same data as the blockchain,  what should I do?
Thank  you  in advance!


texts: Do we have to have a fallback function in our smart contract?

texts:
I have a smart contract that has only one payable function and one that pays, as follows:

contract DAO_Test{
// define something
   function buyToken() payable external returns(bool){
    uint amount = (precision*msg.value)/exchange_Rate;
    token_balances[msg.sender] += amount/1000000000000000000;
    ether_balances[msg.sender] += msg.value/1000000000000000000;
    Deposit(msg.sender, msg.value);
    return true;
    }

   function send_funding (bytes2 proposal_id) internal  returns (bool){
    uint indx = find_proposal_indx (proposal_id);
    Proposal temp;
    temp = proposals[indx];
    if (final_result[indx]){
    temp.recipient.transfer(temp.target_val*1000000000000000000);
}
}

Question 1: Do I need to have a

  function() payable(){}

in my contract?

Question 2: In general, why do we need to have a fallback function?

I'm aware that fall back functions are for the case where the function called does not match the functions defined in the contract. Or when the callers use "send" or "call" methods to pay the contract. I think, it's good not to have fallback function in our contract, because we force the caller to follow the rules (e.g. properly call the functions and use "transfer" to send money to the contract).


texts: Ethereum Smart Contract with Custom Fee and Percentage of the collected Fee Distrusted token holder

texts:
I wanted to know is there a possibility to create a smart contract for a token wherein the transaction fee could be overridden with the network fee and the fee collected on the transaction can be defined. The same collected fee can be redistributed to the token holders in the smart contract.

I have been studying on this and found a smart contract called XITO which claims the same but when I read through their smart contract it does not provide any such logic in it.

http://www.xito.network/
https://ropsten.etherscan.io/address/0xb286a0c8375b5b310e76b186ed7aa222a1d943bc#code

In case this could be done through any another blockchain request you to please help me to guide with the right technology.

Thank you in advance for your help.


texts: Send all Tokens and Eth to a Address automatically

texts:
I have few child wallets and a parent wallet.
Whenever these child wallets get incoming ERC20 tokens or ETH. I want to send them automatically to the parent wallet.

I know I can do below to send the entire eth balance.

beneficiary.transfer(this.balance);

How can I do it for erc20 tokens.

Thanks in advance.


texts: removing standalone geth client from Mac OS X

texts: I have a stand alone geth client on Macbook pro which starts automatically, I want to delete the client so the ethereum wallet can always run without fighting with geth to shut down.


texts:
Need a way to open Geth publicly, but don't want to expose all eth methods. Need only eth.call.

Using --rpcapi eth will expose all eth methods.
How to expose only particular one?


texts: How can you make HTML Text Box print the value of console.log?

texts:
How can I enter input data value in HTML Text Box?

The output is good in console.log, but the HTML Text Box displays the error Object Promise.

I want to know how to print the value of web3.eth.getTransactionFromBlock(blocknumber).input into the Html Text box. Please help me.
These are the source code I have tried many times, but failed.
var transaction = web3.eth.getTransactionFromBlock(1865, 0).then(function (tx) {
        console.log(tx.input)
    });

tto_count.value = transaction;

web3.eth.getCoinbase(
    function (a, coinbase) {
    a = (async() => {
        await web3.eth.getTransactionFromBlock(1688, 0, console.log)
    })()
    document.getElementById("transaction").append("transaction input data  : " + web3.eth.getTransactionFromBlock(1688, 0) + "\n");
    cb = coinbase;
});


texts: How to brute force decrypt wallet password ?

texts:
I have forgot my wallet password, but have an idea what it could be. I need to put a script together to try a long list of possible password.

What is the command to use for that, if I am to put it in bash or pythong script ? or is there a tool to use ?

This tools did not works, looks like it is outdated.
https://github.com/burjorjee/pyethrecover


texts:
I want to know how to instantiate an existing contract deployed on the blockchain using its address.
e.g:

contract A {
    function f1()
    {}
}

A is deployed on the blockchain, and in contract B I want to call the function f1() and get its return.
e.g:

contract B {
    address contrac_A=0x123456;

    //call f1 from A
}

How should I call it using the address of A?


texts: Are state variables copied during inheritance?

texts:
I am testing. Looks to me like state variables are copied during inheritance.

Also when I use new, I am unsure what happens to state variables.

I have d13 state as car - bool. It is updated by d13. When I update using d12 I do not have a new state definition in d12 but it looks like a new state variable is defined in d12 (see storage display).

When I use d14, it looks like another new state variable is defined but I cannot even find that one.

Does anyone know how state variables are inherited and held in storage? What is the point of a design which copies the state variable definition into the new contract?

Code -

contract d13 {
    bool public car;
    function setCar() public returns (bool) {
        car=true;
        return car;
    }

    function removeCar() public returns (bool) {
        car=false;
        return car;
    }
    function showMemory() pure returns (uint) {
        uint ms;
        assembly {
           ms := msize()
        }
        return ms;
    }
}

contract d12 is d13 {
    function isCar() public view returns (bool) {
        return car;
    }

    function newCar() public {
        car=true;
    }

    function oldCar() public {
        car=false;
    }
    function showMemory() pure returns (uint) {
        uint ms;
        assembly {
           ms := msize()
        }
        return ms;
    }
}

contract d14 {
    function isCar() view returns (bool) {
        return (new d13()).car();
    }

    function setCar() returns (bool) {
        d13 d13instance = new d13();
        d13instance.setCar();
        return (d13instance.car());
    }
    function showMemory() pure returns (uint) {
        uint ms;
        assembly {
           ms := msize()
        }
        return ms;
    }

}

Geth -

> eth.getStorageAt(d13con.address,0)
"0x0000000000000000000000000000000000000000000000000000000000000001"
> d13con.car()
true
> d13con.removeCar()
"0x01973e61dbbf3b44994b016122afc1bd6d94ab2476042aed8902eeca01b6ed80"
> d13con.car()
false
> d12con.isCar()
true
> d12con.oldCar()
"0x09bebed58d84621ac18ae6820634f7678be7b8514dd029b5685ec514f552342d"
> eth.pendingTransactions.length
1
> eth.pendingTransactions.length
1
> eth.pendingTransactions.length
0
> d12con.isCar()
false
> eth.getStorageAt(d13con.address,0)
"0x0000000000000000000000000000000000000000000000000000000000000000"
> d13con.setCar()
"0x9b425c7640c06dc8faf66976ba07ef53c7d8a2a8c362ae75756192c78076a65c"
> eth.pendingTransactions.length
0
> d13con.car()
true
> d12con.isCar()
false
> eth.getStorageAt(d12con.address,0)
"0x0000000000000000000000000000000000000000000000000000000000000000"
> d12con.newCar()
"0x300d0c641711436bc60add13b7e101e8acc22305704de4a16bd466db61dce37a"
> d12con.isCar()
false
> eth.pendingTransactions.length
0
> eth.getStorageAt(d12con.address,0)
"0x0000000000000000000000000000000000000000000000000000000000000001"
> d12con.isCar()
true
> eth.getStorageAt(d13con.address,0)
"0x0000000000000000000000000000000000000000000000000000000000000001"
> d14con.isCar()
false
> eth.getStorageAt(d14con.address,0)
"0x0000000000000000000000000000000000000000000000000000000000000000"
> d14con.setCar()
"0x71a896c7822a0413d64df03e96fdce1e77f61425e3a86124948dc99cda2718f6"
> eth.pendingTransactions.length
0
> d14con.isCar()
false
> eth.getStorageAt(d14con.address,0)
"0x0000000000000000000000000000000000000000000000000000000000000000"

I set a contract instance as d12con etc for d12.


texts: which port I use when I want to connect remix to my local quorum network?

texts:
I want to deploy a smart contract on my local network. I executed a local node via

   PRIVATE_CONFIG=ignore nohup geth --datadir ./Node1/new-
   node-1
   --nodiscover --verbosity 5 --networkid 31337 --raft --
   raftport 51001 --rpc --rpcaddr 0.0.0.0 --rpcport 22101 --
   rpcapi
   admin,db,eth,debug,miner,net,shh,txpool,personal,web3,
   quorum,raft --emitcheckpoints --port 21101 2>>node1.log &

I have to use localhost:\127.0.0.1:21101 or 22101? I want to know the difference betwwen the two ports and what are used for?

An other question if you don't mind: When i use the port 21101, it fails to connect and when I consult the node log I find :

    Failed RLPx handshake addr=[::1]:42552  conn=inbound
    err="read tcp [::1]:21102->[::1]:42552:  i/o timeout"


texts: Truffle-contract installed, but receiving error in Chrome console: Uncaught Error: Cannot find module 'truffle-contract'

texts:
I am working on my first end to end ethereum project. A problem that I am stuck on is that I have installed 'truffle-contract', but when I run my server and open the project in the Chrome browser, the console is reporting:

Uncaught Error: Cannot find module 'truffle-contract'
at s (_prelude.js:1)
at s (_prelude.js:1)
at splitter.js:1

My node_modules is showing the 'truffle-contract'.
Package.json is showing it as well:

  "dependencies": {
"truffle-contract": "^3.0.6"
}

In my app folder, I have a 'splitter.js' file which has the require of truffle-contract:

var contract = require("truffle-contract");
const splitterJson = require("../build/contracts/Splitter.json");
const Splitter = contract(splitterJson);

It is showing tripple dots under the first double quote of "truffle-contract", which shows the following when hovered over:

Could not find a declaration file for module 'truffle-contract'.
'/home/richard/workspace/Splitter/node_modules/truffle-
contract/index.js' implicitly has an 'any' type.
Try `npm install @types/truffle-contract` if it exists or add a new
declaration (.d.ts) file containing `declare module 'truffle-
contract';`ts(7016)
module "/home/richard/workspace/Splitter/node_modules/truffle-
contract/index"

Installing with @types didn't make a difference. The path specified is correct.

I have removed node_modules and ran 'npm init', 'npm install truffle-contract' and 'npm install' from fresh, but it made no difference.

Any suggestions as to why it can't find module?


texts: How to Re-Deploy a Contract to Ropsten using Truffle?

texts:
I've deployed my initial contract: My Token on Ropsten.

But I noticed that I've made a mistake, and I would like to make some changes on my smart contract. What is a common development workflow for this? Doesn't seem like I could "re-deploy" it:

➜  LYKECOIN git:(master) ✗ truffle deploy --network ropsten
Using network 'ropsten'.

Network up to date.
➜  LYKECOIN git:(master) ✗

I want to re-create an entirely new smart contract in Ropsten, not updating the last one.


texts:
I have some questions using geth.

Currently I am using the following version of geth.

Geth
Version: 1.8.20-stable
Git Commit: 24d727b6d6e2c0cde222fa12155c4a6db5caaf2e
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10.4
Operating System: linux
GOPATH =
GOROOT = / usr / lib / go-1.10

When you run geth, the memory usage grows slightly to over 90%. Is this symptom normal?
The difference between the current block of ethereum and the current block of the ether node I have is not reduced to less than 30,000. Is this symptom normal?

{
  currentBlock: 6935214,
  highestBlock: 6965271,
  knownStates: 249970684,
  pulledStates: 249970684,
  startingBlock: 6958744
}

Here is the hardware specification of the Ethereum node I currently have.

grep -c processor / proc / cpuinfo
 - 8
grep ^ processor / proc / cpuinfo | wc -l
 - 8
grep 'cpu cores' / proc / cpuinfo | tail -1
 - cpu cores: 4

cat / proc / meminfo | grep Mem
MemTotal: 8133180 kB
MemFree: 2843816 kB
MemAvailable: 3533660 kB

geth CLI Options are as follows.

--maxpeers 50 --maxpendpeers 25 --cache = 2048 --syncmode "fast" --rpc --rpcport "8545" --rpcaddr "000.000.000.000" --rpccorsdomain " net, web3, personal, admin "--datadir / home / hdd / block_data / eth_data


texts: How does a Proxy contract communicate with the underlying Implementation?

texts:
When a user interacts with a proxy contract, they send a transaction signed by themselves to that proxy. My question is, how is that transaction communicated to the underlying implementation contract? Does the proxy send another transaction to it, and if yes, who is that signed by? Or is it a relationship more like the proxy contract inheriting from the implementation?
If you could also provide the source of your answer it would be very appreciated, thanks for any input.


texts: Is sending some datas in the data field safe?

texts:
An airdrop ask to send it 0ETH with 150000 GAS and some datas in DATA field.
Is it safe?
What could be the aim of this transaction?
Thanks.


texts: can't get my ethereum out of my geth coinbase, why?

texts:
So I have 5 ETH stuck in my geth coinbase. Can't seem to get them out anyway I try (my ethereum wallet is not fully syncronized, and at around 80% and it went back again to 0%). I'm afraid to close my geth rpc window because I lost my first 5 eth when I did this a month ago. I tried updating my account,I tried export, and other things, but it does not seem to work anyway. How can i get those ethereums out of there? Do I have to fully sync to the blockchain?
Here's an error message I get when I tell geth to send the Transaction:
Error: exceeds block gas limit
    at web3.js:3104:20
    at web3.js:6191:15
    at web3.js:5004:36
    at :1:1

Please help and Thank you in advanced.


texts:
System Information:

Geth Version: iGeth/v1.7.2-stable/darwin-amd64/go1.9

OS & Version: iOS 11.0

Expected behaviour:

Expecting syncProgress(context) method of GethEthereumClient to return a new GethSyncProgress instance.

Actual behaviour:

The syncProgress is nil. It returns syncProgress sometimes after some app restarts.

Steps to reproduce the behaviour:

First I start Node:

fileprivate func startNode() throws {
    var error: NSError?
    let bootNodes = GethNewEnodesEmpty()
    bootNodes?.append(GethNewEnode(Constants.Ethereum.enodeRawUrl, &error))

    let genesisPath = Bundle.main.path(forResource: "rinkeby", ofType: "json")
    let genesis = try! String(contentsOfFile: genesisPath!, encoding: String.Encoding.utf8)

    let config = GethNewNodeConfig()
    config?.setBootstrapNodes(bootNodes)
    config?.setEthereumGenesis(genesis)
    config?.setEthereumNetworkID(4)

    let datadir = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
    ethereumNode = GethNewNode(datadir, config, &error)

    try ethereumNode.start()

    if let error = error {
        throw EthereumError.nodeStartFailed(error: error)
    }
}

Then try to check sync progress:

fileprivate func startSync() throws {
    if let syncProgress = try? self.ethereumNode.getEthereumClient().syncProgress(self.ethereumContext) {
        self.isSyncMode = true
    } else if self.isSyncMode {
        self.isSyncMode = false
    }
}


texts:
System information

Geth version: geth the newest (updated today) version
OS & Version: Ubuntu
Commit hash : (if develop)

Expected behaviour

I expect, that machine connect Solidity with GETH, and i will deploy new Smart Token.

Actual behaviour

I was using 3 instructions from Internet, but still cant connect Solidity with ETH. Maybe there is another method to deploy smart contract without use admin.setSolc("path/to/solc")? When i type this command in geth console i have response that "setSolc is not a command".

Steps to reproduce the behaviour

Just try use admin.setSolc("path/to/your/solc") in geth console.


texts: Modeling language for Block-Chain-Oriented Systems

texts: Any ideas about how do i use graphic models for representations. Should i follow UML diagrams style?


texts: Calculate Mining Time of a Block for a Given Hash Rate

texts:
In my laptop i've a graphic card that has more or less 10Mh/s rate for ethereum (Nvidia Geforce GTX 950M)

From the following link i've found a formula that gives me a 1.57 day for find a block.

The link --> How can I calculate the average time to mine a block?

Instead from the tool from etherscan.io I get a result of more o less 345 days.

Which is the right formula to extimate the time for me to find a block?

If can be usefull, I will use geth


texts: Do send raw transactions consume extra gas as opposed to a send transaction

texts:
I would assume the portion of verifying the signature consumes gas. I'm asking this because it seems infura does not handle signed transactions and I have a getBalance Call that is failing.

I would assume getBalance, firstly, is a call so this isn't relevant.
Irrespective, Do raw transactions consume extra gas opposed to a regular transaction?


texts: How exchanges manage their wallets for users, and where can i find info regarding

texts:
I am developing a platform where average users can easily trade Cryptocurrency.
I would like to know how exchanges are managing wallets. where they provide a depositing address to each user for each coin.

I have spoken with BitGo and they provide wallet management service for FinTech startups. But they only support

BTC
ETH (not all other ERC20 Token)
LTC
XRP

I would like to be able to receive other coins, such as

TRX
ADA
OMG
and other coins.

Where can i find the info that states which coins are supported by which wallet such as ERC20 or NEO or etc.

Thanks,


texts:
I forked SAFEMOON a few times but I’m having the same issue over and over. FYI I have the PancakeSwap Router v2 hardcoded into the contract the the problem should not stem from that.
Essentially, when I add LP, people can trade the token freely and everything works. However when I try to remove from the LP (or if anyone tries to add more to the LP), the token stops working. This means nobody can withdraw LP, or trade the token. LP withdrawal gets stuck as the “Confirm” button on the final stage doesn’t do anything, and swaps are met with:
“The transaction cannot succeed due to error: TransferHelper: TRANSFER_FROM_FAILED. This is probably an issue with one of the tokens you are swapping.”
After calling setSwapAndLiquify(false) on the contract, it is possible to withdraw from the LP and the token is able to be swapped (however, this literally removes the automatic 5% LP tax which is counterproductive). Setting it to true again throws the same errors as previously.
I’ve tried numerous contracts with different size LP pools etc, but the error is the same constantly.
Me removing LP:
https://bscscan.com/token/0x6160bC4714245B7e5a2c5AE10a147680b2EB9Ec0
My friend adding LP:
https://bscscan.com/token/0x045A44103A89D9CEB73B3EA9c02cE5fEd5c273d7
I honestly cannot figure out why this may be happening and can’t run the risk of someone else adding liquidity to the token and stopping it from working.
Thank you in advance


texts: Token receipt handler in smart contracts with Solidity

texts:
Is it possible to define a handler which is executed every time when tokens are transferred to a contract? I.e. something like an unnamed function for Ether but for user tokens:

function() public payable {
    // handle ETH
}


texts: Initial ERC20 Token supply split into 2 or more hardcoded addresses

texts:
don't know if someone can help me, but let me explain my problem.
For more transparency in my ERC20 token generation smart contract, I want to hardcode the Team Pool (0xA) and Crowdfunding Pool (0xB) with allocation amounts, just as example.

constructor() public {
    symbol = "STT";
    name = "Sample Token";
    decimals = 18;

    totalSupply_ = 500000000 * (10 ** uint256(decimals));
    // Now we need to split the total supply into 2 hardcoded addresses
}

//my pseudo code idea
function allocate() public {
    allocations[0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] = 250000000 * (10 ** uint256(decimals));
    allocations[0xBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB] = 250000000 * (10 ** uint256(decimals));
}

Means that after deployment the total supply will be distributed to two ethereum addresses.

Can someone guide me, please and how the amounts are send while deployment. ?
The rest of the code is based on https://github.com/OpenZeppelin/openzeppelin-solidity BasicToken without mint or burn

Thanks in advance

Cheers

contract SampleToken is PausableToken {
    string public constant name = "Sample Token";
    string public constant symbol = "STT";
    uint256 public constant decimals = 18;

    mapping (address => uint256) freezes;

    /* This notifies clients about the amount burnt */
    event Burn(address indexed from, uint256 value);

    /* This notifies clients about the amount frozen */
    event Freeze(address indexed from, uint256 value);

    /* This notifies clients about the amount unfrozen */
    event Unfreeze(address indexed from, uint256 value);

    constructor() public {
        totalSupply_ = 500000000 * (10 ** uint256(decimals));
        balances[msg.sender] = totalSupply_;
        // we need to split the total supply to two or more addresses
    }

    function freezeOf(address _owner) public view returns (uint256) {
        return freezes[_owner];
    }

    function burn(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);

        balances[msg.sender] = balances[msg.sender].sub(_value);
        totalSupply_ = totalSupply_.sub(_value);
        emit Burn(msg.sender, _value);
        return true;
    }

    function freeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= balances[msg.sender]);

        balances[msg.sender] = balances[msg.sender].sub(_value);
        freezes[msg.sender] = freezes[msg.sender].add(_value);
        emit Freeze(msg.sender, _value);
        return true;
    }

    function unfreeze(uint256 _value) whenNotPaused public returns (bool) {
        require(_value <= freezes[msg.sender]);

        freezes[msg.sender] = freezes[msg.sender].sub(_value);
        balances[msg.sender] = balances[msg.sender].add(_value);
        emit Unfreeze(msg.sender, _value);
        return true;
    }

    /**
    * @dev Allows the current owner to transfer control of the contract to a newOwner.
    * @param newOwner The address to transfer ownership to.
    */
    function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
        super.transferOwnership(newOwner);
    }

    /**
    * The fallback function.
    */
    function() payable external {
        revert();
    }
}


texts: Is there a tool to obfuscate my transactions history by funneling it through a bunch of addresses I control?

texts:
I occasionally gift ETH to friends and family and I'd like a bit of financial privacy after gifting them. I understand this method is not fool proof to find out the source of funds, but at least it defeats nosy individuals looking at how much ETH I have and who I'm paying by just visiting a block explorer page.

I usually funnel my ETH through another account before I send it to them. I do this manually which can get time consuming. Is there a tool that does this for me automatically?


texts: Create our own field with transaction data in privatenet

texts: I know we have 'data' field to add any comments but is it possible to add our own field based on the application ie; a field like 'purchased products' which will have purchased products of a user along with transaction data in privatenet?


texts: How many transactions are there in a block?

texts:
If a block acts as a ledger of transactions, how many transactions can fit in a block?

I have to setup a private test net where only one machine is allowed to mine while (many) others are performing transactions on its blockchain (the miner also sets up the genesis block). What happens if the number of transactions exceeds the maximum allowed number of transactions in a block?


texts: Create a large number of contracts with different addresses

texts:
I'm developing a performance test where I check the time a gateway spends to find a contract in a blockchain. I'm using ganache-cli to simulate the blockchain, my doubts are:

1) Is it possible to generate 100 contracts at one time using the truffle? Should each of these contracts have a different name or can all have the same name?

2) When I use the truffle migrate command I can get the addresses of each contract in the terminal that is running ganache. How do I use web3js to get the contract that I know the addresses?


texts:
I have read all over the internet the past 2 days and i still can not get Mist to work with a geth private chain

I am running

geth --dev

then opening mist and getting this error

I have read the geth documentation about what all the flags do. i have tried doing this with multiple flags but still cannot get it to connect


texts: Which ethereum wallets support bip39 with optional passphrase?

texts:
The hardware wallets, e.g., Trezor and Ledger, support bip39 with an optional passphrase.  In theory, since bip39 is a standard, you should be able to recover these hardware wallets to any ethereum wallet, but I am having difficulty finding software wallets that support the optional passphrase.

Which wallet generators allow you to specify an optional passphrase when generating the mnemonic seed?
Which wallet programs allow you to import bip39 mnemonic seeds with a passphrase?
If I already have an address I'm happy with, is there a tool that can show me what the corresponding mnemonic seed would be that, when combined with a given passphrase, would yield my current address?


texts:
I'm starting with Solidity and Smart Contracts, and the static analysis in Remix is complaining about gas infinity for the function bet:
contract Forecast {

    struct Bet {
        address payable owner;
        uint price;
    }

    // the bets
    mapping(uint => Bet) bets;

    // number of bets
    uint public betCount;

    //bet value
    uint public betValue;

    // Amount accumulated
    uint public accPot;

    /// Not enough funds to bet
    error NotEnoughFunds();

    constructor (uint _betValue) {
        betValue = _betValue;
    }

    function bet(uint price) public payable {

        if (betValue > msg.value)
            revert NotEnoughFunds();

        bets[betCount++] = Bet(payable(msg.sender), price);
        accPot += msg.value;
    }
}

Test:
pragma solidity >=0.4.22 <0.9.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "remix_accounts.sol";
import "../contracts/Forecast.sol";

// File name has to end with '_test.sol', this file can contain more than one testSuite contracts
contract testSuite {

    Forecast forecast;

    function beforeAll() public {
        forecast = new Forecast(42);
    }

    /// #sender: account-1
    /// #value: 42
    function testBet() public payable {
        Assert.equal(forecast.betValue(), 42, "Bet value should be 42");
        Assert.equal(forecast.accPot(), 0, "Accumulated pot should start at 0");
        Assert.equal(forecast.betCount(), 0, "Bet count should start at 0");
        Assert.equal(msg.value, 42, "Msg value should be 42");

        forecast.bet(42);

        Assert.equal(forecast.betCount(), 1, "Bet count should be 1");
        Assert.equal(forecast.accPot(), 42, "Accumulated pot should be 42");
    }
}

In fact, when I run a test I get the error:

✘ Test bet
Error Message:
"Transaction has been reverted by the EVM: { "transactionHash": "0x2bd817dc53af5b2bf6cf5bba53207bf462283a8a229b5d66b3e5eae1f28fcc65", "transactionIndex": 0, "blockHash": "0xd19b57b71cc4948048baba6363ba841a56ddeedeaa65f1b4caffd7c5bd5e2e3f", "blockNumber": 47, "gasUsed": 5000000, "cumulativeGasUsed": 5000000, "status": false, "to": "0x3c725134d74D5c45B4E4ABd2e5e2a109b5541288", "events": {} }"

All documentation I read says too much gas might be spent on unbound loops and that kind of stuff, but here is just 2 assignment, so I really don't understand.
EDITED:
I modified the code to make a minimum test case.
The error I see during the test indeed comes from the revert NotEnoughFunds(); line (which I don't know why because the test has the correct values, but that's a different story). However, as per @xavier59 comment and the link he provided, revert reverts the transaction and doesn't consume all the gas.


texts: Ganache/Web3: "Key not found in database"

texts:
I am using Ganache CLI v6.1.0 (ganache-core: 2.1.0)) (started with default settings by running simply ganache-cli), web3 (^1.0.0-beta.33), and my smart contract is written for solidity ^0.4.0.

I have some functions working where I can, for instance, click a button on my web UI and have it send a transaction to my deployed smart contract and update the data on-chain. This works without any issue.

Strangely, the simple case of calling a constant function (which simply returns the length of an array) is where I'm having issues. For some reason every time I do this I get an error: Key not found in database. This error occurs in the promise returned by the call invocation.

Here is my code:

Solidity function:

function getItemsLength() public constant returns(uint256) {
    return items.length;
}

JS Code:

var account;
var numItems = 0;
web3.eth.getAccounts().then(function(result) {
account = result[0];
var contract = new web3.eth.Contract(
    simpleStorageABI,
    contractAddress,
    {
      from: account,
      gasPrice: '20000000000',
      gas: '100000'
    }
  )
contract.methods.getItemsLength().call(account) // Error occurs here
.then(function(result) {
    numItems = result;
  })
});

I had this working using testrpc instead of Ganache a few days ago, but then moved to Ganache for websocket support (for event listeners). Somewhere along the way this broke, and it seems like perhaps a bug in Ganache.

Has anyone else run into this? I saw some issues in my searching that seemed similar but they mostly seemed intermittent and related to testing specifically. Any insight or guidance would be appreciated, I've been stuck on this for too long.


texts: If I send a transaction with too little gas and the transaction is rejected by the network, do I loose the gas already consumed running up to it being run out, or does it get transferred back to my sending address?


texts: Fail to deploy contract on rinkeby using truffle and metamask

texts:
Following is a snippet from my truffle-config.js file
  networks: {
    // Useful for testing. The `development` name is special - truffle uses it by default
    // if it's defined here and no other network is specified at the command line.
    // You should run a client (like ganache-cli, geth or parity) in a separate terminal
    // tab if you use this network and you must also set the `host`, `port` and `network_id`
    // options below to some value.
    //
    development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
    },

    rinkeby: {
      provider: function () {
        return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3*************************************");
      },
      from: "0xe95745a8F4E3cDb1cF5bfFD4A94F0B249e99f489",
      network_id: 4,
      gas: 4500000,
      gasPrice: 10000000000,
    }

I am trying to deploy my contract on rinkeby using an address generated by metamask. However when I run truffle migrate --network rinkeby It gives me the following error:
C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\index.js:56
        throw new Error(errorMessage);
^
Error: There was a timeout while attempting to connect to the network.
       Check to see that your provider is valid.
       If you have a slow internet connection, try configuring a longer timeout in your Truffle config. Use the networks[networkName].networkCheckTimeout property to do this.
    at Timeout._onTimeout (C:\Users\DELL\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\index.js:56:1)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)

Any suggestions why this might be happening.


texts: Serving DApp on webserver or IPFS won't work

texts:
I can succesfully run the webpack truffle box on my webserver, but if I try to run a DApp which I made by using the pet-shop truffle box as template, I can only use it on localhost. When I upload the /build and /src folders to the webserver, after compiling and migrating to kovan, the only thing I get is my index.html page... Same goes if I publish to IPFS.

I am not able to use webpack within my pet-shop based DApp, I get (locally):

$ webpack The CLI moved into a separate package: webpack-cli. Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D

I already installed the webpack-cli globally, but nothing to do. I also tried to re-compile my DApp's contracts within the webpack box, migrate them to kovan, copied all required files and ran npm run build (which compiles...), but nothing to do.

Any help would be higly appreciated


texts: Error deploying from ethereum studio to ropsten

texts:
I tried to deploy a contract to ROPSTEN from Ethereum Studio using "send contract to the Net" with the following parameter:

JSON RPC URL: https://ropsten-lb.ether.camp

It is actually an small oraclize tutorial contract (Contract DieselPrice).

My deploying address (0x101a23558277e7b8c6b9642b3a0650d03fd2bdb5) has 3 ethers on ropsten.

I get the following error:
"getaddrinfo ENOTFOUND ropsten-lb.ether.camp ropsten-lb.ether.camp:443"

Has anyone experienced such error?

Could not get gas price from https://ropsten-lb.ether.camp: getaddrinfo ENOTFOUND ropsten-lb.ether.camp ropsten-lb.ether.camp:443


texts: Plasma Whitepaper - what is the "free option problem"?

texts:
I'm reading through the Plasma white paper, could someone elaborate on "free option problem" discussed on page 12? What exactly is this?

Excerpt below:

  In smart contracts, there is an issue of the ”free option problem” whereby the receiver (second or last signer) of a smart contract oﬀer
  is needed to sign and broadcast the contract in order to enforce it –
  during that time the receiver of the contract may treat it as a free
  option and refuse to sign the contract if the activity does not
  interest them.


texts: If I create a private blockchain using Geth and mine ether using mine.start() in my account, the ether that is mined, is it real or just test ether ?


texts: How can I import a wallet from aleth zero into geth?

texts: I have a wallet file from the old alert zero implementation. How can I import it into my geth client?


texts: Was it secure to think no more new transaction will be add to a block if a newer block was found in the context of mainnet?

texts:
friends

My application having the needs to detect newest transaction from a EOA, and I am going to use https://etherscan.io's API. To reduce transaction scanning, I decides to recording the last block number of EOA's transaction API calling, but I wondering will this method losing some later transactions.

So I post this question for helping, is this processing will works or how should I do to avoiding repeats transaction scanning ?


texts: Running two instances of geth on Windows - protocol stack: listen udp :30303

texts:
I'm trying to follow the instructions on this blog to get a private Ethereum network running on my Windows machine. https://btcblockchain.wordpress.com/2017/09/27/how-to-run-private-ethereum-blockchain-on-windows/
Maybe later I'll try Docker in the future, but for now I just want to follow this blog. This example requires having two chain in two different folders; I ran the command to setup the genesis.json on each, and that ran fine.

Error:

  Fatal: Error starting protocol stack: listen udp :30303: bind: Only
  one usage of each socket address (protocol/network address/port) is
  normally permitted.

I've seen variations of this issue on this site, but usually with Mist wallet.

My directories are slightly different from that blog, so these are the two commands I ran.

 geth -datadir="e:\Ethereum\ParityWinDev\node1" -verbosity 3 –port 30301 –rpcport 8101 –rpc –rpcapi eth,web3,personal,net –identity “MyNode” –networkid 2001 console

This is still running in a command window when I try the second one below.

 geth -datadir="e:\Ethereum\ParityWinDev\node2" -verbosity 3 –port 30302 –rpcport 8102 –rpc -rpcaddr "0.0.0.0" -ipcdisable -networkid 2001 console

I don't understand why it's complaining about port 30303 when I specified 30302.  I've seen other samples where people use --port as well, so not sure why this sample had just one dash in front of the word "port".

There is no ipc file in any of the node1 subdirectories.

Note: I was running Parity Wallet on the production node at the same time.  I killed those processes, and got same error.

Update 1: Adding screenshot from Resource Monitor showing ports:


texts:
I wrote contract and deployed it on remix today but it takes over 5 min to confirm.And I tried to call function of deployed contract , but the transaction still takes several minutes and even I call transfer token from metamask, the transaction need unusual time to be confirmed.Anyone knows
what happened?Is it a problem of Ethereum?Ropsten?or my walletaddress?(I've tried two but same problem happened)...


texts: ethminer not recognizing multiple GPUs (AMD Radeon / Ubuntu)

texts:
I have 5 GPUs on my setup currently:

$ sudo aticonfig --list-adapters
  * 0. 01:00.0 AMD Radeon (TM) R7 370 Series
    1. 02:00.0 AMD Radeon (TM) R7 370 Series
    2. 03:00.0 AMD Radeon (TM) R7 370 Series
    3. 04:00.0 AMD Radeon (TM) R7 370 Series
    4. 05:00.0 AMD Radeon (TM) R7 370 Series

However ethminer only seems to recognize one:

$ sudo ethminer --list-devices
[OPENCL]:
Listing OpenCL devices.
FORMAT: [deviceID] deviceName
[0] Pitcairn
    CL_DEVICE_TYPE: GPU
    CL_DEVICE_GLOBAL_MEM_SIZE: 2681208832
    CL_DEVICE_MAX_MEM_ALLOC_SIZE: 1073741824
    CL_DEVICE_MAX_WORK_GROUP_SIZE: 256

I followed the GPU setup instructions here: https://github.com/ethereum/go-ethereum/wiki/Mining#gpu-mining

Any advice on getting ethminer to recognize all GPUs?


texts: Constantinople gas change, reentrancy possibilities

texts:
With the new reduced fee for using SSTORE for 'dirty' storage slots, is it possible to re-enter a function from a send() or transfer() and have the contract call send() or transfer() again?

Or is it only possible to re-enter and write to storage a few times?

In other words, does send() or transfer() revert when < 2300 gas remains in the current transaction?


texts:
I deployed a contract and would like to watch for events on that contract.

var access_manager_erc20_abi = require('./AccessManagerERC20_abi.js');  //To read the abi.

//In this js file i export abi into a variable and use it while creating instance of contract below.

//Smart contract address

var AccessManagerERC20ContractAddress = "0x3267ced1528c7eabe69bd129b3d0faf9986d6b55";

//creating instance of contract

AccessManagerERC20Contract = await new web3.eth.Contract(access_manager_erc20_abi,AccessManagerERC20ContractAddress);

watching for events, followed documentation from https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#events

AccessManagerERC20Contract.events.getAccessERC20Event({
    filter: {_producerGatewayID:acc[1]}}, function(error, event){ console.log(event); })
.on('data', function(event){
    console.log(event); // same results as the optional callback above
})
.on('changed', function(event){
    // remove event from local database
})
.on('error', console.error);

when I try to execute this piece of code, it says

  TypeError: AccessManagerERC20Contract.events.getAccessERC20Event is
  not a function

Can someone help me please. I am using web 3 v1.0.0. beta.

Thanks in advance


texts: Calling a smart contract in response to an external event

texts:
I am trying to log all access operations on a file storage in Ethereum. The access operations are read, write, update and delete. Every time, a user does any of these operations on the file storage, I would like to log that into Ethereum. Since Ethereum and file storage are two disparate systems, the only way I can do this is by triggering a call to smart contract for every access event that happens in the file storage.

Q1: Is it possible to call a smart contract from an external system?

Q2: Is there a better architecture to achieve the same results?


texts: Why does it take longer to import more recent blocks

texts:
I am learning blockchain technology. I executed this command to retrieve the blockchain on a Mac using the Terminal with the fast option:

geth --testnet **--syncmode "fast"** --rpc --rpcapi db,eth,net,web3,personal --cache=1024  --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*" --bootnodes "enode://20c9ad97c081d63397d7b685a412227a40e23c8bdc6688c6f37e97cfbc22d2b4d1db1510d8f61e6a8866ad7f0e17c02b14182d37ea7c3c8b9c2683aeb6b733a1@52.169.14.227:30303,enode://6ce05930c72abc632c58e2e4324f7c7ea478cec0ed4fa2528982cf34483094e9cbc9216e7aa349691242576d552a2a56aaeae426c5303ded677ce455ba1acd9d@13.84.180.240:30303"

and I noticed when it started it was retrieving a relatively large number of blocks per call:

  INFO [09-29|16:01:59] Imported new block headers
  count=384 elapsed=171.830ms number=1720000 hash=23fd03…de2a49
  ignored=0

But now as it reaches the end, the retrieval processes going a block at a time with a rate of about 2 blocks per minute:

  INFO [09-30|04:50:36] Imported new chain segment
  blocks=1  txs=0    mgas=0.000   elapsed=7.284ms   mgasps=0.000
  number=1735148 hash=7a06bf…826cf1 INFO [09-30|04:50:59] Imported new
  chain segment               blocks=1  txs=0    mgas=0.000
  elapsed=7.813ms   mgasps=0.000   number=1735149 hash=23dc26…83d45c
  INFO [09-30|04:51:09] Imported new chain segment
  blocks=1  txs=0    mgas=0.000   elapsed=8.678ms   mgasps=0.000
  number=1735150 hash=7bb1e0…85eb48 INFO [09-30|04:51:22] Imported new
  chain segment               blocks=1  txs=0    mgas=0.000
  elapsed=9.371ms   mgasps=0.000   number=1735151 hash=8497a0…1c3cc6

Could someone explain why it takes so long for the more recent blocks to be retrieved?

Right now, according to this site: I still have many more blocks to be retrieved (Block 1775887) versus my most recent retrieved block: 1735151 (1775887 - 1735151) = 40736.

Also, is there a way to keep my Mac awake to process the blocks when I step away from it awhile? It stops the block retrieval if the Mac isn't active.

Thanks for your help.


texts:
Due to security concerns with rpc, I'd like to tunnel into my geth instance and run ipc commands. However, all the scripts I've written use version 1 beta of web3, which geth does not yet support.

I'm wondering if anyone is aware of an upcoming geth release that will roll out with web3 v1, or if geth now allows you to set the web3 api version manually (doubtful on the latter).


texts: Quorum IBFT - PBFT - BFT - 3F + 1 / 3M + 1

texts:
Understand that Quorum supports IBFT. Am trying to decide what is the suitable number of nodes to setup up to support X number of byzantine nodes. Using PBFT formula, 3F + 1, I am trying to come out with the number of nodes is required.

E.g., 3F + 1

Assuming 1 byzantine node, is it 3(1) + 1 = 4 nodes to have as minimum no. of nodes nodes count or 4 honest nodes plus 1 malicious nodes, i.e., total of 5 nodes?

Assuming 2 byzantine nodes , is it 3(2) + 1 = 7 nodes to have as minimum no. of nodes count or 7 honest nodes plus 2 malicious nodes, i.e., total of 9 nodes?

Assuming 3 byzantine nodes, is it 3(3) + 1 = 10 nodes to have as minimum no. of nodes count or 10 nodes plus 3 malicious nodes, i.e., total of 13 nodes?

Is it the former or latter count?


texts: Pattern for generating dynamic ERC-1155 or ERC-721 metadata

texts:
I am quite new to smart contract development so apologies in advance if this seems like a silly question.
I'm looking for some guidance on a usable pattern for the following use case.
I need to dynamically generate an ERC-1155 token's metadata upon minting (1 of several random images, stats etc). The metadata needs to also be able to change based off on-chain interactions. I'm struggling to think of a way to do it on the blockchain given my lack of experience.
As I understand it, I may need to leverage the use of oracles and IPFS? Possibly a custom server (which I would prefer to avoid if at all possible to keep things as non-custodial as possible)?
Is there a standard pattern for this sort of use case?
My initial thinking is:

Factory contract uses oraclize to generate random number stats.
TokenURI points to a custom server that receives stats via URI params.
Token is minted with this URI.
Custom server generates JSON metadata and returns it when that URI is called.

This will keep the necessary on-chain data and off-chain metadata in sync. If on-chain stats change then so too will the JSON returned from the URI.
Would this be considered an acceptable pattern?


texts: Can I grant new test net users of my smart contract Ether I own?

texts:
I am creating a voting smart contract that allows participants to vote on a particular issue and have the vote and various ancillary data written to the blockchain.  I'm a new Ethereum/Solidity developer and I need help creating a good strategy for the test phase of the smart contract development and deployment when it is residing only on the test net.

I would like to make things as easy as possible on my test users so I'm hoping that I can have the smart contract "fund" the entire vote from Ether I requested from the Rinkeby test net myself (i.e. - from my account).  I'm trying to avoid making every test user have to make their own Ether requests from the Rinkeby test net just so they can participate.

In general, how do most of you manage/facilitate the test phase of your smart contracts when they are running on a test net?  Is there a good article or paper somewhere that outlines specifically these issues?


texts:
We are trying to build smart erc20 tokens to create a game system . Let me tell you what we need:

First we need to know if is it possible can you create these tokens?

Five erc20 tokens will be created. Let me call them A B C D E.

*A will be an erc20 token that will give holders airdrop B tokens daily basis ( once in 24 hour) in a rate ( for ex. for 10 A token they hold they will get 100 B tokens)

*B will be a token like ico but will work as both ico and standart token ( without a time limit) . When a user send C token to the address of B token he/she will get D in a calculated propotion.

*All token must be convertible to each other. Lets say user wants to convert A to E. He/she will send A's to a address and will get 1/2 E in return. Or send E and will get 2 A token in return in his/her address.

*As you see in ico's users send ETH and get erc20 tokens but this time we would like them to send erc20 token and receive erc20 token. And if it is possible; for a token they send they must be able to get 2 different token in return.

Is it possible? If so where can we hire a developer can do that or volunteer participant in the project?


texts:
I'm trying to get Metadata from ERC721 token. Actually I'm trying to do it via ETHERSCAN and blockcypher APIs but I can't find the metadata in the response (like the Picture URL or the IPFS ID)

Can somebody suggest me how to do it?

It's something I must do client side or can I do it with Nethereum for instance?

Thanks


texts:
What's a good Ethereum alternative to block.io?

By good I mean, trusted and production ready.


texts:
I am trying to connect my wallet (Metamask) via Infura, but I receiving an error.
My code:

[HttpPost]
    public async Task<IActionResult> LoginAsync([ModelBinder(typeof(AccountBinder))] Account acc)
    {
        try
        {
            Account.ValidateAddress(acc.AccountAddress);
            var web3 = new Web3(acc.AccountNetwork + "" + acc.InfuraApiKey); //infura Ropsten+ProjectID
            var balance = await web3.Eth.GetBalance.SendRequestAsync(acc.AccountAddress);  //works fine
            var etherAmount = Web3.Convert.FromWei(balance.Value); //works fine
            acc.AccountBalance = (double)etherAmount;
            var unlockAccountResult = await web3.Personal.UnlockAccount.SendRequestAsync(acc.AccountAddress, acc.AccountPassword, 60);   //not working!!!!!!!! <- <- <-
            if (unlockAccountResult)
            {
                acc.IsValidated = true;
                return View("Login", acc);
            }
            else
                throw new WrongAccountDetails("Incorrect account or password");
        }
        catch (WrongAccountDetails ex)
        {
            ...
        }
    }

I getting this error:

An unhandled exception occurred while processing the request.
RpcResponseException: The method personal_unlockAccount does not exist/is not available
Nethereum.JsonRpc.Client.ClientBase.HandleRpcError(RpcResponseMessage response)
Nethereum.JsonRpc.Client.ClientBase.HandleRpcError(RpcResponseMessage response)
   Nethereum.JsonRpc.Client.ClientBase.SendInnerRequestAsync(RpcRequestMessage     reqMsg, string route)
Nethereum.JsonRpc.Client.ClientBase.SendInnerRequestAsync(RpcRequest request, string route)
Nethereum.JsonRpc.Client.ClientBase.SendRequestAsync(RpcRequest request, string route)
RealEstate_Web_app.Controllers.AccountController.LoginAsync(Account acc) in AccountController.cs
+
var unlockAccountResult = await     web3.Personal.UnlockAccount.SendRequestAsync(acc.AccountAddress,   acc.AccountPassword, 60);

And so on....


texts: how to batch send eth or erc20 from multiple address to one address?

texts:
How to batch send eth or erc20  from  multiple address to one address?

How to do it with code?

For example, I have 30 eth address.

I want to from 30 eth address  Transferring to  the one account in the contract.

how do I send  same amount ether/erc20 or different amount ether/erc20   in each account.


texts: How are truffle artifacts different from ABI? Do Truffle artifacts include fields that are different from ABI that is generated using remix?


texts: Accessing struct properties from a contract returns hexadecimal strings

texts:
I have a simple contract that has a setter and getter for a struct called Institution. I have removed most of the properties am using, to simplify the question.

pragma solidity ^0.4.22;

contract Example{

struct Institution {
    bytes32 name;
    bool exists;
}

event AddedInstitution(bytes32 name);

mapping(bytes32 => Institution) institutions;

//add an institution
function addInstitution(
    bytes32 name,
    bytes32 upi
) public {
    require(!isInstitutionExists(upi));
    institutions[upi].name = name;
    institutions[upi].exists = true;
    emit AddedInstitution(name);

}
//get an institution
function getInstitution(bytes32 upi) public constant returns (bytes32 name){
    require(isInstitutionExists(upi));
    return (
    institutions[upi].name
    );

}
//is institution exist
function isInstitutionExists(bytes32 upi) private constant returns (bool){
    if (institutions[upi].exists) {
        return true;
    }
    return false;
}

}

The setter works as expected. It adds a new institution and emits an event. But when I call the getter and give it a upi, it returns a location address of the name of the institution instead of giving me the exact name, as shown below:

'0x4d6f6920556e7669766572736974790000000000000000000000000000000000'

The results are consistent in both truffle console and browser.

What is wrong with my code?


texts:
so I am new to Ether, and so I have setup a new node and all seems fine.
now I would like to mine in my own private blockchain so I am running:

geth -datadir /home/ethchain/ -dev -unlock 0,1 -mine -rpc -rpcaddr 0.0.0.0 -rpccorsdomain * -rpcport 8101

but getting:

INFO [09-11|20:45:23] Starting peer-to-peer node               instance=Geth/v1.6.5-stable-cf87713d/linux-amd64/go1.8.3
INFO [09-11|20:45:23] Allocated cache and file handles         database=/home/ethchain/geth/chaindata cache=128 handles=1024
Fatal: Error starting protocol stack: database already contains an incompatible genesis block (have a3c5c170988f516e, new e5be92145a301820)

can anyone explain why am I getting this error and how do I execute the mining now?

tx

Sean


texts: Why is ether divisible to 18 decimal places?

texts: 1 ether is 10^18 wei, the smallest denomination. Why does ether have such a high degree of divisibility?


texts: How to interact with a deployed smart contract in the real world?

texts:
I'm learning Solidity. Now can write and test smart contracts using testrpc, truffle, MetaMask and MyEtherWalet. Basically, MyEtherWalet provides the function that I defined in my smart contract, so I can use them and pass arguments on to them and can interact with the smart contract deployed on testrpc.

Question : If I deploy my smart contract to the real Ethereum blockchain, then is there any user interface with which I could access the contract functions in the same way as I can do in MyEtherWalet?

Question 2:  What is the role of Web3 here?


texts: Account created with web3 does not get listed

texts:
I am learning ethereum and I have setup a private node with geth. And have a simple client written to create account (web3 1.0 beta34) and list.
While the account creation is successful, but it does not get listed,

code for account creation

var web3I    = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
var accountI        = new Accounts(new Web3.providers.HttpProvider("http://localhost:8545"));

var createAccount   = async () => {

    var {address, privateKey, signTransaction, sign} = await accountI.create();
    var password    = "password";
    var keyStore    =   accountI.encrypt(privateKey, password);

};

code for account listing

var getAccounts   = async () => {

    var accounts = await web3I.eth.getAccounts();
    console.log("accounts address    ", accounts);

};

getAccounts();

Q: Why does the account does not get listed?


texts: What Ethereum applications can I use without having to mine or buy ether?

texts:
I would like to play around with Ethereum, create contracts, do stuff.

I want to learn, not do anything serious for now. Dao Wars seems like a good start, but it costs 3 ETH just to start trying.

Is there a place where I can start without having to mine or buy ether?


texts: when entering my private key in MEW I change the public address to one that does not have the tokens of zilliqa

texts: someone could help me send ZILL tokens to a wallet that does not accept them (from zilliqa) by mistake they are in the contract but when wanting to open that address with the private key in MEW I change the public key to a different one where no Are the tokens something can be done?


texts: Method ID for a Solidity generated getter function

texts:
In solidity, the bytecode for functions is taking the web3.sha3 value of a function name and taking the first 4 bytes of the resulting hash in the format of 0x00000000

So if you have a function called totalsupply() the hash would be 0x18160ddd

I have the understanding that public variables have getters automatically created.

However, when trying to determine the bytecode for a public variable such as 'Name'. I would assume the function created is 'Name()' and thus the bytecode is 0x8052474d.

However, it doesnt seem to be working when I try to call a function using that bytecode.

Any thoughts as to what I am doing wrong?


texts: Why transactions remain queued in txpool of geth client?

texts:
Transactions remain stacked in geth client's txpool. Below is my node's current status,

  txpool.status
  {
    pending: 3836,
    queued: 459
  }>
  Is it the count of my local node only?
  How can I resolve it?


texts: theres a way to automatically import all imports you need in contract (that are on your computer) to remix ide

texts: I have a remix ide contract and somehow I added all the imports automatically from my computer files im assuming. Does anyone know how to replicate this as i am trying to do it again and cannot find anything anywhere. I know this is possible because I just did it, and saw a bunch of notifications pop up at the bottom of remix saying importing all files.


texts: Accessing struct fields in Web3 returned by a promise in Truffle

texts:
I'm using web3js (via Truffle) to make a call to a contract, to access a struct in a mapping.

mapping (bytes32 => entry) public entries;

struct entry {
    Mode status;
    Deed deed;
    uint registrationDate;
    uint value;
    uint highestBid;
}

Here is the call:

var myEntry = Registrar.deployed().entries.call("0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4af")

Which returns:

[ { [String: '1'] s: 1, e: 0, c: [ 1 ] },
  '0x0000000000000000000000000000000000000000',
  { [String: '1482956489'] s: 1, e: 9, c: [ 1482956489 ] },
  { [String: '0'] s: 1, e: 0, c: [ 0 ] },
  { [String: '0'] s: 1, e: 0, c: [ 0 ] } ]

Which looks to me like an array, but:

truffle(default)> myEntry;
// [ { [String: '1'] s: 1, e: 0, c: [ 1 ] },
//   '0x0000000000000000000000000000000000000000',
//   { [String: '1482956489'] s: 1, e: 9, c: [ 1482956489 ] },
//   { [String: '0'] s: 1, e: 0, c: [ 0 ] },
//   { [String: '0'] s: 1, e: 0, c: [ 0 ] } ]

truffle(default)> myEntry[0];
// undefined

truffle(default)> myEntry[1];
// undefined

truffle(default)> typeof(myEntry);
'object'

How can I access any of the properties (members?) of this object?

Note: I can't update the contract, it's the ENS' Initial Registrar.


texts: How to send ETH to address(0) from msg.sender address using multiple token's contracts, with Solidity 5.x?

texts:
I need the safest way for an user to send any amount of Ethereum to address(0). The amount is calculated by the contract, and there is no limit (assuming there is enough funds).

All the code I could find does not compile with Solidity 5.x or it simply doesn't work.

The only code that partially worked was this:

pragma solidity 0.5.2;

contract BurnEth {

    function burnEth() public payable {
        address(0).transfer(msg.value);
    }
}

What I need is a contract to call to a BurnEth. It is declared public and it doesn't have a payable function. This cannot be done with the code mentioned above. With the code mentioned above, when the contract is approved using etherscan, and when I go to write to a contract, there is one extra field that accepts the amount of Ethereum that will get burned (decimals allowed). What I want to do is to avoid a need for using that field.  See:

https://ropsten.etherscan.io/address/0x10afa68ec2ac43522b8e56f7b94e27e6b87377ff#writeContract

Therefore, the pseudocode would look like this:

contract BurnEth
    function: burnEth(...) is payable, accepts uint weiAmountToBurn
        body:   -sends the weiAmountToBurn to address(0)

contract OtherContract
    function: calculations() is public, no input parameters
        body:   -calculates the amount of Wei (that is, weiAmountToBurn)
                -makes a call to burnEth to burn calculated Wei from msg.sender address

For the bounty:
I will check each solution and an answer on its own, and then against the code I will use it with. Only the most detailed, and most relevant answers following the pseudo-code will get the bounty reward.


texts: How long is it from the time a transaction is sent until it is viewable on pending transactions?

texts:
How long does it take for a pending transaction to be viewable?
When it comes to viewing pending transactions I am referring to this:
https://etherscan.io/txsPending

Also, is there a faster way to view pending transactions?
I am wondering what is the quickest way to view pending tx, and how fast is it.


texts:
I am going to run the virtual ethereum machine from the code, pass to it a compiled smart contract code.

But I do not know how to do it.

It's my code:
package main

import (
    "context"

    "github.com/ethereum/go-ethereum/core/vm"
)

func main() {
    var code string = "6060604052600a8060106000396000f360606040526008565b00"
    vm := vm.NewEVM(context.Background())

}

To create an instance of a virtual machine

  vm := vm.NewEVM()

I have to pass parameters such as:

- ctx Context
- statedb StateDB
- chainConfig *params.ChainConfig
- vmConfig Config

Where to get these parameters?


texts:
To set-up a private network with a given genesis document, I can start with the init command or start mining. With init and an account already existing, I can see the block created from the console (eth.getBlock('latest')). Mining would, of course, create the block  (miner.start(1) and also credit the reward to an etherbase account or the eth.accounts[0]. So,

Does init trigger a mining?
Who receives the reward for the genesis block when created with an init?

References:

Creating the genesis block

How do I set up a private ethereum network?


texts: Probably a very naive question, but when attacks occur such as the etherdelta one yesterday, what's stopping having a system in place to basically freeze assets in a certain address before the attacker moves funds? I.e. Each node submits a vote to blacklist a certain address and when consensus is reached, nodes refuse to include any transactions from that certain address. Does something like this exist (on any chain), if not why?


texts:
Getting the following error when hitting deploy to Ropsten network
creation of EventExample errored: call to plugin has timed out compilerMetadata - deployMetadataOf - {"from":"udapp","path":"compilerMetadata"}
What does this mean? I am using Chrome, if it matters.
Thank you


texts: Accounts with ether cannot execute transaction on private chain

texts:
According to Metamask my accounts have ether, one account can submit transactions and have them be executed by the network, the other two have their transactions left as Submitted transaction.

Note, the account that works has a private key in the keystore in the chain's datadir.  The other two accounts were added to metamask and had ether sent to them with web3.eth.sendTransaction().

I am not sure why their transactions are not being executed by the PoA network, they are also not sealers in the network, could this be why?


texts: is "newBlockHeaders" in web3 emits a legit block?

texts: I'm using web3.eth.subscribe('newBlockHeaders') to track transaction I sent to the blockchain. My question is that is the block emitted from "newBlockHeaders" legit or in other words, the block has enough confirmations to be the block that will stay forever?


texts:
The Metamask client allows access to four test networks:

Ropsten
Kovan
Rinkeby
Goerli

I'm curious:

What are the similarities / differences between them?
Which use cases are best for each network
Are there more than these listed above?


texts: Should increase/decrease token supply on transfer to/from 0x0?

texts:
I am about both ERC-20 and ERC-1155.
Should totalSupply be increased/decreased, when:

transferring to 0x0?
burning an amount already placed at 0x0 address?

By the way, should 0x0 be allowed to have non-zero balance?


texts:
While deploying contract to ropsten tesnet (truffle migrate --network ropsten) I am getting an error:

insufficient funds for gas * price + value

  ropsten: {
      network_id: 3,
      host: "localhost",
      port:  8545,
      gas:   4698712,
      gasPrice:   65000000000,
      from: '14e6b19304fb3c98a73acea5f80d2c056ee5c09f'

    }

The configuration in truffle.js is given above. I have 1 test ether in my wallet account. How can I fix this issue ?


texts: Distinct, inconsistent compilation of inherited but identical contract in solidity

texts:
Consider the following solidity source file A.sol:

pragma solidity ^0.4.8;

contract A {}

and B.sol:

pragma solidity ^0.4.8;

contract A {}

contract B is A {}

Using solc version 0.4.8, the code produced for the two versions of contract A are not identical:

$ solc --bin A.sol

======= A =======
Binary:
6060604052346000575b60358060166000396000f30060606040525b60005600a165627a7a723058201f05fd362367eb20b594d9537e2d735626b1fc0909c76826b94103a678da6cf10029
$ solc --bin B.sol

======= A =======
Binary:
6060604052346000575b60358060166000396000f30060606040525b60005600a165627a7a723058207dd14680c4efdd761b8db9a748045c916aff2f0a11c4ee7b82731d287045f0540029

======= B =======
Binary:
6060604052346000575b60358060166000396000f30060606040525b60005600a165627a7a72305820942c33894954b0c78b1da86869a47c578755a698e26f671c5b4450476a3d56bc0029

If you scan to the bytes 5820 in the compilations of A, you'll see the two versions differ just after.

I'd expected solc compilations to be repeatable (that seems important for verifying that code on the blockchain is consistent with public source), and don't understand why these two versions of A should differ. What am I missing?

Many thanks for any insight!

Update: I'm using the empty contract as an example here, but I first encountered inconsistent compilations with a less trivial contract. It's not just a quirk of the empty contract.


texts:
Can the price of an ERC721 token be handled in the contract itself?
Maybe along a fixed curve or something.
Can you point me to a simple implementation example of an ERC721 marketplace?
Thank you


texts: delegatecall for Smart Contract versioning

texts:
I've a state variable

address public current;

which stores the address of the latest updated contract. This value can be modified with a function.

Then, I've a function of this kind

  function example(string param1, string param2, string param3, uint256 param4) public {
    if (current == address(this)) {
      do things...
    }
    else {
      current.delegatecall(bytes4(sha3("example(string,string,string,uint256)")), param1, param2, param3, param4);
    }
  }

Obviously, the new contract has the function example with the same signature of the older version. However, when I try to call this function in Remix with current=another_address, the transaction does not modify the storage of the calling contract. It's as if it did nothing.

Am I doing something wrong?

Thank you.


texts:
I'm trying to make the user pay a certain amount of ETH with PullPayment.sol from Open Zeppelin.

It is suppose to :

react to a button
Open Metamask with the proper amount
Make the payment happen

However metamask won't open, I get an error :

tutorialTokenInstance.asyncSend is not a function

I imported open zeppelin properly in my app folder, and I import in my contract

My code

handleTransfer: function(event) {
event.preventDefault();

var amount = parseInt($('#TTTransferAmount').val());
var price = parseInt($('#TTPrice').val())

console.log('Transfer ' + amount);

var tutorialTokenInstance;

web3.eth.getAccounts(function(error, accounts) {
  if (error) {
    console.log(error);
  }

  var account = accounts[0];

  App.contracts.TutorialToken.deployed().then(function(instance) {
    tutorialTokenInstance = instance;
    var value = web3.toWei(price);
    var owner = tutorialTokenInstance.owner.call().then(console.log);

    return tutorialTokenInstance.asyncSend(owner, value)

My smart contract

import 'zeppelin-solidity/contracts/token/StandardToken.sol';
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
import 'zeppelin-solidity/contracts/payment/PullPayment.sol';

contract TutorialToken is StandardToken, Ownable, PullPayment {

    string public name = 'TutorialToken';
    string public symbol = 'TT';
    uint8 public decimals = 2;
    uint public INITIAL_SUPPLY = 12000;

    function TutorialToken() public {
    totalSupply = INITIAL_SUPPLY;
    balances[msg.sender] = INITIAL_SUPPLY;
    owner = msg.sender;
}

}


texts: There is a token which already has holders and a smart contract which now should be updated. No other possibilities to replace a contract like proxy has been added, so I need to deploy a new version. Please advice is there any chance to link a new contract to the old token and not to loose token holder and keep token name, symbol etc.


texts:
https://youtu.be/NBwRXpCQta8

I watched this video and followed it.

But my account test ether is zero.

I used faucet.ma.cx:3000 site too.

But test ether is zero.


texts: I need to have a simple contract for sending ether from one account to another account with specified values?

texts:
pragma solidity ^0.5.2;

contract sendEther{

address payable rec= address(0xD694fab8b63BeF0149aa47b8333dFeAe7f55E9C7);
address public sender = msg.sender;

function send() public payable{

    rec.transfer(msg.value);

}

}

I need to send a specific value to that address mentioned. This is to be included in my Dapp. So i need to send a specific amount to any specific address and the input amount have to be injected by the user


texts: Is it possible to transfer ether from different wallets using php

texts:
I am developing a payment interface where each user will get different wallet address to send ether. After successful transaction I want to move those to another wallet. There is no connection with any contract. Both the acount's private keys and public keys are available.

I tried this one. But it doesn't support transaction. Searched for many solutions and I couldn't get a solution yet.

I believe that anyone can direct me to the solution.

Thanks in advance for your valuable time and help.


texts: Ethereum Node on Azure Virtual Machine (windows) remote access

texts:
I've a Windows Server VM on Azure where geth is running quite good (no mining, just node).

Now, the "start command" is:

geth --rpcapi "eth,web3,db,net,personal,admin" --rpcaddr "10.0.0.4" --port "30303" --rpccorsdomain "*" --rpcport "8545" --rpc --ws --wsaddr "10.0.0.4" --nat "any"

From the Virtual Machine itself, I can go on the browser and write

 http://10.0.0.4:8545

And everything is working.
From "outside" I try to access to

http://virtualmachineip:8545

And I get a Timeout, event if the firewall rule I configured is TOTALLY permissive like:

What could be the problem?

Thanks


texts: Extract the private and public key from the UTC file

texts:
When I create a new account using Geth, it creates a UTC file corresponding to the account. All I know is that the UTC file consists of an encrypted private key.

How can I decrypt this? How can I extract its corresponding public key?

Detailed steps would be great.


texts: Make function invisible for general user

texts:
I have a pretty big contract with a few functions, some are designed for administrative goals. Here's a simplified example:

contract big_contract {
    function user_function_1 (uint32 arg1, string arg2) returns (uint32) {
        // ...
    }

    function user_function_2 (string arg1) returns (string){
        // ...
    }

    function admin_function (bool arg1) {
        // ...
    }
}

The question is - how can I keep admin_function in the contract's code, but make it invisible for general users? I know, that usually, all you need is to add a few lines of code like if (msg.sender == owner) {...}, but I want to hide this function at all.

In my understanding, it's possible to do by editing ABI's code, but I'm not sure. So, in this example, I need to remove definition for admin_function and the contract will still work, just without capability to call admin_function. But for those, who have full ABI, admin_function will still be available.

[
   // {
   //   "constant":false,
   //   "inputs":[
   //      {
   //         "name":"arg1",
   //         "type":"bool"
   //      }
   //   ],
   //   "name":"admin_function",
   //   "outputs":[
   //
   //   ],
   //   "payable":false,
   //   "type":"function"
   // },
   {
      "constant":false,
      "inputs":[
         {
            "name":"arg1",
            "type":"uint32"
         },
         {
            "name":"arg2",
            "type":"string"
         }
      ],
      "name":"user_function_1",
      "outputs":[
         {
            "name":"",
            "type":"uint32"
         }
      ],
      "payable":false,
      "type":"function"
   },
   {
      "constant":false,
      "inputs":[
         {
            "name":"arg1",
            "type":"string"
         }
      ],
      "name":"user_function_2",
      "outputs":[
         {
            "name":"",
            "type":"string"
         }
      ],
      "payable":false,
      "type":"function"
   }

]

Am I right or there are any other ways to make it work?


texts: Pass structures between contracts with Solidity 0.5

texts:
I'm trying to pass an instance of the Storage structure from StorageController.sol to Publisher.sol. No matter what I do, I get VM Exception while processing transaction: revert in my Truffle test.

Both contracts have pragma experimental ABIEncoderV2; at the top. StorageController.sol is imported by Publisher.

Here's what I tried so far:
 1. Using a mapping:
StorageController:

mapping(uint256 => Storage) public storages;

Publisher:

Storage memory _storage = _storages.storages(storage_id);

This won't even compile, it says, TypeError: Different number of components on the left hand side (1) than on the right hand side (6).

Using a function

StorageController:

    function getStorage(uint256 i) external view returns(Storage memory) {
        return storages[i];
    }

Publisher

StorageController.Storage memory _storage = _storages.getStorage(storage_id);

Output: VM Exception while processing transaction: revert

Passing a tuple

StorageController:

    function getStorageData(uint256 i) external view
        returns(bytes32 name, uint256 maxLength, uint256 rank, uint256 writingFee, uint256 sellPrice, bool nonpublic) {
        return ("", 1,1,1,1,false);
    }

(I hardcoded the output values just in case)

Publisher:

(bytes32 name,,,,,) = _storages.getStorageData(storage_id);

Output: same as above.


texts: Can I do contract transactions with metamask?

texts:
In the metamask plug-in, when I click 'Send' there is a Transaction Data (Optional) blank at the bottom that I'm guessing I can put a hex string in that amounts to the {methodID:0xXXXXXXX, params:[X,A,B]}, but I'm not sure this is the case.

If it is the case I don't know how to form the hex number. Is there some kind of converter in web3 that lets you set this up and then generate the hex transaction data?


texts: How to check expected exception using .then synchronous calls in web3js-based Truffle tests?

texts:
test.js

var Test=artifacts.require("./Test.sol");

contract('Test', function(accounts) {
    it("test case-1 working", function(){
        var admin_address=accounts[0]; //admin account initialized with 100

        var testit;
        return Test.deployed().then(function(instance){
            testit=instance;
            return testit.balanceOf(admin_address);
        }).then(function(result){
            console.log("admin balance==>",result.valueOf());
            testit.transfer(admin_address,50,{from:admin_address});
            //The error occurs in the line above. How to catch it?
        });
    });
});


texts:
I'm trying to create a token that holders can earn some amount contantly by a certain rate.
Don't want to depend on transactions to give tokens to holders. An idle contract must constantly do it.
Is there any way to do this without running out of gas ?
Just an example:

You buy 100 tokens and go sleep. The contract will reward you at 0.0001 token / hour

Yea I know I can't write anything to the constract storage without spend gas and fees so I can't see how I can do it.


texts: How to interact with a smart contract to change a variable state

texts:
How do I change a variable in a smartcontract (bool)

As requested, a new followup question from the above^ about ethereum smart contracts (solidity)

If I have, early in the contract:

bool public myVariable = false;

and then later on:

function set_myVariable(bool newVal) public{
    require(msg.sender == 0x..myaddress);
    myVariable = newVal;
}

How do I go about triggering that function in the published contract, and will it "permanently" toggle the true/false state of myVariable, despite the hard-coded =false part at the beginning?


texts: How to write oracle and put sensor data to blockchain?

texts: I havea project in which I need to send the readings from the sensor connected to RPi to blockchain. Due to the fact that smart contract cannot manipulate data outside blockchain I need an oracle that will modify the sensor data (to be an integer) and address it to the Ethereum blockchain. I have no idea how to write oracles and how to run the script on RPi. Please, help


texts: QuorumChain Consensus vs Raft Consensus vs Istanbul consensus quorum

texts:
I am reading about Quorum which is an Ethereum-based distributed ledger protocol with transaction/contract privacy and new consensus mechanisms.
I have read about QuorumChain consensus and Raft consensus from this document.

According to this answer and this link, Istanbul consensus mechanism implemented in a quorum. What are the advantages and disadvantages of each consensus mechanisms used in a quorum?


texts: All my contracts is in pending state for last 72 hours?

texts:
Ok guys, where is the problem? Gas? Gas price? Something else?

TXhashes:

0x0f9c73d12db222cf820e8831007be326fc666dac88a2daefe3e19e44a820de1c

500k * 3gw - 4 days gone

0x10fbccbdabbee095007942afb28e463d00fa3e0fddae0bd83ba1cf4415522e24

this transaction should change gas params in previous one contract to    40GW *500k. 24 hours gone, still no luck.

0xe5c582b5defb8ba5598e37acb2fe49061f44d20d526af822fc3eaee3c6a378e9

this one is the same copy of the first one with increased gas variables (5.9kk*42GW). 22 hours no luck

0xc555b0a12fac7f29671e09992676f033b7063d5d70b8025838d5454b368998e5

this one is the copy of the first one but with 2.5kk * 42GW , more than 18   hours, luck status still the same.

Thank you for your attention and maybe answers, im a bit nervous around all this situation and i want to understand if this problem in 'cause of blockchain overload.


texts: Length not found or not visible after argument-dependent lookup in struct storage ref

texts:
Good day
I've got a struct like this, and I also declare an array to store this struct.

Then in the same contract, I tried to check if the corresponding struct is null or not by checking its length equals to zero.

But the compiler shows me the error msg in if (propertyList[_id].length == 0) throw; of removeProperty function

  Member "length" not found or not visible after argument-dependent
  lookup in struct Property storage ref

But if I create a function

function getPropertiesLength() constant returns(uint){
    return propertyList.length;
}

Then modify my code to if (getPropertiesLength() == 0) throw;

it works just fine.  Why? 0.0

My code is listed below. I appreciate any suggestions and opinions :)

Many thanks!!!

contract usingProperty{
    struct Property{
        bytes32 name;
        uint id;
        mapping (address => bool) accessStakeholders;
        uint[] rating;
    }

    Property[] public propertyList;

    function addProperty(bytes32 _name, address[] _accessStakeholders, uint _rating) returns(bool success, uint _id){

        _id = propertyList.length++;

        Property prop = propertyList[_id];
        for (uint i = 0 ; i < _accessStakeholders.length ; i++){
          prop.accessStakeholders[_accessStakeholders[i]] = true;
        }

        prop.name = _name;
        prop.id= _id;
        prop.rating.push(_rating);
    }

    function removeProperty(uint _id){
        if (propertyList[_id].length == 0) throw;
    }

}


texts: Get seed and Password of testrpc accounts

texts: I am working with solidity contracts in development and need to pass seed and password to load wallet. but by running testrpc with --gasLimit, I only get 10 accounts and geslimit. is there any way to get seeds and passwords for that accounts?


texts: Setting up a private Ethereum network and integrate it with Hyperledger Caliper

texts:
I hope you're alright and safe there.
I'm trying to set up a private Ethereum network and bind it to Hyperledger Caliper. However, I couldn't sufficient sources to do that. Recently, I used geth v1.19 Ethereum client and created two nodes, initialised them with the same genesis.json file. But I couldn't go beyond that point. I tried to bind it to Caliper and the error I got as the following.
ethereum@ethereum-VirtualBox:~/caliper-benchmarks$ npx caliper launch master     --caliper-workspace .     --caliper-benchconfig benchmarks/scenario/simple/config.yaml     --caliper-networkconfig networks/ethereum/1node/ethereum.json
2020.09.26-02:18:31.025 info  [caliper] [cli-launch-master]     Set workspace path: /home/ethereum/caliper-benchmarks
2020.09.26-02:18:31.028 info  [caliper] [cli-launch-master]     Set benchmark configuration path: /home/ethereum/caliper-benchmarks/benchmarks/scenario/simple/config.yaml
2020.09.26-02:18:31.029 info  [caliper] [cli-launch-master]     Set network configuration path: /home/ethereum/caliper-benchmarks/networks/ethereum/1node/ethereum.json
2020.09.26-02:18:31.029 info  [caliper] [cli-launch-master]     Set SUT type: ethereum
2020.09.26-02:18:32.106 info  [caliper] [benchmark-validator]   No observer specified, will default to none
2020.09.26-02:18:32.106 info  [caliper] [caliper-engine]    Starting benchmark flow
2020.09.26-02:18:32.154 error [caliper] [cli-launch-master]     Unexpected error during benchmark execution: Error: Ethereum benchmarks must not use http(s) RPC connections, as there is no way to guarantee the order of submitted transactions when using other transports. For more information, please see https://github.com/hyperledger/caliper/issues/776#issuecomment-624771622
I may not achieve to set up a proper private Ethereum network for Caliper. I would be grateful if you could help me out with testing the private Ethereum network with Caliper.
My email: znkcn2000@gmail.com
Best regards,


texts: How do you set up a Truffle script with Infura as provider?

texts:
I'm trying to set up my Truffle scripts to use Infura as a provider.

I have the following, which appears to set everything up correctly:

const HDWalletProvider = require("truffle-hdwallet-provider");

module.exports = function(callback) {
    let Web3 = require('web3');
    const truffleContract = require('truffle-contract')
    let myContract = truffleContract(require('../build/contracts/myContract.json'));
    const provider = new HDWalletProvider(<my mnemonic>, "https://rinkeby.infura.io/v3/" + <my infura project ID>)
    var web3 = new Web3(provider);
    myContract.setProvider(web3.currentProvider);

    myContract.deployed().then(async function(contract_instance) {
            console.log("Calling contract...");
            response = await myContract.helloWorld({from: accounts[0]});
            console.log("Transaction receipt: ")
            console.log(JSON.stringify(response));
    }
}

Except that it prints out "Calling contract..." and then never prints out the response. How can I get a better idea of what is going wrong here? Thank you.


texts: Is this implementation of multisig2of3.sol secure?

texts:
I implemented multisig 2 of 3 contract. Please give me feedback on codestyle, security and usability. On codereview there is only two solidity questions, so I posted here.

see on github

pragma solidity >=0.4.22 <0.6.0;
contract multisig2of3 {
    address signer1;
    address signer2;
    address signer3;
    address payable receiver1;
    address payable receiver2;
    address payable receiver3;

    constructor(address owner1, address owner2, address owner3) public {
        assert(owner1 != owner2);
        assert(owner2 != owner3);
        assert(owner3 != owner1);
        signer1 = owner1;
        signer2 = owner2;
        signer3 = owner3;
    }

    function deposit() public payable {
        if (msg.value > 1 ether || address(this).balance > 1 ether) revert();
    }

    function setReceiver(address payable newReceiver) public {
        if (msg.sender == signer1) receiver1 = newReceiver;
        if (msg.sender == signer2) receiver2 = newReceiver;
        if (msg.sender == signer3) receiver3 = newReceiver;
    }

    function withdraw() public {
        address payable approvedReceiver;
        if (receiver1 == receiver2) approvedReceiver = receiver1;
        if (receiver2 == receiver3) approvedReceiver = receiver2;
        if (receiver3 == receiver1) approvedReceiver = receiver3;
        require(approvedReceiver != address(0));
        receiver1 = address(0);
        receiver2 = address(0);
        receiver3 = address(0);
        approvedReceiver.transfer(address(this).balance);
    }
}


texts:
What I’m trying to determine is if we create a new ERC20 token and group to distribute 10,000 wallet addresses as part of an airdrop campaign when the token is launched, can we avoid paying gas for each transaction or at the least minimize our transaction cost?

Also, will it make any difference if I call this method from constructor and when I call it by accessing that method through myEtherWallet?


texts: Is there currently any way to privately send ether? If not, are there any plans in the future to implement any privacy features?


texts: How to use web3.py to get data from public chain

texts:
Platform: Win10+geth1.8.2
I have opened geth to sync block, it's ok to use 'geth attach' directly, but I can't get any return from web3.py. Anyone can help me?


texts: How many Consensus algorithm does ethereum involve?

texts:
I know POW is the Consensus algorithm of ethereum now, and it will be changed to POS. But does ethereum has other Consensus algorithm besides POW and POS?
I heard from a man there are other Consensus algorithm in ethereum but I don't know if it is true. thank you .


texts: How to fix "invalid argument 0: json: cannot unmarshal hex number with leading zero digits into Go struct field CallArgs.value of type *hexutil.Big"?

texts:
Using Remix and metamask, I have deployed a contract on the rinkeby network that contains a function that, when called will send unsold tokens to a specific address. The code for it is like this

  function finalizeCrowdsale() public onlyOwner returns (bool) {
    require(hasEnded());
    require(token.transfer(tokenWallet, remainingTokens));
    return true;
  }

When I attempt to call this function in remix (from the account which deployed the contract, which is the owner), I get an error

transact to JTokenCrowdsale.finalizeCrowdsale errored: Error: invalid
argument 0: json: cannot unmarshal hex number with leading zero digits into
Go struct field CallArgs.value of type *hexutil.Big

What causes this and how can I fix it?

Thank you.