texts: Could not find "store" in either the context or props of "Connect(c)". Either wrap the root component in a

texts:
i'm trying to create a drizzle-react app which uses the new DrizzleContext component but running the following error in my 'localhost:3000':

> Could not find "store" in either the context or props of "Connect(c)".
> Either wrap the root component in a <Provider>, or explicitly pass
> "store" as a prop to "Connect(c)"

my index.js looks like this:

import React from 'react';
import ReactDOM from 'react-dom';
import { Drizzle, generateStore } from "drizzle";
import { DrizzleContext } from "drizzle-react";
import { LoadingContainer } from 'drizzle-react-components'
import './index.css';
import App from './App';
//import * as serviceWorker from './serviceWorker';
import drizzleOptions from './drizzleOptions';

const drizzleStore = generateStore(drizzleOptions);
const drizzle = new Drizzle(drizzleOptions, drizzleStore);

ReactDOM.render(
    (<DrizzleContext.Provider drizzle={drizzle} >
        <LoadingContainer>
            <App />
        </LoadingContainer>
    </DrizzleContext.Provider>),
    document.getElementById('root')
);

I've tried keeping the drizzleOptions inline (a small default options object) but to no avail. The only thing i can think of is my drizzle related imports are having the warning:

  could not find a declaration file for module 'drizzle'
  same goes for drizzle-react and drizzle-react-components

.. any help would be greatly appreciated. Thanks.

--MORE INFO UPDATED--
I tried to do some debugging and seems like the problem is in the 'generateStore' function of drizzle. the store object that is being returned is empty even though the drizzleOptions argument passed has correct values. Any pointers?

-- UPDATE --
'generateStore' was not the issue. the store object remains empty by default for every dapp and has not populated values. The issue is something else.


texts: Why the value of v is always either 27 (11011) or 28 (11100)?

texts: Why the value of v is always either 27 (11011) or 28 (11100), and, how is it known wether it will be 27 or 28?


texts: I am interested in creating a new token and have a few questions

texts: The question is, how can I implement a feature in the smart contract that can keep track of all stakeholders. The reason I ask is that I would like the contract to pay out dividends. So far, the only way I can think of is by storing the addresses of each stakeholder in a dynamic array. The only thing that is worrying me, and I have been struggling to find an answer to this question is: what is the maximum size or capacity of a dynamic array in Solidity? Also, am I wasting my time with this approach? Is there a better way to solve this problem?


texts: Updating a contract variable and testing with truffle

texts:
I have the following contract, made extremely simply:

pragma solidity ^0.4.18;

contract Test {
  bool completed;

  function Test() {
    completed = false;
  }

  function setCompleted() public {
    completed = true;
  }

  function getCompleted() public view returns (bool) {
    return completed;
  }
}

And I am testing it in javascript like so:

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

contract('Test Contract', function(accounts) {
  it("should set and get completed", function() {
    var TestContract

    return Test.deployed().then(function(instance) {
      TestContract = instance

      return TestContract.getCompleted.call()
        .then(function(result) {
          console.log(result, 'should be false');
          return TestContract.setCompleted.call()
        })
        .then(function() {
          return TestContract.getCompleted.call()
        }).then(function(result) {
          console.log(result, 'should be true');
        })
    })
  })
})

Shouldn't the call to the setCompleted function update the contract's variable? Am I missing something?


texts:
I have the following contract (https://gist.github.com/postables/365f418b85c9d93503001682d6cc779e) which works when using Oraclize's web IDE version of remix.

However when testing the contract out on Rinkeby, I can't get it to work. Not sure what I'm doing wrong but would love some help.


texts: Is it possible to rollback or fork a smart contract at a specific transaction?

texts: Let's say I want to keep all the data stored in my contract only up to a specific transaction. Is there any type of rollback process or forking mechanism for smart contracts that will allow me to either return to or create a new contract with a state specified by a specific previous transaction?


texts: how to call smart contract function in C#.net core

texts:
protected async void Page_Load(object sender, EventArgs e)
        {
            var senderAddress = "0x605a1f8d368cbdd4d0a5cbad74f75c428660f17b";
            var password = "zxcasdqwe123";
            var abi = @"[{""constant"":false,""inputs"":[{""name"":""passAddress"",""type"":""address""}],""name"":""isWhitelisted"",""outputs"":[{""name"":"""",""type"":""bool""}],""payable"":false,""type"":""function""},{""constant"":false,""inputs"":[{""name"":""userAddress"",""type"":""address""}],""name"":""userAdd"",""outputs"":[],""payable"":false,""type"":""function""},{""inputs"":[],""payable"":false,""type"":""constructor""}]";
            var web3 = new Nethereum.Web3.Web3();
            var newAddress = "0xE96932536293CF4712180973c6201DDbDf6fa3C0";
            /*var unlockAccountResult = await web3.Personal.UnlockAccount.SendRequestAsync(senderAddress, password, new HexBigInteger(120));
            Assert.True(unlockAccountResult);
            */
            //var transactionHash = await web3.Eth.DeployContract.SendRequestAsync(abi, byteCode, senderAddress, newAddress);
            //var receipt = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash);
            //while (receipt == null)
            //{
            //    Thread.Sleep(5000);
            //    receipt = await web3.Eth.Transactions.GetTransactionReceipt.SendRequestAsync(transactionHash);
            //}
            //var contractAddress = receipt.ContractAddress;
            var contract = web3.Eth.GetContract(abi, "0x23699275461c4755377c293bb657e84d3ddfdbd9");
            var fucntion = contract.GetFunction("userAdd");
            var result = await fucntion.CallAsync<String>("0xE96932536293CF4712180973c6201DDbDf6fa3C0");
        }

I have deployed my contract on rinkeby and got the address and now i am calling my fucntion of my contract but it is showing me null.

help
thanx in advance


texts: Truffle beta Contract.at is supposed to be a promise

texts:
I'm trying to test a contract with Truffle beta (because of the new web3 1.0.0 support).

When i try to create the contract object by using Contract = artifacts.require("Contract"); contract = Contract.at(Contract.address); and subsequently logging console.log(contract) it returns a pending promise.

I read the release notes and under 'breaking changes' it says that the .at function is now async. But when I try to prefix await to contract = await Contract.at(Contract.address); I get an error saying that the at function is in fact not async.

I noticed this error when I tried to call a function with contract.methods.myFunction(argument).call() and there was an error saying there is no 'methods' for undefined.

Has anyone experienced the same problem?


texts: How do I connect to the Remix JavaScript VM from my front end

texts:
I have been developing using Remix and Metamask but it's a slow progress when pushing to the test networks. I have switched to the JS VM in Remix but I am not sure about how to connect my frontend to it. At the minute this is what I am using, I assume it is this bit of code that I need to change.

    if (typeof web3 !== 'undefined') {
    web3 = new Web3(web3.currentProvider);
} else {
    // set the provider you want from Web3.providers
    //web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}

Can someone point me in the right direction, I just want to connect to the contracts in the JS VM. Thanks


texts: How to connect Ethereum RPC Client to a remote server?

texts:
I have Ethereum node running the JSON RPC server on this IP example 136.10.164.134 . Then I want to use a client to push some data. I see this library to make the client.
But I can't connect to my server. I got this error :
requests.exceptions.ConnectionError: HTTPConnectionPool(host='136.10.164.134', port=8545):
Max retries exceeded with url: / (Caused by NewConnectionError
('<requests.packages.urllib3.connection.HTTPConnection object at 0x10ecfacd0>:
Failed to establish a new connection: [Errno 61] Connection refused',))

I just put these 3 lines as it's mentioned in the documentation like this in my python script :
from eth_rpc_client import Client
client = Client(host="136.10.164.134", port="8545")
client.get_coinbase()

I think I can't connect to my server because the password itsn't defined in my script. How can I send the server password in ethereum rpc client ?
Edit
Ok So now I fixed the connection problem. I reconfigured parity with this command line :
geth --rpc --rpcaddr <ip> --rpcport <portnumber>

And set my IP to the web3 object :
var Web3 = require('web3');
var web3 = new Web3();
web3.setProvider(new Web3.providers.HttpProvider('http://136.10.164.134:8545'));
web3.eth.syncing

But now I have another problem. I have this error :
ValueError: No JSON object could be decoded

I'm watching the network with Charles and I can see this :
415 Unsupported Media Type
Supplied content type is not allowed. Content-Type: application/json is required

Of course the content-type sent is text/html; charset=utf-8.
How can I change the content type with this Ethererum rpc client ?


texts: Parity: How to view connected Peers alternative to 'admin' keyword?

texts:
As we know we cannot use admin, which works on geth, on Parity.

For example I want to retrieve information such as enode-id, ip-address, used port of each connected peer.

parity_netPeers (https://github.com/paritytech/parity/wiki/JSONRPC-parity-module#parity_netpeers) returns some information without newline, it become difficult see detect the peers connected.

curl --data '{"method":"parity_netPeers","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Example:

Here there is actually 2 connected peers but it returns many more information.

{"jsonrpc":"2.0","result":{"active":2,"connected":2,"max":25,"peers":[{"caps":[],"id":"575bbc154d3c37c35d5f91a42813641fef4389bc288c0e50cf2ab1cbbde014287b93d3748336ff02c99a11e7d58ab54868933c7a9804c36a071078cb9a586ca8","name":"","network":{"localAddress":"77.23.7.15:39741","remoteAddress":"Handshake"},"protocols":{"eth":null,"les":null}},{"caps":["eth/63","eth/62"],"id":"4d331051d8fb471c87a9351b36ffb72bf445a9337727d229e03c668f99897264bf11e1b897b1561f5889825e2211b06858139fa469fdf73c64d43a567ea72479","name":"Geth/v1.5.9-stable-a07539fb/linux/go1.7.1","network":{"localAddress":"77.13.17.145:35507","remoteAddress":"13.40.17.95:3000"},"protocols":{"eth":{"difficulty":null,"head":"3060e08b5cd0b90adb3c464342f6df13482361e8ef09724d7525cae48abbaf59","version":63},"les":null}},{"caps":[],"id":"13d6cc66f445072d2e389c5d47d1557543ec9f96237576a38072a5b76b67ba445050641219e1f42c1443a7287fab6cb3f4c078fa886520cbf3577ac23f5e0cad","name":"","network":{"localAddress":"77.13.17.15:44079","remoteAddress":"Handshake"},"protocols":{"eth":null,"les":null}},{"caps":[],"id":null,"name":"","network":{"lo
...`


texts:
So I found scam smart contract which allows to approve only when you are owner.
 function _approve(address owner, address spender, uint256 amount) internal {
    require(owner != address(0), "BEP20: approve from the zero address");
    require(spender != address(0), "BEP20: approve to the zero address");

    /*
    *
    */

    if (owner == address(0x192939103120931280391284)) {
        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    } else {
        _allowances[owner][spender] = 0;
        emit Approval(owner, spender, 0);
    }
  }

When you are interacting with it via pancakeswap or other application, you will never be approved because of if/else statement. I suppose you can sell it without approving but I have no idea how. Any idea/help?


texts: Importing wallet into Mist using custom datadir

texts:
I'm having an issue that seems to be quite common but I haven't found a solution. I'm using Ethereum Wallet 0.9 and I have all the application data, including the blockchain on an external drive. When I want to launch the wallet I first launch geth and point it to where the latest blocks are (on the drive in the chaindata subfolder of the Ethereumwallet.exe). This works fine and geth starts from the latest block I have, and when I open Ethereumwallet it talks to geth and shows only the latest blocks need to sync.

However, Ethereumwallet.exe doesn't see my keystore (stored in the same directory) and also doesn't let me import my json wallets when pointing geth to my directory. When I start Ethereumwallet without configuring datadir, it starts downloading the entire chain but does show me my wallets and my existing balance. How to import my wallet files by default and have a custom datadir?


texts: The funds sent to the contract do not show the correct value on the side of the contributor.?

texts:
The question is not answered that's why I ask again.
Can someone tell me and point out ( correct me) where the problem lies.

Eth has been sent to the crowdsale contract successfully. BalanceOf and amountrised were calculated correctly. Unfortunately, shows with the error on the side of the contributor.

Why is this happening? What did I miss here? Thank You Robert.

Token Contract
https://ropsten.etherscan.io/address/0x6f5c43f62b4b18aa8ed37b42f2804f7049cbe0e9#code

CrowdSale Contract
https://ropsten.etherscan.io/address/0x9b94e1894abe2051e6e96bf1b57fe5d3adbbc5aa#code

Environment == Injected Web3 Ropsten MetaMask/Remix

More details are here.
Why incorrect number of tokens are sent according to the current rate to the contributor.?


texts:
}).then(assert.fail).catch (function(error){
      assert(error.message.indexOf('revert') >= 0,'msg.value must be less than tokens tokenAvaliable')
    })

I have the following code in the test file can anyone explain what is indexOf('revert') means


texts: Trying to run a Rinkeby testnet node on windows

texts:
Im trying to run a light node om windows, it works until here:
geth --datadir=$HOME/.rinkeby init rinkeby.json

but when I type this:
geth --networkid=4 --datadir=$HOME/.rinkeby --syncmode=light --ethstats='testnode:Respect my authoritah!@stats.rinkeby.io' --bootnodes=enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303

the command prompt says : " invalid command: "my" "


texts: Storage/Retrieval of mapped structure data

texts:
I want to store the structure data in a mapping i.e. if I have a student structure as described below, then I should be able to have a myriad of students and distinguish between them using wallet addresses.

I want to store student data account wise and allow for retrieval of this data through wallet address.

I have written following code but I'm only able to retrieve the most recent setData() call of data.

contract FormSubmit{

  struct Student {
  string  email;
  string  password;
  string  address1;
  string  address2;
  string  city;
  string  state;
  string  zip;
  }

  mapping(address => Student) Students;

 function setData(address _address, string memory _email, string memory     _password,
string memory _address1, string memory _address2, string memory _city, string memory _state,
string memory _zip) public
{

  Students[_address].email = _email;
  Students[_address].password = _password;
  Students[_address].address1 = _address1;
  Students[_address].address2 = _address2;
  Students[_address].city = _city;
  Students[_address].state = _state;
  Students[_address].zip =_zip;
}

function getData(address _address) public view returns(string memory, string memory, string memory, string memory, string memory, string memory, string memory){
  return(Students[_address].email,
  Students[_address].password,
  Students[_address].address1,
  Students[_address].address2,
  Students[_address].city,
  Students[_address].state,
  Students[_address].zip);
}}

Please Help me

EDIT

You can see in the getData I am getting information of last stored student not the previous student stored on this same address.


texts:
I'm FPGA design engineer, and I'm thinking in learning more about Ethereum to make a FPGA implementation, but I've read in many sites that Ethereum is ASIC resistant but I couldn't find any technical explanation.

Why is not possible to create a FPGA/ASIC implementation connected to a pool?

Can anyone bring tech details on why is impossible to create an Ethereum ASIC/FPGA miner?

Thanks in advance!


texts:
I've been struggling with how to do this for quite some time and hoping this community could help.

I know that it should be added or something similar, so tokens balance of the investor address can be changed after investment.

I tried to modify buy() in a few ways by adding this for example:

require(tokenReward.transfer(msg.sender, numTokens));
require(tokenReward.transferFrom(ASSET_MANAGER_WALLET, msg.sender, numTokens));

require(tokenReward.transferFrom(tokenReward.owner(), msg.sender, numTokens));

if (tokenReward.transferFrom(tokenReward.owner(), msg.sender, numTokens))

tokenReward.transferFrom(tokenReward.owner(), msg.sender, amount.mul(rate));

if (tokenReward.transferFrom(tokenReward.owner(), msg.sender, amount.mul(RATE))) {
       revert();
     }

if (tokenReward.transferFrom(tokenReward.owner(), msg.sender,  numTokens)) {
       revert();
     }

No success.

AND THIS IS VERY IMPORTANT !

Without this line of code,

  require(tokenReward.transferFrom(tokenReward.owner(), msg.sender,
  numTokens));

I could send eth and balanceOf and amountRised were CORRECTLY CALCULATED BUT THE INVESTOR BALANCE WAS NOT CORRECT.

After adding this line of code, require(tokenReward.transferFrom(tokenReward.owner(), msg.sender, numTokens));
I can not do anything. When sending eth to crowdsale, I get this from Myetherwallet,

Is there anyone here who could help solve this problem. Thank you, Robert

Token Contract
https://ropsten.etherscan.io/address/0x2aa448505f3ba5359e2537113e0fe1293aea9ecb#code

Crowdsale Contract
https://ropsten.etherscan.io/address/0xf70142870fe11e39af3539005e5f02b31e60fb4c#code


texts:
If I create a nested filter.watch

filter_a.watch(
    filter_b.watch();
);

If I call

filter_a.stopWatching();

does filter_b.watch() go out of scope for web3.js?  Does geth keeps sending filter_b.watch() results?


texts:
I have a Nvidai GTX 1080ti overclocked and I have a dedicated gpu memory of 11GB and when I see the meter or check the usage of the graphic card while mining using claymore it is around 32MH/S and it is using upto 75% of vram and the dedicated GPU memory usage is around 3GB. It is not using 11GB.

So, my question here is when I used GUI Miner for bitcoin it was running at 1.7 GH/S and claymore is running at 32MH/s is this correct or I have done anything wrong? and I am getting a constant 10% stale shares, so, do I have to keep my GPU overclocked or under clocked or keep as is?


texts: How to properly initialize a storage array?

texts:
What's the correct right hand side expression for initializing a storage array of address?

I'm trying to initialize a storage address[] from inside a function. Everything I've tried gives warnings, and I'm looking for the correct way to silence them.

// address[] storage b;
Warning: Uninitialized storage pointer.

This warning is warranted. After testing I've found b is pointing to "garbage data" which happens to be the same as another address[] storage a array I define earlier. (Related post) On top of that, modifying b (b.length = 0) is modifying the a array.

Every right hand expression I've tried hasn't worked, since they're meant for memory arrays. (eg. = address[]())


texts: Is older web3.js UI code compatible with new contracts that use ABI coder v2?

texts:
The solidity 0.8.0 patch notes state:

ABI coder v2 is activated by default.
You can choose to use the old behaviour using pragma abicoder v1;. The
pragma pragma experimental ABIEncoderV2; is still valid, but it is
deprecated and has no effect. If you want to be explicit, please use
pragma abicoder v2; instead.

I believe this means newer contracts will use ABI coder v2 by default. Are these new contracts compatible with existing web UI code that uses web3.js, and was only written with ABI coder v1 in mind?


texts: Why is the math code causing transactions to fail

texts:
Ok so This is my first time working on solidity contracts and I'm at a loss how to debug this code.
This code fails:
 function claimReturns(address claimant) private {
        uint otherTotals = safeSub(lastYearsTotalSupply, accounts[claimant].balance);
        uint newAmount = safeDiv(safeMul(safeMul(accounts[claimant].balance, multiplier), otherTotals), lastYearsTotalSupply);
        mint(newAmount, claimant);
    }

while this code succeeds:
 function claimReturns(address claimant) private {
        mint(20000000000000000000, claimant);
    }

I don't think its a gas issue because the failed transaction is reported that only like 20% of the gas I allocated was used.  But I can't see anything wrong with my math either.
I'm testing on the ropsten network with remixIDE.


texts:
I am facing some issue in executing the eth.sendTransaction method. Though there is sufficient amount of balance in the transferring account, I am still getting insufficient funds error. I've tried passing a hexadecimal number to the value field of the abc object, but it still doesn't work.

eth.sendTransaction works fine when the from account is set to eth.accounts[0], for any other account, it throws this error.


texts: Can't send a new transaction with a lower nonce while the previous one is still pending

texts:
Several days ago I sent a transcaction via MetaMask, to a different account of mine, with a gas fee of 30 gwei. It's still pending due to a fee being too low. A transaction contains all Eth in an account. A day later I pressed "cancel", the button then disappeared but nothing changed.
My balance is still the same.
I want to either cancel it or have it proceed. I can't increase gas fee because the amount sent is precisely "all of Eth in that account - 30 gwei".
The 1st transaction has the nonce 9. I tried to send 2 other transactions with the nonce 8, from the same account and to the same other destination account of mine, but they both failed. Merely "failed". Reason - no idea, and there was no error message anywhere.
How to make it proceed or cancel? Or should I let it be pending because my balance still remains the same? Can I use the same account to send Eth to yet other addresses with no issue?
And also, why did the 2 other transactions with the nonce 8 failed?


texts: Does Rinkeby Faucet Test Net send real ether?

texts: I just got the MetaMask Chrome Extension. I received 3 Ethers from the Rinkeby Faucet and sent it to my Ethereum address on Coinbase. Will I receive real money? I'm new to this.


texts: Get the balance of an ERC20 token at an Ethereum address

texts:
I'm trying to get the balance of a token on an Ethereum address.  So let's say my Ethereum address has 1 SNT.  I'd like to make a call to get that 1 SNT as a response.  I've written many other calls and can't seem to find or figure out this one.  I've tried using the method "eth_call" and using the balanceOf method.  I was thinking I could use this method in the contract of the ERC20 token:

function balanceOf(address _owner) constant returns (uint256 balance);

I tried setting the to as the token address, the data as the code for balanceOf, and my wallet address also in the data, but that always returns me 0.

payload = {
        "id": 123,
        "jsonrpc": "2.0",
        "method": "eth_call",
        "params": [
            {
                "data": "0xf7888aec000000000000000000000000" + walletAddress_With0xRemoved,
                "to": tokenAddress
            },
            "latest"
        ]
    }

I found this site which has an API, but i'd really like to do it the right way rather than using a wrapper API.

https://tokenbalance.com/

CONTRACT=0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7
ETH_ADDRESS=0x198ef1ec325a96cc354c7266a038be8b5c558f67

curl https://api.tokenbalance.com/balance/$CONTRACT/$ETH_ADDRESS

{
    "name": "Golem Network Token",
    "wallet": "0xda0aed568d9a2dbdcbafc1576fedc633d28eee9a",
    "symbol": "GNT",
    "balance": 7.998173814269688,
    "eth_balance": 0.9912952230000018,
    "decimals": 18,
    "block": 3461147
  }

Edit: I just realized this website has source code available, haha.  Though this isn't the type of ethereum programming i'm used to (Go).


texts:
I have created two contracts A and B as follow:

Contract A:

pragma solidity 0.4.25;

contract A{
    // uint public X ;
    event MyName(address _from, address sender);
    function checkMe(uint val) public{
        emit MyName(this, msg.sender);
        // X = val;
    }
}

Contract B

pragma solidity 0.4.25;
import "browser/A.sol";

contract B{
    A a;
    constructor() public{
        a = A(0xE6c28FEF0491c7626c002131a2c833094f6135D3);
    }
    function useCall() public{
        require(address(a).call(bytes4(sha3("checkMe(uint)")), 2));
    }

    function useDelegateCall() public{
        require(address(a).delegatecall(bytes4(sha3("checkMe(uint)")), 3));
    }
}

Upon calling the useCall and useDelegateCall function of contract B, it reverts. Can someone help me to diagnose what I am doing wrong here?

Thanks,


texts: I'm still very new to this. What is the difference from Geth and Eth I keep reading about? Why were these 2 things developed?


texts: Get Ethereum price with Uniswap on Graph Protocol

texts: I'm learning Graph protocol and i was wondering if there was any way to get Ethereum price against USDC?


texts: What is the => for in the mapping function?

texts:
I'm very new to actual programming not as much blockchain. I know a little Java and am trying to learn solidity I am reading through the Intro to smart contracts turotial and on the 7th line (see below) they declare a variable using mapping but I don't understand how the => comes into play.

mapping (address => uint) public balances;


texts: Is it possible to transfer value between two cryptocurrencies?

texts:
I am interested in whether it is possible to use Ethereum to execute an exchange between two different crypto-currencies, such that the funds are released only once both parties have agreed and in some manner 'committed' to the transaction.

For example Alice is selling 1 BTC and wants to buy LTC, and Bob wants BTC and is willing to sell LTC - both sides have agreed a price.

As far as I understand the https://github.com/ethereum/btcrelay project would allow validation of a multi-sig transaction from Bitcoin, but can this be extended easily?

Edit: I imagine acting as a central entity to match counterparties, this is specifically about the execution.


texts: Truffle on Windows 10: how to unlock an account for migration to a private network

texts:
I try to migrate a smart contract to a private network via truffle on Windows 10. I specify a certain account in truffle.js and so far I get the following error:

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: authentication needed: password or unlock

What is the best way or the best ways to unlock the (remote) account so that the migration via migrate --network networkName can take place?

Thanks


texts:
I am producing kinda salary system.
If somebody loses an account, he or she loses the salary for his entire lifetime!!
So need some account recovery.
First I wanted to use my own recovery system with BrightID to confirm identity of the person who lost his private key. But BrigthID allows to recover by just two trusted connections (friends). That's too bad for an account with money associated to it, two fake friends and the salary goes.
Next, I may require (or advise very strongly, but people are not following advice...) to use a smart wallet with recovery for the salary account, not just a wallet.
Which smart wallet to choose? Or to create my own smart wallet? What if people will want to change the set of features (e.g. the recovery procedure) for the smart wallet? use upgradeable by global voting smart contract for the wallets? any other ideas?
I want the wallet to be accessible both desktop and mobile.
I want it to work for 100 years! (unless the civilization dies)


texts: Not able to successfully send Transactions via MetaMask on Firefox Browser

texts:
Does anybody help me figuring out why I am getting failed transaction here?What does this error means? Few days back,with the same line of code,I was able to successfully send transactions.

An update:

With same code and setup I am able to successfully send transactions via MetaMask on chrome browser with no issues.

But on Mozilla Firefox ,I am getting failed transactions. Seems like some issue with MetaMask compatibility with firefox? Attaching screenshot with this comment of mine is of Mozilla Browser issue.(Though couple of days back I was able to successfully send transactions on my firefox browser too)

Web3.js Version : "web3": 1.2.1
Truffle v5.0.30
Please refer to the attached screenshots for issue.


texts:
I was trying to compile the mulDiv function, part of the uniswap-v3-core code base, but I am getting the following error:

Unary operator - cannot be applied to type uint256

This is the line where it breaks:
uint256 twos = -denominator & denominator;

I am using Solidity v0.8.3, while they used Solidity v0.7.6.
This doesn't seem to be listed in the v0.8.0 breaking changes. How can I make it work in v0.8 while ensuring that the logic stays the same?


texts: Truffle: Explain why does Truffle create 2 contract each time deploy to network

texts:
I am using Truffle for writing smart contract. When I want to deploy to test network (i.e: rinkeby network), I use following command:
truffle migrate --network rinkeby

As this is log:
Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... 0xc032b44fb7d51ad386b6c1e7d9910798e36e1590b9fd557d50348af090ce06e3
  Migrations: 0x44b273afa97a8c0c1dac41b2f5972b22c0a92bb2
Saving successful migration to network...
  ... 0x8fc27bea14c6c7e0bceac0c5232013211e8f7bd0cd05611935350b1fbf3c986b
Saving artifacts...
Running migration: 2_game_presale.js
  Deploying GamePresale...
  ... 0x154df08d0d55d51fc2d2f78a8ac643f94b9cfde2eb5081e6b31d12367a7994ee
  GamePresale: 0x3cd9498845833058e48fde58e521f34420123793
Saving successful migration to network...
  ... 0x789d608fd3302a931ef1ed744d50cfa63be24bde7d768c8508c0b978541e9b1f

Looks like that Truffle deploy to 2 contracts. So I go to etherscan for checking:

So based on this image, truffle has created 2 contracts. So my question is:

Why truffle creates 2 contract.
After every contract creation, truffle creates 1 more transaction. What is that ?

Thanks


texts: Where are passphrases stored in test rpc?

texts:
I am new to ethereum. I am trying to create a smart contract.
I would like to know where exactly account passwords are stored?

Currently i am on testrpc, i would like to know where the accounts/passwords are stored.


texts: Which network does truffle use for testing?

texts:
I have a network 'foo' that is configured inside truffle.js. Running my tests works just fine

truffle test --network foo ./test/*.js

then I realized I forgot to start 'foo'.
To confirm this running the console fails.

truffle console --network foo

How is it that my tests can pass even saying Using network 'foo' while the network is not running?

What am I missing here?


texts: TypeError: Member "mint" not found or not visible after argument-dependent lookup in contract ERC20

texts:
token.mint(beneficiary, tokens) prevents code from fully compiling using Zeppelin 1.8.

Casting your token as a MintableToken* solves this issue and allows your code to compile:

MintableToken token = MintableToken(ERC20(token));
token.mint(beneficiary, tokens);

*Where 'MintableToken' could be replaced by the name of your token.

However, this causes tests to revert once your code compiles.


texts: Do externally owned accounts send messages/transactions do each other? Why doesn't a contract sign its message?

texts:
Question 1: Can one account holder send Ether to another one without using a smart contract?

Question 2: Is there any need that two accounts send messages/transaction directly to each other?

a transaction: signed message:  sent by externally owned account.
message is sent by contract to another contract.

But a contract can call other contract functions and change the state of 2nd contract. So, the question is:

Question 3: Why does a contract not need to sign a message it sends?


texts: Contract storage not being updated after sendTransaction

texts:
First of all, sorry about the code written in Portuguese.

I have the following contract:

contract GerenciadorBoletos {

     struct Boleto {
         uint codigoBarra;
         uint codigoBarraDigitavel;
         uint cpfOuCnpjBeneficiario;
         uint cpfOuCnpjPagador;
         uint valorOriginal;
         uint dataVencimento;
     }

     mapping(uint => Boleto) public registroBoletos;

     function inserirBoleto(
         uint codigoBarra,
         uint codigoBarraDigitavel,
         uint cpfOuCnpjBeneficiario,
         uint cpfOuCnpjPagador,
         uint valorOriginal,
         uint dataVencimento
     ) {
         Boleto memory b = Boleto(
             codigoBarra,
             codigoBarraDigitavel,
             cpfOuCnpjBeneficiario,
             cpfOuCnpjPagador,
             valorOriginal,
             dataVencimento
         );

         /* I need to do some validations before store it, but there is no code yet */

         registroBoletos[b.codigoBarra] = b;
     }
 }

Then I'm running some mocha test suites with web3.js

// generates a new registry
function gerarBoletoValido() {
    return {
        codigoBarra: BigNumber.random(44).toString().slice(2),
        codigoBarraDigitavel: BigNumber.random(47).toString().slice(2),
        cpfOuCnpjBeneficiario: BigNumber.random(14).toString().slice(2),
        cpfOuCnpjPagador: BigNumber.random(11).toString().slice(2),
        valorOriginal: parseInt(Math.random() * 1000),
        dataVencimento: Date.now() + 3*24*3600,
        dataLimitePagamento: Date.now() + 7*24*3600,
        metodoCalculo: MetodoCalculo.INTERNO,
        multa: parseInt(Math.random() * 100),
        juros: parseInt(Math.random() * 100) % 11,
        desconto: parseInt(Math.random() * 100) % 11,
    }
}

var boletoValido = gerarBoletoValido();
it('Deve inserir com sucesso um boleto com os dados válidos', function(done){
     gerenciadorBoleto.inserirBoleto.sendTransaction(
     boletoValido.codigoBarra,
     boletoValido.codigoBarraDigitavel,
     boletoValido.cpfOuCnpjBeneficiario,
     boletoValido.cpfOuCnpjPagador,
     boletoValido.valorOriginal,
     boletoValido.dataVencimento,
     {
         from: web3.eth.accounts[0],
         gas: 3000000,
     },
     function(e, result) {
         expect(e).to.not.exist;
         expect(result).to.exist;
         result.should.be.above(0);
         expect(String(gerenciadorBoleto.registroBoletos(boletoValido.codigoBarra)[0])).to.be.equal(String(boletoValido.codigoBarra));
         done();
     });
});

The problem is that the last assertion shows that nothing is being inserted:

 Uncaught AssertionError: expected '0' to equal '41227991517789294285860497224073582695415194'
      + expected - actual

      -0
      +41227991517789294285860497224073582695415194

What am I missing?


texts: Cannot find module react-bootstrap/lib/Breadcrumb

texts:
I'm trying to figure out an issue with this tutorial that i'm following, whenever I try to use truffle test within the CMD in the defi-tutorial folder, it comes up with the issue in the header, cannot find module react-bootstrap/lib/breadcrumb. Here is the tutorial that i'm following: https://www.youtube.com/watch?v=CgXQC4dbGUE&list=PLS5SEs8ZftgUNcUVXtn2KXiE1Ui9B5UrY
The time of the error i'm experiencing is what he's doing at around 53:30
Here is the code i'm currently typing:

require("chai")
    .use(require("chai-as-promised"))
    .should()

contract("TokenFarm", (accounts) => {
    //Write tests here...
    describe("Mock DAI deployment", async () => {
        it("has a name", async () => {
            let daiToken = await DaiToken.new()
            const name = await daiToken.name()
            assert.equal(name, "Mock DAI Token")
        })
    })
})```


texts: How to generate Ethereum address in PHP?

texts: I am working on a web application where I need to generate Ethereum addresses in PHP, how do i go about generating a random Ethereum public/private key pair in PHP? thanks.


texts:
I was checking at SYNC transactions of some Uniswap contracts:

and noticed that in some contracts the ETH amount comes first and in others second (here it's second, i.e. reserve1).
Other than contextually inferring it, how can I know what is what?


texts:
I am very much curious about this new storage system YottaChain.
Can someone point me good articles/videos/sources as a reference to go through and understand its implementation with ethereum smart-contracts?


texts:
I need to call a recursive function with if statements. Is this possible in
Solidity? Please provide an example.


texts: Smart Contract different behaviour on testnet vs Solidity Browser

texts:
The following smart contract behaves differently on Solidity Browser and testnet:

pragma solidity 0.4.2;

contract mortal {
    address owner;

    function mortal() { owner = msg.sender; }

    function kill() { if (msg.sender == owner) suicide(owner); }
}

contract myEscrow is mortal {
    uint numEscrows;

    function queryNumEscrows() constant returns (uint) {
        return numEscrows;
    }

    function start() returns (uint) {
        numEscrows++;

        return numEscrows;
    }

}

On Solidity Browser it behaves as it should, increasing the value numEscrows when start() is called, and queryNumEscrows() returns this value correctly.

On testnet, the value numEscrows seems to be stuck on 0. queryNumEscrows() always returns 0, no matter how many times start() has been called.

On testnet I deployed in this way:

personal.unlockAccount("0x47978a69f410d0f61850c92acdb0d4c464d70937", "pass", 86400);
personal.unlockAccount("0x3b877e80b5c0b29d88f3768ed4292b35fdd93a9d", "pass", 86400);
web3.fromWei(eth.getBalance("0x47978a69f410d0f61850c92acdb0d4c464d70937").toNumber(), "ether")
    "1673.35...."

var myescrowContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"queryNumEscrows","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"start","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"}]);
var myescrow = myescrowContract.new(
   {
     from: web3.eth.accounts[0],
     data: '60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b6101828061003f6000396000f360606040526000357c0100000000000000000000000000000000000000000000000000000000900480630127efc51461005257806341c0e1b51461007a578063be9a65551461008e5761004d565b610002565b346100025761006460048050506100b6565b6040518082815260200191505060405180910390f35b346100025761008c60048050506100c8565b005b34610002576100a0600480505061015c565b6040518082815260200191505060405180910390f35b600060016000505490506100c5565b90565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561015957600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b5b565b60006001600081815054809291906001019190505550600160005054905061017f565b9056',
     gas: 4700000
   }, function (e, contract){
    console.log(e, contract);
    if (typeof contract.address !== 'undefined') {
         console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
    }
 })

Contract mined! address: 0x95162fb5af8fae1970a90d891ca3862b020dda60 transactionHash: 0xfd5107184eba5cd2032759987ed7dace2de3328c2e8461b50b1d5a9a9e3ae12f
https://testnet.etherscan.io/address/0x95162fb5af8fae1970a90d891ca3862b020dda60

// This should be zero, right
myescrow.queryNumEscrows();
0

// Start escrow from Alice to Bob for 1 euro <=> 10^9 weis
myescrow.start.sendTransaction("0x90e8682b63d7922a3e942d4bbd4c88095634a17b", "0x47978a69f410d0f61850c92acdb0d4c464d70937", {from:"0x3b877e80b5c0b29d88f3768ed4292b35fdd93a9d", value:"0x3b9aca00"}, function (err, result) { if (err) { console.error(err); return; } else {console.log('txhash: ' + result)} });
0x445b6c9a7c735a54fd246596d40e2e8726244a91b98c512ca7ff9c1a5bd82c00

// After several minutes ...
myescrow.queryNumEscrows();
0

Why numEscrows is not increasing?

P.S.: By the way, I have deployed this very smart contract on testnet using Mist and it works, increasing numEscrows properly. But when deploying directly through geth console, it doesn't work. Why?


texts: Proxy calls are all reverting in test suite despite implementation being set and initialised

texts:
I am currently writing an upgradable contract using the unstructured data proxy model and an ERC20 token implementation (similar to USDC).
This means the traditional approach of sending a transaction to a proxy and it hitting the fallback function (unless you are the admin) and delegating the call to the implementation while storing the state in the proxy.
Currently, I am writing a test suite that deploys both contracts and sets the implementation's initialise function via the proxy.
I am running into an error that no matter what call I give the proxy, whether it be asking for the symbol via "symbol()" or asking for the minter role, it always reverts (but shouldn't):

Error: Returned error: VM Exception while processing transaction: revert

If I use the admin key, it correctly fails with:

Error: Returned error: VM Exception while processing transaction: revert Cannot call fallback function from the proxy admin

However, it should not revert when calling functions defined in the implementation. My code for this test is as follows:
const { accounts, contract, web3 } = require('@openzeppelin/test-environment');
const [ admin, user, recipient ] = accounts;
// Loads the built artifact from build/contracts/ERC20.json
const ERC20 = contract.fromArtifact('ERC20');
const Proxy = contract.fromArtifact('Proxy');
// test framework
const { expect } = require('chai');
//erc20 generic tests
const shouldBehaveLikeErc20 = require("./behaviors/ERC20.behavior.js");
const shouldBehaveLikeErc20Detailed = require("./behaviors/ERC20Detailed.behavior.js");

describe('ERC20', function () {

    const name = 'ERC20';
    const symbol = 'ERC20';
    const decimals = 18;
    const totalSupply = web3.utils.toBN("1e28");

    beforeEach(async function() {
        this.ERC20 = await ERC20.new();
        this.ERC20V2 = await ERC20.new();
        let data = web3.eth.abi.encodeFunctionSignature('initialize()');
        this.Proxy = await Proxy.new(this.ERC20.address, admin, data, { from: admin });
    });

    it("should behave like ERC20", function() {
        //need ERC20 ABI with Proxy address as Proxy delegates
        this.token = this.ERC20;
        this.token.address = this.Proxy.address;
        shouldBehaveLikeErc20(accounts, totalSupply);
        shouldBehaveLikeErc20Detailed(name, symbol, decimals)
    });

    it('the deployer is the minter', async function () {
        let abi = {
                "constant": true,
                "inputs": [
                    {
                        "internalType": "address",
                        "name": "account",
                        "type": "address"
                    }
                ],
                "name": "isMinter",
                "outputs": [
                    {
                        "internalType": "bool",
                        "name": "",
                        "type": "bool"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            };
        let functionData = web3.eth.abi.encodeFunctionCall(abi, [ admin ]);
        //always reverts here, but it shouldn't
        let result = await web3.eth.call({
            from: user,
            to: this.Proxy.address,
            functionData
        });
        expect(web3.eth.abi.decodeParameter('bool', result)).to.equal(true);
    });

    it('upgrades the implementation address', async function () {
        await this.Proxy.upgradeTo(this.ERC20V2.address, { from: admin });
    });

});


texts: Transaction no confirmed and JUnit test assert fail

texts:
I have some JUnit test that assert some values returned from the blockchain deployed smart-contract. But the assert return me a error because the assertEqual call is done when the transaction has not been validated yet.

In Web3j 4.0.6 and a Quorum 2.2.3 version envyroment is ther a wey to make callbacks?

Im using the generated Web3j wrapper, the web3j quorum version is the following 4.0.6


texts: How to collect addresses with a specific token

texts:
I run a local eth node on my server and would like to collect all addresses which hold a specific token.

In addition I'd like to supply them with another token.
One way I researched is to send them the new token via an airdrop contract. This one is taken from OmiseGo.

contract Airdropper is Ownable {

function multisend(address _tokenAddr, address[] dests, uint256[] values)
onlyOwner
returns (uint256) {
    uint256 i = 0;
    while (i < dests.length) {
        ERC20(_tokenAddr).transfer(dests[i], values[i]);
        i += 1;
    }
    return(i);
}

Do you have a suggestion how to get the addresses? (and do you think the OmiseGo Solution is a good one?)


texts:
I'm following the instructions here to generate a valid ethereum address from scratch.  I'm using BouncyCastle's secp256k1 to do the privkey --> pubkey, but I don't know where to get a proper implementation of keccak for C# to do the final step pubkey --> address.  Can anyone help me with this?

The BouncyCastle KeccakDigest does not return the same result as in the instructions for the same pubkey.


texts: Unable to call payable function from node console

texts:
I am trying to execute following function

    function createSurvey() external payable notTheOwner returns(uint surveyId, address newSurveyAddress) {
    require(msg.value > surveyCreationFees);

    uint surveyReward = msg.value.sub(surveyCreationFees);

    address _newSurveyAddress = (new Survey).value(surveyReward)(msg.sender);
    uint _surveyId = surveys.push(_newSurveyAddress).sub(1);
    surveyToOwner[_surveyId] = msg.sender;

    SurveyCreated(_surveyId, _newSurveyAddress);
    return (_surveyId, _newSurveyAddress);
}

Contract is deployed using account 0 and I am trying to call a function from account 1

I have tried following :

> surveyfactory.createSurvey.call({value: 100, from: web3.eth.accounts[1], to: web3.eth.accounts[0]})

  Error: VM Exception while processing transaction: revert
      at Object.InvalidResponse (/home/zcon/ethereum_voting_dapp/chapter1/node_modules/web3/lib/web3/errors.js:38:16)
      at RequestManager.send (/home/zcon/ethereum_voting_dapp/chapter1/node_modules/web3/lib/web3/requestmanager.js:61:22)
      at Eth.send [as call] (/home/zcon/ethereum_voting_dapp/chapter1/node_modules/web3/lib/web3/method.js:145:58)
      at SolidityFunction.call (/home/zcon/ethereum_voting_dapp/chapter1/node_modules/web3/lib/web3/function.js:135:32)

I have also tried

surveyfactory.createSurvey.call({value:4000,from:web3.eth.accounts[1]})

Complete code of contract is available here

value I am sending is greater than surveyCreationFees


texts: Deploy contract that requires an ERC20 object in constructor

texts:
I am starting an ICO and basing my contract on OpenZeppelin. I am trying to deploy the contract using web3.js and my problem is that in the constructor I need to pass the ERC20 object of my token. I am not sure how to do that. Do I need to pass the address of the token or the ABI or what exactly? I do not find any information on this anywhere.

This is my contract constructor:

function CrowdSale(uint256 _hivePerEther, address _wallet, ERC20 _token, uint256 _openingTime, uint256 _closingTime) public {

}

My question is how to load and pass my token to the constructor when deploying using web3.js


texts: Node JS problem Interacting with Ethereum Smart Contract

texts:
I'm having only partial success with a Node.js script I wrote that interacts with one of my Ethereum Smart Contracts.

Here's what's working:
-I'm able to call methods in the Smart Contract from my Node.js script
-I'm able to capture and display the results returned from these function calls using my Node.js script

The problem I'm having has to do with capturing EVENTS that are emitted by the contract.

My code won't run cause I keep the following error:

TypeError: theContract.saleTXReceivedEvent is not a function

What's weird is the code I'm using in my Node.js file is the exact same code I've been using in my regular client-side JS files (which are embedded into my HTML files) - which work perfectly well.

Here's the code:

var capturedEvent = theContract.saleTXReceivedEvent();
capturedEvent.watch(function(error, result) {
  if(!error) {
    console.log("Sale was successful!");
    console.log("Results are as follows: ", result);
  }
  else {
    console.log("ERROR!!!! Details: ", error);
  }
});

So again, this code works perfectly in my client-side web files, but it gives me an error when in my node.js file:

TypeError: theContract.saleTXReceivedEvent is not a function

It is of course true that saleTXReceivedEvent is not a Function - its an EVENT, but in terms of the syntax, how else am I supposed to reference it? Why is it working fine in my regular JS files but failing in my NodeJS files?

What's going on here?


texts:
I have problem when I use truffle test. I seperated files used in contract with Solidity framework and I can't compile my code(see below). When code is not seperated works fine.

I tried reinstall truffle again but doesn't help for me. I'm using ubuntu but on mac its working! - so I suppose maybe problem is in case-sensitive.

contracts/Contract.sol:7:1: ParserError: Source "contracts/Token.sol" not found: File import callback not supported
import './Token.sol' as Token;
^------------------------------------------^
Compiliation failed. See above.

I read Solidity source file page and File import callback not supported


texts: Send transactions from any address (account) to a private ethreum network (PoA)

texts: I am trying to send a transaction to a private Ethereum network (PoA) using an arbitrary address. However, the network is not accepting transactions from that address. Are there any method to unlock the network to accept transactions from any address, or I have to unlock each address individually?


texts: Is there any specific reason for web3.js to not compile contracts directly from file?

texts:
web3.eth.compile.solidity ask for a string as a parameter. Not only, it must be a string without line breaks:  in the official greeter tutorial to use an online-tool to remove line breaks from contract is encouraged.

I find that very embarrassing, and I feel that the typical signature for such a method should get a path to a .sol file instead of a string. So... maybe web3 not compiling from a file is some sort of security measure? Or there is any powerful reason to web3 not compiling from a source file I'm unaware?


texts:
I am mining for the first time in my life, and doing it so in the last 24 hours.

I am running this command :  ethminer -G -F http://ethereumpool.co/?miner=17@0x44a7709d896dc619391423b902a9570b9f3ba90d

so I am using ethminer, and ethereumpool. I can see a valid hashrate and all seem to be working in my terminal.

But EthereumPool mentions that withdrawals happen only after a certain threshold :

When i will receive withdraw?
When your balance exceed 1 ether. Withdraws are processed once a day.

Until I reach the 1 ether which might take months with my hashing power, can I check my pending balance somehow so that I make sure I am mining correctly?

Or should I choose another pool? I am just worried I might be mining for months and then realize I did something wrong.


texts: Can you explain some fields in geth logs "Imported new state entries"?

texts:
Here is a part of logs during geth syncing:

INFO [04-13|05:01:20] Imported new state entries               count=1152 elapsed=6.026ms   processed=21622419 pending=7126  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:20] Imported new state entries               count=768  elapsed=4.248ms   processed=21623187 pending=7420  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:21] Imported new state entries               count=768  elapsed=3.480ms   processed=21623955 pending=8237  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:23] Imported new state entries               count=1920 elapsed=10.053ms  processed=21625875 pending=7894  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:23] Imported new state entries               count=768  elapsed=3.886ms   processed=21626643 pending=7584  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:25] Imported new state entries               count=1152 elapsed=6.621ms   processed=21627795 pending=7054  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:26] Imported new state entries               count=768  elapsed=4.586ms   processed=21628563 pending=9079  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:27] Imported new state entries               count=768  elapsed=11.209ms  processed=21629331 pending=9281  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:28] Imported new state entries               count=768  elapsed=4.465ms   processed=21630099 pending=9035  retry=0   duplicate=28494 unexpected=55593
INFO [04-13|05:01:28] Imported new state entries               count=768  elapsed=3.731ms   processed=21630867 pending=9147  retry=0   duplicate=28494 unexpected=55593

Can you please explain these fields in this log:

elapsed
pending
retry
duplicate
unexpected


texts: Accessing calling contract storage in a library

texts:
I need to understand how is it possible to access the calling contract storage from library code. From Solidity manual:

  This means that if library functions are called, their code is executed in the context of the calling contract, i.e. this points to the calling contract, and especially the storage from the calling contract can be accessed.

So I'm trying to compile this simple test library:

library Test_Lib {
    function test_function()
    public
    returns (bool)
    {
        return (this.owner.send(this.balance));
    }
}

But I get the following error:

  Error: Member "owner" not found or not visible after argument-dependent lookup in library Test_Lib

Where am I wrong?


texts:
I have created a private ethereum blockchain. My question is:
How to monitor a private Ethereum blockchain? Is there an open source project to do so like etherscan


texts: eth-registrar-ens cannot read property 'entries'

texts:
I am getting the following error trying to run the code below. I can not figure out how to resolve it?

 var Registrar = require('eth-registrar-ens');
 var Web3 = require('web3');
 var ENS = require('ethereum-ens');

var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));

var ens = new ENS(web3)

var registrar = new Registrar(web3, ens, 'eth', 7,
  function (err, txid) {
    console.log(txid);
  }
);

registrar.getEntry('insurance', function (err, result) {
  console.log(result);
});

TypeError: Cannot read property 'entries' of undefined
at Registrar.getEntry (/home/jordan/work/ens-test/node_modules/eth-registrar-ens/lib/index.js:236:20)
at /home/jordan/work/ens-test/app.js:30:12
at Layer.handle [as handle_request] (/home/jordan/work/ens-test/node_modules/express/lib/router/layer.js:95:5)
at next (/home/jordan/work/ens-test/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/jordan/work/ens-test/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/jordan/work/ens-test/node_modules/express/lib/router/layer.js:95:5)
at /home/jordan/work/ens-test/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/jordan/work/ens-test/node_modules/express/lib/router/index.js:335:12)
at next (/home/jordan/work/ens-test/node_modules/express/lib/router/index.js:275:10)
at expressInit (/home/jordan/work/ens-test/node_modules/express/lib/middleware/init.js:40:5)


texts: has anyone written a nodejs server side component to listen only for Ethereum Events?

texts:
I tried the below code to run it using the pm2 module, as nohup command as well. But, this doesn't seem to work. I saw this, but no code is present. so this is what I'm trying to accomplish.

I want to run this piece of code as a daemon on the server so that it can listen for the incoming event coming from the Ethereum Blockchain.

Web3   = require("web3");
web3   = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/jusRXXXXXXLnnNk"));

address="0x1fe.....3";
abi=[....];
var myContractInstance  = web3.eth.contract(abi).at(address);
function event(){
var event = myContractInstance.Sent({},function(error, result) {
    if (!error) {
          var msg = result.args.from +" sent  " + result.args.amount + " coins to " + result.args.to;
          console.log(msg);
    }
    else {
        console.error(error);
    }
});
}

event();

I tried keeping the code without the event() as well like this:

Web3   = require("web3");
web3   = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/jusRXXXXXXLnnNk"));

address="0x1fe.....3";
abi=[....];
var myContractInstance  = web3.eth.contract(abi).at(address);

var event = myContractInstance.Sent({},function(error, result) {
    if (!error) {
          var msg = result.args.from +" sent  " + result.args.amount + " coins to " + result.args.to;
          console.log(msg);
    }
    else {
        console.error(error);
    }
});

Can anyone help on this with the instruction on what I'm missing here?

Edit 1: I'm using emit in the event as well. here's the updated pastebin.


texts: Trying to use single library for both parent and child contracts

texts:
I would like to have a single owner across the parent contract and child contracts that this parent creates. However, when the child contract is created, it redeploys the library and uses the parent contract as the msg.sender. This makes sense, but I was wondering if there is a way to use the parents library instead of deploying a new instance of it.

contract Owned {
  address public owner;
  function Owned() public {
    owner = msg.sender;
  }
}

contract A is Owned{
  B b;
  function A() {
    b = new B();
  }
}

// This contract deploys another Owned library with contract A as the owner
contract B is Owned  {
  address parent;
  function B() {
    parent = msg.sender;
  }
}


texts: What is the difference between  this.balance VS address(this).balance in solidity contracts?


texts:
To connect to the ethereum test network and sync the blockchain, I run:

parity --chain testnet

When I have to stop at some point, I do Ctrl+C and it says:

  Finishing work, please wait... and quits

However when I check for processes running, I still see the process running:

/usr/local/bin/parity sync

I am doing kill -9 <pid> to kill the process. There has to be a better way. I couldn't find anything in the docs. What is a clean way to stop the node?


texts: What is actually removed during a contract suicide, and why doesn't this cause the blockchain to change?

texts:
I'm trying to get my head around how contract suicides work, and what actually happens during them. I understand why we use them.

This post states that when the SUICIDE opcode is executed, the data of the contract being killed is removed:

  In fact, the SUICIDE opcode uses negative gas because the operation
  frees up space on the blockchain by clearing all of the contract's
  data.

If the contract's data is removed to free up space, then surely the block in which it resides changes, and therefore that block's hash also changes. Wouldn't this therefore mean changing all subsequent blocks that rely on this hash?


texts:
Is it possible to subscribe to pending transactions with Parity and receive full information about it in 1 request? Now i receive hashes first, and than i make requests to get info about this hashes. I want to do it in 1 request.

Thank you.


texts: Cannot get pending transactions from geth (Ropsten revival testnet)

texts:
I'm using Ropsten (revival) testnet with geth.
I can see that all blocks are the same as
https://ropsten.etherscan.io/
But I cannot see the pending transactions.

From https://ropsten.etherscan.io/txsPending
there are about 16 pending transactions but when I do

> eth.pendingTransactions

with geth, I get and empty list: []

How can I get the list of pending transactions ?


texts: Is it possible to run out of gas in a method before reaching the self-destruct call?

texts:
I'd like to implement a self-destruct method for a smart contract that pools money from people as a last resort.

Before calling self-destruct, I'd like to refund all the money to the users and send whatever is remaining to the owner address.

I'm thinking of something along the lines of

uint256 usersLength = users.length;
for (var i = 0; i < usersLength; i++ ) {
    address user = users[i];
    uint256 refundAmount = pooledMoney[user];
    user.transfer(refundAmount);
)
selfdestruct(owner);

I'm a little worried what would happen if the size of the users array is very large, will the method run out of gas within the loop?

If so, what are alternative solutions for implementing something like this?


texts: How long can a string be until it spills into the next word?

texts:
string is dynamic length storage.

I imagine a string of length (bytes length) 1, 2 or 3 is all the same length on storage, probably one word.

Which byte causes it to spill over into a second, third and fourth word?

I tried using strings like "123456789abcdef0" that repeated on and on. This is the data I came up with. I also tried splicing in emoji at the beginning or end of the string.

Transaction cost /    Execution cost /    Length(bytes)
48302 26454   1
50222 26454   31
70389   46557   32
90651 66627   33
92635 66627   64
112897  86697   65
114881    86697   96
135143  106767  97
137127    106767  128
157389  126837  129

Test case:

pragma solidity ^0.4.20;
contract StringGas {
    string[] words;
    function StringGas() public {
        words.push("BEGIN");
    }
    function addAWord(string _word) external {
        words.push(_word);
    }
}

I did it by hand. I'm sure somebody has a fancy Truffle way to do this. This is just data, maybe there is SOME input that breaks my experiment here.


texts: Not able to get deployed address of smart contract

texts:
Error: connect ECONNREFUSED /home/sanya/.ethereum/geth.ipc
      at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
    errno: 'ECONNREFUSED',
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '/home/sanya/.ethereum/geth.ipc' }
  (node:3593) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED /home/sanya/.ethereum/geth.ipc
      at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)

  (node:3593) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

  (node:3593) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Code for deployment is -

const solc = require('solc');

const net = require('net');

let fs = require("fs");

let Web3 = require('web3');

const web3 = new Web3('/home/sanya/.ethereum/geth.ipc', net, {});

let source = fs.readFileSync('../ethereum/node01/contracts/KYC.sol');

console.log(source.toString());

let helloCompiled = solc.compile(source.toString(), 1).contracts[':KYC'];

var password = "apple";

try {
    web3.eth.personal.unlockAccount("0x49f513854af455f45044b12869ebb1dec9db3073", password, 600)

}

catch (e) {

    console.log(e);

    return;
}

let Hello = new web3.eth.Contract(JSON.parse(helloCompiled.interface),

    null, {

    data: '0x' + helloCompiled.bytecode

});

console.log("abi" + helloCompiled.interface)

console.log("abi" + typeof (helloCompiled.interface))

console.log("bin" + helloCompiled.bytecode)

console.log("bin" + typeof (helloCompiled.bytecode))

let helloInstance;

Hello.deploy().send({

    from: '0x49f513854af455f45044b12869ebb1dec9db3073',

    gas: '4700000'

}).then((instance) => {

    console.log("Contract mined at " + instance.options.address);

    helloInstance = instance;

})

    .catch(function (error) {

        console.log(error)

    });


texts: How much time will the Ethereum wallet take to sync for the first time

texts: I downloaded and installed Ethereum wallet for windows 64 on my machine. When I tried to launch it for the first time, it started downloading the blocks .Already many hours have passed by but the download of the chain structure seems to be never ending . I would like to create new account and get some ether into my wallet . How long with this sync up take and can I proceed to create a new account , while the sync up is going on in the background


texts: Plasma.io: What if someone is offline during a mass withdrawal?

texts:
I'm reading the Plasma paper published a couple months ago, and on page 27, they talk about "Adversarial Mass Withdrawals" in the event of block withholding.

My question is, what if someone is offline during a mass withdrawal? The paper says in the event of block withholding "one simply should exit from this Plasma chain to another as quickly as possible." There's a fairly long process to do a mass withdrawal, but if someone is offline, I'm guessing they can't participate in time, so how is this problem solved?


texts: I m doing project for document verification using blockchain in which we don't have to carry documents everywhere, hash key of block will fetch data of doc from blockchain.I m not getting how to search through blockchain or what will be efficient method for searching through blockchain for finding block data belonging to that particular hash?


texts: Keccak256 collision in function’s prototype

texts: I was reading the github version of the upcoming book Mastering Ethereum, where the author defines the function selector as The first 4 bytes of the Keccak256 hash of the function’s prototype. This allows the contract to unambiguously identify which function you wish to invoke. So, my question is, in case the first 4 bytes of two functions, and their argument(s) number/type in the same contract are same (I know, the chance is pretty small), then what is the behavior of the function invocation? Does it throw any error or it randomly picks up a function matching the hash and executes that?


texts:
I'm using Infura as my web3 provider, and have MetaMask installed to connect to the blockchain. I'm trying to send a transaction, but have learned that Infura is read-only, and doesn't support the eth_sendTransaction method. I found this thread talking about it.

I'm trying to figure out how to sign a transaction locally then send it. This is my code that deals with signing and sending a transaction

...
let encodedData = await this.props.users.methods.registerUser(this.state.signUpUserName).encodeABI()

let signedData = await this.web3.eth.accounts.sign(encodedData, this.state.userAccount)

await this.web3.eth.sendSignedTransaction("0x" + signedData,function(err, result) {
    if(!err){
        console.log(result)
    }
})
...

I'm getting an error when I try to send the transaction, I think it's due to signedData not being RLP encoded, but I don't know much about it.

invalid argument 0: json: cannot unmarshal hex string of odd length into Go value of type hexutil.Bytes

signedData is an object containing the following data:

Object { message: "0x704f1b94000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000064a61726574680000000000000000000000000000000000000000000000000000",
messageHash: "0x61f631cd8d21c0c03ca6548c35ec63b00aa41f53c4f3a89f1ef20ccc90b333e7",
v: "0x1b",
r: "0x5ed963bd343bdb044faf9a8f4074c074db6055cc72dd9d3e1032851e8d709dd2",
s: "0x6fb58f55543c473e61dba4556021115c5aff041195453307a579eac5fa313685",
signature: "0x5ed963bd343bdb044faf9a8f4074c074db6055cc72dd9d3e1032851e8d709dd26fb58f55543c473e61dba4556021115c5aff041195453307a579eac5fa3136851b" }

I was reading up on the ethereumjs-tx library, but that requires a private key to sign data, and as far as I know, you can't get the private key from metamask. Do I need to hardcode my private key from MetaMask into my code? How would one sign data locally and then proceed to send a transaction?


texts: Solidity: How can a contract B, burn from contract A, generate another contract?

texts:
As we know if we want contract A, in the future, creates another contract: contract B, when we're deploying contract A, we also put the code of contract B in the transaction. So we send the following code to the blockchain to deploy contract A:

pragma solidity ^0.4.4;

contract Contract_A {

address public b_addr;
function Contract_A(){

 }
  function create() {
    Contract_B bb = new Contract_B();
    b_addr = address(bb); }

function fetch(){
    Contract_B cc = Contract_B(b_addr);
    cc.change();}
}

contract Contract_B {

  uint public val;
  function Contract_B(){
   val=7;}
   function change(){
   val+=90;}
  }

Assume, contract B wants to create another contract: contract C, in the future.

The question is: where should we put the code of contract C?


texts: What Is The Easiest Way To Split ETC from ETH in 2017

texts: I am not very technical. I want to know if there is an easier way to split eth from etc without using the mist wallet 0.8.1 in 2017.


texts: Questions about interacting with contracts using truffle

texts:
I have a simple Escrow contract that I've deployed using testrpc. I'm not sure how to interact with the methods once I've created an initialized a new one.

Here's the contract:

pragma solidity ^0.4.4;

contract Escrow {

address public buyer;
address public seller;
address public arbiter;

  function Escrow(address _seller, address _arbiter) {
    buyer = msg.sender;
    seller = _seller;
    arbiter = _arbiter;
}

  function payoutToSeller() {
    if(msg.sender == buyer || msg.sender == arbiter) {
      seller.send(this.balance);
    }
}

  function refundToBuyer() {
    if(msg.sender == seller || msg.sender == arbiter) {
      buyer.send(this.balance);
    }
  }

  function getBalance() constant returns (uint) {
    return this.balance;
  }
}

Console returns the following when I create a new instance of my escrow contract:

Escrow.new([acct2, acct3]).then(function(instance) { console.log(instance.address);})
0x7982e782f1f3937d7b626691b11216155b6b47d0
undefined

So it seems to have worked. My question is how do I interact with that contract to send it some value? Similar to how I would with a deployed MetaCoin contract using something like MetaCoin.deployed().then(function(instance) { return instance.sendCoin(acct1, 10, {from: acct2});})?

Also, who is the msg.sender in this case?

Thank you for any help.

UPDATE - Setting address =  Escrow.new([acct2, acct3]).then(function(instance) { return instance.address;})

Trying to add contract address to Escrow.at(address) and receiving the following error Error: Invalid address passed to Escrow.at(): [object Promise]. Also have tried Escrow.at(address).get() and getting the same error. Thank you.


texts: Solidity - Proper way to Import Contracts

texts:
When importing one Solidity contract into another, what’s the difference between importing it and accessing it using the is keyword, vs. importing it and just instantiating an object of it?
Here’s what I mean.
When working with OpenZeppelin’s Library of contracts for example, we quite often see multiple contracts being imported into a single contract, like so:
import "../node_modules/@openzeppelin/contracts/GSN/Context.sol";
import "../node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "../node_modules/@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol";
import "../node_modules/@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol";
import "../node_modules/@openzeppelin/contracts/introspection/ERC165.sol";
import "../node_modules/@openzeppelin/contracts/math/SafeMath.sol";
import "../node_modules/@openzeppelin/contracts/utils/Address.sol";
// etc. (that list goes on!)

This is then followed by the use of is in the host-contract’s declaration statement:
contract MyERC721Contract is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
   . . .

}

Now contrast this approach with one where you’re importing a Contract, and then instantiating an object of that imported Contract, as follows:
import "../contracts/CustomerContract.sol";

contract MyCommerceContract {

    CustomerContract public Customer;

    constructor() {
       Customer = new CustomerContract();
    }

}

So when would you use the first approach - the one that uses is - and when would you use the second?
And why?
Are there some really simple hard and fast rules regarding this?


texts:
I'm using both call and delegatecall within an assembly block and i've noticed that when issuing a call I need to provide 4 bytes (sig) + any arguments, whereas for delegatecall I need to provide 4 bytes (sig) + 32 bytes of zeros and then my arguments.

Does anyone know why this is the case? Does it have something to do with using delegatecall for libraries which expect the contract state to be the first argument?


texts: Bep20 OpenZeppelin Token Unable to Verify

texts:
I created one token on bep20 chain and I am starting to like it, but I am unable to verify. I am pretty new to that and I hope I haven't missed something that cannot be fixed. So the token is 0x0005fd45281d89042965acbaf645ecc86bc5ec5c and the creation hash is 0xe204201e04ceb186fd86ef86269f825a8aa67ae08a9aa73c961ac2e93b4a219b
you can check it here: https://bscscan.com/tx/0xe204201e04ceb186fd86ef86269f825a8aa67ae08a9aa73c961ac2e93b4a219b
the code from remix that I used to create is this:
pragma solidity ^0.8.1;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract DIAMOND is ERC20 {
    constructor(uint256 initialSupply) public ERC20("1DIAMOND","1DIA") {
        _mint(msg.sender, 7 + initialSupply + 7);
    }
}

Any help will be greatly greatly appreciated, because this really killed my enthusiasm on the topic.


texts: How can I have no gas fees in a private PoA network while avoiding spam attacks and the halting problem?

texts:
Complete noob here.
I'm developing a dApp that functions on top of a private clique PoA blockchain (using geth).
The project should be viable in a production environment and allow nodes to transact completely free of charge.As such, I would like to have no gas fees for transactions but I understand this would lead to spam attacks and issues like the halting problem.
I've thought about keeping the gas price and having a master account to distribute ether to new accounts when they join so they are able to pay for the transactions.
Is this a good solution? What other solution should be considered?


texts: Can transaction fee be paid by 3rd account?

texts:
I have a scenario like that:

I have a "Main" account with ethereum client:

And there are other two accounts, lets call them: "A" and "B"

"A" account will send to "B" account some token (ecr20 token). But transaction fee must be paid by "Main" account.

Is it possible? How can i create a transction like that?


texts: How to reduce corruption in developing countries using Ethereum

texts: I would like an honest opinion on whether or not the picture below is self-explanatory. I would also like to know what more functionalities I can add to reduce the capital flight by government officials by using Ethereum's unique qualities.


texts: I have downloaded the ethereum source from https://github.com/ethereum/go-ethereum, is there anyway to build the source in windows 10 machine. As per the document it says use make geth , but it will work in ubuntu machine.


texts:
Here is my code:

pragma solidity ^0.4.24;

contract TRY{
    uint public temp=0;
    function transfer_ether() public payable{
        require(msg.value>=60);
        temp=60;
        msg.sender.transfer(msg.value-60);
    }
    function to_contract() public payable {
        uint a=temp;
        temp=0;
        msg.sender.transfer(a);
    }
}

I deployed this code on test network on MyEtherWallet using Ganache.
Even when I enter a value less than 60.. it still doesn't revert as specified in the condition.
I cannot understood why is it happening.It would be helpful if someone explains the problem.

The solution to this problem:
pragma solidity ^0.4.24;

contract TRY{

uint public temp=0;
uint public b=0;

function transfer_ether() public payable{
   require(msg.value>=60 ether);
        temp=msg.value;
         b=temp-(60 ether);
        temp=60 ether;
       msg.sender.transfer(b );
}

function to_contract() public payable {
    uint a=temp;
    temp=0;
    msg.sender.transfer(a);
}

}


texts: web3.js getBalance function returns promise?

texts:
I'm using web3js version 0.20.6.

When I try the getBalance function it returns a string and it works. But the documentation here says it should return a promise. But the documentation here says it returns a string.
Is this a change between the versions?

In the world of async calls using promise, the chain of method calls needs to get converted into promise based then and catch. Is it okay to have so many layers of promise going from parent to child to its child method?


texts: How is the ERC721TokenReceiver.onERC721Received data parameter used in practice?

texts:
The ERC-721 and ERC-1155 NFT standards’ safeTransferFrom functions both accept a bytes data parameter which is then passed on unaltered to the transfer recipient address if this is a smart contract.

Are there token-receiver contracts in the wild that are using this data?
Are there any popular wallet implementations that actually let the user specify this data when transferring an NFT? (or specify it themselves under the hood?)


texts: How to turn off specific warnings for the solidity compiler?

texts:
Whenever I use pragma experimental ABIEncoderV2 and truffle, I get the following warning in the terminal:
Warning: Experimental features are turned on. Do not use experimental features on live deployments.

Is there any way to turn it off, at least for development?
Update Apr 2021: this specific issue is no longer applicable to Solidity v0.8 and above, since the abi encoder v2 has been finalised. Changing the pragma to pragma solidity ^0.8.0 will make the warning go away.


texts:
I have created an ERC20 token, but whenever I want to trnasfer it, transaction fees is deducted in ethers. But I donot want to but ethers. Cant the fee be deducted in terms of my custom token?

Thanks


texts:
Is there a simple way to convert bytes32 to bytes in Solidity?

I'm trying to get the length of the string passed in the bytes32 variable but everything gets returned 32 size which makes sense.

But explicit conversion does not seem to work:

bytes memory _tmpUsername = bytes(_username);  // _username is of type bytes32

This throws an error of:

Explicit type conversion not allowed from "bytes32" to "bytes storage pointer"


texts: So in the decentralized future, we will pay to use services like Twitter, etc.?

texts:
I'm currently learning a lot about blockchain and the vision behind smart contracts.
As I understood, the idea of a turning-complete blockchain enables applications like social media platforms, messengers, or something like Google to be decentralized.
To query data, we look up the blockchain. To mutate data/ to mutate the blockchain, we need to send a transaction. This will include every time I want to post or like something on social media, as an example.
So the future of the internet we are looking at, is an ad-free internet, but an internet where people have to pay to participate in it?
Thank you in advance for your answers. I'm very much looking forward to it!
I know this is a fairly conceptual question, but the ethereum subreddit would not let me post under 20 karma points and literally cannot find any other active platform for asking this questions I'm really curious about!


texts: Methods and constants order in the contract ABI

texts: Is it possible to annotate methods and constants order in the contract ABI before compilation?


texts: Are there Ethereum Wallets (other that Mist) that provide support for test-network

texts:
I was going through a list of Ethereum wallets from here and here. Some good or I should say popular ones other than Mist were Jaxx and MyEtherWallet.
But I was concerned if any Ethereum wallet provides functionality of connection to test-network. Like In Mist I can connect to a test network and play around with ethers and also can test my contracts over private network before deploying it on public blockchain.
Are there any Ethereum wallets available which fullfill following criteria:

Is a Light-wallet
Provides support of custom Tokens
Provides support for test network.

Is there any chance of Mist releasing a light-wallet?


texts: How can you call a function with a modifier in another contract?

texts:
How would you call a function with a modifier from another contract. Let the contracts be:

contract MyContract {
    address owner;
    modifier getModified (address owner) {
        if (msg.sender != owner) throw;
        _;
    }

    function func(address newOwnerAddress) getModified(owner) returns (address newOwner) {
        //....code....
    }
}

contract newContract {
    MyContract myContract = MyContract(0x08271...);

    function bid(uint amt, address _oldOwner, address _newOwner) returns(bool success) {
        if (amt > ...) {
            myContract.func(_newOwner,{getModified:_oldOwner})
        }
    }
}

I am getting an error Error: Undeclared identifier: getModified for getModified in Remix. I tried reading the docs but they also dont mention the funcition call with modifiers to other contracts.
Thanks in advance.


texts: How would I go about passing a user input into a smart contract? Say I want to pass a token name via user input and set it as the token name inside the smart contract. How would I do this?


texts: Need to execute several transactions as fast as possible

texts:
In the case of an emergency (e.g. theft), it may be necessary to disable several accounts as fast as possible.
I am writing the smart contract.
Should each of several accounts be disabled in a separate transaction or do one transaction with an array of accounts to be disabled?

If we split into several independent transactions, each transaction uses less gas and thus passes through faster.

If we do one transaction, it requires a fewer number of transactions. Will this work faster?

If there are several transactions, need to manage (repeat if stalled with not enough gas price) each transactions separately.


texts: How do I know how much gas to use when calling a contract?

texts: When I am calling (sending a transaction to) a contract how do I determine how much gas to use? Is there a way to calculate this upfront & what happens if I send too much / too few gas?


texts: Importing a contract from another contract in NodeJS app

texts:
I'm using a function in my NodeJS app to deploy contracts. The user inputs the contract he wishes to deploy and the app deploys it. The structure of the app is

.
├── app
│   ├── models
│   │   └── user.js
│   └── routes.js
├── cert.pem
├── config
│   ├── auth.js
│   ├── database.js
│   └── passport.js
├── contracts
│   ├── Registry.sol
│   ├── TrustEntity.sol
│   └── User.sol
├── key.pem
├── modules
│   ├── contracts.js
│   └── helpers.js

TrustEntity.sol is

pragma solidity ^0.4.11;
import "./User.sol";

contract TrustEntity {
    address owner;
    address registry;
    address[] pendingRequests;

    function pushPending(address requester) {
        pendingRequests.push(requester);
    }
}

and User.sol is

pragma solidity ^0.4.11;
import "./TrustEntity.sol";

contract User {
    // State variables
    TrustEntity trustEntity;
    address owner = msg.sender;
    bool verified = false;
    uint creationTime = now;
    uint level = 0;
    address[] public pendingRequests;

    // Set trustEntity's deployed contract address
    function User(address _trustEntity) {
        trustEntity = TrustEntity(_trustEntity);
    }

    function requestValidation() {
        trustEntity.pushPending(owner);
    }
}

Finally, the relevant part of the deploy function is

function deploy(contractName, publicAddress, _gas) {
    // Get the contract code from contracts
    const input = fs.readFileSync('contracts/' + contractName + '.sol').toString();
    const output = solc.compile(input);
    // The trailing ':' is needed otherwise it crashes
    const bytecode = output.contracts[':' + contractName].bytecode;
    const abi = JSON.parse(output.contracts[':' + contractName].interface);
    console.log(abi[0].inputs[0]);
    const contract = web3.eth.contract(abi);
    console.log("Contract:" + contract);
    const contractInstance = contract.new({
    .
    .
    .
}

When I try it, the following error is returned

{ contracts: {},
  errors: [ ':2:1: ParserError: Source "User.sol" not found: File not supplied initially.\nimport "./User.sol";\n^------------------^\n' ],
  sourceList: [ '' ],
  sources: {} }
TypeError: Cannot read property 'bytecode' of undefined

even though the docs say (as expected) that . refers to the current directory. Specifically, they say: "To import a file x from the same directory as the current file, use import "./x" as x;". Also, it was working fine in Remix so I'm not sure where the error is.


texts: Automatic peer discovery in a private blockchain

texts:
Is there a way to enable automatic peer discovery in a private network. As far as I know, the only way to connect to peers while operating on a private blockchain is to add them through addPeer() command. For a private network with many nodes, this process is not efficient.
Is anything being implemented to automatically connect all the nodes running on the same networkid and having the same genesis block?

Having bootnodes is an option but I have to manually add any new nodes. I am looking for a simpler solution.

How are the connections generally managed in a private network? Did anyone work on an efficient solution to address this issue? Any pointers?

Related:

What are the peer discovery mechanisms involved in Ethereum?

Peer discovery not working on private network


texts:
I don't understand quit well what are the requirements on the disk volume to run a full node of ethereum and what is its expected growth.

e.g. for now I have the following volume distribution across different ethereum folders on an ubuntu machine (listed only the biggest chunks):

16G ./.ethash
12G ./.ethereum
12G ./.ethereum/chaindata

what's exactly there (.ethereum and ./.ethereum/.chaindata seem to have the same size)?

how much disk space does the mining activity require (that's the reason for space in the folder ./.ethash or not?)?

Edit: additional info - content of ./ethash
running the ls -l command there

drwxrwxr-x 2 ubuntu ubuntu       4096 Jul 24 07:22 ./
drwxr-xr-x 6 ubuntu ubuntu       4096 Jul 23 18:16 ../
-rw-rw-r-- 1 ubuntu ubuntu 1409284744 Jul 24 07:43 full-R23-03b8bc47a10d1baa
-rw-rw-r-- 1 ubuntu ubuntu 1367339400 Jul 24 00:20 full-R23-1250db2965df18ca

You see big binary files.


texts: About contract kill and forensic investigation

texts:
Let’s say that I created a contract and, using that, I and other people, made many transactions which meaning is undoubtably proven reading the contract.

At a certain point someone kills the contract and all the code is canceled.

How can I prove the meaning of the transactions made in the past if the code has been deleted? Is there any practical method to going back to old blocks in order to extract the smart contract which have been used at the time?


texts: I bought some ICON (ICX) tokens on Binance, then transferred them to MetaMask. I still see the transaction on Etherscan.  Initially, the tokens showed in MetaMask (tokens held went from 8 to 9), but the # of tokens was an odd number.  I checked MetaMask the next day and the number of tokens is back to 8 with no sign of the ICX coins.  If click on Add Token and I copy in the contract address, the token name says "Like ETH", precision says 0.  Where are those tokens?  Thanks.


texts:
TypeError: Cannot read property 'call' of undefined
at Context. (test/TdetayProofTest.js:18:74)
here my test:
var TdetayProof = artifacts.require("./TdetayProof.sol");
contract('TdetayProof', function(accounts) {
// deploying the contract (TdetayProof)
it("Can be deployed.", async () => {
let tdetayProofInstance = await TdetayProof.deployed();
return assert.notEqual(tdetayProofInstance, undefined, "Contract TdetayProof has been deployed.");
});
// uploading new piece of proof
it("Can upload new piece of proof and update total proofTdetay count", async () => {
let tdetayProofInstance = await TdetayProof.deployed();
await tdetayProofInstance.submitProofTdetay("IPFS Hash", "Proof Title", "Proof Tags", 0);
let totalProofTdetay = await tdetayProofInstance.getTotalProofTdetay.call(); the line with the issues.
return assert.equal(totalProofTdetay, 1, "Public tdetay mapping contains 1 proof.");
});
it("Can upload new piece of proof with correct owner", async () => {
let tdetayProofInstance = await TdetayProof.deployed();
let proofOwner = await tdetayProofInstance.getOwner(0);
return assert.equal(proofOwner, accounts[0], "Owner is the first account.");
});
// Destroying piece of proof
it("Can not be destroyed by accounts other than the owner.", async () => {
let tdetayProofInstance = await TdetayProof.deployed();
try {
await tdetayProofInstance.destroy({from: accounts[1]});
} catch(error) {
// console.log('This is the error returned by trying to destroy a contract as a non-owner: ', error);
return assert.isTrue(true, "Contract TdetayProof can not be destroyed.");
}
return assert.isTrue(false, "Contract TdetayProof can be destroyed by non-owner.");
});
it("Can be destroyed by the owner.", async () => {
let tdetayProofInstance = await TdetayProof.deployed();
await tdetayProofInstance.destroy();
return assert.equal(web3.eth.getCode(tdetayProofInstance.address), "0x0", "Contract TdetayProof can be destroyed.");
});
});


texts:
The context:
I have a simple app that that consults historic of events frequently. It works fine on my development machine, with just a few thousands blocks. I am not sure if it will continue to work 3 years from now (when millions of blocks could potentially be mined).
Is there any way to create a "mock" IBFT-2 network with, let's say, 8 million initial (random) blocks.
Update 2020-12-08:
The answer by "shemnon" (trying to connect to an already existing consortium chain with millions of blocks), partially replies the testing issue, but now my initial question can be reformulated as:
"If I have a current testing network with 20 millions blocks, Is there any way to create a "mock" IBFT-2 network, with, let's say, 20x10 millions blocks?
The idea is to always being able to test with future x10/x100/... blockchain sizes due to the append only/always increasing nature of blockchain.


texts: How to find contract creation block time with web3?

texts: Is it possible to find out in which block a contract was created using web3?


texts: Got Error: TokenCreate has not been deployed to detected network (network/artifact mismatch)

texts:
truffle.js

module.exports =  {
    networks: {
        development: {
            host: "127.0.0.1",
            port: 8545,
            network_id: "*" // Match any network id
        }
    }
};

 2_deploy_tokenCreate.js

const TokenCreate = artifacts.require('./TokenCreate.sol');

const NewToken = artifacts.require('./NewToken.sol');[![enter image description here][1]][1]

module.exports = function(deployer) {
  // Use deployer to state migration tasks.
  const openingTime = web3.eth.getBlock('latest').timestamp + 2; // two secs in the future

  const closingTime = openingTime + 86400 * 20; // 20 days

  const rate = new web3.BigNumber(1000);

  const wallet = accounts[[1]];

  return deployer

      .then(() => {

          return deployer.deploy(NewToken);

      })

      .then(() => {

          return deployer.deploy(

              TokenCreate,

              openingTime,

              closingTime,

              rate,

              wallet,

              NewToken.address

          );

      });
};

 TokenCreate.sol

pragma solidity ^0.4.22;

import "./NewToken.sol";

import "../../node_modules/zeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol";

import "../../node_modules/zeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol";

contract TokenCreate is MintedCrowdsale,TimedCrowdsale {

    constructor()
        Crowdsale(_rate, _wallet, _token)
        TimedCrowdsale(_openingTime, _closingTime)
    {
        uint256 _openingTime;
        uint256 _closingTime;
        uint256 _rate;
        address _wallet;
        MintableToken _token;
    }
}


texts:
I would like to get an oracle for values of countries' based currencies.
Are there such free oracles?


texts:
how can i calculate:
1083.83 / 8.25 = 131.37.
As I see its not possible in simple way. I have tried a lot of math function but not works.
Is there any solution for this?


texts: Get the result of token transfer transaction in geth

texts:
There is a way to get the result of a token transfer operation in Parity https://ethereum.stackexchange.com/a/9009

Is there a way to do it in geth by RPC?


texts: Ethereum Wallet Start Mining option is disabled

texts:
I just downloaded Ethereum wallet and after syncing the blocks when I went to Start mining to get some Ether, the menu button is grayed out, its disabled

This is my wallet, in case if you can send me some Testnet Ethers

0x3cf387E565cb7466d2a334A6DeD2BBe3CA0242Eb


texts: What is the beneficiary in block header?

texts: There is the data called "beneficiary" in block header. What is this data?


texts: View queued transactions with go-ethereum

texts:
I want to see all transactions, that were queued at a past block. Lets say in block 2000000 with geth. Is there a way to do that?
Is there a way to see current queued transactions?


texts:
Noticed two days ago my live ETH node has not been able to keep up with the network.  It is a fast VPS that always was fine until two days ago.

Running 2.3.5-stable of Parity.

Block generation is always a little faster than I can sync.  This never happened before.

Am I the only one experiencing this?


texts: Why is my node synchronization stuck/extremely slow at block 2,306,843?

texts:
Using macOS 10.12.1 with Ethereum Wallet 0.8.7, nodes are connected but Sync doesn't even start. Stuck at block 2,306,843.

What can I do? Please keep in mind, I am neither a coder nor a tech geek.


texts: I used shape shift to convert bitcoin to ether and received ether in my wallet. I am trying to send it back to shape shift and it is asking me for a password. I don't remember ever setting up a password. I thought there were default accounts in the wallet. Did I just lose a bunch of money?


texts: Is there a command line like RSA_verify in Ethereum

texts: I want to know if there is command line in Ethereum can do the RSA signature verification that we can directly use


texts: How to sign transactions offline via geth for a specific chain?

texts:
Is there a way to sign a transaction to be accepted on a specific chain?

In other words, if I want to sign an offline transaction via geth, say 0.5 eth from external address A to external address B, is there a way to specify the desired chain to be Kovan/Mainnet/etc in the transaction?

I'm hoping to prevent a malicious actor from broadcasting the hash of the signed transaction on another chain (like mainnet, when the txn was meant for a testnet). E.g. replay attack

On geth, I've tried to sign a transaction offline through eth.signTransaction( ):

var tx = eth.signTransaction({from:YOURADDRESS, to:TOADDRESS, gas:GAS, gasPrice:GASPRICE, nonce:19, value:500000000000000, networkId:1},YOURADDRESS)

In place of the "networkId" parameter, I've tried the following combinations of parameters and arguments:

networkId:1
networkId:42
chainId:1
chainId:42

The tx.raw or hash of the signed transaction for each confirguration returns the same bytecode. I was even able to broadcast and submit a txn on kovan with a chainId:1 argument.

Pls help. Thank you in advance!


texts:
I would like to create a token which any wallet cannot hold more than 100 of.
Is this possible while this token, also is mintable?


texts: what should be the proper block gas limit?

texts:
I have created a private network and trying to deploy my contract using Remix IDE. Remix is connected to my private blockchain at port 8545, my coinbase account have 2 ethers and I have set my Gas limit to 21000 but whenever I try to deploy the contract I get an error :

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

When I click on force sending then i get error :

Intrinsic gas too low

And when I increase the gas limit to 21001, I get the error:

exceeds block gas limit


texts:
I know normal gas price is 1gwei(https://etherscan.io/tx/0x4b0aaea87288a1080288187d99c666749577801014535f879d5d85719866ddeb).

But why transaction in erc20 is 6gwei or 30gwei (https://etherscan.io/tx/0xec5b8ff681d02e62cf151186b0fabfe097ec3c8a27dd85be8952410ca917f8f5).

Can I send transastion in erc20 with gasprice=1gwei?