texts:
I want all js clients to react on new event being stored to blockchain:

contract MainContract{
    event Evt(address indexed _sender,string jsn);
    function deposit(string jsn) returns (int256) {
        Evt(msg.sender, jsn);
    }
}

Here I expect watch callback to be executed.

    var contract = web3.eth.contract(abi).at("0xe45866ac5d51067ce292bc656c790e94ddcf0766");
    var myEvent = contract.Evt({},{fromBlock: 0, toBlock: 'latest'});
    myEvent.watch(function(error, result){
        console.log("on watch");
        console.log(arguments);
    });
    // this call saves event data successfully!
    contract.deposit('hello there',function (res) {
        console.log(arguments)
    });

But I don't see 'on watch' in my console.
Is this possible? How can I do this? Any example?

UPDATE: my best guess right now that this is metamask.io problem (https://github.com/MetaMask/metamask-plugin/issues/792)

UPDATE2: Looks like a bug in ethereum kernel, some people report same experience: https://github.com/ethereum/go-ethereum/issues/14670


texts: What's the relationship between Ethereum and Filecoin?

texts: I read on a few websites that Filecoin will "run" on Ethereum. Is that still the plan for Filecoin? If so, what does this mean in practice?


texts:
I want to setup a simple testnet, and mind some ether to deploy my first contract so I follow the official geth tutorial, but I'm stuck at the "run" part and the instructions don't do what I expect.

If I do anything with geth, I get :

2200 backend.go:477] server started
2200 server.go:530] Listening on [::]:30303
_

And it does nothing but listen. I'm forced to ctrl+C. I want to create a private testnet, so I use this : (just following the tutorial)

geth --datadir ~/.ethereum_private init ~/dev/genesis.json
geth --fast --cache 512 --ipcpath ~/Library/Ethereum/geth.ipc --networkid 1234 --datadir ~/.ethereum_private  console

and the first line brings me on the "listen" line again, I don't know what to do from here and I'm not finding any info about that. Is there something I did wrong, am I missing something ?

The only reaction I can get is if I use geth --mine, the command line responds that I have no keys in store (which is normal).

(I have also done the wallet tutorial until the "deploy" step)

And I forgot, the geth console returns 'cmd' is not defined for every single command.


texts: Distribute coins across a private network

texts:
I've set up a private network and generated around 100 addresses. Exactly 80 of those addresses have a balance of 10 or more ETH, while the rest of the addresses have balances of 0. I've also preallocated 10,000 ETH to a separate address (let's call it base) in genesis.json.

I would like to send 5 ETH from base address to every address that has a balance >= 10 ETH. I've seen examples for ERC20 tokens around but couldn't find anything using the actual currency of a chain instead of a token.

Also, is it possible to check balances and send the desired amount to all the addresses created on the network without me having to save every one addresses in a separate file and load them up when sending?

Any help would be greatly appreciated. Thank you!


texts: Solidity: Handling multi-mappings with multiple entries per key

texts:
I am wondering how I would implement a smart contract that would allow me to iterate through a list of (possibly matching) results in a mapping in order to "find" the right one to get. In a way, I'm trying to recreate what in SQL would be a SELECT * FROM mytable and then iterating through the returned rows. Obviously, this doesn't translate well to Blockchain/Solidity.
So here's my example:
mapping (address => bytes32[]) private map;

So for an/any address, I want to be able to store an arbitrary number of uint8-bytes32-pairs. So far, so good. Now retrieving a single one, knowing EXACTLY the uint8-"key" is fairly easy:
function getOne(address a, uint8 b) public view returns(bytes32) {
    return map[a][b];
}

For iterating through all, this would be done on the client side:
function getAll(address a) public view returns(bytes32[]) {
    return map[a];
}

Now, I can go though this array on my client-side and fetch the one I need using getOne().
Anyhow, this feels like quite some overhead. Is there some more elegant/efficient way to do this in Solidity?


texts: Walk-Through Creation of a Personal Two-Factor Authentication Wallet / Contract

texts:
I would like to create a multi-signature wallet to store large amounts of Ether with at least one signature from my Android phone (the other from my PC and/or another phone). What would be the cheapest and most user friendly way to accomplish this?

Are there any mobile wallets currently available that would allow me to sign a transaction for free or would I have to send the contract a Wei and have it validate the sender address? (Note: Jaxx I think forces HD Wallet behaviour, so it might cycle new addresses and that might not be very user friendly).


texts: Where does DappNode ubuntu installer download the .ethereum files?

texts:
I am currently using DappNode and syncing the blockchain.
When I used GETH directly there used to be .ethereum folder where all the chaindata and keystore was present.
But when I use DAPPNODE the .ethereum folder is not created.
My question is:

Where does the DappNode store .ethereum kind of file in my server?

I used the following commands to install Dappnode:
 sudo wget -O - https://prerequisites.dappnode.io  | sudo bash

The prerequisites were docker, docker-compose and xz.

   sudo wget -O - https://installer.dappnode.io | sudo bash


texts: How do you make a button that formats a transaction MetaMask can use?

texts:
So far, after many hours of searching, it is not documented or shown in any tutorial a single working example. I tried this:

function BuyButton() {
        web3.eth.getAccounts(function(error, result) {
            web3.eth.sendTransaction(
                {from:result[0],
                to:"0x23db62344f40fc356sfcba267514270e60eed82fd",
                value:  1000000000000000000,
                gas:  300000,
                data:   {"constant": false,
                        "inputs": [],
                        "name": "BuyItem",
                        "outputs": [],
                        "payable": true,
                        "stateMutability": "payable",
                        "type": "function"},
                    }, function(err, transactionHash) {
              if (!err)
                console.log(transactionHash);
            });
        });
    }

But it doesn't work. I can get MetaMask to generate a simple send without the data field, but there is no documentation in web3.js exactly how to use that data field, nor are there examples of someone making something as simple as a button.


texts: TypeError when trying to deploy a contract with web3 1.0.0-beta.11

texts:
I'm trying to figure out how to deploy a contract with web3 in version 1.0.0-beta.11,  and I don't know if I'm hitting a bug in web3, an incompatibility issue with the version of solc I'm using, or if I'm just doing something wrong.

I'm using the latest version of solc released on NPM: 0.4.13. I'm trying to deploy the following contract:

contract Greetings {
    string message;

    function Greetings() {
        message = "I am ready!";
    }

    function setGreetings(string _message) public {
        message = _message;
    }

    function getGreetings() constant returns (string) {
        return message;
    }
}

with the following series of instructions run in a node console:

sourceCode = fs.readFileSync('Greetings.sol').toString()
compiledCode = solc.compile(sourceCode)
contractABI = JSON.parse(compiledCode.contracts[':Greetings'].interface)

[ { constant: false,
inputs: [ [Object] ],
name: ‘setGreetings’,
outputs: [],
payable: false,
type: ‘function’,
signature: ‘0x49da5de4’ },
{ constant: true,
inputs: [],
name: ‘getGreetings’,
outputs: [ [Object] ],
payable: false,
type: ‘function’,
signature: ‘0xca4c3a41’ },
{ inputs: [],
payable: false,
type: ‘constructor’,
signature: ‘constructor’ } ]

contract = new web3.eth.Contract(contractABI)
byteCode = compiledCode.contracts[':Greetings'].bytecode
contract.deploy({data: byteCode, arguments:[]}).send({from: '0x00D1AE0A6fC13B9ecdefA118B94cF95ac16D4ab0', gas: 4700000}).on('error', function(error){console.error(error);}).then(function(newContractInstance){console.log(newContractInstance.options.address)})

and there on the last one, I'm getting the following cryptic error:

TypeError: Cannot read property 'length' of undefined
    at /Users/jdoe/myproject/node_modules/web3/packages/web3-eth-contract/src/index.js:356:43

any idea what I'm doing wrong?


texts: i need some help transfering funds back into my account from a smart contract i accidentally sent funds to

texts:
i was using uniswap and i thought i was easily transfering one token into another and somehow i put myself into a smart contract and cant get my funds back.... yesterday i had figured out with the transfer option in write contract function underneath the info of the last person my 672.4 VRS was sent to but i had to pay $3.85 in either and was going to but by the time i was able to transfer the ether i had bought, it had been about 24 hrs and now when im trying to do the same transfer its saying it will cost $1200..... can some one please help me out so im not out $2500....  transaction source code https://etherscan.io/tx/0x4621958479d6a263f3448547562d4bf135ea808c6a4a80892e9853086c2d53a6
Where i believe my tokens are now code https://etherscan.io/token/0xabc430136a4de71c9998242de8c1b4b97d2b9045?a=0x561852228e80d9a41195ecb112a4ca3b66f1158a
thanks


texts: Downloading the Ether Mist Multisig Wallet..blockchain download time..and future syncing

texts:
Hi i'm intrested in purchasing some ether.. and think the Mist Multisig wallet is a good place to keep it.

So I downloaded the wallet...now the blockchain(syncing) is downloading and has been running for a few hours.

I just wanted to know is this a once off thing, I mainly plan on buyn a few ether/ cyptocoins as a speculative and not really doin much for say a few years...
I don't plan on mining either. So is it goin to sync every time I open this wallet???


texts:
I am trying to pack tightly my structure data type.
The question that arose is how much storage size does the bool variable take?
And if we suppose that it will take 1 byte, if I put consecutive up to 8 bool variables, will the EVM try to pack them together in 1 byte?


texts: Execute smart contract function on python

texts:
so I already successfully make a smart contract and deployed it on my BC network. I can execute the function using the Ethereum wallet. My question is, how can I execute the functions on Python language? For example, here is one function of my SC:

function withdrawToken(address recipient, uint value) returns (bool success) {
    if (int(tokens[recipient] - value) < 0) {
        tokens[recipient] = 0;
    } else {
        tokens[recipient] -= value;
    }
    OnValueChanged(recipient, tokens[recipient]);
    return true;
}

For making a transaction in Python language, I'm using web3 library and it's also already worked. I'll really appreciate your help, thanks!


texts: How do I store or use private keys in node js that I deploy in live server?

texts:
I have a live server running a full GETH NODE in which I need to sign a transaction with a private key. The problem is I dont know how I can use the private key without explicitly providing the private key to the server. Is using hash corp a good option or is their any easier way?Is there a way to leverage having full GETH NODE to advantage?
const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1,'hex')
var wallet = new ethers.Wallet(privateKey1,provider)


texts: Publish and Verify the source code of a contract created by another contract on etherscan


texts: Both web3.eth.accounts.create() and web3.eth.personal.newAccount() not working

texts:
I'm making a dApp on reactjs. I wanted to create a new account and have done it trying 2 methods

this.web3.eth.personal.newAccount()
this.web3.eth.accounts.create()

I have attached the code below(ignore the comments)

 OTPSubmit(event) {
     event.preventDefault();
     //alert('A name was submitted: ' + this.state.value);
     this.setState({
        showComponent: true,
       account: this.web3.eth.personal.newAccount()
       #account: this.web3.eth.accounts.create()
     });

   }

These are the errors I'm getting

web3.eth.accounts.create() is not a function
Cannot read property 'newAccount' of undefined

Can you please help me? I am very new to this


texts: Questions on MinterRole contract in openzeppelin

texts:
I am using the openzeppelin for creating the ICO contract. I am concerned about the MinterRole here. After I develop Token contract, I added the sale contract as a minter using "addMinter" function.

Question

After the sale is over

I do not see a way to remove the contract address as a minter. I see that "renounceMinter" will remove only the person's who is calling this method.
I understand even If I remove (or) not remove the contract address as a minter at that point (i.e., after the sale is over) the Sale contract will b defined in such a way that it will not work at all. is it safe even if we leave the contract address in the minter list  ?
Why openzeppelin has designed the "MinterRole" contract with the "renounceMinter" function that can remove only the person who is calling that contract but the function "addMinter" can do this for others also ?

Code

SampleCrowdsale

contract SampleCrowdsale is FinalizableCrowdsale, MintedCrowdsale

MintedCrowdsale

contract MintedCrowdsale is Crowdsale {
  constructor() internal {}
  function _deliverTokens(
    address beneficiary,
    uint256 tokenAmount
  )
    internal
  {
    // Potentially dangerous assumption about the type of the token.
    require(
      ERC20Mintable(address(token())).mint(beneficiary, tokenAmount));
  }
}

ERC20Mintable

contract ERC20Mintable is ERC20, MinterRole

MinterRole

pragma solidity ^0.4.24;

import "../Roles.sol";

contract MinterRole {
  using Roles for Roles.Role;

  event MinterAdded(address indexed account);
  event MinterRemoved(address indexed account);

  Roles.Role private minters;

  constructor() internal {
    _addMinter(msg.sender);
  }

  modifier onlyMinter() {
    require(isMinter(msg.sender));
    _;
  }

  function isMinter(address account) public view returns (bool) {
    return minters.has(account);
  }

  function addMinter(address account) public onlyMinter {
    _addMinter(account);
  }

  function renounceMinter() public {
    _removeMinter(msg.sender);
  }

  function _addMinter(address account) internal {
    minters.add(account);
    emit MinterAdded(account);
  }

  function _removeMinter(address account) internal {
    minters.remove(account);
    emit MinterRemoved(account);
  }
}


texts:
I'm doing some research on how to generate truly random numbers on the blockchain.
Aside from Chainlink VRF, the other viable solution seems to be Provable Things (former Oraclize) with their random oracle. Even though it may raise questions on true decentralization for the randomness generation, it is much more convenient since it takes ETH instead of LINK to pay fees.
All good, the only problem is that everything I found online indicates that the project was quite active a couple of years ago but now it seems slow and even somewhat broken on some pages. Their documentation here (http://docs.provable.xyz/#pricing-advanced-datasources-testnets-policy) had its last update in 2019, while the query tester here (https://app.provable.xyz/) seems to be broken for some tests (computation) and also testing for random is missing.
Is the project dying or somewhat abandoned or pivoting?


texts: How to find the date of an Ethereum transaction while parsing it with web3?

texts:
Is there a way to know the date of a transaction by looking at the raw blockchain data?

I know that Etherscan and other blockchain explorers have dates for the transactions, but I couldn't find a way to do it via web3.

web3.eth.getTransaction, and other transaction related APIs
don't seem to be exposing any Date objects.


texts: error using push to add an element to an array

texts:
i am having troubles when i want to compile the sol file, specifically this error:

':20:16: TypeError: Member "push" not found or not visible after argument-dependent lookup in uint32[100] storage ref\n    uint32 a = people.push(12);\n               ^---------^\n'

pragma solidity ^0.4.18;

contract Voting {

 mapping (bytes32 => uint8) public votesReceived;
 uint32[100] public people;

 bytes32[] public candidateList;

 function Voting(bytes32[] candidateNames) public {
   candidateList = candidateNames;
   people.push(12);
 }

 function onlyOneVote(uint32 ethaddress) returns(bool) {
   bool a = autentic(ethaddress);
   if (a == true) {
     people.push(ethaddress);
   }

 }

 function autentic(uint32 id) view public returns(bool) {
   for(uint i = 0; i< people.length; i++) {
     if(people[i] == id) {
       return (false);
     } else {
       return(true);
     }
   }
 }

i'm using ganache for "the blockchain" thank you in advance


texts: do I have to create a token to use a smart contract using Ethereum?

texts:
If I want to use a smart contract, do I have to create a new currency/token, or can I do them using ethers?

If I can use ethers, what will be the consequences on the data stored and encapturing the execution of those smart contracts?

Thanks


texts:
Is there documentation and examples for using the personal api via JSON-RPC?

I found this.

However it does not say what the method would be in JSON-RPC.


texts: Can any one explain how issuer of a token can buy back the token?

texts: Can that be done by a simple token transfer to my contract's account? And, how?


texts: geth ignoring --ipcpath in Linux with attach and datadir

texts:
I am trying to create a test network and have been able to start a network (I think).

geth --datadir ./eth-data --ipcpath geth.ipc attach

I get

Fatal: Unable to attach to geth: dial unix /home/victory/.ethereum/geth.ipc: connect: no such file or directory.

I have also tried with the full path but it always looks in the ~/.ethereum directory.

According to the help doc I am running 1.4.5-stable

I would like to know how I can attach to my testnet so I can start mining and testing.


texts: What is the longest fork that had occurred so far?

texts: What is the longest fork that had occurred since the start of Frontier?


texts: When I try to mine ethereum I get JSON-RPC error

texts:
I am new at ethereum mining and I am trying to solo mine. I already installed geth and now I am trying to mine. When I go to ethereum software folder and type ethminer -G, it gives me the following error:

miner  20:17:35.189|main  Getting work package...
  X  20:17:36.390|main  Failed to submit hashrate.
  X  20:17:36.393|main  Dynamic exception type: class jsonrpc::JsonRpcException
std::exception::what: Exception -32003 : Client connector error: libcurl error: 7 -> Could not connect to http://127.0.0.1:8545

JSON-RPC problem. Probably couldn't connect. Retrying in 1...

What can be the problem?


texts: I sent my Humaniq & Taas coin (from my ico purchase) to my Parity Wallet.

texts: Being a newb to crypto I screwed up. I sent the taas and humaniq coins I bought during their ico to my Parity wallet. Nothing has appeared and I now think that maybe this wallet only supports ethereum? Are my coins lost forever or can I recover somehow?


texts:
Good day, I was looking at the way contracts addresses are created and it seems that the process is quite deterministic (depends on the nonce). Is there a way to get the address of a contract that wasn't yet deployed for a specific nonce? something like:

contractAddress = getAddress(nonce1, data, privateKey)

I know there used to be the pyethereum library that offered such tool, but it wasn't updated in a long time and I was hoping to use a more active tool.

As always, your help is appreciated!


texts: Does there exist a formula of the mining revenues (revenues, not profit) based on my personal hashrate, the difficulty and the exchange price?


texts: How to publish contract source code to etherscan through remix?

texts:
I deployed contract by remix. And then I want to verify and publish it at etherscan.io. But, I tried ETHERSCAN - CONTRACT VERIFICATION and SOURCIFY plugin. The result is verified, but I can't see my contract source code at etherscan.
So, how can I publish source code to etherscan through Remix?


texts: Cannot connect localhost to ropsten testnet via infura

texts:
I want to connet my meteor localhost to ropsten testnet.
Therefore i have a lib.js with the connecting commands:

//var Web3 = require('web3');
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://ropsten.infura.io/..."));
    if(!web3.isConnected())
        console.log("not connected");
    else
        console.log("connected");
}

A time out msg appears. I read about the
var Web3 = require('web3');
But when i add this line i also get a error msg for missing modules.
How can i get this run?


texts: Are there IDEs that can detect stack depth failure?

texts: for example, can browser-solidity, Mix or live.ether.camp debug stack depth failures?


texts: If a blockchain is a distributed database, where is the data?

texts:
There are a lot of articles describing how Ethereum is just another database, and a number of posts here on this site that talk about storing data on the blockchain itself (e.g., [1], [2]). However, my question is a bit more basic than those. Specifically, if a blockchain is just a database, then:

What kind of database is this (e.g., relational database, nosql, registry-style key/value pairs, plain text, etc)? What any older technology can I look to for an understanding of how it works? This Quora question has answers that suggest both relational-style (by mentioning foreign keys) and key/value pairs, figured I'd ask here and see if I can get more consensus.
How do I "read" a value from the database? How can I be sure I'm getting the most recent version of that (e.g., no transactions have taken place that update the value of this data)?


texts: What is the use of private key in smart contract?

texts:
I have testnet public key like(0x3581cAe15410AB5673B6A58152Af9a081394Cf41)
my usage of public key in modifier function
ex:

pragma solidity ^0.4.24;

contract FirstContract {
address owner;

function FirstContract() public {
     owner = msg.sender;
}

modifier ownerOnly()  {
      require(msg.sender == owner);
      _;
}

function checkOwner(address ownerAddress) public view ownerOnly returns(string) {
      return("you are owner");
}
}

and what is the use of private key in solidity with example.
Thanks!


texts:
I know nothing of solidity and I don't even understand what a dApp is or how to access one, so this question might be silly.

But I have a contract to migrate and it hangs, so I want to try migrating with something else to see if the problem is the contract or truffle, Parity or my private blockchain.

Do you have alternatives that you could list?


texts:
I'm running a Parity node in a docker container. I've installed it with docker pull parity/parity:stable some time ago.

How can I know which version of Parity I'm running? (without stopping the node).

If I log in the container I can only see a constant stream, such as:

2019-07-03 11:52:51 UTC Imported #8078283 0x56bf…bf65 (181 txs, 7.98 Mgas, 530 ms, 30.92 KiB)
2019-07-03 11:52:52 UTC eth_accounts is deprecated and will be removed in future versions: Account management is being phased out see #9997 for alternatives.
2019-07-03 11:52:54 UTC Imported #8078284 0xe819…c89d (3 txs, 3.79 Mgas, 276 ms, 2.01 KiB)
2019-07-03 11:53:00 UTC   31/50 peers   5 MiB chain 32 MiB db 0 bytes queue 95 KiB sync  RPC:  0 conn,    1 req/s,   24 µs


texts: Recommended approach to becoming a developer in the space

texts:
Like a lot of people I’ve following the space closely for about 3 and a half years now (admittedly as a speculator) and am keen to get deeper into contributing to the space as a developer.
I have been learning solidity and dapp development on the side of my full time job and have also gone through a Part time web development bootcamp which was Ruby on Rails based. With the Technical nature of the space and not having a proper CS education, I’ve ruminating on what would be the best way to both quickly become useful to the ecosystem but also how to quickly break in.
The 2 most sensible paths to me are 1. Focus on learning dapp development on my own and build up a portfolio or 2. Explore the idea of doing a CS conversion degree which is usually about a year while attempting to still build a portfolio
Would be very keen to hear your thoughts on the best and most efficient way to approach this and even better if some of you have gone through this journey yourselves!


texts:
I am working with a simple contract where any user can pass a number to it and the response will be a number incremented by that number and a seed number. This contract does not serve any practical purpose and it is intended for experiments only.

addNum.sol

pragma solidity ^0.4.11;

contract NumberTracer {
    bytes32 tracer;
    uint256 seed = 1000;
    uint256 currentSum;

    function NumberTracer(bytes32 t) {
        tracer = t;
    }

    function addNumber(uint256 n) {
        currentSum = seed + n;
    }

    function getCurrentSum() returns (uint256) {
        return currentSum;
    }
}

I created two different web3.js based files to interact with the contract.

addNum-deploy.js

var Web3 = require('web3');
var fs = require('fs');
//
var ethHttpProvider = new Web3.providers.HttpProvider("http://localhost:8545");
var web3 = new Web3(ethHttpProvider);
var abiFile = fs.readFileSync('NumberTracer.abi').toString();
var abiDef = JSON.parse(abiFile);
var byteCode = fs.readFileSync('NumberTracer.bin').toString();
//
var contract = web3.eth.contract(abiDef);
var deployedContract = contract.new(['MyTrace0'],
    { data: byteCode, from: web3.eth.accounts[0], gas: 4700000 },
    (err, res) => {
        if (err) {
            console.log(err);
            return;
        } else {
            console.log("Transaction hash : " + res.transactionHash);
            console.log("Contract address : " + res.address);
        }
    }
);

Using the contract address from the deployment above, I run my test as follows.

addNum-test.js

var Web3 = require('web3');
var fs = require('fs');
//
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
var abiFile = fs.readFileSync('NumberTracer.abi').toString();
var abiDef = JSON.parse(abiFile);
var contract = web3.eth.contract(abiDef);
var contractInstance = contract.at('0x...');
//
contractInstance.addNumber.call([100],
    (err, res) => {
        if (err) {
            return
        } else {
            contractInstance.getCurrentSum.call([],
                (err, res) => {
                    if (err) {
                        console.log(err)
                    } else {
                        console.log(res)
                    }
                }
            )
        }
    }
)

And this is the output I see:

node addNum-test.js
{ [String: '0'] s: 1, e: 0, c: [ 0 ] }

Why is the update not visible?

The Solidity documentation mentions that state variables are persisted. So, why don't I updated value of currentSum?


texts:
How does Ethereum handle a netsplit? Or say a major outage where undersea cables are severed rendering 1/3 or more nodes offline.

Does transaaction sent continue to be processed by the existing full nodes/miners or will the network grind to a halt?


texts: Gas Estimation Failed for Airdrop for sending Tokens to Multiple Addresses using Remix

texts:
I have deployed a Crowdsale contract and now I need to send my Tokens to a list of addresses using remix and injected web3.
I am using below code for Airdrop but when I send tokens to multiple contracts, then I faced the same error i.e "Gas Estimation Failed".
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?

I am using the following parameters on Ropsten Test net:

"0xc7B64B7F81EC1A6692B747697425C0f7d30F5f37",["0x5bd6a15D5DB703e1C498Ec8B6f79839F1bA491e7","0xE4D4aaD83EF6b27bd91Dd9E16Ee3BfF4CB04dd6c"],["100000000000000000000","200000000000000000000"]

Sending 100 tokens to first Address and 200 tokens to second address.
Any help will be appreciable.

   contract ERC20 {
      function transfer(address _recipient, uint256 _value) public returns (bool success);
    }

contract Ownable {
  address public owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

contract Airdrop is Ownable {

  function distributeBulk(ERC20 token, address[] recipients, uint256[] values) onlyOwner public {
    for (uint256 i = 0; i < recipients.length; i++) {
      token.transfer(recipients[i], values[i]);
    }
  }

  function distribute(ERC20 token, address recipient, uint256 value) onlyOwner public {
      token.transfer(recipient, value);
  }
}


texts:
I have read that Ethereum during the compilation splits the code into tags.

The solc optimizer doesn’t optimize across tags. If we consider “1+1”, it can be optimized to 0x2 if under the same tag:

// Optimize OK!
   tag_0:
   0x1
   0x1
   add

But not if the instructions are separated by tags:

// Optimize Fail!
   tag_0:
   0x1
   0x1
   tag_1:
   add
   ...

Is there any way we can configure how the solc compiler tags the code?


texts: what are benefits of creating tokens for creators

texts:
What are the benefits of tokens for their creators? and specially gas tokens? (like CHI Gas token or token with infinite supply)
How their prices are determined in the first place?
Thanks.


texts: Unable to get metamask account with web3

texts:
I have been following a tutorial on creating solidity contracts. I am unable to get the list of account numbers on my metamask wallet when I use my script below.

  async componentWillMount(){
    await this.loadWeb3()
    await this.loadBlockChainData()
  }

//connect to metamask and reads it into the app using web3
  async loadWeb3() {
    if (window.etheruem) {
      window.web3 = new Web3(window.etheruem)
      await window.etheruem.enable()
    }
    else if (window.web3) {
      window.web3 = new Web3(window.web3.currentProvider)
    }
    else {
      window.alert('Non etheruem browser detected. You should consider trying to install metamask')
    }
  }

  async loadBlockChainData() {

    const web3 = window.web3
    //load account from metamask
    const accounts = await web3.eth.getAccounts()
    console.log(accounts)

  }

I should be getting a list of account numbers but the code above prints "[]" instead.

My research indicates that the connection issues might be due to privacy settings. So I tried to disable my privacy settings to allow incoming connections. But I think that option to disable privacy settings has been removed in the later metamask updates.

I have also tried to change my network to the Ganache address (instead of the main etheruem network) and successfully got testing accounts balances on Ganache reflected on metamask, but I am still not getting the accounts printed on my web console. It continues to prints a "[]"

I also tried adding my local server address to the list of sites that are allowed to connect to my metamask. (although wasn't advised by the tutorial) But this also doesn't seem to work.

I also found a recent question similar to mine, but the issue was different (I believe) since I am running my application on a local server instead of just a page.

Please let me know if anyone has any suggestions on how to fix this.

Thank you


texts:
My minner (lolminner) is working perfectly, but in 2minners I'm not receiving almost any rewards. Apparently, I'm finding block at an incredibly low speed (at least compared to the previous week).
Can someone tell me whats's happening? I'm new to this.
In the photo you can see how slow it started getting since about 6 pm yesterday. The jump from 8 to 12 is because I turn it off at 9.30 and turn it back on at 12.30, but that last 12:50 lock was the last one I found, at least until 2 am, when I decided to turn it off again


texts: Truffle Contract deployment >> Error: Returned values aren't valid, did it run Out of Gas?

texts:
I have a rpc enabled running private ethereum blockchain node with mining enabled.
I have connected to it using metamask and have performed some contract interactions (deployment, calling functions,etc) using remix and it works fine. However when I try doing the same with truffle framework I am facing an error. I have referred to couple of different ways with the popular tutorials directed by google and followed the steps but I always land on this same error.
So this is the code I use to start my node:

  geth --datadir test --networkid 15 --rpc --rpcport "30308" --rpccorsdomain "*" --rpcaddr "0.0.0.0" console

I have used a single account for every purpose (mining, deploying contracts and so on) to avoid confusions and the account has a ton of ethers(to avoid gas problems). At every point of operations the account is unlocked(to avoid locked account errors).
This is my contract in the contracts folder of truffle: Hello.sol

pragma solidity ^0.5.8;

contract Hello {
   uint public message;
   constructor() public {
   message = 123456;
   }

   function get() public view returns (uint) {
   return message;
   }

   function set(uint inpStr) public{
   message = inpStr;
   }
}

This is the migration file in the migrations folder of truffle: 2_deploy_contracts.js

const Hello = artifacts.require("Hello");

module.exports = function(deployer) {
    deployer.deploy(Hello);
};

After this I ran truffle compile which worked fine(no issues here).
This is the truffle config file: truffle.js

module.exports = {
    rpc: {
            host: "localhost",
            port:30308
    },
    networks: {
            development: {
                    host: "localhost",  //testing on the same vm
                    port:30308,
                    network_id: 15,
                    from: "0x56164f073d19fdd9e8a0041e2a3a9dc8c8*******",
                    gas: 2000000
            }
    }
};

I ran truffle migrate which worked fine and deployed my contracts(no issues here).
After that I ran truffle console:

  Hello.deployed().then(function(instance) { dApp = instance; })

Running dApp gives me all the information about my contract(looks legit).
Now when I try:

  dApp.message.call()
  or
  dApp.get()

It throws me this error:

  Error: Returned values aren't valid, did it run Out of Gas?
      at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:318:1)
      at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:208:1)
      at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)
      at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-providers-http/src/index.js:96:1)
      at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:112:1
      at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3-core-requestmanager/src/index.js:147:1
      at sendTxCallback (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/~/web3-core-method/src/index.js:473:1)
      at Method.formatOutput (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/~/web3-core-method/src/index.js:163:1)
      at Method.outputFormatter (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/src/index.js:818:1)
      at Contract._decodeMethodReturn (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-contract/src/index.js:465:1)
      at ABICoder.decodeParameters (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3-eth-abi/src/index.js:226:1)

when I perform:

  dApp.set(10)

It works fine and displays the transactions details. When it comes to the other fuctions which require the data to be displayed gives me the above error. What could be the culprit here?


texts: Memory Arrays Should Have Push() And Pop()

texts:
Dynamic memory arrays currently cannot be resized. This is true for Solang and solc solidity. However, Solang uses a heap, and has a realloc() function. Thus it is is possible for Solang to support pop() and push() on memory arrays.

Note that push and pop already supported on contract storage arrays. Also, arrays are stored in struct vectors in Solang, which are allocated with malloc.

Steps:

In method call add some code to detect "push" and "pop" call on memory arrays. This should result in a new Expression::DynamicArrayPush() and Expression::DynamicArrayPop(). Note that push() with no arguments should return a reference to the new element.
In the code emitter, some code is needed to emit code for Expression::DynamicArrayPush() and Expression::DynamicArrayPop(). Both of these will new to call realloc() to resize the array, and of course pop needs to return the last element and push the new element.
The call return value of realloc() might be a new pointer if the memory was be moved. The array variable will need to be updated.
An alternative implementation would generate a Expression::DynamicArrayResize() for the code emitter.
Arrays can be the bytes type, or every type followed by [], so int64[], address[], struct-foo[], enum-bar[]. All types will need test cases like the one below.

contract c {
        function test() public {
                bytes foo = new bytes(1);

                foo[0] = 128;
                foo.push(64);

                assert(foo.length == 2);

                assert(foo[1] == 64);

                assert(64 == foo.pop());

                assert(foo.length == 1);
        }
         }


texts:
I'm using ethereum to create a transaction system. My goal is to record every transaction when an event is fired and the client shall receive a response whether the transaction was successfully executed. Here's my code:

   app.post('/transfer', function (req, res) {
        var from = req.user.address;
        var to = req.payload.to;
        var amount = req.payload.amount;
        point.transfer.sendTransaction(from, to, amount);
        var event = point.PointTransfer({}, '', function (error, result) {
            console.log(error);
            if (!error) {
                console.log("Point transfer: " + result.args.amount + " points were sent. Balances now are as following: \n Sender:\t" + result.args.c + " \t" + wardpoint.balance.call(result.args.sender) + " tokens \n Receiver:\t" + result.args.receiver + " \t" + wardpoint.balance.call(result.args.receiver) + " points");
                var transaction = new Transaction({
                    sender: result.args.sender,
                    receiver: result.args.receiver,
                    amount: result.args.amount
                });
                transaction.save(function (err) {
                    if (err)
                        res.send(err);
                    else
                        // If no errors are found, it responds with a JSON of the new user
                        res.json(req.body);
                });
            }
        });
    });

I'm not sure if this is the correct way, as it appears that the event is fired at a period of time after a transaction is executed. What is the best practise to implement response withn a solidity event?


texts: Can I build Dapp without forcing users to spend ether?

texts:
I know this is a weird question but I wanted to see what are the alternatives for quick user adoption of a Dapp.

Currently majority of the market is familiar with fiat currency and forcing the user to setup an ethereum wallet will lead to slow adoption of the Dapp. I totally understand that every transaction needs gas (transaction fees) but is there any other alternative approach?

Setting up ether wallet and the buying ether from an exchange by itself takes significant time.


texts:
Using truffle and truffle test I have the below test code:

  function testBuyItem() public {
    uint8 expected = 2;
    bytes32 expectedName = "Item";

    Assert.equal(uint(8), uint(7), "Should fail");

    contract.buy.value(1 ether)(expected);
    var (typeId, name, condition) = contract.getUserItem(1);

    Assert.equal(expectedName, name, "Should be Item");
  }

It doesn't fail, even if I have a failing test ABOVE the contract.buy.value(1 ether)(expected) line.  If I comment out the contract.buy... line it fails as expected.  The code for buy has a payable modifier than checks the value of msg.value with require.


texts: Why I can't get any status from Nethereum TransactionReceipt?

texts:
Sample code below (simplified for illustrative purposes only):

var a = new ManagedAccount(mOwner, mOwnerPwd);
var w = new Web3(a, mNodeUrl);
w.TransactionManager.DefaultGas = mGasLimit;
w.TransactionManager.DefaultGasPrice = mGasPrice;
Contract c = w.Eth.GetContract(mVAbi, mVAdd);

var r = c.GetFunction("issueCoin").
    SendTransactionAsync(mOwner, To, Value).Result;

Thread.Sleep(10000);

var rcpt = w.TransactionManager.TransactionReceiptService.PollForReceiptAsync(r).Result;

No matter how long I sleep, the rcpt.Status is always NULL, even when I deliberately let the transaction runs out of gas and failed, the rcpt.Status is still NULL.

My question now is, how can I check and ensure a transaction is successful?


texts: Feedback the cheat and fraud of etc eth on twitter. How can i recover my loss?

texts:
Eth and etc arg two great projects.
As i can't find the etc email, hope you can kindly cc to etc too, thanks.
A few days ago on Twitter to search for the etheric classic, found an account, and read the news every day. About 5 o'clock this afternoon, find out of a message, as shown below (screenshot after the event):

Earlier in the message there are a few words that the eth is to open a little limited test time, if you go to the address https://etherscanio.github.io/etherscan.io.html and send 3 eth ,it will be returned 30 eth to you . At the time I thought it was an official classic Ethernet Twitter, i did not think too much, send 3 eth from my eth account 0xa236c36C501e887E85964f2B766113bf3A83A8b5 to the account:

but i did not receive the back of the transfer, it is estimated fooled. Back to Twitter, I saw part of the msg about x10 eth deleted, but some people curse:

Also on Twitter i Leave a message to Asked etc:

but my account was frozen after some time. . .
I am very surprised, why official etc Twitter have such a thing?
I do not know the loss can recover? the loss can recover ...? recover...? Are there more people fooled? etc eth to leave more people a bad impression?

The cheat website is based on github : https://github.com/etherscanio/etherscanio.github.io
Maybe github should response for it too?

i found the info@ethereum.org email on the officail website https://www.ethereum.org/ ,
but email send failed as said not a valid address . And after a long time google , i cant find the email to etc


texts: Parity scheduled transaction stuck at submitting

texts: I scheduled a transaction for the BAT token after block 3798640. It remained pending before the block for hours, then submitted about an hour ago, see Tx local viewer screenshot. Anyone know if this transaction will go through? Alternatively, is there a way to make sure it is cancelled?


texts: erc20 transfer SafeMath: subtraction overflow?

texts:
I am trying to transfer a erc20 token.

   const data = contract.methods.transfer(recipient, amount).encodeABI();
   const rawTx = {
        from: sender,
        nonce: '0x' + count.toString(16),
        gasPrice: this.web3.utils.toHex(2000000000),
        gasLimit: estimateGas,
        to: contracts.address,
        value: '0x0',
        data: data,
        chainId: '0x' + contracts.chainId
      };
      console.log(rawTx);

      const privKeyBuffer = new Buffer.from(senderPrivateKey, 'hex');
        const tx = new EthereumTx(rawTx);
        tx.sign(privKeyBuffer);
        const serializedTx = tx.serialize();
        const signedTransaction =  '0x' + serializedTx.toString('hex');
        console.log(signedTransaction);

but when I try to trace_rawTransaction, to see if the transaction is alright, I get this output:

{
    "jsonrpc": "2.0",
    "result": {
        "output": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e536166654d6174683a207375627472616374696f6e206f766572666c6f770000",
        "stateDiff": null,
        "trace": [
            {
                "action": {
                    "callType": "call",
                    "from": "0x...",
                    "gas": "0x7470",
                    "input": "0xa9059cbb0000000000000000000000004b346650ea60d22583c9e47a44b49120ae2638250000000000000000000000000000000000000000000000000de0b6b3a7640000",
                    "to": "0x...",
                    "value": "0x0"
                },
                "error": "Reverted",
                "subtraces": 0,
                "traceAddress": [],
                "type": "call"
            }
        ],
        "vmTrace": null
    },
    "id": 1
}

The output is :

SafeMath: subtraction overflow

What is happening?


texts: Customize the structure of a transaction

texts:
I'm still a newbie with ethereum and I want to know if it is possible to customize the structure of a transaction in order to add extra fields like a message or an integer or anything else.

If the answer is yes, can you please give me some good hints to guide my researchs.

Thank you!


texts: Authentication or Identification of smart contract

texts:
This is more of a general discussion then a direct question.

I am trying to find a way for a smart contract to be identified somehow by another one.

My final goal is to allow some functions in "contract1" to only be executed by contracts that have been created following the template of "contract2" but may contain different kind of data.

A first though was, could I keep a sort of hash or key in "contract2" and send it over to "contract1" following a bit the example of the transfer function in ERC223:

 // Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {

    if (isContract(_to)) {
        return transferToContract(_to, _value, _data);
    } else {
        return transferToAddress(_to, _value, _data);
    }
}

basically adding one more if function:

 // Function that is called when a user or another contract wants to transfer funds .
    function transfer(address _to, uint _value, bytes _data) public returns (bool success) {

        if (isContract(_to) && _data == *SECRETKEY*) {
            return transferToContract(_to, _value, _data);
        } else {
            return transferToAddress(_to, _value, _data);
        }
    }

But obviously the problem with this is that the key would need to be kept in clear and therefore not so secret after all.

Does anyone have any suggestions on how could I go about doing this ?


texts: Full list of Blockhashes of Ethereum Blockchain

texts:
Is there a way to retrieve a full list of the blockhashes of Ethereum blockchain without downloading a full copy blockchain?

(The naive approach I have in mind is to download the blockchain, use some interface to retrieve the blockhashes of the blocks based on their indices and write them into a file). Is there a better approach?

Thanks.


texts: Why I Can't mine using my private network?

texts:
Mist Version: 0.10.0
OS & Version: windows/64
Node version: geth 8.11.1

Screen shot : https://imgur.com/a/gRPeJz0

I've created a private network all fine but when I attache and miner.start(1); the kh/s show in Mist but I keep waiting and no ether got mine not a single one!!!

https://codeshare.io/GqxZ3Z
this is the code of the first command line where I start geth

https://codeshare.io/2pgZYX
this is the second terminal where I start mining command

Genisis file:

{ "coinbase" : "0x0000000000000000000000000000000000000001",
  "difficulty" : "0x20000",
 "extraData" : "",
 "gasLimit" : "0x8000000",
 "nonce" : "0x0000000000000042",
 "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
 "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
 "timestamp" : "0x00", "alloc": {}, "config": { "chainId": 15, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 } }

thanks guys


texts: Unique Private key will never have a duplicate?

texts: Couldn't you write a script that generates eth accounts continuously and polls to see the balance of each account(hoping that it lands on one with a balance already). What are the logistics on this?


texts:
contract Helloworld {
    uint private simpleInt;

    function getValue() public view returns (uint) {
        return simpleInt;
    }
}

What is the difference between "return" and "returns", I am a beginner.


texts:
I have been deploying contracts on rinkeby but we are almost done to go to mainnet.

I have been comparing deployments with truffle and remix and there is a huge difference in gas uses, so I would like to deploy my contract from remix and then make the json files with the contract address to the build directory, is it possible? I can easily get the ABI from remix, but I think it doesn't have the address where the contract is deployed, right?


texts: ETH - Pre-Paid smart contract so users don't pay transactions

texts:
I'm developing a "corporate" DApp, therefore the employees don't have any reason to "spend" their ether/gas for interacting with the contract...
Is there any way to enable each transaction to be auto-paid by the contract itself? If not how would you address this problem? I cannot pass ETH to employees, because they might "spend it", and, at the same time, why would they use their own ETH?
Thank you all for any suggestion.
Cheers


texts: Adding interval on incoming data from web3 subscription

texts:
I am trying to set an interval on the incoming data from web3 subscription and use alchemy as provider to avoid rate limit.
I tried adding setInterval on the data to do this but it returns undefined when wrapped.
this.subscription = web3.eth.subscribe('pendingTransactions', (err, data) => {
   if (err) console.log('Failed to connect pending mempool!');
})

setInterval(function() { // `data` returns undefined
   this.subscription.on('data', async (txHash) => {
       // do someting
   })
}, 3000);

What is the correct way to set interval on incoming data from subscription?


texts:
pragma solidity >=0.4.0 <0.7.0;

contract NewHello{

    struct kullanicilar{
        string name;
        string surname;
        uint age;
    }

    event infoChanged(
        string name,
        string surname,
        uint age
    );

    uint newUser;
    mapping(address => string) public users; // contains a name for every address
    //[] public userAddress ;

    function updateUser(string memory name , string memory surname , unit age) public returns(uint userID){
        userID = newUser++;
        users[userID] = kullanicilar(string name, string surname, age);
        emit infoChanged(name,surname,age);
    }
    function getUser(address a) public view returns(string memory) {
        return users[a]; // return address name
    }
}

Hello ! I want to tell you what I want.
I built a sturct name is kullanıcılar(means users in Turkish) and I built a event for if I changed my informations about my users I want to see my event.
finally I made getUser func which is return to me the name of this user.

but I have got a error at updateUser function which is

  ParserError: Expected ',' but got identifier users[userID] = kullanicilar(string name, string surname, age); ^--^

I checked my codes and I can't find my error anyone can help me for this :)
thanks for read :)


texts: Do we have a full archive node after a geth fast sync?

texts:
I have read the comments in PR for the fast sync and I am a little bit confused that Péter Szilágyi is stating that after a fast sync the user will have a full archive node with all historical states.

  This allows a fast synced node to act as a full archive node from all intents and purposes.

My understanding of the fast sync is that geth is downloading some historical states on the way to the pivot block (state download running in parallel to the header/receipt download), but the complete state download will only happen at the pivot point. From there on it continues with the full sync.

Hence, in the best case, we have some historical states before the pivot point and a full history after that, right? Can someone please confirm/correct my mental model?


texts: Software to measure power consumption of mining?

texts: Does anyone know of any good software that will measure my PC's power consumption while I mine ethereum? I'm aware I could buy something to measure it on the socket, but free software is well, free.


texts: What are differences between Bitcoin and Ethereum transactions?

texts:
I have read about how transactions work and how they can be redeemed in bitcoin. In a very abstract way, the sender defines the output script that should redeem the transaction. But I am new to Etherum. So my question, how Etherum transactions differ than bitcoin?

To clarify my question, if I have a smart contract on the Etherum blockchain that can send some ethers from the contract owner to someone else under a specific condition (A similar contract is in this nice answer  in this question, timed commitment using ethereum blockchain). I know how bitcoin can handle the previous case ( It requires passing around partially signed transactions, holding unpublished transaction, sharing hashes) , but technically how Etherum handle it? And which is more secure bitcoin or etherum?


texts: Can I connect to testnet after synchronization finished on mainnet?

texts:
I just finished block synchronization on mainnet by default, but I realized I want to try on testnet first. Should I do synchronization on testnet again? Or how can I connect to testnet?

Thanks a lot.


texts: web3.toAscii(transaction hash) for web3js version 1

texts:
When i used web3.toAscii I received the following error :

I think the reason is my web3 version i.e. '1.0.0-beta.34'

If so, is there any alternative command for web3 version 1 for the following command ?

transaction = web3.eth.getTransaction('0x0c485e0f155f7f216d06e70ef85b684392c9b190c2f7c0af67ec1b56d6945498')
input = web3.toAscii(transaction.input)
console.log(input)

I also used following command :

web3.utils.hexToAscii(0x0c485e0f155f7f216d06e70ef85b684392c9b190c2f7c0af67ec1b56d6945498)

However, I receive the following error :

That mean its input cannot be a transaction hash.


texts: Oraclize: callback contain no result Error

texts:
I have the following contract to get a random number from 1 to 6 from random.org:

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

contract RandomOrg is usingOraclize {
    string public res;

    event Log(string text);

    function RandomOrg() {

        Log("Created!");
    }

    function __callback(bytes32 myId, string _result) {
        if (msg.sender != oraclize_cbAddress()) revert();

        res = _result; // 'result' is the random number generated by random.org
        Log(res);
        updateNumber();

    }

    function updateNumber() payable {
        string memory query = "https://www.random.org/integers/?num=1&min=1&max=6&col=1&base=10&format=plain&rnd=new";
        oraclize_query(0, "URL", query);
    }

}

When using MetaMask and Oraclize dev IDE, the contract is successfully created, however, when calling the updateNumber() function (with or without msg.value, result is the same), I'm getting the following error:

callback contain no result Error: JsonRpcEngine - response has no error or result for request:
{
  "jsonrpc": "2.0",
  "id": 255617697,
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0x3768372d20afe96dde0c27677b916046cd32002d",
      "to": "0xe931380cb4389dce98227e095e41c9927433504e",
      "data": "0x1b6a2481",
      "value": "0xde0b6b3a7640000"
    }
  ]
}

What could be the reason of this?


texts:
I am trying to use external modifier however I getting error as below code.

  {
    require(block.timestamp < start + buyPeriod);
    require(1 ether == msg.sender);<--- error got here
    require(_tickets[msg.sender] == 0);
    _tickets[msg.sender] = hash;
    _entries.push(msg.sender);
    return true;
    }
Getting error as Getting TypeError: Operator == not compatible with
types int_const 1000000000000000000 and address payable.

Could anyone can help me to fixed it?


texts: I have question regarding mining process and stratum protocol. I need for my lab to implement simple cpu miner in Node JS. I've found some info regarding ethash, and some steps. But there's no info regarding interaction with pool. Is every calculated hash must be submitted to pool or only valid hashes? Who makes PoW check, mining client or pool? How's pool calculating miners speed if only valid shares are submitted?


texts: How to init type of ConnectionInfo variable?

texts:
In ethers 5.x, how to init type of ConnectionInfo variable? I am having hard time to init a variable of the type. Here the doc for ConnectionInfo:
ConnectionInfo
connection.url ⇒ string
The URL to connect to.

connection.user ⇒ string
The username to use for Basic Authentication. The default is null (i.e. do not use basic authentication)

connection.password ⇒ string
The password to use for Basic Authentication. The default is null (i.e. do not use basic authentication)

connection.allowInsecureAuthentication ⇒ boolean
Allow Basic Authentication over non-secure HTTP. The default is false.

connection.timeout ⇒ number
How long to wait before rejecting with a timeout error.

connection.headers ⇒ {[key:string]:string}
Additional headers to include in the connection.

Here is the code (NOT working) with error:
import { ConnectionInfo } from "@ethersproject/web";  //<<==ConnectionInfo seems to be a class. But didn't find the definition of it on ethers github.
var connection = new ConnectionInfo(); //<<== await didn't work either.

The error is:
Possible Unhandled Promise Rejection (id: 0):
TypeError: undefined is not a constructor (evaluating 'new _web.ConnectionInfo()')


texts:
I'm not sure if this question is on topic here or not, but looking at the white paper and its contributors, is Vitalik the original and only author?

Did he file a patent for the algorithm or just posted the paper?


texts: Is there a graph data structure in solidity?

texts: I am trying to achieve a file lineage information Dapp and I need a graph kind of data structure for that. I know I can always write one but is there a ready to use data structure that is efficient enough?


texts: How to find all ERC721 compliant NFTs owned by an address? (Web3 JS)

texts:
It is possible to check which address owns a particular NFT by using the ERC721 standard function:
function ownerOf(uint256 tokenId) public view virtual override returns (address) in ERC721.sol
But I would like to know all NFTs owned by a particular address.
My Question:
Is there a way to retrieve all ERC721 tokens owned by a partcular Ethereum address using Web3.JS?


texts:
I am following this tutorial about creating new tokens:

https://hashnode.com/post/the-2018-guide-to-writing-and-testing-real-world-crowdsale-contracts-cjcs8dfes00apmdwthw03c2jq

it('one ETH should buy 5 Hashnode Tokens in PreICO', function(done){
        HashnodeCrowdsale.deployed().then(async function(instance) {
            const data = await instance.sendTransaction({ from: accounts[7], value: web3.toWei(1, "ether")});
            const tokenAddress = await instance.token.call();
            const hashnodeToken = HashnodeToken.at(tokenAddress);
            const tokenAmount = await hashnodeToken.balanceOf(accounts[7]);
            assert.equal(tokenAmount.toNumber(), 5000000000000000000, 'The sender didn\'t receive the tokens as per PreICO rate');
            done();
       });
    });

Question 1: Many people do not specify "to" in sendTransaction. By default does it go to where instance was deployed? It is not the address: 0x5AEDA56215b167893e80B4fE645BA6d5Bab767DE below. Is this address for the hashnode tokens?

module.exports = function(deployer) {
  const startTime = Math.round((new Date(Date.now() - 86400000).getTime())/1000); // Yesterday
  const endTime = Math.round((new Date().getTime() + (86400000 * 20))/1000); // Today + 20 days
  deployer.deploy(HashnodeCrowdsale,
    startTime,
    endTime,
    5,
    "0x5AEDA56215b167893e80B4fE645BA6d5Bab767DE", // Replace this wallet address with the last one (10th account) from Ganache UI. This will be treated as the beneficiary address.
    2000000000000000000, // 2 ETH
    500000000000000000000 // 500 ETH
  );
};

Question 2: In the test above, accounts[7] is used to send ether from. Then below it uses balanceOf to determine balance of accounts[7]. Does it mean that the same account address i.e. 7 stores ether and hashnode token?

contract HashnodeCrowdsale is CappedCrowdsale, RefundableCrowdsale {
....
function forwardFunds() internal {
      if (stage == CrowdsaleStage.PreICO) {
          wallet.transfer(msg.value);
          EthTransferred("forwarding funds to wallet");
      } else if (stage == CrowdsaleStage.ICO) {
          EthTransferred("forwarding funds to refundable vault");
          super.forwardFunds();
      }
  }
}

HashnodeCrowdsale inherits from CappedCrowdsale which inherits from Crowdsale.

Question 3:
forwardFunds is overwritting the forwardFunds in Crowsdale, but then inside Crowdsale when forwardFunds is called the one in HashnodeCrowdsale is called.
Should it not be the one inside Crowdsale because Crowdsale does not know that HashnodeCrowdsale is inheriting Crowdsale. It's the other way round Hashnodecrowdsale knows that it is inheriting from Crowdsale


texts: How to get value history from ERC721 Token

texts:
I'm trying to figure out HOW to get a sort of "history" of values for a specific ERC721 (for instance KnownOrigin)

What are the important items to consider? Is something feasible via Smart Contract or it's better to use API (like https://api.ethplorer.io/ or https://api.etherscan.io/)?

Is there any standard way to do that? What is the best approach?

Is it somehow related to "internal transaction" topic?

I've seen online tools that has this info so there must be a way to do it.

Thanks in advance


texts: HelloWorld.deployed().balance.call() is not working

texts:
I entered the command correctly but I am still getting this error:

TypeError: Cannot read property 'call' of undefined at evalmachine.:1:19
at ContextifyScript.Script.runInContext (vm.js:35:29)
at Object.exports.runInContext (vm.js:67:17) at TruffleInterpreter.interpret (/usr/lib/node_modules/truffle/lib/repl.js:99:17)
at bound (domain.js:280:14) at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer. (repl.js:545:10) at emitOne (events.js:96:13)
at REPLServer.emit (events.js:188:7) at REPLServer.Interface._onLine (readline.js:239:10)

I would really appreciate some help on the matter.


texts: How to fill transaction nounce gap for an EOA?

texts: If for whatever the reason, one transaction submitted (say lost transaction with nonce N) was not mined into block. The consequence is that any transactions submitted after the lost transaction will not be mined. In order to move ahead, a transaction with nonce N has to be mined. My question is what is the easy way to submit a transaction with nonce N and get it mined?


texts: Need advice on creating an nft smart contract which hatches/changes into a new final image after some time!

texts:
So I want an egg hatching nft, imagine a pokemongo egg and after some time has passed, the egg hatches into a new image which will be the final image of the nft.
Does anyone know of any ideas of how this can be done? is it even possible?
I first thought having the image in the metadata point to a dynamic file, however, that is not secure and defeats the purpose.
Or can this just be done in the smart contract itself where it modifies the image with a simple function in the code? Has this been done by anyone? Any tutorials? tips? code that does this?
is this just a basic dynamic smart contract?
Any help is appreciated


texts: Please help me withdraw from this contract

texts:
i only have a check goals reached and safe withdrawal neither work. What is going on!? Been trying to get help forever...

contract address: 0x999d5f024439A0EcfD554753e9E4A9eDa9261B73

JSON:

[ { "constant": false, "inputs": [], "name": "checkGoalReached", "outputs": [], "payable": false, "type": "function" }, { "constant": true, "inputs": [], "name": "deadline", "outputs": [ { "name": "", "type": "uint256", "value": "1496312040" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [], "name": "beneficiary", "outputs": [ { "name": "", "type": "address", "value": "0x64c0118a896bb075448a7f0cd6e760a41cff800c" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [], "name": "tokenReward", "outputs": [ { "name": "", "type": "address", "value": "0x64c0118a896bb075448a7f0cd6e760a41cff800c" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "balanceOf", "outputs": [ { "name": "", "type": "uint256", "value": "0" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [], "name": "fundingGoal", "outputs": [ { "name": "", "type": "uint256", "value": "1e+22" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [], "name": "amountRaised", "outputs": [ { "name": "", "type": "uint256", "value": "200000000000000000" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [], "name": "price", "outputs": [ { "name": "", "type": "uint256", "value": "1e+21" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [], "name": "safeWithdrawal", "outputs": [], "payable": false, "type": "function" }, { "inputs": [ { "name": "ifSuccessfulSendTo", "type": "address", "index": 0, "typeShort": "address", "bits": "", "displayName": "if Successful Send To", "template": "elements_input_address" }, { "name": "fundingGoalInEthers", "type": "uint256", "index": 1, "typeShort": "uint", "bits": "256", "displayName": "funding Goal In Ethers", "template": "elements_input_uint" }, { "name": "durationInMinutes", "type": "uint256", "index": 2, "typeShort": "uint", "bits": "256", "displayName": "duration In Minutes", "template": "elements_input_uint" }, { "name": "etherCostOfEachToken", "type": "uint256", "index": 3, "typeShort": "uint", "bits": "256", "displayName": "ether Cost Of Each Token", "template": "elements_input_uint" }, { "name": "addressOfTokenUsedAsReward", "type": "address", "index": 4, "typeShort": "address", "bits": "", "displayName": "address Of Token Used As Reward", "template": "elements_input_address" } ], "payable": false, "type": "constructor" }, { "payable": true, "type": "fallback" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "beneficiary", "type": "address" }, { "indexed": false, "name": "amountRaised", "type": "uint256" } ], "name": "GoalReached", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "backer", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" }, { "indexed": false, "name": "isContribution", "type": "bool" } ], "name": "FundTransfer", "type": "event" } ]


texts: Please provide a full guide to mining with AlethZero?

texts:
I am new to mining and would like a start to finish, simple guide to use ALethZero to mine Ether.

I would appreciate any help on this.

Thank you!


texts: How can I access the address of a contract in a drizzle dapp?

texts: I've started working from the drizzle box and can access functions within contracts, but if I want to give an allowance to a contract address so it can use users tokens how can I give the correct address? drizzleOptions contains contracts which have addresses per network but I don't think I can figure out which network is current without a web3 instance, there must be a simple way though to get the address of a contract on the current network?


texts:
Is it possible to interact with a deployed contract in a private blockchain with Web3 API ?

i have alreaded deployed a contract and i saved the contract adreess, but i don't find how i cant interect with this contract ?


texts:
function x(uint256 _value) public {
    limit += _value;
    if(limit >= 5){
    myMethod();
    limit = 0;
    }
 }

I have a method like that(x function). if limit is smaller then 5 everything is OK but the last caller (for example contract has 3 and he will send 2-3 value) it will continue to if statement and it will run myMethod(); so the last caller should pay more gas then other callers.
myMethod(); is calling another method from another contract with importing and giving contract address. (is it mean more gas?)
I want to do if the code will continue to if statement I want to pay gas fee of myMethod(); Is it possible?
  function x(uint256 _value) public {
    limit += _value;
    if(limit >= 5){
    msg.sender = address(this); // or msg.sender = owner;
    myMethod();
    limit = 0;
    }
  }

Or can I create automatic function without call on the contract. Directly :
if(limit>=5){
myMethod();
}

Without method, directly call on contract //I know it is not possible but is there any diffrent method for that?


texts: Running Ethminer on a private Ethereum network

texts:
I'm trying to carry out some tests on Ethminer and was trying to run benchmarks on it before it starting returning a hashrate of 0, from what I've been able to tell this is becasuse the GPU I'm using dones't have enough RAM for the DAG.

Is it possible to create a private ethereum network using one the the Ethereum clients, like geth, and mine or benchmark using Ethminer on that network or will I run into the same issue of the size of the DAG stopping me?


texts: Is the Web3 promise try / catch a reliable way to know if a block is mined?

texts:
I've been cloning many Defi apps on Github and reading their implementations of Web3 / Javascript with the contract.
Seems like most are just calling the contracts methods using the promise style, and less common is the event emitter style.
async function buyCredits() {
  try {
    const receipt = await contract.methods.buyCredits().send({
      from: account,
      gas: 233000,
      value: choice.value,
    });

    // Is it safe to assume this block was mined here
    // and the user has the new
    const credits = await contract.methods.usersCredits().call({
      from: account,
    });

    alert('It was mined!');
    console.log(`This user has ${credits} credits`);
  } catch (e) {
    alert("It NOT mined!");
  }
}

Where buyCredits is just an external payable contract function that gives users credits for ether.
Is this the most reliable way? From the Web3 docs, it seems like the promise to contract methods just return the tx receipt and that does not guarantee the block is mined.
Are there any tutorials, pointers, etc.. on doing this in the most reliable and recommended way?
Thanks!


texts: The difference between msg.sender.balance and owner[msg.sender]

texts:
Hello everyone i have a code like:

mapping(address => uint)owner;

function show() view public returns(uint) {
    return owner[msg.sender];
    //return msg.sender.balance;
}

in slodity and when i return owner[msg.sender] it shows me '0: uint256: 0'
and when i return msg.sender.balance it shows me '0: uint256: 99999999999996134991'
i want to know what's the difference and what do they mean ?
Tnx for your help .


texts: erc20 transfer amount exceeds allowance during transaction into nethereum

texts:
Getting error "erc20 transfer amount exceeds allowance" during transfer eth in nethereum. any solution please.........
MY SOURCE CODE:
public async Task<string> TransferAsync(string from, string to, decimal amount)
{
    DefaultAccount = new Account(privateKeyByte);

    var client = new RpcClient(new Uri(WEB3_CLIENT_URI));

    web3 = new Web3(DefaultAccount, client);

    standardTokenService = new StandardTokenService(web3, CONTRACT_ADDRESS);

    try
    {
        var finalAmount = amount * 1000000000000000000m;

        var receipt = await standardTokenService.TransferFromRequestAndWaitForReceiptAsync(from, to, new System.Numerics.BigInteger(finalAmount));

        return receipt.TransactionHash;
    }
    catch (Exception ex)
    {
        return ex.Message;
    }
}


texts: How do you find the public key used to sign a transaction?

texts:
I'm trying to figure out how you find the public key used to sign a transaction from v, r, and s.  Before someone says so, this isn't a duplicate of Get public key of any ethereum account.  That question asks how you do it just from the address, not from a transactions.  The responses to that question just say that it can be done with some libraries, but don't explain how the math actually works.

I'm trying to follow the steps in the Wikipedia article on ECDSA (https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm).  I'm good up to step 6 of the signature verification algorithm.  We can get u1 and u2 from r, s, and the transaction itself.  The generator point is part of the secp256k1 specification, but I don't see where the public key (Q_A in the Wikipedia article) comes from.  We haven't used v yet (not clear to me what it is), but it's only one byte and we lost more than one byte when we went from public key to Ethereum address (Keccak-256 hash, then drop 12 bytes), so I don't see how that can get us back to the public key.

To be clear, I'm trying to figure out how the math actually works.  I know there are some black box methods in Python, JavaScript, etc, but I can't figure out how they work.  Thanks.


texts: A way to capture actual gas used per transaction

texts:
Two questions, related:

Is the getGasUsed() on the TransactionReceipt truly the actual gas used, not the gasLimit or the gas estimate? Looks like it but...
Is the actual gas used obtainable ("readable") outside of the TransactionReceipt?  Can you use the tx hash or other material to after-the-fact determine the actual gas used?

EDIT:  Just came across this in the test drivers for web3j:
EthGetTransactionReceipt etxr = web3j.ethGetTransactionReceipt(txhash).send();
assertTrue(ethGetTransactionReceipt.getTransactionReceipt().isPresent());
TransactionReceipt TXr = etxr.getTransactionReceipt().get();

I tried it and it works.   After the fact (like in a Filter or Flowable), when I get the TXhash, I can get the TXreceipt and thus the actual gas used.
Why isn't this more easily discoverable?


texts: Where do etherscan get the contract Addresses from for the creation Transaction

texts:
In etherscan each creation transaction has the contractAddress as 'to' value.

e.g.:
https://etherscan.io/tx/0xe0ddfde8610cceae5b360c58a7c016b6654f838b8d820f290403d0c8d2cacfdc
here:
[Contract 0x85303e8e244b68a100308a59e1a008ff03a384b2 Created]

But actually RPC requests show that the Blockchain saves only "null" in this value in the transaction in the mined Block.

So How do etherscan know, which address the new contract has?


texts: Can an account give conditional instruction to EVM

texts:
Let me try to specify my question with an example:

Consider that there are two accounts(AccountA and AccountB), and AccountA wants to send some ether to AccountB when a specific condition  is met(i.e. if balance of AccountA is greater than 100).

If i were try to implement this case with centralized way, i would do following:

AccountA accepts an agreement(above condition)
When AccountB requests to receive ether(based on agreement), centralized app checks condition and if condition is true the app gives ether to AccountB(without AccountA's permission).

So my question:

Can i implement above case via smart contracts?

If i can, how?


texts: How to access account address for local development in Mist Wallet?

texts: I'm trying to develop a DApp and test it using the Mist wallet. When I navigate to localhost:8000 in the Mist browser and open up the Dev Console, web3.eth.accounts returns an empty array. I know I have an account because I can see it in my Mist wallet. How do I access this account in my code?


texts: How to switch to --node-light in Windows app without losing wallet?

texts:
After figuring out how to add geth --light option by adding --node-light to windows shortcut, i'm facing a new problem - apparently switching requires to reimport the wallet, and it expects a .json file.

In the app menu I've found File > Backup > Accounts which just opens a keystore folder. The files in this folder are JSON but don't have .json extension. Dropping these files into the drag and drop area crashes the app.

How do I find/create the .json file that is expected?

Thanks!


texts: how can I pass data to my smart contract?

texts: I have a threshold and some data that must be passed to the smart contract. The smart contract uses this data to make decisions. I'm using web3js. how do I pass this data to the smart contract?


texts: Web3js: How to check the progress sendSignedTransaction()?

texts:
Im using a job queue for the transactions. I need to know progress to inform the users the status of their transaction. I've just tweak this code https://github.com/ethereum/web3.js/issues/1151#issuecomment-362002768

handleGetData = async (payload) => {
    try {
      const {
        token_symbol, address_from, address_to, amount, private_key_from,
      } = payload;

      const web3 = new Web3(new Web3.providers.HttpProvider(process.env.WEB3_PROVIDER));

      const tokenSelected = selectToken(token_symbol);

      const contract = web3.eth.Contract(tokenSelected.abi, tokenSelected.address, {
        from: address_from,
      });

      let bal = await contract.methods.balanceOf(address_from).call();

      console.log(`Balance before send: ${typeof bal === 'object' ? JSON.stringify(bal.balance) : bal} \n----------`);

      // const count = await web3.eth.getTransactionCount(address_from);

      const amountToWei = web3.utils.toWei(amount);

      const rawTransaction = {
        from: address_from,
        // nonce: `0x${count.toString(16)}`,
        gasPrice: web3.utils.toHex(gasPriceGwei * 1e9),
        gasLimit: web3.utils.toHex(gasLimit),
        to: tokenSelected.address,
        value: 0,
        data: contract.methods.transfer(address_to, amountToWei).encodeABI(),
        chainId: +process.env.TX_CHAIN_ID,
      };

      const privKey = Buffer.from(private_key_from, 'hex');

      const tx = new Tx(rawTransaction);
      tx.sign(privKey);

      const serializedTx = tx.serialize();

      console.log(`Attempting to send signed tx:  ${serializedTx.toString('hex')}\n----------`);

      const receipt = await web3.eth.sendSignedTransaction(`0x${serializedTx.toString('hex')}`);

      console.log(`Receipt info: \n${JSON.stringify(receipt, null, '\t')}\n----------`);

      bal = await contract.methods.balanceOf(address_from).call();

      console.log(`Balance after send: ${typeof bal === 'object' ? JSON.stringify(bal.balance) : bal}`);

      this.done();
    } catch (error) {
      this.job.failed().error(error.message);
    }
  };

I'm using redis kue for queueing. Thank you.


texts: web3.js error ethjs-query gives out error in write contract functions

texts:
Hi I am getting error

Error: [ethjs-query] while formatting inputs '[{"0":false}]' for method 'getTransactionReceipt' error: Error: [ethjs-format] hex string '[object Object]' must be an alphanumeric 66 utf8 byte hex (chars: a-fA-F) string, is 0 bytes
    at ethjs.min.js:11
    at new Promise (<anonymous>)
    at i.getTransactionReceipt (ethjs.min.js:11)
    at i.e.<computed> [as getTransactionReceipt] (ethjs.min.js:11)
    at ethjs.min.js:11

Im calling the smartcontract invest function :

function invest()public payable onlyAmount() firstExist  returns(bool){

//  balances[msg.sender]=msg.value;
 invested[msg.sender]+= msg.value;
 isInvested[msg.sender]=true;
 users[msg.sender].creationTime=now;
  commission=(msg.value.mul(10)).div(100);
 forCreators(commission);
emit Invest(msg.sender,msg.value);
 return true;
}

Where As Im calling the function from web3.js like

tokenContract.invest({
    from: user_address,
    gasLimit: web3.toHex(8000000),
    gasPrice: web3.toHex(web3.toWei('10', 'gwei')),
    value : web3.toHex( web3.toWei(0.25, 'ether'))

  })
  .then(txHash =>  eth.getTransactionSuccess(txHash)
      .then(receipt => {
        alert("Sigup Has been successful",receipt);
      })
  )
  .catch((err) => {
    alert("Error couldnot signUp");
    console.log(err);
  })

this error is showing on all write functions .. Read is working just fine. I have never encountered this error before. I tried deploying contract on Ropsten and Rinkeby same error.
And these contract functions are working just fine on etherscan and remix.
In web3js Even Metamask doesnt appears for transactions. What might be the issue?


texts: How do i use .send() to fire methods of my smartcontract?

texts:
I have looked alot for information about this and lastly i turn myself to here. I've written a smartcontract and deployed it to  Ropsten  . I am then using web3.js to interact with my smartcontract, i can use .call methods with no errors, but i have no idea how to fire methods that change the state, in this case mint, burn and send_X_tokens. From web3 docs it is stated in examples to be like this

myContract.methods.myMethod(123).send({from: 'ADDRESS'})
.then(console.log(receipt){
});

but that doesn't help me much. I assume i have to setup my account to be open or create and sign a transaction in order to use gas, but i cannot find anything on how to do that.

So thus far my code looks like this.

contract.methods.mint().send({ from: '0x76a9CEA17DbA8a371944d00a2E9A17AA3669B392', gas: 4000000 }).then(console.log(result))

And the error looks like this.

(node:28313) UnhandledPromiseRejectionWarning: Error: Returned error: The method eth_sendTransaction does not exist/is not available
    at Object.ErrorResponse (/home/ubuntu/ethereum_website/node_modules/web3-core-helpers/src/errors.js:29:16)
    at /home/ubuntu/ethereum_website/node_modules/web3-core-requestmanager/src/index.js:140:36
    at XMLHttpRequest.request.onreadystatechange (/home/ubuntu/ethereum_website/node_modules/web3-providers-http/src/index.js:96:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpResponseEnd (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
    at IncomingMessage.<anonymous> (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

Help me solve this (probably) most basic puzzle.


texts: In truffle5, how to manipulate time with evm_increaseTime?

texts:
I am using truffle 5 and ganache-cli. I've imported increaseTime as

import increaseTime from './helper/increaseTime';

and the increaseTime.js file is like this

export default function increaseTime(addSeconds) {
  const id = Date.now();

  return new Promise((resolve, reject) => {
    web3.currentProvider.sendAsync({
      jsonrpc: '2.0',
      method: 'evm_increaseTime',
      params: [addSeconds],
      id,
    }, (err1) => {
      if (err1) return reject(err1);

      web3.currentProvider.sendAsync({
        jsonrpc: '2.0',
        method: 'evm_mine',
        id: id + 1,
      }, (err2, res) => (err2 ? reject(err2) : resolve(res)));
    });
  });
}

I am trying to use change the time to insert the follow code

await increaseTime(24 * 60 * 60);

But I've got error message,

TypeError: web3.currentProvider.sendAsync is not a function

Am I doing something wrong?


texts: How can I send ether between two contracts by directive of a third contract?

texts:
Is it possible to have one contract (A) tell another contract (B) to send ether to a third contract (C)?  I have tried a number of things and cannot seem to make this work, BUT I am very new at this so that is almost certainly my issue.

Here is the latest permutation of the code:

pragma solidity ^0.4.0;

contract A {
    C c = new C();

    function A() payable public {}

    function execute(address _bAddress) payable public {
        B b = new B(_bAddress);
        b.execute(address(c));
    }

    function getFunds() constant public returns (uint) {
        return c.getFunds();
    }
}

contract B {
    address client;
    address authorizedAgent;

    modifier isClient() {
        if (msg.sender != client) {
            revert();
        }
        _;
    }

    modifier isAuthorizedAgent() {
        if (msg.sender != authorizedAgent) {
            revert();
        }
        _;
    }

    modifier isAuthorizedEntity() {
        if (msg.sender != client && msg.sender != authorizedAgent) {
            revert();
        }
        _;
    }

    function B(address _agent) payable public {
        client = msg.sender;
        authorizedAgent = _agent;
    }

    function depositFunds() payable public {}

    function getFunds() isAuthorizedEntity constant public returns (uint) {
        return this.balance;
    }

    function execute(address _c) isAuthorizedAgent payable public {
        _c.transfer(this.balance);
    }
}

contract C {
    function C() payable public {}

    function depositFunds() payable public {}

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

I run this in Remix like so (i.e. there is no calling code):

Instantiate an A
Instantiate a B passing it the address of the A created in step #1
Deposit 1 ether into the B from step #2
Call execute on the A from step #1 passing it the address of the B from step #2

No matter what permutations of the code I try I get the same error message:

 transact to A.execute errored: VM error: revert.
 revert The transaction has been reverted to the initial state.
 Note: The constructor should be payable if you send value.   Debug the transaction to get more information.


texts: How dapp owners pay for their clients transcaction fees in the Ethereum Blockchain?

texts:
I am currently dealing with a problem in Ethereum Blockchain. I wrote a smart contract in Solidity Language, about a site that someone can make his Registration and after the transaction is completed he should be able to login to his account making a call to the blockchain. If the blockchain accept the user details, he can have access to his account.

The problem is that i want, as a dapp owner, to pay for all the transaction fees to the Blockchain myself.

I found 2 possible ways to do that (Can contracts pay the gas instead of the message sender?), but as far as i know after the new Ethereum Upgrade, it was supposed to be included, meaning that the dapp owners could pay the fees to the Blockchain directly from their smart contracts by depositing funds in the contract.

So I am wondering, has anyone else heard anything about such a feature being added to Ethereum lately? If not, does anyone know if it is planned to be included in the near future?


texts: No "from" address specified in neither the specified in neither the given options nor the default options

texts:
So I already went through this query, but I still couldn't get my doubt solved. Be it any Blockchain Dapp, the same error is coming for me.
I used the marriage certificate and kickstart examples.

Can anyone please help me with this?


texts:
I have created my token "BBY" that is ERC20 complaint, right now I've sent all the tokens to the owner's address. I will be giving out tokens when some one sends ether. I have deployed it to Ropsten and I'm intended to deploy it to Main Net then, I'm intending to sell it to exchanges as well. So I'm looking for the steps to do that, following some tutorials I came to know that, I first have to get all my tokens from token contract to my wallet , How can I do that?

As in meta mask I can't see the tokens tab. The screen shot is attached.

Can someone help me understand what is the way to get the tokens from contract to the wallet and then sell it to exchanges lets say: etherdelta.

P.S: I'm new to contract things and this is my first contract, so any help will be appreciated, Thank you very much


texts: Why this error occurring when i running my dapp?

texts:
I create a dapp using Solidity,Web3Js,Javascript and Html with metamask i always getting this error when i am trying to submit my transition i am getting this error

at c (inpage.js:1)
    at inputTransactionFormatter (inpage.js:1)
    at inpage.js:1
    at Array.map (<anonymous>)
    at i.formatInput (inpage.js:1)
    at i.toPayload (inpage.js:1)
    at n.e [as sendTransaction] (inpage.js:1)
    at u.sendTransaction (inpage.js:1)
    at u.execute (inpage.js:1)
    at index.html:143

so please help me to solve this error.

code:

<script>
    if (typeof web3 !== 'undefined') {
           web3 = new Web3(web3.currentProvider);
       } else {
           web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
       }
       web3.eth.defaultAccount = web3.eth.getAccounts[0];
       var dairyindustryContract = web3.eth.contract([{
        "constant": false,
        "inputs": [
            {
                "name": "_producerid",
                "type": "uint256"
            },
            {
                "name": "_name",
                "type": "string"
            },
            {
                "name": "_place",
                "type": "string"
            }
        ],
        "name": "producerdetails",
        "outputs": [],
        "payable": false,
        "stateMutability": "nonpayable",
        "type": "function"
    }]);
        var dairyindustry= dairyindustryContract.at('0x8879ab5cf518e1cddffe4cb71d74c309ba1a03f6');
        console.log(dairyindustry);
        $("#is_button").click(function(){
        dairyindustry.producerdetails($("#producerid").val(),$("#name").val(),$("#place").val(),(err,res)=>{
            if(err){
                alert('Erroe');
            }
        })
        });
    </script>


texts: how to interact with the contract with more complex arguments(sort of a string of struct)

texts:
I want develop a contract that can be interacted from outside with a considerably complex argument(like a string of struct), but the Ethereum seems that the contracts can only be communicated with functions using simple arguments like type uint, string, bytes, how can I manage it?
I mean if I want to develop a function with arguments of a string of struct of unspecified length, how can I manage it?


texts: How long did a transaction spend in the mempool?

texts:
I'm trying to create some statistics on how long a transaction spends in the mempool before being included in a block, so I can reason about future gas prices. It would appear transactions in Ethereum don't receive a timestamp until they're mined, so instead, what is the best way of observing when a transaction was submitted? If I ask Parity to inform me of all new pending transactions, and recording the local timestamp at that time, quite often the block it ends up being included in, has a timestamp that is prior to when I saw it, so this seems wildly unreliable.

Wondering how other API's obtain this information reliably, and how "gas station" sites intelligently calculate this information.


texts: What are the options that the web3.js solidity compiler passes to solc?

texts:
I've been using the following command to compile my contracts from CLI:

solc ballot.sol --combined-json abi,asm,bin,interface > ballot.json

However, the ballot.json file has a completely different structure from the object generated by the:

web3.eth.compile.solidity(<source code>)

How could I figure out what arguments are being passed to solc from inside the web3.js client


texts:
My hard drive was recently replaced due to internal damage and the old data was uploading onto the new hard drive. Since then when opening ethereum wallet 0.7.3 it is stuck and wount synch. the message it is showing is

  "Found running Ethereum Node! "

what is this, what does it mean? So i downloaded the latest version 0.8.1 and that is stuck " searching for network.." and will not synch either.

Ive tried geth --fast commands, set the date and time..all the obvious and such but nothing seems to change.


texts: Debugging JS unit tests with truffle framework in VS code

texts: Is there a way to debug JS unit tests for smart contracts? I use VS Code for development, and when I try to run a Mocha debugger it complains that artifacts is not defined. I briefly looked at truffle code, it looks like it adds artifacts, contract and some other global js variables when it runs the unit tests. Is there a way for me to add those explicitly in the JS unit test file so I could debug that unit test file?


texts: Can I use Flutter or Android Studio to design front end instead of using react.js and still be able to interact with ethereum?

texts:
I am new to blockchain and currently learning solidity. I have understood the concept behind blockchain and solidity is also good so far. I can design mocha tests and deploy the contract on local ganache-cli. Now I want to design front end to interact with it.
Can I do that with Flutter?

Thanks in advance.


texts:
Initially, transaction is created in some local node and is in its local pool. Then it propogates to other nodes.
So, is it possible to know, what node was transaction initially created by?


texts:
Currently I want to make a smart contract for verifying documents. However, I couldn't make it works. I have followed the tutorials as shown here (it is for Solidity 0.4.4 and mine is solidity 0.5.0)

DoCert

Here is what I've tried.

Notary.sol (edited, following suggestion on comment below)

pragma solidity ^0.5.0;

contract Notary {

  struct Record {
      uint mineTime;
      uint blockNumber;
  }

  mapping (bytes32 => Record) private docHashes;

  constructor() public {
    // constructor
  }

  function addDocHash (bytes32 hash) public {
    Record memory newRecord = Record(now, block.number);
    docHashes[hash] = newRecord;

  }
  function findDocHash (bytes32 hash) public view returns(uint, uint) {
    return (docHashes[hash].mineTime, docHashes[hash].blockNumber);
  }
}

app.js

function find () {
  hashForFile(function (err, hash) {
    notary_find(hash, function(err, resultObj) {
      if (resultObj.blockNumber != 0) {
        $("#responseText").html("
File fingerprint found on Ethereum blockchain.
"
            "
File Hash Value: "   hash   "
"
            "
Block No.: "   resultObj.blockNumber   "
"
            "
Timestamp: "   resultObj.mineTime   "
"
        );
      } else {
        $("#responseText").html("
File fingerprint not found on Ethereum blockchain.
"
            "
File Hash Value: "   hash   "
"
        );
      }
    });
  });
};

notaryWebLib.js

function notary_find (hash, callback) {
  contract.methods.findDocHash(hash).call(function (error, result) {
    if (error) callback(error, null);
    else {
      let resultObj = {
        mineTime:  new Date(result[0] * 1000),
        blockNumber: result[1]
      }
      callback(null, resultObj);
    }
  });
};

Thank you

Edit :
The problem is the blockNumber is keep saying NULL (as shown below). Sorry I forgot to add it yesterday


texts: Can we modify a deployed contract in ethereum-wallet?

texts: I have deployed a contract in ethereum-wallet for creating my own crypto-currency. I want to ask that in future if i want to add functionalities to my currency then is it possible ?


texts:
ERC-721 n00b here,
Problem: I want to control the price of the cost of minting my token. I want the first 1-100 tokens to cost x and 101-200 tokens to cost y and so on.
My understanding is that ERC-721 minting cost is determined by the size of the metadata being put on the token plus gas.
I am not sure how to control the cost of minting specific token by token minted thus far.
What’s done so far:
I’ve implemented my first ERC-721 on remix using open zeppelin.
I am able to deploy my contact on ropsten using truffle migrations and have built a front end where users can call the mint function and sign the transaction.