texts: What happens with the balance of a contract after it is upgraded using ZeppelinOS?

texts:
ZeppelinOS implements upgradeability of smart contracts through the use of a proxy and unstructured storage.

If the contract holds some ether, what happens with that ether after it is upgraded?


texts:
How does etherscan know that a particular transaction is an ERC20 token transfer?
If you look here: https://rinkeby.etherscan.io/tx/0xa8e4aa4f533e03bd8298f393d50d4ca41dba3368493c481e386d11389008353d etherscan knows that account A is transfering account B 200 tokens.  IM quite familiar with quering ethereum using JSON RPC, so IM wondering if that info is there somewhere.

Thanks


texts: How to automate blockchain transactions of users without having to ask them to enter wallet addresses?

texts:
I am working on a game with an in-game currency.
The goal would be that when a player buys something, he only have to click on buy, without having to enter the public address and so on.

Are smart contracts the solution?
Are there smart contracts implementation platforms available?
Share your ideas and solutions and explain them.


texts: How to install infura to a server runing ubuntu 16.04

texts:
Im setting up an exchange and came to the installation of ethereum using this document http://support.bitexchange.systems/support/articles/how-to-install-ethereum-in-your-server.

The 'geth' command for install and synch of eth node runs for eternity. I heard infura does the trick faster but how am I supposed to do this?


texts: Are the transactions between two accounts have to go through a contract?

texts: Are all the transactions in ethereum have a relation to a contract (its to or from field is a contract). When two accounts want to transfer something between them, do they have to speak through a contract?


texts:
Does block.number point to the last mined block or the one current transaction is going to be mined within?

It's not quite clear from reading
https://solidity.readthedocs.io/en/develop/units-and-global-variables.html#block-and-transaction-properties


texts: Why do we need to run our own Ethereum node?

texts:
I have been reading a lot about Dapp development, and the gist of it seems to be that you need an ethereum node to connect to with web3.js in the frontend to read/write to the blockchain.

1) You have a choice for a public node or running your own, and the fundamental reasons seems to be a philosophical one which is if you trust your transactions going to the public node; if not then run your own.

2) I read here (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?) that if you want to run your own Ethereum node, that you can't have it run over https, so you have to run it through a proxy. I am basically just fronting the node with an API, what are some other reasons for this?

3) I also understood that your Ethereum node has its own private and public key. You wouldn't have to worry about this if you leave the node locked, but when would I want to unlock and sign a transaction to write to the blockchain? If I do this, I am assuming that I would want to run a separate Ethereum node from the one mentioned in 2) and ensure that only my servers have access to it, is that correct?

4) How is the flow supposed to work here? The user signs a transaction with their private key on the client side, then uses my node from 2) to relay that transaction? Why can't I just do this with a public Ethereum node?

Please correct me if my assumptions are incorrect.


texts: How could I debug EVM storage/memory layout while developing contract?

texts:
I'm looking for a tool which could provide me the following features:

Feature to check how value/reference types fit into storage/memory slots.
The doc says "declaring your storage variables in the order of uint128, uint128, uint256 instead of uint128, uint256, uint128, as the former will only take up two slots of storage whereas the latter will take up three." I would like to be able to check my cases using a debugger.
Feature to check whether value/reference variable is stored in memory or in storage.
There are a lot of cases when variables could either being copied or passed by reference. It seems not all of them is covered by docs.


texts: Constructor Function: How can I tell which function is the constructor?

texts:
How can I tell which function is the constructor function?

In the OpenZeppelin implementation of the MultisigWallet, OpenZeppelin claims this is the constructor function:

/**
   * Constructor, sets the owners addresses, number of approvals
     required, and daily spending limit
   * @param _owners A list of owners.
   * @param _required The amount required for a transaction to be
     approved.
   */

function MultisigWallet(address[] _owners, uint256 _required, uint256 _daylimit)
    Shareable(_owners, _required)
    DayLimit(_daylimit) { }

My problem is that I cannot tell the difference between this function and any other function.

How do I identify constructor functions?


texts: What Would Be The Reward For Smart Contract Miners In Ethereum POS?

texts:
I have seen this: What’s the block reward for smart contract miners?
Which addresses it for the POW period of Ethereum, but what about POS? They just earn a sort of "interest" for their stake as staking rewards, so why can't they just ignore all of the smart contracts?

I also saw this: How do miners profit post-PoS, if at all, how will new miners get their start, and who will execute the EVM byte code (and why)? but it doesn't say why the miners don't ignore it.


texts:
I have sent 10 ether from my ethereum wallet to my poloniex ethereum wallet, but it doesn't came. Please help me! Im waiting too long! Polo didn't answer, ether didn't came back to my ether wallet! If somebody help me
, I will send some reward to you!

TxHash:
0x2dff536aafdb64512cdacb8cc3a97b2fd53334e156d8c2935c0e5936c7b72d1c

From:
0x7ed1e469fcb3ee19c0366d829e291451be638e59

To:
Contract 0x10555c9e4638bdd01e18fa02bfceacda627e4245


texts: In Node.js connected to Geth : solc.compile prefixes an additional ':' before contractName

texts:
I'm trying the following script on Node.js while running a node connected to Rinkeby Testnet (from  https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethcontract):

const fs = require("fs");
const solc = require('solc')

let source = fs.readFileSync('nameContract.sol', 'utf8');
let compiledContract = solc.compile(source, 1);
let abi = compiledContract.contracts['nameContract'].interface;
let bytecode = compiledContract.contracts['nameContract'].bytecode;
let gasEstimate = web3.eth.estimateGas({data: bytecode});
let MyContract = web3.eth.contract(JSON.parse(abi));

However, this code doesn't work on my computer: when I log compiledContract I can see that the key in the mapping is :nameContract and not nameContract.

When I replace in the code nameContract by :nameContract, it works.
I've checked my Solidity file and there is no mistyping errors in it.

Do you have an idea why this happens? I'm using Git BASH on Windows10.


texts: Is this type of Dapp reasonable to be built on Ethereum?

texts:
I'm currently doing some tests with Solidity programming language and EVM.
I want to create application where people could make a personal accounts and make some business logic then.
But I'm afraid of creating account gas price.
Now I have very simple Account contract:

contract Account {
    string name;
    string secName;
    uint balance;

    function Account(string name, string secName) {
        name = name;
        secName = secName;
        balance = 1;
    }
}

Also I have function to create new account in other Manager contract

function createAccount(string name, string secName) isCreator {
        Account account = new Account(name, secName);
        accounts.push(account);
    }

Calling this function cost 127909 gas and now It's around 0.14$ (5 gwei for gas). Seems to be a little bit expensive for creating account with only two text fields.

So the questions is: probably ethereum blockchain is not good solution for Dapp like that or It's possible to decrease amount of gas for creating new account transaction?


texts: Is it possible to interact with multiple contracts in the same .sol file using Truffle?

texts: Instead of separating each contract into it's own file, I'm wondering if/how I can interact with each individual contract one in a single .sol file through truffle console. Thanks.


texts: Eth address created from an outdated version of MEW off line

texts:
Hello I have MEW off line client 3.7 (2018 version) on an airgapped computer
Since the new client doesn't let me create new ethereum wallets offline (it blocks itself (idle) while creating it) can I create a new eth wallet from the 2018 MEW off line client? It's the only one that doesn't block itself while creating a new wallet
Once created, then can I saftley send coin to this address? (ethereum address created from the 2018 version of Myethereumwallet offline client)?


texts: Wrong network used on metamask by mistake

texts: I have bought some HUR tokens through metamask (transaction is confirmed) but cannot see the tokens in the wallet. I sent the ETH over main network, instead of rinkeby test network- what can i do??


texts: How can you confirm the state of a contract?

texts:
Say I have a contract like so:

pragma solidity ^0.4.0;

contract SimpleStorage {
    uint storedData;

    function set(uint x) {
        storedData = x;
    }

    function get() constant returns (uint) {
        return storedData;
    }
}

Kindly correct me if I'm wrong, but it is possible to change x to, say, the value 500, and the transaction that called set(500) will be included in a block, which will make the change in the contract state. If another user calls the get function after the block has been mined, it'll return 500.

However, is it not the case that the block that contains the transaction that called set will be orphaned in the future, and then future get calls would return the previous value (e.g. 0)? Or am I not understanding Ethereum properly?

If what I said is true, how could I be sure that the contract is returning a proper value? Do I need to store somewhere the transaction hash that invoked set and then see how many confirmations it had? Or does a better solution exist?


texts:
I just updated my Parity client on Mac to v1.5.0, but now get this error:

Client service error: Client(Database("IO error: lock /Users/<path>/.parity/906a34e69aec8c0d/v5.3-sec-overlayrecent/db/LOCK: Resource temporarily unavailable"))

Any ideas how to deal with this?


texts: Comparing the array of numbers in Solidity

texts:
I have the following array of numbers:

1. [2, 4, 6, 8]

2. [4, 2, 5, 7]

I need to check whether or not each number of the first array is included in the second array. In that case, a function needs to return true. If at least one number of the first array is not included in the second array, the function needs to return false.

I can do this by comparing each pairs of numbers, but that doesn't seem the most computationally efficient function. What would be the most gas-efficient way to achieve this in Solidity?

UPD: The first array numbers are function inputs, the second array numbers are global variables.


texts: Parity – unlock multiple accounts at startup

texts:
I unlock an account on parity startup using the following arguments:

parity
   --unlock $COINBASE \
   --password $CONFIG_DIR/password \
   ...

How can I unlock multiple accounts at startup?


texts:
I've created a contract
https://ropsten.etherscan.io/address/0xfaba4475358c1c23e37549f9bd54300261873d41#code

And using its  createChild() method
I've created 3 children

https://ropsten.etherscan.io/address/0x79700787ed34aacd736a14f65d46bcfda61b3e9a#internaltx
https://ropsten.etherscan.io/address/0x617214e49c2e31d1a5afa05b1acf8868598e51ce#code
https://ropsten.etherscan.io/address/0x306d7eb3fc1fe3ea09b216f193f2dc10e89698d9#code

Every child contains exacly same code

My question is

Why gas price of creation of every of this 3 children contracts is high (200k gas)
If only first contains unique code ?

Second and third account should have exacly same code hash
in account state tree
https://i.stack.imgur.com/afWDt.jpg

the state database should have only one entry and 3 accounts pointing to it (code is immutable) so gas costs of second and third creation should be much lower since there is no new code written to blockchain only new account created.


texts: Why does my web3 not execute this smart contract function?

texts:
Good day, I am busy with a small project trying to call a buy() function on an Ethereum Smart Contract. This Contract is found on the Ropsten Test Network here:https://ropsten.etherscan.io/address/0xA8E7798546D846Ee17a52d594c410564dF034F90
A user sends ETH to that function, and the contract returns an ERC20 Token(s) in return, depending on the rate and amount of ETH.
Here is the HTML including only the buy function call:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/Style.css">

<input id="amountBuy" value="0">
  <button type="button" id='buybtn' onclick="buyTokens();"> Buy ECHO Tokens </button>

    Status:Loading. ..

I have created the following web3 script to execute the function:

And here is the script I call:
NOTE: I took out the ABI just here to make it more readable, but the correct ABI is in the script
async function loadWeb3() {
  if (window.ethereum) {
      window.web3 = new Web3(window.ethereum);
      ethereum.enable();
  }

}

async function load() {
  await loadWeb3();
  updateStatus('Ready!');
}

function updatebuyStatus(status) {
  const statusEl = document.getElementById('buystatus');
  statusEl.innerHTML = status;
  console.log(status);
}

load();
async function loadContract() {
  return await new window.web3.eth.Contract(ABI , "0xA8E7798546D846Ee17a52d594c410564dF034F90");
}

async function load() {
  await loadWeb3();
  window.contract = await loadContract();
  updateStatus('Ready!');
}

// BUY FUNCTION
async function getCurrentAccount() {
    const accounts = await window.web3.eth.getAccounts();
    return accounts[0];r
}

async function buyTokens() {
  const value = parseInt(document.getElementById("amountBuy").value);
  updatebuyStatus(`Transaction Pending ... ${value}`);
  const account = await getCurrentAccount();
  const coolNumber =  window.contract.methods.buy(value).call();
  updatebuyStatus('Transaction Successfull');
}

Can anyone help me call the buy function?
A metamask popup should appear to let me confirm and/or edit and then I should just send
Thank you in advance :)


texts: Possible error in white paper validation algorithm?

texts:
If we take the block validation algorithm described in the
white paper (Section Blockchain and Mining), it states at point 6:

  Let TX be the block's transaction list, with n transactions. For all i in 0...n-1, set S[i+1] = APPLY(S[i],TX[i]). If any applications returns an error, or if the total gas consumed in the block up until this point exceeds the GASLIMIT, return an error.

Is the bold claim true? I mean if the bold part would be true, would it imply that valid blocks cannot contain transactions with errors?
Or is it simply a generic validation algorithm that does not correspond to the real one?

(I know for sure that there are valid blocks with failed transactions, e.g. out of gas exception, callstack overflow, etc., e.g. https://etherscan.io/tx/0x3967f859c56c61f3365f6873ea001985e4e694952a9c22b68be731132c8e3e77)


texts: How do you automatically get new blocknumbers from transfers on the contract?

texts: I'm new to working with web3 so I'm looking for a way to automatically get the block number from a transaction (Bridge). Is it done with an API? How would it pull the data from something like bscscan?


texts: Error when installing testrpc / truffle on Ubuntu Subsystem on Windows 10

texts:
Node version 7.10.0

npm installed

Ubuntu Subsystem on Windows 10

I try to install testrpc and truffle.
When I install truffle via

sudo npm install -g truffle

I always get the following error:

npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/debris/bignumber.js.git /home/xxx/.npm/_cacache/tmp/git-clone-f9c59612
npm ERR! /home/xxx/.npm/_cacache/tmp/git-clone-f9c59612/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/xxx/.npm/_logs/2017-06-10T08_24_33_791Z-debug.log

Adding --unsafe-perm does also not help.

When installing testrpc via

sudo npm install -g ethereumjs-testrpc

the installation seems to work but when I run testrpc I get

/usr/lib/node_modules/ethereumjs-testrpc/node_modules/solc/soljson.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](

Error: Cannot find module './build/Release/scrypt'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/scrypt/index.js:3:20)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

Why these errors and what can I do?

Thanks!

Edit:

the TestRPC issue could be solved via

chmod -R 777

on

/usr/lib/node_modules


texts: How do i know how much eth the receiver will get?

texts: I bought some ethereum a long time ago and I'm trying to buy something with it now. I want to make sure the address I'm sending it to gets a specific amount (say 2.00 ETH). When I enter the "amount to send" on MyEtherWallet, should i enter 2.00? Or is the gas/tx fee (don't really understand all this lol) which is specified below subtracted from that amount and so I should put 2.1 or something? Thanks very much.


texts: end process after web3 sendTransaction return transactionHash

texts:
I want to end the process after sendTransaction return transactionHash. Here is my code currently :

const Web3 = require('web3');
const web3 = new Web3("http://127.0.0.1:8545");

async function task(db) {
    const accounts = await web3.eth.getAccounts();
    const length = accounts.length;

    // Do multiple transaction
    while (length--) {
        feeTx = {
            ...
        }
        await web3.eth.sendTransaction(feeTx, async function (err, transactionHash) {
            if (err) {
                // await for db(mongo) insert then continue loop
                await db.insert(err);
            } else {
                console.log("DONE");
                // await for db(mongo) insert then continue loop
                await db.insert(transactionHash);
            }
        });
    }
}
// do db connection first
db = ....
await task(db);
// Close db connection
db.close();
// The process should be ended here.
// but it doesn't end, if one of the transaction is still pending to be mined,
// even I already get all the transactionHash from task()
// The process will be ended when all the transaction is success(mined).

This process won't be ended if one of the transaction is still pending even I already get all the transactionHash. I know can end the process by process.exit(0) manually, but I believe that this is risk for my code(Since it is an async loop). So is there any method and more safety way to end the process after I get all the transactionHash?

Sinice code above is a little bit complicated, this one would be clearly:

const Web3 = require('web3');
const web3 = new Web3("http://127.0.0.1:8545");

async function task(db) {
    const accounts = await web3.eth.getAccounts();
    const length = accounts.length;

    try {
        // Do multiple transaction
        while (length--) {
            feeTx = {
                ...
            }
            // What i want is only the transactionHash(It will return me immediately without the transaction be mined).
            // sendTransaction here will wait until it get the receipt (The transaction is already be mined).
            const transactionHash = await web3.eth.sendTransaction(feeTx);
            // transactionHash logging
            await db.insert(transactionHash);
        }
    } catch (err) {
        // Error logging
        await db.insert(err);
    }
}
// do db connection first
db = ....
await task(db);
// Close db connection
db.close();
// The process will end here. With long processing since it wait until all the transaction be mined


texts:
I have created an ERC-20 token called  FBC in Ethereum however I am supposed to trigger the price of the FBC with my parameter service produced from the broadge soccer data. For instance, when Fenerbahçe wins a match the price of the FBC should be increased.

However, as I have researched over the web I couldn't find any instance or hint for this case and what I am asking you

Am I using the right type of token?

Should I create another instance of value in my smart-contract to assign as the FBC or should I change the pattern of the token?


texts: Oraclize: oraclize_newRandomDSQuery always reverted

texts:
I'm using oraclize for generating random number for my smart contract. I have tested successfully with 2 methods:

Using WolframAlpha
Using random.org service

But when I try oraclize_newRandomDSQuery. My transaction always reverted. I don't know why Here is my code:

function _sendRandomQuery(uint256 _gasLimit) internal returns (uint256) {
           oraclize_newRandomDSQuery(0, 7, 200000);
           return 100;

}

Please tell me why.


texts: How to get the return type of a function of an already deployed contract?

texts: I am currently working on a real estate blockchain project. Now I have 2 contracts user.sol and property.sol. The person who is registered on the website through user.sol can only buy or sell property in property.sol. I have a modifier in user.sol contract named CheckingRegistration which checks the person who is requesting to buy or sell property in property.sol is registered or not. I have deployed my user contract on blockchain. Now my question is how do I access the state of a person that whether he is registered or not in my property.sol which will deploy later.


texts: Is it possible to call contract methods protected with modifier like onlyOwner without access to the node with the keyfile using only private key? I know that I can create raw transaction and sign it using ethereumjs-tx but when I need to execute chain of 4-5 transaction it becomes boring. I'd like to use truffle-contract infrastructure.


texts:
I need some fast advice, so whoever helps me ill be forever grateful.

I was wondering what would be the best way to make an app that allows users to buy ERC20 tokens and trade them amongst other users?

Let me provide an example of what it should be able to do?

Allow user to buy my erc20 token with a form field value
Allow user to send token balance to another address

Can somebody please provide me direction!


texts: How can I read the entire Solidity warning in the Remix browser?

texts: When I get a Solidity warning in the Remix browser, I can usually just hover over the warning symbol to the left of the editor and read the error message. But, this time the end of the error message is off the screen to the right. How can I capture/see the rest of the off-screen message? The only way I've found, so far, is to zoom out the whole web page. Is there a better way?


texts:
I am focused on understanding Proof of Work (PoW) vs Proof of Stake (PoS).

One idea I liked is that we can see the mining of a block as a lottery of probability P, where I buy a ticket of cost C using my hardware and electricity, to obtain a reward R.

Since R should be simple to obtain (the value in ETH of the reward times value of ether in fiat), I want to set up figures for P and C.

What is the simplest way to reach these figures? Starting of course with Hash Rate and Total Difficulty. What are the most popular techniques to arrive to those values?


texts: Importing files from an "outside" folder

texts:
I am trying to import files from a relative path outside of my Truffle-project folder:

import '../../../common/solidity/contracts/token/ERC20/BurnableToken.sol';
import '../../../common/solidity/contracts/token/ERC20/MintableToken.sol';

But when I compile with solc.exe, I get the error File outside of allowed directories.

BTW, I have no idea how come solc.exe has any knowledge of my Truffle-project folder.

In any case, checking the docs, I found the following related information:

  Note that solc only allows you to include files from certain directories: They have to be in the directory (or subdirectory) of one of the explicitly specified source files or in the directory (or subdirectory) of a remapping target. If you want to allow direct absolute includes, just add the remapping =/.

But I fail to understand the meaning of just add the remapping =/.

Can anybody please shed some light on this statement?

How exactly can I import those two files correctly?

Thank you!!!


texts:
i have tried several branches and all fails, has anyone got this working on openbsd?

an issue has been created on github about this aswell
https://github.com/ethereum/solidity/issues/5728


texts:
I'm trying to monitor events using web3.js, with the allEvents() method. Is there a way to get a unique identifier for the event that was called?

When calling watch, the things you get from the callback are:

address: String, 32 Bytes - address from which this log originated.
args: Object - The arguments coming from the event.
blockHash: String, 32 Bytes - hash of the block where this log was in. null when its pending.
blockNumber: Number - the block number where this log was in. null when its pending.
logIndex: Number - integer of the log index position in the block.
event: String - The event name.
removed: bool - indicate if the transaction this event was created from was removed from the blockchain (due to orphaned block) or never get to it (due to rejected transaction).
transactionIndex: Number - integer of the transactions index position log was created from.
transactionHash: String, 32 Bytes - hash of the transactions this log was created from.

Obviously, "event" is not sufficient as there can be multiple events with the same name but different signatures.

Thanks!


texts: Increase all values of mapping or array without loop

texts:
Would it be possible to increase all the values of a mapping or array (without a loop)?

Example:

mapping(address => uint) score;

uint[] values;

function increase_scores() public {
    // Example pseudo-code for mapping and array:
    score.all += 1; // ??
    values += 1; // Ex.Something like the python map(lambda x: x+1,list) ??
}

Edit: To provide more context, I have a mapping with users and scores. Every time I call the function increase_scores, I would like to increase the score of all the users of the mapping. Therefore, I wouldnt want to loop on the full array as I may run out of gas, if there are many users.

Edit: The map example of python is also not a good idea as at the end as it has to iterate over all the array or mapping..it will run out of gas too. There is no difference with the loop.


texts: is there a way to get the result of web3's encodeFunctionCall with ethers?

texts:
I'm using web3 to get the RLP encoded data for a function call like so

const safeTransferFrom: any = tokenERC1155Abi.find((f) => f.name === 'safeTransferFrom');
const params: Array<any> = [identity, minterAddr, 1, amount, '0x0'];
web3.eth.abi.encodeFunctionCall(safeTransferFrom, params);

is there a way to achieve the same result with the ethers.js library?


texts: Is there a smart contract to send my balance to a new wallet once it reaches a certain level?

texts: Is there a smart contract or anything that could send my balance to a new wallet once it reaches a certain level?


texts:
The web3.js API allows for synchronous RPC batch requests
with the example given as:

var batch = web3.createBatch();
batch.add(web3.eth.getBalance.request(
    '0x0000000000000000000000000000000000000000', 'latest', callback));
batch.add(web3.eth.contract(abi).at(address).balance.request(address, callback2));
batch.execute();

However when I try to implement it in my frontend like this:

var batch = web3.createBatch();
batch.add(currentK.claimFor.request(holderAddr.get(),{from:holderAddr.get(), gas:300000}));
batch.add(currentK.claimFor.request(to,{from:holderAddr.get(), gas:300000}));
batch.add(currentK.transfer.request(to, amount,{from:holderAddr.get(), gas:300000}));
batch.execute();

...where claimFor is an ABI function.  edit as ABI was incorrectHowever it bombs out and the console presents an error message:

The actual problem is that no activity is seen to be put against the blockchain.

--edit--

logging to console through a callbacks on the added functions returns the error:
Error: invalid argument 0: cannot unmarshal non-string as hex data.  In both claimFor and transfer the first arg is a string containing a valid address.


texts: Pyethapp Build error: No files/directories in ..pip-build-gpzcs1\leveldb\pip-egg-info (fr om PKG-INFO)

texts:
I'm new to ethereum & do not have any ethereum clients 'installed'.
I'm trying to install pyethapp in a clean virtualenv following the github tutorial, but it produces the following error.

  pip install pyethapp

Collecting scrypt (from pyethapp)
  Using cached scrypt-0.7.1-cp27-none-win32.whl
Collecting gipc==0.4.0 (from pyethapp)
  Using cached gipc-0.4.0.zip
Collecting werkzeug (from pyethapp)
  Using cached Werkzeug-0.11.9-py2.py3-none-any.whl
Collecting ipython>=3.0.0 (from pyethapp)
  Using cached ipython-4.2.0-py2-none-any.whl
Collecting CodernityDB (from pyethapp)
  Using cached CodernityDB-0.5.0.tar.gz
Collecting statistics (from pyethapp)
  Using cached statistics-1.0.3.5.tar.gz
Collecting pyyaml (from pyethapp)
  Using cached PyYAML-3.11.zip
Requirement already satisfied (use --upgrade to upgrade): wheel in c:\users\user01\desktop\ethereum\
venv\lib\site-packages (from pyethapp)
Collecting pexpect (from pyethapp)
  Using cached pexpect-4.1.0-py2.py3-none-any.whl
Collecting leveldb (from pyethapp)
  Using cached leveldb-0.193.tar.gz
No files/directories in c:\users\user01\appdata\local\temp\pip-build-gpzcs1\leveldb\pip-egg-info (fr
om PKG-INFO)

Do I need to install this thing called 'leveldb' manually? Or am I doing something wrong?


texts: How to generate address from an Extended Public key?

texts:
How can I generate a wallet address when given an Extended Public Key?

For example, an xpub key from Electrum?

I know this can be done with bitcoin and litecoin, is there a way to do it with Ethereum?

Thank you


texts: Smart contract transaction takes different amounts of gas on different platforms

texts: I have an ERC-20 token contract on which I want to perform some testing on a local chain. I got my chain setup, contract deployment and testing scripts ready on my Windows machine. However, since I wanted to test with multiple miners which is not possible on my laptop, I decided to create the same setup on a docker image and run it on a more powerful server that I have access to. For some reason, with the same contract code, transfer transactions which used to take 34 000 gas on my windows setup, now take 6 700 000 gas per transfer on my docker. This kind of screws my tests which include sending many transactions, as now only 1 transaction is added per block (I have set the block limit to 10 000 000). I am very confused as of how can the same transaction take  more than 100 times the gas it used to take?


texts: An error when trying to return a static array

texts:
This compiles:

This don't:

Untitled:3:9: Error: Type uint8[2] memory is not implicitly convertible to expected type uint8[2] storage pointer.
        uint8[2] z = [255,255];
        ^--------------------^

What's going on behind the scenes in the second example?


texts: Scalability of private chain with 0 block time

texts: What could be some issues in scalability if a block time of 0 is set to a private ethereum blockchain? If I set it to zero, blocks will only be added to the blockchain every time there's a single transaction. But what happens when the chain scales and you have say, 100 transactions occurring at the same time?


texts: Balance overflow - ethereum sample token

texts:
Here is the first example token.

pragma solidity ^0.4.20;

contract MyToken {
    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function MyToken(
        uint256 initialSupply
        ) public {
        balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
    }

    /* Send coins */
    function transfer(address _to, uint256 _value) public {
        require(balanceOf[msg.sender] >= _value);           // Check if the sender has enough
        require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
        balanceOf[msg.sender] -= _value;                    // Subtract from the sender
        balanceOf[_to] += _value;                           // Add the same to the recipient
    }
}

I don't understand this line code:

require(balanceOf[_to] + _value >= balanceOf[_to]);

Because _value is an unint, why do we need to check if the final amount of recipient is greater than or equal to the previous amount? I see that this line of code always returns true, I do believe I miss something here. If you know why we need to check this, please let me know. Thanks!


texts: Import error in Truffle Pet Shop tutorial

texts:
I'm executing an example in the Truffle Pet Shop tutorial.

While testing with file TestAdoption.sol, I have encountered the following error:

Source truffle / Assert.sol not found

The source code causing the error is:

pragma solidity ^0.4.17;

import "truffle/Assert.sol"; // error source truffle / Assert.sol not found"
import "truffle/DeployedAddresses.sol";// error source truffle/DeployedAddresses.sol not found"
import "../contracts/Adoption.sol";

contract TestAdoption {
  Adoption adoption = Adoption(DeployedAddresses.Adoption());

}

Any suggestions to solve the problem?


texts: geth RPC API to check if geth is running in testnet or mainnet?

texts: Simple question: is there a way to query geth to know if it was launched with --testnet flag or not?


texts: Quorum nodes with different permissioned-nodes.json files

texts: Is it possible for different Quorum nodes to have different permissioned-nodes.json files? suppose we have a 3 node network with node1, node2, and node3. Then can node1 include node3 in its permissioned-nodes.json but node2 exclude it? what happens in this situation? can node3 start connecting to the network and receive blocks?


texts: Why am I getting "Invalid number of arguments to Solidity function" on Etherscan?

texts:
I'm trying to call a function via the Etherscan UI. I made sure the input data is correct, but I keep getting this error:

Invalid number of arguments to Solidity function

What's wrong?


texts: Is it worth developing on ethereum? Will the chain last?

texts:
After crypto kitties, many people are wondering if the scaling issue will ever be solved. The traffic is exponential, what would happen if 2 more crypto kitties came out at the same time?

I decided to ask the experts (you guys) who know the most.


texts:
There are a few questions on creating transactions and signing them offline using ethereumjs-tx. What I'm interested in is how do we build the binary data field based on the desired functionality.
E.g. what is the binary data equivalent of 'execute method1 with 'foo' and 7 as arguments'?

I was planning on creating a transaction to do what I want using web3 and just stealing the bytecode from that, but it seems hacky. Any suggestions would be much appreciated!


texts:
I have a function where I pass a id. With that id the contract find in a mapping a struct. My idea is to check if exists that struct with the given id with a if clause.

I try with 0, null, "".

Is that possible?
Thx


texts: Are not send transactions from coinbase account

texts:
i have a Ethereum-Wallet with 2 accounts. Transactions from first account(Main account (Etherbase)) not sending but incoming transactions working correctly.
EtherWallet output:

[2016-10-11 10:57:49.034] [INFO] (ui: wallet) - EVENT LOG:  { '0': 'The transaction from Main account (Etherbase) to SE couldn\'t be successfully executed.' }

Sending via geth also does not work.
Second account works normal.
What could be the problem?


texts: Is there any sort of reentrancy attack that could go along with using this line of code in my smart contract?


texts: Testing solidity transfer method not transferring tokens

texts:
I have this solidity contract:

contract Token {

  mapping(address => uint256) public balanceOf;

  event Transfer(
    address indexed _from,
    address indexed _to,
    uint256 _value
    );

  constructor(uint256 _initialSupply) public {
    owner = msg.sender;
    balanceOf[msg.sender] = _initialSupply;
    totalSupply = _initialSupply;
  }

  function getTokens() public returns (bool success){
    balanceOf[owner] -= 48;
    balanceOf[msg.sender] += 48;
    emit Transfer(owner, msg.sender, 48);
    return true;
  }

}

When I run this using ganache and truffle manually, the method getTokens() works fine. I tried to write a test for it, but it does not transfer the tokens and tells me the balance of account 1 is 0.

let ControlToken = artifacts.require("./ControlToken.sol");

contract('ControlToken', function (accounts) {
    it('transfers token ownership', function() {
        return ControlToken.deployed().then(function(instance) {
            let tokenInstance = instance;
            return tokenInstance.getTokens.call({ from: accounts[1] });
        }).then(function(success) {
            assert.equal(success, true, 'it returns true');
            return tokenInstance.balanceOf(accounts[1]);
        }).then(function (balance) {
            assert.equal(balance, 48, "Balance should be 48")
        });

    });
});

This tests fails when i run it using truffle test. According to Solidity Transfer Token Test Case is not working fine. the problem may be that I'm using call() on getToken instead of send(), yet when i try send() the test does not recognize the command. Any help would be much appreciated!


texts: Questions regarding Safe Remote Purchase contract in Solidity docs

texts:
I'm looking to build a simple store dapp where users can buy products with Ether and I came across this Safe Remote Purchase contract in the Solidity docs and I am looking for some further explanation in how this contract works.

My understanding is that a seller must deposit twice the amount of Ether they would like to sell an item for. A buyer must then also send twice the purchase price of Ether. At that point the contract is locked until a buyer calls confirmReceived at which point, the buyer and seller are returned half of what they deposited back. How does the seller then receive the remaining balance in the contract? Is it expected that a developer would include an additional withdrawal function for the seller?

Is the reasoning for depositing 2x the value supposed to act as a dispute resolution tool? It would seem that if confirmReceived is never called the Ether in the contract is essentially burnt?

Also am I correct in understanding that in order to take advantage of the ability for a buyer or seller to "block the refund" in confirmReceived their address would have to be a contract that had some logic within their fallback function to verify that the amount they were receiving is correct?

// This actually allows both the buyer and the seller to
// block the refund.
if (!buyer.send(value) || !seller.send(this.balance))
   throw;


texts:
...
Source file requires different compiler version (current compiler is 0.8.2+commit.661d1103.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version
...

In truffle-config i have set
...
  compilers: {
    solc: {
       version: "0.5.16",    // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)
      // settings: {          // See the solidity docs for advice about optimization and evmVersion
      //  optimizer: {
      //    enabled: false,
      //    runs: 200
      //  },
      //  evmVersion: "byzantium"
      // }
    }
  },
...

But I'm getting error when I run truffle test.
  TestFirst
    1) testAge
    > No events were emitted

  0 passing (25s)
  1 failing

  1) TestFirst
       testAge:
     Error: Returned error: VM Exception while processing transaction: revert
      at Context.<anonymous> (C:\Users\92311\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\testing\SolidityTest.js:92:1)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
...


texts: Increase gas after sending a transaction

texts:
I am sending a transaction with sendSignedTransaction :
const tx = new Tx({
   ...
   "gasPrice": web3.utils.toHex(41 * 1e9),
   ...
}

await web3.eth.sendSignedTransaction(serializedTx)
  .on('transactionHash', (hash) => {
      console.log('waiting....');
  })
  .on('receipt', (receipt) => {
      console.log('... Transaction validated !');
  });

It works fine. Here is what i want to do:

I want to set a very low value for gasPrice: For example 41 gwei
If the transaction is not validated after 15 seconds, i want to increase gasPrice to 51 gwei
etc.

How can i do that programmatically ?
Thanks


texts: rpc call "personal_signAndSendTransaction/eth_sendTransaction" sending tokens but losing ether 3 hours later

texts:
Using rpc call personal_signAndSendTransaction/eth_sendTransaction to send token on Ropsten testnet.
Tokens were received but extra ether were charged and 0.19958 ether were taken from the sending address for three times and all send to an address:
0xbc3edbdfe92dfe06bc005d499b2a35649baec237

The only difference for personal_signAndSendTransaction and eth_sendTransaction is that when using eth_sendTransaction, all ethers in the address will be gone.
Not sure if anyone has similar experience but that seems to be a very serious issue.

System information

Geth version: geth version

  Version: 1.8.1-stable

OS & Version: Windows/Linux/OSX
Linux
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

Go Version: go1.9.4

Commit hash : (if develop)
Git Commit: 1e67410e88d2685bc54611a7c9f75c327b553ccc

Expected behaviour

Geth connect to testnet Ropsten and all addresses, contract, and transactions are on Ropsten.
sending tokens to my wallet address using following RPC call.
RPC call: personal_signAndSendTransaction
Token Transaction received by the destination account.                       OK

Actual behaviour

The expected token transactions was sent but three hours later, three ether transactions occurred and a total of 3x0.19958 ethers were take away from the address: 0x2f6e4dd0286aacdbfa88db0e92cc7a1c89709175.

0x7c6121679ddeae6aa42759acbf4a8032560438440f69a1103d983e3110c90941 | 2882698 | 8 hrs 58 mins ago | 0x2f6e4dd0286aacdbfa88db0e92cc7a1c89709175 | OUT | 0xbc3edbdfe92dfe06bc005d499b2a35649baec237 | 0.19958 Ether | 0.00042
-- | -- | -- | -- | -- | -- | -- | --
0x342b729dbf7763aff4d606cf4f2f99e10dda6910a876136753bd27975e13ad8b | 2882698 | 8 hrs 58 mins ago | 0x2f6e4dd0286aacdbfa88db0e92cc7a1c89709175 | OUT | 0xbc3edbdfe92dfe06bc005d499b2a35649baec237 | 0.19958 Ether | 0.00042
0x38fde4291f48fac9bcf42a79570f04b7841f2cb58a01d8148e9dbf13e434c08f | 2882698 | 8 hrs 58 mins ago | 0x2f6e4dd0286aacdbfa88db0e92cc7a1c89709175 | OUT | 0xbc3edbdfe92dfe06bc005d499b2a35649baec237 | 0.19958 Ether | 0.00042

Steps to reproduce the behaviour

{
    "jsonrpc":"2.0",
    "method":"personal_signAndSendTransaction",
    "params":[
        {
            "from": "0x2f6e4dd0286aacdbfa88db0e92cc7a1c89709175",
            "to": "0x567527C374602B9d206DDfaf001dECA3F595b7b5",
            "gasLimit" : "0xcc40",
            "value": "0x0",
            "data": "0xa9059cbb0000000000000000000000005fec1b24b198ecf5feb9e44ec79314594225c85300000000000000000000000000000000000000000000021e27c1806e59a40000"
        },
            "bitontop123"
    ],
    "id":1
}

TxHash:
0xb6f795f717fd5f95c2c4157802c9946e68c6c2caa61a83aee280d20f634e3646
TxReceipt Status:   Success
Block Height:          2881961 (3846 block confirmations)
TimeStamp:            11 hrs 59 mins ago (Mar-22-2018 05:15:55 AM +UTC)
From:                     0x2f6e4dd0286aacdbfa88db0e92cc7a1c89709175
To:                         Contract 0x567527c374602b9d206ddfaf001deca3f595b7b5
Token Transfer:      10,001 ERC20 (TESTOKEN)  from 0x2f6e4dd0286aacdbfa88db0e92cc7a1c89709175to  0x5fec1b24b198ecf5feb9e44ec79314594225c853
Value:                     0 Ether ($0.00)
Gas Limit:               90000
Gas Used By Txn:   38036
Gas Price:               0.00000002 Ether (20 Gwei)
Actual Tx Cost/Fee:              0.00076072 Ether ($0.000000)
Nonce:                   1436
InputData:              Function: transfer(address _to, uint256 _value) ***
                               MethodID: 0xa9059cbb
                               [0]:  0000000000000000000000005fec1b24b198ecf5feb9e44ec79314594225c853

                               [1]:  00000000000000000000000000000000000000000000021e27c1806e59a40000

Backtrace

[backtrace]


texts: Ganache + Truffle: how to deploy a contract without considering the gas

texts:
I am working with Ganache and Truffle.
I am trying to deploy kind of a huge smart contract, but most of the functions in this smart contract are pre-prod functions, so I do not really worry about real-world migration.

Therefore, I am trying to deploy my smart contract with ganache locally without wanting to worry about gas usage.
No matter what I have tried, I still get the error:

"SmartContractName" ran out of gas (using a value you set in your network config or deployment parameters.)

I've been playing with Ganache block-limit and gas price: ganache-cli -g 0 -l 1000000000000
I've been playing with the gas in the migration file return deployer.deploy(SmartContractName, { gas: 400000000000 })

And I've been playing with truffle-config:

development: {
    host: "localhost",
    port: 8545,
    network_id: "*",
    gas: 1000000000,
    gasPrice: 0
}

So far, nothing has worked. Does anyone have a solution?


texts: How to know how much gas will be consumed for a specific action on the Ethereum blockchain?

texts: I'm new to Ethereum and can't wrap my head around the estimated gas for a particular contract. If the contract consists of code which calls on specific functions, why can't the Dapp tell me in advance EXACTLY how much gas the particular action will cost?


texts: Ethereum transaction giving error 'invalid sender'

texts:
This is how my contract looks like -
pragma solidity >=0.4.25 <0.8.0;

contract Calculator {
    uint public result;

    event Added(address caller, uint a, uint b, uint res);

    constructor() public {
        result = 777;
    }

    function add(uint a, uint b) public returns (uint, address) {
        result = a + b;
        emit Added(msg.sender, a, b, result);
        return (result, msg.sender);
    }
}

Above contract is deployed on Ropsten test net. And I am trying to invoke the add(...) function with a transaction. And my code looks like this -
const accountAddress = rtUtil.getAccountAddress();
const accountPk = Buffer.from(rtUtil.getAccountAddressPk(), "hex");
const contract = await rtUtil.getCalculatorContract();
const data = contract.methods.add(3, 74).encodeABI();

const web3 = rtUtil.getWeb3();
const taxCount = await web3.eth.getTransactionCount(accountAddress);

const txObject = {
   nonce: web3.utils.toHex(taxCount),
   to: rtUtil.getCalculatorContractAddress(),
   value: web3.utils.toHex(web3.utils.toWei('0', 'ether')),
   gasLimit: web3.utils.toHex(2100000),
   gasPrice: web3.utils.toHex(web3.utils.toWei('6', 'gwei')),
   data: data
};

const commmon = new Common({chain: "ropsten", hardfork: "petersburg"});
const tx = Transaction.fromTxData(txObject, {commmon});
tx.sign(accountPk);

const serializedTx = tx.serialize();
const raw = web3.utils.toHex(serializedTx);
const transaction = await web3.eth.sendSignedTransaction(raw);

And when I run the code I get error -
Uncaught Error: Returned error: invalid sender
Process exited with code 1

My Nodejs versions is v15.1.0
And my package.json dependencies are -
"dependencies": {
  "@ethereumjs/common": "^2.0.0",
  "@ethereumjs/tx": "^3.0.0",
  "@truffle/contract": "^4.2.30",
  "@truffle/hdwallet-provider": "^1.2.0",
  "web3": "^1.3.0"
}

Can anyone tell me what I am doing wrong?
Thanks in advance.


texts: Error: random is not a function solidity/web3js

texts:
I am trying pull a random number generated from a function on my smart contract that uses the' block difficulty' and the 'block time stamp'.

The solidity code looks like this:

pragma solidity ^0.4.18;

 contract ApprovalContract {

  function random() external view returns (uint8){
  return uint8(uint256(keccak256(abi.encodePacked(block.timestamp,
  block.difficulty)))%251);
  }
 ...
 }

The application code written in JS looks like this:

ApprovalContract.methods.random().call(
        function(error, result) {
            if (error) {
              console.log('error: ' + error);
            }
            else {
              console.log('result: ' + JSON.stringify(result));
            }
          });

All I need to do is log the randomly generated number to the console. Unfortunately, I keep seeing "Uncaught TypeError: ApprovalContract.methods.random is not a function"


texts:
I am making a dapp and I am trying to import modules. The structure of my folders is the one that you can get from the truffle webpackage, the following:

-App
---build
---constracts
---migrations
---node_modules
-----ethereumjs-tx <--- module to import
---src
-----js
-------app.js <-------- App where I am calling the module
--test

I am writing:

const Tx = require('ethereumjs-tx');
const Tx = require('../../node_modules/ethereumjs-tx');
const Tx = require('{all my path}/ethereumjs-tx');

I also tried copying the module in my own directory

const Tx = require('/ethereumjs-tx');
const Tx = require('./ethereumjs-tx');

and changing const to var, but I always get the same error:

Cannot find module 'ethereumjs-tx'

Any idea how to solve that? or is there another way to use this module?


texts: Deployment Failed | hit a require or revert statement somewhere in its constructor

texts:
I create a custom ERC20Token and a contract to store data sent from web3.Js. after storing data in mapping I would like to call ERC20Token contracts functionality inside this contract.

code of contract to store data in mapping.

import './EMPToken.sol';
contract socialposts {

//address payable public  owner;
EMPToken token;
address _empTokenAdr = 0xd3591733C103EaCfBE7e0c2b4C037764dA836FDe;
constructor() public {
// owner = msg.sender;

createPost('I am using Blokchain','David Abrahim');

}
function createPost(string memory content,string memory name) public {
   postCount++;
   posts[postCount] = post(postCount,content,name,msg.sender);
   //msg.sender.transfer(msg.value);
   token = EMPToken(_empTokenAdr);
   token.approve(msg.sender,2);
   }
}

Below are the version information
Truffle v5.1.5 (core: 5.1.5)
Solidity v0.5.12 (solc-js)
Node v10.16.3
Web3.js v1.2.1

I am using Ganache blockchain with truffle. "socialposts" is a contract that takes input from UI and stores(I didnt include all code of this contract here). EMPToken.sol is my custom ERC Token. I want to trigger the "transfer" function of ERCToken inside "socialposts" contract.

Below is the error message i am getting

Error:  * Deployment Failed *

"socialposts" hit a require or revert statement somewhere in its constructor. Try:
   * Verifying that your constructor params satisfy all require conditions.
   * Adding reason strings to your require statements.


texts:
I nead to prepare a birth certificate to declare a newborn.

Does anyone know where I can find examples birth certificate with solidity ?


texts: Configure Truffle Compiler: Default Import Folder

texts:
I want to use an external library. I guess it is good to load the library in production from a CDN because this requires less space and should be faster.

import "github.com/Arachnid/solidity-stringutils/strings.sol";

But in dev this library cannot be found:
Cannot find import strings.sol from Challenge.sol. If it's a relative path, ensure it starts with ./ or ../.

I read in this post:
How should we set a import path in solidity?

And in this tutorial:
http://solidity.readthedocs.io/en/latest/layout-of-source-files.html

  When the compiler is invoked, it is not only possible to specify how to discover the first element of a path, but it is possible to specify path prefix remappings so that e.g. github.com/ethereum/dapp-bin/library is remapped to /usr/local/dapp-bin/library and the compiler will read the files from there.

So I created the folders
/usr/local/dapp-bin/library/solidity-stringutils/ and downloaded the github repo to that folder.

I also tried to put it directly into
/usr/local/solidity-stringutils/

But I' still getting:
    Cannot find import strings.sol from Challenge.sol. If it's a relative path, ensure it starts with ./ or ../.

Can I configure truffle that it takes libraries from a default folder. Good would be github.com/*/lib-name => ./vendor/lib-name


texts:
I'am trying to hash two bytes16 variables to produce bytes32 or bytes16 variable :

bytes16 T=hash(bytes16 t1, bytes16 t2)

I looked in documentation but I didn't find anything


texts: In Ethereum, is it possible for a malicious client to duplicate a coin by double executing a transaction?

texts:
Is it possible a scenario in which a malicious client executes two transactions with the same nonce of a specific account and copies and sends coins?
Suppose users A, B, and C have the following balances:
A: 3, B: 0, C: 0
Tx1 : { nonce:1, data : { receiver: B, amount: 3 } } from User 'A'
Tx2 : { nonce:1, data : { receiver: C, amount: 3 } } from User 'A'
Assuming that both transactions are executed and included in the blockchain, is the following balance status possible?
A: 0, B: 3, C: 3
Is it possible for a malicious client to attempt consensus by including those two transactions in the blockchain as in the following situation?


texts: What actually a block contains, is the data inside it a virtual or physical entity?

texts:
My understanding of a block in blockchain is that it is a data structure that contains information like Block Size, Block Header, Transaction Counter and then Transactions. Deeper in the Block Header we have information like Previous Block Hash, Merkle Root, Timestamp, Difficulty Target and Nonce.

Recently, I appeared for an interview and my above explanation of what actually makes a block in blockchain was not very much accepted by the interviewer and he quoted that my response was not up to the mark.

Though my question is not related to coding per se, I wish to clear my concepts here. Will appreciate if someone can guide me here as to what could have been the best technical answer in my case. Will appreciate a pointer to an article or any other document which explains these underlying concepts in details.


texts: member not found or not visible after argument-dependent lookup in mapping

texts:
pragma solidity >=0.4.0 <0.7.0;

contract New{

    mapping(address => string) public users;

    string name;

    address[] public userAddress ;
    //string[] public userNames;

    function updateUser(string memory name) public{
        users[msg.sender]= name;

    }
    function getUser(address[] calldata) external view returns(string memory){
        return users.name;
    }

}

I want to set a name and I want to get my name.For this reason I made a getUser func. but I can't get my name.

but I have got a error like this :

browser/asd.sol:17:16: TypeError: Member "name" not found or not visible after argument-dependent lookup in mapping(address => string storage ref). return users.name; ^--------^

what should I do ?


texts:
hope everyone's doing ok.
So I am really interested in blockchain development. My programming experience so far has been C++
and a little bit of Python. I know the basics of Javascript as well.
So I have recently learned Solidity as well (add this to my programming experience). I have learned
the basics of it and I intend to play around with it to learn more and become better at it.
So now I am looking for the next step. I have been looking up courses online, paid ones so that I can get proper guidance for everything but I can't seem to find a proper course. I did take a specialization on Coursera for Blockchain by Buffalo University. However that's not really enough. I want to builds dApps and stuff but can't find the right direction to learn everything. If possible, I would like to know what skills/languages/tools I should learn and in what order. This can give me an idea of the direction I need to go in. If possible, do recommend a good course as well if you know about any or a any other good source.
Thank you for your time!


texts: Are Ethereum State Channels unidirectional or bidirectional?

texts: Could anyone please tell me if the state channels are unidirectional or bidirectional? Also, if a node goes off-line with an open channel, is it still able to receive transactions? I mean, not to sign but to receive something. I'm really curious about what would happen when there are short-term disconnections.


texts:
I am trying to deploy an upgradeable smart contract on bsc testnet using hardhat. But after running npx hardhat run --network testnet scripts/deploy.js it gives me the following error.
ProviderError: max code size exceeded
    at HttpProvider.request (D:\rarible-hardhat\protocol-contracts\tokens\node_modules\hardhat\src\internal\core\providers\http.ts:46:19)ts:46:19)                                                                                ccounts.ts:142:34)
    at HDWalletProvider.request (D:\rarible-hardhat\protocol-contracts\tokens\node_modules\hardhat\src\internal\core\providers\accounts.ts:142:34)                                                                                nal\ethers-provider-wrapper.ts:13:20)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at EthersProviderWrapper.send (D:\rarible-hardhat\protocol-contracts\tokens\node_modules\@nomiclabs\hardhat-ethers\src\internal\ethers-provider-wrapper.ts:13:20)

How can I adjust the code size or any other method to resolve this error.


texts: when I use the web3 interface to sign on msgs, it tell me that the account should be unlocked, how can I manage this with geth and what exactly does unlocking mean?


texts: Is there a unicode currency symbol for DAI?

texts:
USD uses the symbol $. Ether has Ξ. Is there an agreed-upon Unicode currency symbol for DAI?

And in your answer, please don't point me to an image of the symbol. I'm asking specifically if there's a Unicode symbol that I can paste into an MS Word document for example.

Bonus points if you include other popular tokens such as USDT or Wrapped Ether.


texts: What's the difference between "pending" block and txpool?


texts: Simple single-node geth test network not mining

texts:
I have set up a test node with geth as described here. I
followed the instructions exactly, except:

I created a second account with personal.newAccount("password") and so use
miner.setEtherbase(personal.listAccounts[1]) (index == 1)
I fiddled with the "coinbase" in the genisis (don't have a good reason, but the one that's there seems arbitrary)
Use a different network ID: 531453

The problem is that it isn't mining even though all things indicate it should be mining...

> eth.mining
true
> eth.hashrate
0
> net.listening
true
> eth.blockNumber
1

Any troubleshooting advice?

Info

environment

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
$ uname -a
Linux ip-172-31-20-178 4.4.0-1052-aws #61-Ubuntu SMP Mon Feb 12 23:05:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

geth

$ geth version
Geth
Version: 1.8.8-unstable
Git Commit: 577d375a0df08710e52b1c38720f98a7f25d206a
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.9.2
Operating System: linux
GOPATH=/go
GOROOT=/usr/lib/go-1.9

the command

geth --datadir /meth/footh \
    --nodiscover --maxpeers 25 --rpc --rpcapi db,eth,net,web3 \
    --rpcport 8080 --port 30303 --identity footh --rpccorsdomain "*" \
    --networkid 531453 --mine --minerthreads 1 --etherbase 0xebee17d2d1aa3b21bd291360fea65597daa203d5 \
    console
    # this is the etherbase account I set up as per the instructions

genisis.json

{
    "nonce": "0x0000000000000042",     "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x",     "gasLimit": "0x8000000",     "difficulty": "0x400",
    "config": {},
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x3388888888888888888888888888888888888888",     "alloc": {     }
}

peer

I did create and successfully connect a peer after much troubleshooting. In case it's relevant. It has the same problem. Mining not happening but enabled, etc:

> admin.peers
[{
    caps: ["eth/62", "eth/63"],
    id: "536e146bb7104cabb04b32d68aac7f0f3a41654c4fccc035382ea0504256bd3c6481401943d8928a99df2ea2997963f41459c15520b088a4bd6b0690e12d0768",
    name: "Geth/v1.8.8-unstable-577d375a/linux-amd64/go1.9.2",
    network: {
      inbound: false,
      localAddress: "[::1]:49360",
      remoteAddress: "[::1]:30301",
      static: true,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 132096,
        head: "0x6af5ce3df582c12b0afc173eb208b0fe55de7118c0ddbc675281b7fbf6a42613",
        version: 63
      }
    }
}]


texts: What is the most active Ethereum chatroom for devs? Slack? Telegram? IRC?

texts: Where does most of the ethereum developers hang out? Slack? Telegram? IRC? I'm looking to join a chatroom where everyone can help others while developing.


texts: How can I do a fast geth sync without consuming too much memory?

texts:
My problem is this. The recommended advice in order for geth to run a faster initial sync is to use the option --fast plus a non-default value for the option --cache. The option --cache appears to be necessary if you want the fast sync to progress beyond a few percent of the total block sync. For example, a "mere" value of --cache=512 allows geth to fast sync about half of the now over a million ethereum blocks before going down to regular sync, while --cache=768 leads to a fast sync of 700,000 blocks, suggesting a rough ratio of 1 MB RAM per fast sync'd block.

As regular sync is superslow, I'd like the fast sync to progress past the million-block mark. Unfortunately, a value of --cache=1024 leads to an out-of-memory crash. Is there a way to do a fast initial sync without geth consuming gobs of memory?


texts: How to find transaction info when it's not showing up in the explorers

texts:
About an hour ago, I have deposited 0.05 ETH to this address: 0x1da075fd6816e5477125922282e540084e308be8

The geth output shows:

INFO [09-05|19:12:59] Submitted transaction                    fullhash=0x21da1d09b186e8929d29d945487ff0aba4efa09744b4ec082c4a7b1da45ddc23 recipient=0x1da075fd6816e5477125922282e540084e308be8

I have made this transaction using the official Ethereum Wallet, using "light sync". I cannot find this transaction in any blockchain explorer, however the geth output clearly tells me the transaction was submitted. In the Ethereum Wallet UI, I also clearly saw my transaction pending (0/12 confirmations). However, I cannot find this information anymore in the wallet UI, no matter where I look. (I have restarted the wallet since).

I have tried the following explorers, none of them know about my transaction:

EtherScan
EtherChain
EtherCamp

How can I find out what happened to my transaction ?


texts:
I want to install the Mist Wallet and store my Ethereum in it. However, I wanted to know how stable the Mist Wallet is. Is it safe and reliable to use?

The reason I ask this is because there are frequent new Beta releases on the github here: https://github.com/ethereum/mist/releases

So, which version is safe to use and is it OK to store my ethereum in a wallet which is still in Beta phase?

Looks like they are doing bug fixes almost every few days.


texts: How do you implement a front-end contract with back-end functionality in Solidity?

texts: How do you create a front end contract that calls a back end with the idea of being able to upgrade or change the back end contracts without having to redeploy the front end contracts?


texts:
Uncaught (in promise) Error: No "from" address specified in neither the given options, nor the default options.
    at Object._executeMethod (index.js?2fac3b5:942)
    at CampaignNew._callee$ (new.js?76ccf38:18)
    at tryCatch (runtime.js?60a82e3:62)
    at Generator.invoke [as _invoke] (runtime.js?60a82e3:296)
    at Generator.prototype.<computed> [as next] (runtime.js?60a82e3:114)
    at step (asyncToGenerator.js?c130066:17)
    at asyncToGenerator.js?c130066:28

Code is:

 onSubmit = async(event) => {
    event.preventDefault();
    const accounts = await web3.eth.getAccounts();
    await instance.methods.createCampaign(this.state.amount).send({
        from: accounts[0]
    });
};


texts: Is there an API which allows to download source code of contracts?

texts:
I am doing research into the security of smart contracts and was hoping to gather a dataset containing smart contract source codes. I was wondering if there is an API which allows this.

At etherscan you can use an API to get the smart contract ABI, but I'd like the source code. I give this as an example because all verified contracts of etherscan would be a great dataset.

My goal is to analyse these source codes to for instance categorize them based on a taxonomy or check how many of them contain certain patterns.


texts: How to call hash function in solidity to free a stuck smart contract?

texts:
I was selling an altcoin on Etherdelta using a sell order and 3 transactions went through however the ethereum did not show up in my wallet. I contacted support and they say that "your altcoin is stuck in the smart contract" and "you need to call in a hash function for solidity". I have no idea what that means.

Here are the transactions:

0x22d6d860c7c2ac7211304a2ef64b092fb860c4b00b87b8092dc3aef2549450f6

0x1dfe2a2a41561c1660f02b92c770d550d3ff70dc73fad15c4dfece867ba8e757

0xd36988c5ac1c1648543f9c653870bd6652c886a39a8b78e66bae097d60b291fa


texts: Could I use Infura to get the token details?

texts:
I went through https://infura.io/docs but not sure if Infura could allow me to read token details like owner, token Id, etc. I also googled on how to read token using Infura but to no avail.

Has anyone tried it?


texts:
I'm running a parity supernode, recently switched from geth because parity seems to perform much better, even in archive mode.

To log the standard output of geth, I used to run:

geth [options] console 2>>/tmp/geth.log

I tried to run similar command for parity, but it wont log the standard out.

 ~ $ parity --help | grep -A1 log
  -l --logging LOGGING     Specify the logging level. Must conform to the same
                           format as RUST_LOG.

Natively, parity allows to set a logging level. But how can I make parity actually write logs?


texts: Does Solidity have any keyword to spool out results into an external file like .txt or .csv or .dat?


texts: How can I know the network id, with web3 or command line, so I know to which network my geth has attached?


texts: how to use ethereumjs-tx.js in a browser

texts:
I have been trying to use ethereumjs-tx in a browser. I have downloaded the browser builds from here https://github.com/ethereumjs/browser-builds/tree/master/dist
This is my code snippet
<head>
    <title></title>
    <meta charset="utf-8" />
    <script type="text/javascript" src="ethereumjs-tx.js"></script>
</head>
<body>
<script>

 var Tx = require('ethereumjs-tx');
    var privateKey = new Buffer('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex');

var rawTx = {
    nonce: '00',
    gasPrice: '09184e72a000',
    gasLimit: '2710',
    to: '0000000000000000000000000000000000000000',
    value: '00',
    data: '7f7465737432000000000000000000000000000000000000000000000000000000600057'
};

var tx = new Tx(rawTx);
tx.sign(privateKey);

var serializedTx = tx.serialize();
</script>

However, it keeps throwing the error in the console
Uncaught ReferenceError: require is not defined


texts: Javascript Client for Light Client Protocol

texts: Is there a Javascript client, even in beta, that implements the Light Client Protocol ?


texts: Why most ERC-20 Tokens Have 18 Decimals?

texts: I don't really understand the fundamental rationale for this. I'd think 0 decimal is much simpler to understand for most people?


texts:
Currently I have only one miners performing in my private network setup with GETH.
I am trying to process multiple transactions at a same time. This keeps throwing an issue as
Returned error: replacement transaction underpriced
I know somehow my transaction didn't succeed. Does having multiple miners solve this? My understanding with multiple miners means transactions get distributed among miners and above mentioned error doesn't appear.
I got stucked since I am not able to process other transactions while one being in progress.


texts: how to monitor transactions from both eth and erc-20 tokens?

texts:
So far, I already could get event logs from contract address(erc-20) by this function:
    sub, err := client.SubscribeFilterLogs(context.Background(), query, logs)

What I want: eth transaction logs
(Using golang/go-ethereum)


texts:
I'm using web3py's getBlock function to get the latest block. I am right now caching the latest 50 blocks so that I reduce the amount of workload in my geth node, and to improve overall speed in my service, since a recently created block is likely to be inspected several times in a short period of time.

In that scenario, could that block change because a different longer chain appeared and the chain my node was following gets invalidated? Or in other words, when I execute w3.eth.getBlock('latest', full_transactions=True) how certain can I be that this block is going to actually remain in the chain?


texts: Ethereum address(generated) and ecrecover computed address is not matching

texts:
I created the Ethereum address by following the below steps .

         1. Generated a public key(ECDSAsecp256k1) from HSM.
         2. Generated a Keeccak256 hash of Q point of ECPublicKeyParameters .
            (Public key type :
            org.bouncycastle.crypto.params.ECPublicKeyParameters)
         3. Took last 40 characters as Ethereum address

Generated address : 0x1e4d916EF29C292aC1c773e6e9C5e31879A65B59

By using the generated Ethereum address a transaction has been created and then signed(SHA256withECDSA) the message by private key(ECDSAsecp256k1) in HSM.i had r,s value as output of sigining.

Then with that r,s and v(27,28) value ,I tried a generate back ethereum address using the ecrecover method and it gave a different address.

ecrecover output address : 0x26EeeeCc7Dc04A302083522949E5e86B98c340e2

If i try with v value as (0,1) , getting the following address from ecrecover

ecrecover output address : 0x0000000000000000000000000000000000000000(v as 0,1)

Is there anything wrong in address generation or signing?


texts: Node 1 is not mining the transaction of node 2

texts:
I have created and started two nodes

Node 1:

$./geth --datadir p22333/ --port 22333 account new

$./geth --datadir p22333/ --port 22333 init genesis.json

$./geth --datadir p22333/ --port 22333 console

Node 2:

$./geth --datadir p22334/ --port 22334 account new

$./geth --datadir p22334/ --port 22334 init genesis.json

$./geth --datadir p22334/ --port 22334 console

Later I added the node 1 with node 2 using the admin.addpeer()

On Node 1 console:

admin.addpeer("hexaddress of node 2")
net.peerCount

  1

On node 2 console:

net.peerCount

  1

personal.unlockAccount("hexaddress of node 2", "password")

  true

eth.sendTransactions({from:"hexaddress of node 2",to:"hexaddress of node 1",value:web3:toWei(40,"ether"),gas:30000})

  0x2312312......

eth.pendingTransaction

  {
  hash:21...
  from:31....
  }

On node 1:

eth.pendingTransaction

  []

It is not showing the pending transactions on other nodes as well as When I mine on node 1, it is not taking the transaction of node 2. Where is my mistake?


texts: How to let an ethereum address reveal its private key when it detects specific contract conditions?

texts: 1. Is this even possible? Can an ethereum address be programmed to do something when certain blockchain conditions are met? All without relying on a 3rd-party to have to observe the blockchain and reveal the address private key manually.


texts: How to get the decimals of ERC20 Token in smart contract

texts:
I have a smart contract which operates with an "external" ERC20 Token. For some calculations I need to access the decimal() function of the ERC20 Token.

In my contract I have the following line:

price = 200 * (10 ** token.decimals());

When I want to compile I get this error: TypeError: Member "decimals" not found or not visible after argument-dependent lookup in contract IERC20.

I initialize the "external" Token through the constructor:

IERC20 private token;

constructor(IERC20 _token) public {
    token = _token;
}

Does anyone know how to get access to the decimals of the token?


texts: What happens if a block signer goes offline on Rinkeby?

texts: Rinkeby relies on a sequence of trusted signers to add blocks to its test chain. What happens if one of these block signers goes offline? How long is the next node in the list supposed to wait before submitting its own block, and how do other nodes know that they weren't Sybil'd out from the supposedly offline node?


texts: 1) "before all" hook: prepare suite for " "

texts:
I am trying to create an Integrated test (to test multiple smartContracts working together). I re-initialize them inside beforeEach() function. So I get the clean test for each test case. I have done the same things in other integrated tests,(using the same contracts), but here I get this errors.

As you can see, there was no issues in IntegrationTestWhitelist (all 4 sub-tests passed)
However, TransactionTests failed

While troubleshooting I figured out that, the TransactionTests works only if I initialize two or less smartContracts in beforeEach().
Any more than that and I get "out of gas" error. I tried to initialize/comment them in different combinations too, and it is always fine as long as I do not initialize more than two. There seems to be nothing wrong with contracts individually. Rather it looks like the are "too" expensive when combined.
So I wonder if anyone had a similar issue?
The Code:
pragma solidity >=0.4.21 <0.7.0;
pragma experimental ABIEncoderV2;

import "../../../contracts/Whitelist.sol";
import "../../../contracts/Blacklist.sol";
import "../../../contracts/dgE.sol";
import "../../../contracts/ECB.sol";
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";

contract TransactionTests {

    //Contracts
    dgE public DGE;
    ECB public ecb;
    Whitelist public WHITELIST;
    Blacklist public BLACKLIST;

    // Run before every test function (Only works if I comment out any two of them)
    function beforeEach() public {
        DGE = new dgE();
        ecb= new ECB();
        WHITELIST = new Whitelist();
        BLACKLIST = new Blacklist();
    }

    /**
    * The function should always return the same value. (Just an initial test)
    */
    function testSender() public {
        Assert.equal(msg.sender,msg.sender,"Values should be Equal");
    }


texts: Error: The send transactions "from" field must be defined!

texts:
I get this error, even though  I do specify the transaction sender.Here is my code:
for(let a=1; a<TEST_ORACLES_COUNT; a++) {
  await config.flightSuretyApp.registerOracle({from: accounts[a], value: fee});
  let result = await config.flightSuretyApp.getMyIndexes.call({from: accounts[a]});
  console.log(`Oracle Registered: ${result[0]}, ${result[1]}, ${result[2]}`);
}

It will accept my code if I put accounts[1] instead of accounts[a]. But I need to loop. Any idea how to get around this?


texts: Is possible accept/confirm transactions with a webapp like metamask?

texts:
I have a webapp for test, in this web i can do transactions with my smart contracts fro pay and change the states of this contracts.

But for confirm the transactions, i'm using metamask with a testaccount of Ethereum in the ropsten testnet. Like this example:

How i can implemantate this confirmation of transactions in mi webapp? i can do it whit web3.js or with similar API? I need the authentication of the user in the blockchain or a wallet?


texts: Is there any way to set up an auto transfer of ETH from one wallet to another when the value hits a certain amount? Eg can I set up a transfer to another wallet to automatically occur ONLY when ETH is at $4000? Thanks in advance. MT


texts: Which recent Parity release can be used to synch a node for use with Mist 0.8.8

texts:
I am finding Geth exceptionally slow to synch.  I found Parity to be much faster. However recent Parity releases make it very complex just to use the Parity client to synchronise and then open Mist.  It would also be helpful to know how to use just the Parity node client and then how to set the dir path to point to the correct chaindata folder rather than create a new one and synch from genesis again.

Thanks for your help


texts: How to pass quotes inside a string via remix?

texts:
How do you pass in a value as a string via remix - if that value includes quotes?
For example
A function takes a string - in remix I enter:
<path id="svg_1" d="m-44.5,88.5c234,144 125,271 124.5,270.5c0.5,0.5 252.5,-74.5 253.5,-72.5c1,2 -12,141 -12.5,140.5c0.5,0.5 437.5,-39.5 437,-40c0.5,0.5 -9.5,-240.5 -10,-241c0.5,0.5 -219.5,320.5 -220,320" opacity="0.5" stroke-width="1.5" stroke="#000" fill="#6F5C2A"/>

Because this code that I'm trying to store as a string, has quotes in it, remix thinks there are multiple strings being passed, when the function only takes one string.
So how do I pass something like this into remix such that returning the string returns the code properly?
\"m-44........\" does not work unless its single quotes and then it returns the string improperly


texts: How can I watch tokens in Parity wallet?

texts:
I love the Parity Ethereum wallet. It works very well. But I assumed it would automatically show any tokens I own if I watched contract that held the tokens.

For example if I watch singularDTV contract, it should show my singularDTV tokens, but it doesn't do that by default.

How do I get my parity wallet to show any tokens I own?


texts: What are the accounts generated by Truffle and Ganache? How is the Truffle migration done eactly?

texts:
I have a few question regarding Truffle, Ganache, and testing:

When I execute truffle develop and get 10 accounts and 10 private keys, do those represent my accounts in my wallet or other users?  For example, are they supposed to represent what shows up in msg.sender, which is myself, or accounts that I can interact with by sending funds or processing them in my smart contract.
How are the 10 accounts on Ganache different from the 10 accounts from question #1?  Do these 10 accounts on Ganache represent the account in my wallet or other users?  Are they the same except Ganache's accounts are on HTTP://127.0.0.1:7545 whereas the Truffle generated accounts are on http://127.0.0.1:9545/?
When I perform the Mocha test, do the accounts that are being passed as an argument represent my own accounts in my wallet?  For example, are they the 10 accounts generated by truffle develop?

contract("Some test", async (accounts) => {
  console.log(accounts)
});

Someone said "migration contract helps keep track which migrations have been executed already. So the process is to create a new migration file with an increased number and to deploy just run truffle migrate." Is migration similar to versioning different contracts?

module.exports = function (deployer) {
  deployer.deploy(ASmartContract); // is this migrating or deploying?
};
Where are different versions stored and selected is the above process?

I've seen some tests that deploy the contract:

let instance = await SomeSmartContract.deployed();

whereas other tests simply instantiate it through its constructor without deploying:

let someSmartContract = await SomeSmartContract.new();

Is there any difference between the two?

I learned that the Solidity Compiler compiles the contract definition into two things: byte code ready for deployment and ABI. 1) Is it only necessary to compile when you make changes to the Solidity contract or other things like the front end code or the tests? 1) Is it necessary to compile each time before performing a test or only once before deploying/migrating? 2) Does the command "truffle migrate --reset" also compile automatically before migrating?


texts: Synchronization: why startingBlock is ahead of currentBlock?

texts:
> eth.syncing
{
  currentBlock: 908716,
  highestBlock: 928604,
  knownStates: 0,
  pulledStates: 0,
  startingBlock: 908891
}

It looks like synchronization started from block 908891, though the current block is 908716. How blocks 908717..908890 get synced then?

startingBlock: QUANTITY - The block at which the import started (will only be reset, after the sync reached his head)
currentBlock: QUANTITY - The current block, same as eth_blockNumber


texts: use geth in ropsten network invalid transaction v, r, s values

texts:
when I use solc instruction compile following code that get bin & abi:

pragma solidity ^0.6.0;
contract TestContract{
  function multilpy(uint a,uint b) public pure return (uint){
    return a*b;
  }
}

And when I use geth instruction following step:

code = smart contract bin
abi = smart contract abi
myContract = eth.contract(abi)
personal.unlockAccount(eth.accounts[0])
contract = myContract.new({from: eth.accounts[0], data: code, gas: 100000})

to post transaction in Ethereum test network that chainid and networkid is 3.

Appear invalid transaction v, r, s values in my transaction error


texts: Events declared in library are missed in contract ABI

texts:
DYDX contract SoloMargin is firing events like LogTrade, LogSell but they are not provided in ABI.
SoloMargin contract: https://etherscan.io/address/0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e#code
Proxy to implementation: https://etherscan.io/address/0x56e7d4520abfecf10b38368b00723d9bd3c21ee1#code
This is bug in solidity compiler or etherscan? Why these events are not listed in ABI?
There should be an option for compiler to include them into ABI?


texts: Inside `geth` how could I convert abi object into a string?

texts:
Inside geth how could I convert abi object into a string? I want to convert it into string to apply str.replace(/[\r\n]/g, ''); to remove new lines and make it more compact.

myContractCompiled.Array.info.abiDefinition

returns the abi of the contract as:

[{
    constant: true,
    inputs: [{
        name: "id",
        type: "string"
    }, {
        name: "index",
        type: "uint256"
    }],
    name: "get_length",
    outputs: [{
        name: "",
        type: "uint256"
    }],
    payable: false,
    type: "function"
},
...
{
    inputs: [],
    payable: false,
    type: "constructor"
}]

But I am facing with following error when I try to convert abi object into string:

> myContractCompiled.Array.info.abiDefinition.toString()
"[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"

Thank you for your valuable time and help.


texts: Ethereum Blockchain Size calculation from Etherscan

texts:
I was looking into Etherscan.io charts of Ethereum Block Count and Ethereum Average Block Size. Both of them have the data since 07/30/2015 and if one multiply both time-series

(Ex. 07/30/2015 - 644 Byte Blocksize * 6912 Total Blocks of the day =  4451328 (0.004451328 GB) added to the Blockchain.

All the way up to 07/08/2018, Total Blockchain size comes out to around 47 GB size of the Blockchain. Looks like I am missing something major here as the current Ethereum Blockchain size is almost 1TB.

Any help into what I am missing would be appreciated.


texts:
I know this is too easy for all of you to answer, but I am really struggling with the terms.

I understand that Etherium is a platform where application can be ran against some fees (ethers). but what does it have to do with contracts and votes?

After each article I read, I get more confused as new terms come up in every line.

My main goal is I am programming an ico page and I need to create etherium addresses programmatically. but the two questions above will help me understand the basics.


texts: I was reconciling my old transactions to my current total in etherscan.io and noticed that ETH 2.75 that I had sent in May 2016 to the DAO were never credited back. I downloaded a file named TheDAOETCRefundAccountOutstandingBalance into Excel, and found out that there is one entry with my wallet address, which under the column Hardfork Balance has 2.115 and under the column Current balance has 1.547. If I go to refunds.thedao.fund and enter my wallet account number I see zero everywhere, so I'm stomped and perplexed as to where my initial ETH 2.75 went, how to reconcile that with the numbers found in DAO ETC Refund file, and why everything is zero in refunds.thedao.fund. I really would like to recover that money.


texts: What is the difference between these 2 smart contracts?

texts:
I noticed some smart contracts have there name,symbol, and supply set up like this example #1 and setup a defined constructor. Notice, they did not fill in the "string public symbol", "string public name", or "unit decimals", or "unit total supply".

Example #1:

contract PucksToken is ERC20Interface, Owned, SafeMath {
    string public symbol;
    string public  name;
    uint8 public decimals;
    uint public _totalSupply;

    mapping(address => uint) balances;
    mapping(address => mapping(address => uint)) allowed;

    // ------------------------------------------------------------------------
    // Constructor
    // ------------------------------------------------------------------------
    constructor() public {
        symbol = "0PUCKS";
        name = "0 Pucks Token";
        decimals = 18;
        _totalSupply = 100000000000000000000000000;
        balances[0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222] = _totalSupply;
        emit Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply);

And some set the smart contract like this and use the "string public constant" to define.
Example #2:

contract BTClite is StandardToken, Ownable {

  string public constant name = "BTC LITE";
  string public constant symbol = "BTCL";
  uint8 public constant decimals = 8;

  uint256 public constant SUPPLY_CAP = 21000000 * (10 ** uint256(decimals));

  address NULL_ADDRESS = address(0);

My question is when writing a smart contract, in example #1 is the defined "construct" code info sufficicent to define the terms of the contract and you do not have to fill in the information "string public constant"?

Basically why did example #1 not fill/input  this information in below?

string public symbol;
    string public  name;
    uint8 public decimals;
    uint public _totalSupply;

or are they both the same?


texts: Is there a tool to add SafeMath to production code?

texts:
There are a lot of tools to prepare JavaScript/CSS code for production, e.g. to minimize, to convert ES8 code to ES5. Is there a tool to automatically apply SafeMath library to a .sol file?
The problem is that .add(), .mul(), etc. are much less readable than +, -, +=, etc. It takes much more time to edit and understand the source code with .add()'s instead of +'s. But the task of converting + to .add() doesn't require any intelligence and could be done by a build script. Does such a script exist (something like babel but for Solidity)?


texts: What are all possible values of txreceipt_status?

texts: I was wondering what are all the txreceipt_status possible statuses. I was investigating some blocks and noticed that some statuses are empty like: ' ' or have '1'. For both of those, transactions happened. So what is the difference between those, and what other status messages exist ?


texts:
I am trying to use https://github.com/kesar/ethereum-php on the back-end of my web site.

I followed a tutorial http://iotbl.blogspot.ca/2017/03/setting-up-private-ethereum-testnet.html to set up two local chains on Ubuntu Server 16.04.

This is what geth version prints:

Geth
Version: 1.8.2-stable
Git Commit: b8b9f7f4476a30a0aaf6077daade6ae77f969960
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.9.4
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.9

This is how I start the chains:

  geth --nodiscover --verbosity 9 --networkid 50000 --port 50000 --datadir Chain01/ console

  geth --nodiscover --verbosity 9 --networkid 50000 --port 50001 –datadir Chain02/ console

I am able to add a peer inside terminal for chain2 and command net.peerCount displays 1 as expected.

With that working I tried to go through https://github.com/kesar/ethereum-php/blob/master/README.md and ran into a timeout. This is my PHP code:

$client = new EthereumClient('http://127.0.0.1:50000');
$iBlockNum = $client->eth()->blockNumber() ;

This is what I see in the geth’s log:

TRACE[03-08|15:56:06] Accepted connection addr=127.0.0.1:43610
TRACE[03-08|15:56:11] Failed RLPx handshake addr=127.0.0.1:43610 conn=inbound err="read tcp 127.0.0.1:50000->127.0.0.1:43610: i/o timeout"
TRACE[03-08|15:56:11] Setting up connection failed id=0000000000000000 err="read tcp 127.0.0.1:50000->127.0.0.1:43610: i/o timeout"

This is what wireshark shows as being sent from port 43610 to port 50000:

  {"jsonrpc":"2.0","method":"eth_blockNumber","id":83}

but port 50000 does not reply.

One other detail I am debugging in Eclipse oxygen. Not sure whether it can affect the interaction.

Another thing: the php code above works fine when I connect to http://truffleframework.com/ganache/.


texts: Does etherscan api support retrieving ERC-20 Token txns?

texts:
I use etherscan api. https://api.etherscan.io/apis

I want to get ERC-20 Token txns (or Token Transfer Events) like this page. https://etherscan.io/address/0x57e7674b1c58a0edce5a62af228ab34f09c00fca#tokentxns

but I only got the following response. This is the same as this page. https://etherscan.io/address/0x57e7674b1c58a0edce5a62af228ab34f09c00fca#internaltx

$ curl "https://api.etherscan.io/api?module=account&action=txlistinternal&address=0x57e7674b1c58a0edce5a62af228ab34f09c00fca&apikey=xxx"

{
  "status": "1",
  "message": "OK",
  "result": [
    {
      "blockNumber": "6751220",
      "timeStamp": "1542883826",
      "hash": "0x5e3abc85125b7363ab29f24d1c5962ab83a15de39f697ba85004906eeff8b71a",
      "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "to": "0x57e7674b1c58a0edce5a62af228ab34f09c00fca",
      "value": "1900000000000000",
      "contractAddress": "",
      "input": "",
      "type": "call",
      "gas": "2300",
      "gasUsed": "0",
      "traceId": "0",
      "isError": "0",
      "errCode": ""
    },
    {
      "blockNumber": "6751254",
      "timeStamp": "1542884443",
      "hash": "0x5119c2d5eae0fdc4a0e000b84231cfb5db075efd30fcca3fabe91d2bbfdc9006",
      "from": "0xb1690c08e213a35ed9bab7b318de14420fb57d8c",
      "to": "0x57e7674b1c58a0edce5a62af228ab34f09c00fca",
      "value": "2418981481482",
      "contractAddress": "",
      "input": "",
      "type": "call",
      "gas": "2300",
      "gasUsed": "0",
      "traceId": "1",
      "isError": "0",
      "errCode": ""
    }
  ]
}

How can I get ERC-20 Token txns (or Token Transfer Events)?


texts: Does somebody knows how to properly use AWS CloudHSM to sign ethereum transactions (Keccak256)?


texts: How to interact with Smart Contract via Web3/Nethereum without known ABI

texts:
Let's say I'm using Web3 or Nethereum, both of which apparently require the contract's ABI to bind the functions.
Is there no way to call smart contract functions without knowing the complete ABI?  What If I know only the smart contract address and function name/parameters?
Thanks in advance!


texts: Where is the log of transactions stored?

texts:
I have created a simple smart contract using geth and I am able to run it successfully without any issues.

The code I have used is:

pragma solidity ^0.4.13;

contract Simple {
  function arithmetics(uint _a, uint _b) returns (uint o_sum, uint o_product) {
    o_sum = _a + _b;
    o_product = _a * _b;
  }

  function multiply(uint _a, uint _b) returns (uint) {
    return _a * _b;
  }
}

I am able to run it using the command:
simple.multiply.call(10,20)

The logs of all these transactions should be stored somewhere in the blockchain. Where are they stored? How can I access them?


texts:
In a Solidity source file I have an import along the lines of...

import 'https://github.com/<username>/<repo>/<source>.sol';

which works fine in Browser Solidity but solc (ver 0.3.6) cannot import it and returns an error along the lines of:

Source "<source>.sol" not found: File not found.

From the path resolution documentation I was of the understanding that solc could discover such import paths as Browser Solidity has demonstrated.

Am I missing something (perhaps the URL is wrong) or is it just not a feature yet?


texts: Why is this not a vulnerability in localethereum contract?

texts:
I am looking through localethereum smart contract: https://etherscan.io/address/0x09678741bd50c3e74301f38fbd0136307099ae5d#code
and I have trouble understanding why what I am seeing is not a vulnerability.

It is a p2p escrow service: seller sends ETH to smart contract, ETH gets locked up in escrow, after some conditions are met between buyer and seller, seller can release ETH from escrow to the buyer by calling a method in that smart contract.

Sometimes there might be a dispute between buyer and seller - at that point escrow gets locked and it is up to administrator to resolve the dispute and release ETH to the rightful person using the following function:

function resolveDispute(
  /**
   * Called by the arbitrator to resolve a dispute
   * Requires the signed ACTION_DISPUTE actionByte from either the buyer or the seller
   */
  bytes16 _tradeID,
  address _seller,
  address _buyer,
  uint256 _value,
  uint16 _fee,
  uint8 _v,
  bytes32 _r,
  bytes32 _s,
  uint8 _buyerPercent
) external onlyArbitrator {
    address _signature = ecrecover(keccak256(_tradeID, ACTION_DISPUTE), _v, _r, _s);
    require(_signature == _buyer || _signature == _seller);

    var (_escrow, _tradeHash) = getEscrowAndHash(_tradeID, _seller, _buyer, _value, _fee);
    require(_escrow.exists);
    require(_buyerPercent <= 100);

    uint256 _totalFees = _escrow.totalGasFeesSpentByRelayer + GAS_doResolveDispute;
    require(_value - _totalFees <= _value); // Prevent underflow
    feesAvailableForWithdraw += _totalFees; // Add the the pot for localethereum to withdraw

    delete escrows[_tradeHash];
    DisputeResolved(_tradeHash);
    _buyer.transfer((_value - _totalFees) * _buyerPercent / 100);
    _seller.transfer((_value - _totalFees) * (100 - _buyerPercent) / 100);
}

My problem is at the bottom: if _buyer or _seller is a malicious user and his address here is in fact a contract, transfer call would execute fallback method in that contract which could throw and cause resolveDispute() call in localethereum contract to throw and never be able to complete. This would lock ETH in escrow forever.

What am I missing here and how is that not a vulnerability?


texts: can i get specified ERC20 token holders details?

texts: can i get specified ERC20 token holders details,example token holder address,how many token holding that address like this details


texts:
I hae some coins on MyEthereumWallet, that I can see in block explorer, but can not access it. I think that the mnemoic and password is correct. My assumption is that I messed up something with the HD path. I'm only storing Ether on this wallet. What are the possible HD pathes that I should try?

I think I created the wallet some 1.5 - 2 years ago. MEW also changed during that time. Maybe the default HD path changed, or there was a possibility to switch to other option that is not there anymore, i dont know.

If you have any idea, please help.

Thank you!


texts: What way there is to implement a new signing scheme in Ethereum?

texts:
I want to deploy a new signing scheme for the Ethereum transactions as an alternative to the currently implemented ECDSA. This will be for future research purposes on post-quantum signing schemes.
The alternative signing scheme exists as C code.

The first approach now was to replace ECDSA in one of the Ethereum client implementations like go-ethereum. Another idea was designing a smart contract containing the logic for the signing which will be executed every time a transaction is performed beforehand.
As I understood, it is not (so easily) possible to execute external codes / programs in smart contracts.
So the only way would be the protocol change with a later needed fork of it?

I hope there is a way, maybe you have another idea.