texts:
New miner here trying to mine Ethereum on my R9 290 tri-x with a reported hashing rate of 28 MH/s.

So yesterday I was mining solo with ethminer console before I realized that you'd need months and be very lucky to get a block and actually get paid with 1 ETH.

Today I tried to mine with awesome miner and joined alpereum pool like one of the guides suggested.

So their minimal payout is 0.2 ETH and current ETH price is 370$ while the built in calculator says i'll be making 6.3 $ per day.

So does that mean i'll need to mine nonstop for about 11 days before I'll get my first 0.2 ETH into my wallet?

As a new miner i'm just trying to see if this is even working and waiting 11 days for result is a bit gruesome.

I've found some mining pools with 0.05 minimal payout... maybe I should try those but that would still take 3 days of testing before I get anything into my wallet if this is how this thing actually works...

Also at the time of writting this my miner started reporting an error:
Socket was closed remotely (by pool)
ETH: Job timetout, disconnect, retry in 20 sec...

Any advice you can give me? Am I understanding how this works properly?


texts:
I installed Ethereum on VPS and I have two accounts.
After I installed Ethereum on my mac where I have one account.
For now I'm on testnet network.

I want to connect to VSP accounts from mac terminal.
I tried to do this :

geth --rpc --rpcaddr "xxx.xx.xxx.xxx" console

(xxx.xx.xxx.xxx) is the VPS IP

But when I do :

personal.listAccounts

I have just one account so I'm no connect to VSP but to my mac account .

How can I do to connect to VPS account?


texts:
I want to work on a smart contract that manages monthly subscription purchases on my website.

Is this a valid usecase for smartcontract?

I read a lot of tutorial on smart contract but dont see a way to do that, because I need to link somehow an account on my website to an eth adress (the subscriber).


texts: Can a smart contract create and handle 2 or more different erc20 tokens?

texts: I was wondering if a smart contract can create and manage more than 1 token, like TOK1  and TOK2.


texts: What use case do peers have on test net?

texts:
Hi I am new to Ethereum (and Blockchain) and am trying to set up testnet using Geth to learn about about the intricacies of Blockchain. So this might be a trivial question:
A lot of tutorials out there direct you to add a peer to your node - why do we need peers? What does it help solve? Wouldn't just instantiating multiple nodes (w/ the same genesis file) on the testnet have the same usecase as adding peers? Do you need to be peer nodes on the testnet to transact? If so, why?

Also since each node independently stores the history of transactions on this testnet, how can I access that ledger from a node?

Thanks for answering.


texts: first time mining. stuck at generating ethash

texts:
I tried using phoenixminer and claymore. I am already in dmz mode and av is off.
I can connect to the ethermine pool but stuck at generating ethash
CUDA version: 11.0, CUDA runtime: 8.0
Available GPUs for mining:
GPU1: GeForce RTX 2080 Ti (pcie 101), CUDA cap. 7.5, 11 GB VRAM, 68 CUs
Nvidia driver version: 461.40
Eth: the pool list contains 2 pools (2 from command-line)
Eth: primary pool: us1.ethermine.org:4444
Starting GPU mining
Eth: Connecting to ethash pool us1.ethermine.org:4444 (proto: EthProxy)
GPU1: 34C 17% 66W
GPUs power: 66.5 W
Listening for CDM remote manager at port 3333 in read-only mode
Eth: Can't resolve host us1.ethermine.org:4444 - No such host is known
Eth: Reconnecting in 5 seconds...
Eth: Connecting to ethash pool us1.ethermine.org:4444 (proto: EthProxy)
Eth: Connected to ethash pool us1.ethermine.org:4444 (2606:4700:90:0:b886:9f1:5c3e:5711)
Eth: New job #7c0ee9e7 from us1.ethermine.org:4444; diff: 4000MH
GPU1: Starting up... (0)
GPU1: Generating ethash light cache for epoch #395

Tried looking for any solution.Didn't find any.
Thanks


texts: As Dapps obviously need JS how will they be accessible to visually impaired people?

texts:
How about using screen readers or text only browsers with Dapps?
Has someone ever tried existing Dapps with this tools?
Thanks.


texts:
Here's my main.js file:

require.config({
    paths: {
        angular: '//ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min',
        web3: 'lib/web3',
        MainController: 'controllers/MainController',
        mainService: 'services/mainService'

    },
    shim: {
        "angular": {
            exports: "angular"
        }
    }
});

require(['web3', 'angular', 'utils/init'],
    function() {
        web3 = new Web3();
        web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
        angular.bootstrap(document, ['app']);
    }
);

So, I've succesfully connected to Geth, because I can obtain my account address using web3.eth.getAccounts(...).

The problems arise when I try to check my balance:

var getBalance = function(address){
    web3.eth.getBalance(address, gotBalance);
    function gotBalance(error, wei){
        console.log(wei);
    }
}

I get the following error:

I've tried calling some other methods that use BigNumber library under the hood and I get the same error.

Any ideas how to fix this issue?


texts:
To install cpp-ethereum, I followed the below steps given in the ethereum community forum:

sudo apt-add-repository ppa:george-edison55/cmake-3.x
sudo apt-get -y update
sudo apt-get -y install language-pack-en-base
sudo dpkg-reconfigure locales
sudo apt-get -y install software-properties-common
wget -O - ://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb //llvm.org/apt/trusty/ llvm-toolchain-trusty main"
sudo add-apt-repository -y ppa:ethereum/ethereum-qt
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential git cmake libboost-all-dev libgmp-dev libleveldb-dev libminiupnpc-dev libreadline-dev libncurses5-dev libcurl4-openssl-dev libcryptopp-dev libjson-rpc-cpp-dev libmicrohttpd-dev libjsoncpp-dev libargtable2-dev llvm-3.8-dev libedit-dev mesa-common-dev ocl-icd-libopencl1 opencl-headers libgoogle-perftools-dev qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev libqt5webengine5-dev ocl-icd-dev libv8-dev
git clone ://github.com/ethereum/cpp-ethereum-cmake
git clone https://github.com/ethereum/cpp-ethereum
cd cpp-ethereum
git checkout master
mkdir build && cd build && cmake .. && make -j2

Everything is fine up to cmake ..

When I do the make then it build 10% percentage and giving the following errors:

CallInst *CreateCall(Function *Callee, ArrayRef<Value *> Args,
         ^
/usr/lib/llvm-3.8/include/llvm/IR/IRBuilder.h:1566:13: note:   no known
conversion for argument 2 from ‘<brace-enclosed initializer list>’ to ‘llvm::ArrayRef<llvm::Value*>’
/home/iiita/cpp-ethereum/evmjit/libevmjit/Arith256.cpp: In member function
‘llvm::Function* dev::eth::jit::Arith256::getExpFunc()’:
/home/iiita/cpp-ethereum/evmjit/libevmjit/Arith256.cpp:408:25: error: ‘class
llvm::Argument’ has no member named ‘getNextNode’
   auto exponent = base->getNextNode();
                         ^
make[2]: *** [evmjit/libevmjit/CMakeFiles/evmjit.dir/Array.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[  8%] Built target scrypt
[  8%] Built target secp256k1
[  8%] Automatic moc for target ethash-cl
make[2]: *** [evmjit/libevmjit/CMakeFiles/evmjit.dir/Arith256.cpp.o] Error 1
[  8%] Built target ethash-cl_automoc
[  9%] Automatic moc for target ethash
[  9%] Built target ethash_automoc
[ 11%] Built target jsengine
[ 11%] [ 11%] Built target jsonrpcstub
Generating qrc_natspec.cpp
Scanning dependencies of target testeth_automoc
[ 12%] Scanning dependencies of target natspec
Automatic moc for target testeth
[ 12%] Built target testeth_automoc
Scanning dependencies of target createRandomTest_automoc
[ 13%] [ 13%] Building CXX object libnatspec/CMakeFiles/natspec.dir/NatspecExpressionEvaluator.cpp.o
Automatic moc for target createRandomTest
[ 13%] Built target createRandomTest_automoc
[ 13%] Generating qrc_js.cpp
Scanning dependencies of target jsqrc
[ 13%] Building CXX object libjsqrc/CMakeFiles/jsqrc.dir/qrc_js.cpp.o
Linking CXX static library libjsqrc.a
[ 13%] Built target jsqrc
[ 13%] Building CXX object libnatspec/CMakeFiles/natspec.dir/qrc_natspec.cpp.o
make[1]: *** [evmjit/libevmjit/CMakeFiles/**evmjit**.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX shared library libnatspec.so
[ 13%] Built target natspec
make: *** [all] Error 2


texts: How to implement "Mint" and "Own" in an ERC20 Token

texts: So, I recently created a standard ERC20 token but I need to implement "mint" and "owner" functionality. I see that in older implementations but openzeppelin no longer has contracts like "Mintable" and "Ownable". How do I implement this "mint" functionality?  I do see it in ERC20.sol but not able to test it in console(truffle).


texts: Generate new address in Etherum node using Json-RPC

texts:
Well, first of all, I am very new to Ethereum and maybe I am asking something stupid but my question is the following. I feel comfortable using json-rpc commands and I want to know how can I create a new Ethereum address.
In bitcoind the method that I am searching is "getnewaddress" but I don't know if there is another way to do in Ethereum. If someone could help me I'd be grateful


texts:
I deployed a MULTISIG WALLET with 3 signatories.  It has 3 approvers and I need to update one of the approver's ETH wallet.

Am I able to remove/add signatories using Multisig MIST Wallet???


texts: I want to configure ganache for using proof of authorisation consensus mechanism instead of using proof of work. I want to edit genesis.json file for the same. I want to know where ganache stores its genesis.json file? Can I edit it?


texts: Private key or password for Account that is deployed on remix

texts:
I have deployed new contract on remix ethereum got Contract Adress as well as account address
but now i want private key or password for my account address
how to get that because while creating i have connected with JAVAScript VM for some reason web3 inject is not working on my laptop so now i confuse what to do and how to get Private key for my account address which i have created and when i am connecting Injected web3 it is connecting to Metamask but at below it says Currently you have no contract instances to interact with.
I am not understanding what to do ..?? please help..!!


texts: How to send token ERC20 in 1 line of code on Ubuntu

texts:
I know now how to get balances of Token with sudo geth --exec "eth.call({to: '0xad408ef944da873fe9b65f4e78e21ac2d489db90', data: '0x70a08231000000000000000000000000280e5dbe0d36be7344743ce034b104b94d930e51'})" attach

But for sending an ERC20 token, e.g. Golem the command would be

sudo geth --exec "eth.call({to: '0xa74476443119A942dE498590Fe1f2454d7D4aC0d', data: '0xNNNNNNNNNNNNNNNN'})" attach

So how to format the data part with sending address, receiving address, value, gas and gasPrice?


texts:
At the moment I can't sync mist wallet for 3 days
it download block till 4,102,477 and final hundred bloks are stuck
but the numbers below (downloading chain structure) still running and running
for a whole day
wallet don't show my ballance still


texts: How should 'fallback' function be defined if we transact using 'call' method?

texts:
i came to know that 'call' method is better for transacting, since all gas is transferred and could withstand reentrancy attack.. but how should we define fallback function for 'call' method?
using solidity ^0.6.0
Should we use fallback() external payable{} or receive() external payable {} ?
when i used  fallback() external payable{} remix gave me this warning
Warning: This contract has a payable fallback function, but no receive ether function. Consider adding a receive ether function. contract MultiSig{ ^ (Relevant source part starts here and spans across multiple lines). browser/wallet.sol:37:5: The payable fallback function is defined here. fallback() payable external {}
Please explain which fallback function to be used for this scenario and in general what should be used when? And also how will it guard against reentrancy?


texts: In consensus-by-bet, are all bets registered on the chain?

texts:
From Vlad:

  Validators bet independently on blocks at every height (i.e. block number) by assigning it a probability and publishing it as a bet. Through iterative betting, the validators elect exactly one block at every height

Are all bets published on the chain, and if so, do they end up in the next block, or is the Casper smart contract prioritized in each block (so that a record of the betting always ends up in the block that is selected in consensus-by-bet) or how does that work?


texts: How can I import an existing ERC20 token into my contract?

texts: I'm trying to develop a staking contract. All of the guides I've seen utilize either payable (ETH) or a newly created token. How can I import an existing token (presumably via address) into my contract? Also, what is the easiest way to approve the token so I can utilize the transferFrom() function?


texts:
Not really sure what information you need.. I am running geth with the following command:

/usr/bin/geth --datadir /mnt/ethereum --fast --nousb --cache 4096 --trie-cache-gens 1024 --rpc --rpcaddr 0.0.0.0 --ws --wsaddr 0.0.0.0 --wsorigins=*

I then have some software sending transactions to it. I am getting back a transactionHash, however they are never getting onto the blockchain.

I have tested the code, by pointing to Infura, and this works perfectly.

The geth node is synched, any idea of why it might not be broadcasting?

Thanks in advance.
Adam


texts: How do I monitor the status of a Geth sync in fast mode?

texts:
I started up a fresh Geth node and it's syncing in fast mode. I'm currently here:
INFO [10-26|18:11:04.053] Imported new state entries               count=768  elapsed=63.553ms    processed=245780433 pending=100559 trieretry=0   coderetry=0 duplicate=247 unexpected=903

How do I know how far along it is in its sync? It says I've currently processed 245780433 trie nodes; is the total number of nodes known? Alternately, is the disk usage of a fast sync known?


texts: Which fork implemented EIP-141? (invalid opcode)

texts: EIP-141 https://eips.ethereum.org/EIPS/eip-141 was introduced in 2017, but I cannot find it in any of the meta lists for forks https://eips.ethereum.org/meta. Is there a fork under which it was introduced or is that not applicable given any invalid opcode already doubles as an ABORT? Is there a list for soft changes such as this one?


texts: What is the purpose of Private Blockchain?

texts: What is the real purpose of private blockchain for example in Ethereum ? I mean found a lot of tutorials online about creating a private blockchain, creating an accounts there, setting coinbase accout, start mining and so on, but none of them tells the reason why it's there, what use i can get from that ? Is that just for study purposes ? The ethers that i mined on my private blockchain, are they are real ethers ? Can i transfer them to real wallet ?


texts: Sync Still Stuck After Downloading Mist Version 0.8.3

texts:
I was told that the new version would fix the syncing issue, but I just downloaded Version 0.8.3 and I'm still stuck on the exact same block.

My operating system is OSX.


texts: how do I send ether from msg.sender to contact in solidity

texts:
in solidity, how do I send eth from the msg.sender to the contract? For learning purposes, I want to transfer eth from one address(msg.sender) to a contract.

thank you!


texts:
I am new to node js and I tried to follow some tutorials to understand it. But, when I started writing DApp code, I get lot of errors like this (calling smart contract functions from app.js). I face issues understanding why it don't see deployed as a function. Can some one suggest me a best tutorial for starting DApp coding?

Thanks


texts: How to Debug geth Node that Won't Connect to Parity-based Private Network?

texts:
I have a private network consisting of two Parity nodes that know about each other from the chainspec file and seem to connect to each other just fine.

I have a third computer.  From here, I can run a Parity node and it will connect to the private network just fine.  But when I run geth on this same computer, it does not connect to the other two parity nodes.

I have initialized this geth with a genesis file that I think is appropriate, based on the Parity chain spec file that is working on the Parity nodes.  I say "think" because I see no documentation about this and another question on SE didn't get an answer so I'm just making guesses.

And of course we know the machine and its firewalls aren't the problem because when I run a Parity node from the machine, as I said it connects fine.

The frustrating part is that the geth node doesn't realize that it's not connecting becuase it doesn't know there's anything to connect to.  So I have no errors to start debugging from.  I have tried manually adding peers at the json console.  I get "true" but then listing peers shows nothing.

Can anyone tell me how to start debugging?


texts: Just that, is there any way to change the token price during the ICO execution? automatic or manual? some documentation or example? Thank you in advance.


texts:
currently i am learning ipfs and ethereum based blockchain technology,I wanted to know can we store data on ethereum blockchain and yes then how.
and also wanted to know how exactly ipfs work for blockchain.


texts: Are there any dice / casino gambling games / smart contracts for ethereum yet? Where can I get a list of them?


texts: What's the point of returning a value in a non-constant function?

texts:
As we know you can't get the return value of a non-constant function
Still ERC20 does this a lot, for example:

 function approve(address _spender, uint256 _value) returns (bool success)

Hypothesis: return values are only there for contract-to-contract calls, and since you can't return anything from a transaction it is useless if not called by contracts.

Is this true? Are contract to contract calls with return values possible? And should you then always have a (Event, return) pair in this cases?


texts: Certain functionality of a DApp can be hosted on the blockchain as smart contracts. How about other resources such as HTML and JS files? Multiple places reference "Swarm" as the place to host these resources, but when you look at Swarm wiki, it's basically a list of TO-DOs. There are DApps out there right now. How are they hosted?


texts: How to access data stored in Ethereum Blockchain using Smart contract?

texts:
I want to write solidity contract which stores hash table as mapping(uint => string) documents data structure in ethereum blockchain.

Now, each time I run a function "storeDocument" in this contract, I store a students' details in mapping as ID => Hash_of_stu_data and run the contract. Likewise, I have to store many students' details in same mapping data structure by creating several transactions. So, it is stored permanantly in blockchain.

So, now there is another function "verifyDocument" in same contract that returns boolean value if given hash is matched on providing ID as key and hash anytime by anyone on a different transaction. So, it has to access same documents mapping data structure, compare against the value and return bool value.

How do I verify a particular student's hash based on key value in table in another transaction ? Since it is permanently stored, what should I do ? This happens only if store all records and verify in the same transaction. This is possible if accessing data from Blockchain that is stored in mapping data structure in same transaction. But, I want this table to be updated with new entries everytime I create a transaction to store a key value pair as we do in database.

I am able to access mapping table data in the same transaction. But I want to store it permanently as we do so in database to verify my hash at any time. You can assume this contract is for checking the integrity of any document.

This is sample code:

pragma solidity  >=0.4.0 <0.6.0;

contract Example {

mapping(uint => string) documents;

function storeDocument(uint id, string docHash)  public
{
    documents[id] = docHash;
}

function verifyDocument(uint id, string hashToVerify) view public returns (bool)
 {
    if(keccak256(abi.encodePacked(documents[id])) == keccak256(abi.encodePacked(hashToVerify )) )
    {
        return true;
    }
    else
    {
        return false;
    }
 }
}

Please help me. Please mention if question isn't asked properly.
Thank you.


texts: Withdraw erc20 DAI token from smart contract but get DAI/insufficient-allowance

texts:
I try to withdraw DAI token from smart contract into my wallet on kovan net that holds around 20 dai by executing the following:
const mantissa = (numberOfDaiTransfer * Math.pow(10, underlyingDecimals)).toString();
result = await underlying.methods.approve(myContractAddress,mantissa);
result = await underlying.methods.approve(myWalletAddress,mantissa);
result = await underlying.methods.transferFrom(myContractAddress,myWalletAddress,mantissa).send(fromMyWallet);

However I get Dai/insufficient-allowance error and the transaction gets reverted. What could be the problem?
regards


texts: what is the most efficient way to compute a logarithm in solidity? Is there a library that implements it or a built in function?


texts: How to watch several ethereum addresses for transactions

texts:
I am wondering what the best way is to watch several (hundreds or thousands) Ethereum addresses at once for incoming transactions and send out the amount deposited once a transaction is detected. I came across similar questions on this forum where a few solutions have been proposed.

For instance, one answer proposed here: How to monitor all your addresses and send payments out immediately to a main address

setInterval(function(){
  var target = web3.eth.accounts[10];
  for (var account = 0; account < 10; account++) {
   var balance = web3.eth.getBalance(web3.eth.accounts[account]);
   if(balance > 0)
     web3.eth.sendTransaction({from: web3.eth.accounts[account], to: target, value: balance});
  }
}, 10000);

However, this does not seem very scalable, because you'd have to unlock all hundreds or thousands of addresses to keep watch.

Another solution proposed is to watch for all transactions on the blockchain, and check if the address match any of your watched addresses:
https://ethereum.stackexchange.com/a/35818/27511

Again, I don't think this is scalable if you have hundreds or even thousands of addresses. Let's say you have 10,000 addresses to watch, and 1,000 incoming transactions, that would be an n^2 operation to check each transaction against each address.

Is there a more efficient way, or are these the only options?


texts: Does a non-miner node validate both single transactions and an entire block?

texts:
My understanding is that an originating node broadcasts a transaction to its neighbours, who all validate the transaction to ensure (a) the signature is valid and (b) the state change is valid, before broadcasting the transaction to their neighbours. The node at this point does NOT execute the transaction.

Eventually, the transaction would arrive at a mining node which then includes it in a block. If the miner is successful, it broadcasts the block to the network.

Regular nodes will then validate the block and if valid, will execute the transactions within.

Is this correct?


texts:
I am having some mocha tests and trying to run them, I am on TS
these are my two test file code
import { Signer } from "@ethersproject/abstract-signer";
import { ethers, waffle } from "hardhat";
import { GsnTestEnvironment } from "@opengsn/gsn/dist/GsnTestEnvironment";

import FrontProxyFactoryArtifact from "../artifacts/contracts/FrontProxyFactory.sol/FrontProxyFactory.json";
import FrontSmartWalletArtifact from "../artifacts/contracts/FrontSmartWallet.sol/FrontSmartWallet.json";
import FrontPayMasterArtifact from "../artifacts/contracts/FrontPayMaster.sol/FrontPayMaster.json";

import { Accounts, Signers } from "../types";
import { FrontProxyFactory } from "../typechain/FrontProxyFactory";
import { FrontSmartWallet } from "../typechain/FrontSmartWallet";
import { FrontPayMaster } from "../typechain/FrontPayMaster";
import { shouldBehaveLikeGreeter } from "./front.behavior";

const { deployContract } = waffle;

describe("Unit tests", function () {
  let gsnInstance: any;
  let salt: any;
  let encodedData: any;
  before(async function () {
    this.accounts = {} as Accounts;
    this.signers = {} as Signers;

    const signers: Signer[] = await ethers.getSigners();
    this.signers.admin = signers[0];
    this.accounts.admin = await signers[0].getAddress();
  });

  describe("FRONT", function () {
    beforeEach(async function () {
    // hardcoded for now
    salt = 34;
    // encoded byte data of setForwarder method in smart wallet for deploy function
    encodedData = "0xb9998a2400000000000000000000000018eee2eb65942a5237fe2a9982f8ffc2da2647cf";
    gsnInstance = await GsnTestEnvironment.startGsn('localhost')
    this.factory = (await deployContract(this.signers.admin, FrontProxyFactoryArtifact, [gsnInstance.deploymentResult.forwarderAddress])) as FrontProxyFactory;
    this.smartwallet = (await deployContract(this.signers.admin, FrontSmartWalletArtifact, [])) as FrontSmartWallet;
    this.paymaster = (await deployContract(this.signers.admin, FrontPayMasterArtifact, [])) as FrontPayMaster;
    await this.paymaster.send(1e17)
    });
    shouldBehaveLikeGreeter(gsnInstance, salt, encodedData);
  });
});

export function shouldBehaveLikeGreeter(gsnInstance: any, salt: any, encodedData: any): void {
    it("should return the new greeting once it's changed", async function () {
    await this.paymaster.setRelayHub(gsnInstance.deploymentResult.relayHubAddress)
      await this.paymaster.whitelist(this.factory.address, this.accounts.admin);
      await this.factory.deploy(salt, this.smartwallet.address, encodedData, gsnInstance.deploymentResult.forwarderAddress)
      const smartWalletAddress = await this.factory.computeAddress(salt, this.smartwallet.address);
      const createdWallet = await this.factory.registry(this.accounts.admin);
      // this should pass
      assert.equal(smartWalletAddress, createdWallet, "Unsuccessful Deployment")
  });
}

BUT the errors I get are on the code that is not even there for instance I get an error
test/front.ts:50:123 - error TS2304: Cannot find name 'user1'.

50       await factory.deploy(salt, smartwallet.address, encodedData, gsnInstance.deploymentResult.forwarderAddress, { from: user1 });
                                                                                ~~~~~
test/front.ts:52:52 - error TS2304: Cannot find name 'user1'.

52       const createdWallet = await factory.registry(user1);
                                                      ~~~~~
test/front.ts:49:55 - error TS1003: Identifier expected.

49       await paymaster.whitelist(factory.address, this..admin);

which is a bit strange since I am not using user1 anywhere
am I missing something, any help would be appreciated
Thanks


texts: Stuck on Install Solidity with Brew on MacOSX

texts:
I tried to install Solidity this way, but as soon as I do brew install solidity it stops at the following line:
==> ./b2 --prefix=/usr/local/Cellar/boost/1.65.1 --libdir=/usr/local/Cellar/boos
Does anybody know why it stops at this point?
Many thanks in advance!
UPDATE:
You just have to wait! It may take a little longer...


texts: Normal transactions VS. Internal transactions in etherscan

texts:
On etherscan:

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

There are two types of transactions mentioned under No Of Transactions:

Normal transactions and Internal transactions.

What is the difference between them and why are the Normal transactions usually much less than Internal transactions?


texts: Is homestead a hard fork and when will it be activated?

texts: In one of the descriptions it was mentioned that the homestead update contains a new opcode and other changes that are not backward compatible. Thus a hardfork will be required. What is a process of switching to the new consensus rules? Is it a given block or something dynamic (e.g. as soon as 75% of the miners are signaling support by some meta information in the block)


texts: Does the EXTCODECOPY instruction also copy the state of the variables?

texts: The Yellow Paper discussed the EXTCODECOPY instruction, which lets you copy the code of an external contract to memory. Does this include the state of the variables in the contract? Is it possible to read or hash the state of a contract such that a change can be detected?


texts: Is creating new account per unique user OK in Ethereum?

texts:
When using Bitcoin one can generate new address per user of service and save pair (address -> userId), so it is always obvious which specific user sent coins.

Also, all these coins are stored in the wallet as UTXO, so it is easy to send them to another address paying fee once.

In Ether, on the other hand, I can create a new account per user like this personal.newAccount("abracadabra")
 but seems like there is no way to send ETH from 100 wallets without paying fee 100 times.

Is there a better and cheaper way to create a new account per user (so I can identify them)?


texts: web3 websocket connection prevents node process from exiting

texts:
I have a node js process that creates a web3 websocket connection, like so:

web3 = new Web3('ws://localhost:7545')

When the process completes, it does not exit, but rather hangs forever with no console output.

Taking at look at what handles the process has outstanding with process._getActiveRequests() and process._getActiveHandles(), I see this:

Socket {
    connecting: false,
    _hadError: false,
    _handle:
     TCP {
       reading: true,
       owner: [Circular],
       onread: [Function: onread],
       onconnection: null,
       writeQueueSize: 0 },
    <snip>
    _peername: { address: '127.0.0.1', family: 'IPv4', port: 7545 },
    <snip>
}

Looks like web3 is holding a socket open, which makes sense since I never told it to close the connection. Looking through the documentation and googling, it doesn't look like there's a close or end method for the web3 object.

Manually closing the socket allows the process to successfully exit:

web3.currentProvider.connection.close()

Anyone have a more elegant or officially sanctioned solution? It feels funny to me that you have to manually do this rather than have the object destroy itself on process end.


texts: Why does geth say "Mining too far in the future"?

texts:
I left my PC mining overnight (geth not running) and then cancelled the mining and started up geth. I get:

Mining too far in the future              wait=1h8m29s

Presumably I have to wait for that long before geth will function again, but what does it actually mean? Should I be running geth at the same time as mining to prevent it?


texts: Incorporating AI/Machine Learning (e.g., Recurrent Neural Networks) into EVM/Solidity via Oracles

texts:
I am exploring the viability and avenues to incorporate AI/ML with EVM and/or Smart Contracts via solidity or oracles.

For example, I wish to leverage Recurrent Neural Networks, which demonstrates how to use a recurrent neural network to predict the next word in a sentence.

I wish to predict what function the ethereum nodes will call as a first step to using AI/ML to make smart contracts even smarter.


texts: how to call smartcontract with eth.sendRawTranasction()

texts:
i want to call my erc20 token smartcontract with eth.raw transaction. suppose i want to call .transfer("0x0",500) and send with web3.eth.rawTranscation so where can i add this call function?

rawTx : {
        nonce: nonceHex,
        gasPrice: gasPriceHex,
        gasLimit: gasLimitHex,
        data: hexdata,
        from: creating_address,
        value: valuehex
    };


texts: How do I pass msg.sender to a struct as a payable address?

texts:
Currently following a tutorial and this error keeps repeating throughout my code.
I'm trying to add msg.sender to a struct as a payable address but the error: Invalid type for argument in function call. Invalid implicit conversion from address to address payable requested. repeats all through the code.
Just curious how to set msg.sender to the struct.
Many thanks.
    struct Image {
        uint256 id;
        string hash;
        string description;
        uint256 tipAmount;
        address payable author; // < ---- Invalid implicit conversion from address to address payable requested.
    }

/////

    function uploadImage(string memory _imageHash, string memory _description) public {

        require(bytes(_imageHash).length > 0, "Must Have Hash!");

        require(bytes(_description).length > 0, "Must have description");

        require(msg.sender != address(0), "Must have author address");

        imageCount++;

        images[imageCount] = Image(
            imageCount,
            _imageHash,
            _description,
            0,
            msg.sender // < ---- Invalid implicit conversion from address to address payable requested.
        );

        emit ImageCreated(imageCount, _imageHash, _description, 0, msg.sender);
    }


texts:
I wonder if there is a way to keep track of my smart contract as an owner of it.
Like get a full dynamic report regarding each and every action happened on it since it has been created ?


texts:
Hello I have a question about storage trie in Ethereum.

I read many articles but there is no mention about what data is in storage trie.

So, Please help me.

Thanks.


texts:
I'm having problems deploying the contract via Trufflem, using Parity as my client, on the Kovan network.

The contract is a slight variation of this one. When I ran $ truffle migrate using the project starter files, it ran without problems - I've signed the transaction using the Signer in GUI. However, when I try to deploy this contract, the output is

ookie@ookie:~/Desktop/contracts/migrations$ truffle deploy
Compiling ./contracts/contract_name.sol...
Writing artifacts to ./build/contracts

Using network 'development'.

Network up to date.

Also, my 2_deploy_contracts.js file looks like this:

var Contract = artifacts.require('./contract_name.sol');

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

Any ideas on what I'm doing wrong?

It's worth mentioning that deployment from Parity interface is working flawlessly.

Thanks in advance!


texts: How would you integrate Ethereum smart contracts into an existing node/react project?

texts:
I have an existing node/graphql/mongodb/react/redux project that is in beta and I would like to integrate Ethereum smart contracts to be able to save transaction information into the block chain. Is this possible? If so, how do I do it?

I am already have a working knowledge of Solidity and Truffle and I have built a couple of sample projects and deployed those to a private network.

Is it better to start from scratch?


texts: Will Dapps in production be able to buy and use SaaS solutions?

texts:
SaaS services help centralized organizations or apps solve their business problems. For example, Google Apps offers startups as an easy solution for company email and document storage. The sales process is simple because there are a small number of known people making the buying decision - they interact with representatives of the company selling the SaaS service and a decision is made.

Will Dapps in production be able to buy or benefit from SaaS solutions (whether the SaaS solutions are centralized or decentralized)? If so, how will the buying decision be made? How will rollout work?


texts: How to get back stolen tokens from the exchange?

texts: so recently i got stolen in about 50k in Humaniq tokens .. it was a phishing website directed from a slack DM E-mail .. so the guy who stole them,has also stole a lot from other people but everything that comes in never comes out of his wallet and people are reporting his address .. HMQ(Humaniq tokens) are only on 3 or maybe 4 exchanges so only 4 ways to go. Is there any possibility to get my tokens back if i try communicating with exchanges and prove that this stolen fund belongs to me . Thank you


texts:
I know how to instantiate a memory array. Looks like this:
address[] memory users = new address[](1);
users[0] = address(0x0);

But I cannot create a calldata array in this same fashion. Any pointers?


texts:
I am new here and I am suffering with the case below, I am trying to push data into an Array, but I can't make it work, the array continuous with zero length.

    contract StarNotary is ERC721 {

    struct Star {
        string name;
        string dec;
        string mag;
        string cent;
        string story;
    }

    using Library for Library.data;
    mapping(uint256 => Star) public tokenIdToStarInfo;
    mapping(address => uint256[]) private _ownerToTokenId;
    mapping(uint256 => uint256) private _starsForSale;
    mapping(bytes32 => Library.data) private _hashToTokenId;

    Star[] public stars;
    uint256[] tokensForSale;

    function createStar(string _name, string _dec, string _mag, string _cent, string _story)
    public
    returns(uint256)
    {
        require(!checkIfStarExist(_dec, _mag, _cent), "Star already registered!");

        Star memory newStar = Star(_name,_dec,_mag,_cent,_story);

        uint256 tokenId = stars.push(newStar) - 1;

        return tokenId;

    }
}

Do you know what can be happing? I look for it and find nothing.

Tks
Ricardo


texts: How does the ethereum network validate addresses that were created offline?

texts: Myetherwallet.com allows us to create private/public keys offline, so the network doesn't know anything about it. When someone sends ether to this address that was created offline how does the network validates this address and how does it know it is a real address?


texts: How to transfer the information of the token when transmitting RPC communication

texts:
I have difficulties during the project and ask you questions. Please help me

situation

Create an ERC20-based token and try to create a transaction.
Communication with geth is RPC communication.
How do I send and receive information from the token when communicating with RPC?
question

Create an ERC20 token wallet with the function “personal_newAccoun” t, where you need to put the token information

When sending token, “eth_sendTransaction, eth_sendRawTransaction” should be used to send the token information here

How to load the eth_getBalance token information when checking balance (balance)
“id”: 1 “}” {“jsonrpc”: “2.0”, “method”: “eth_getBalance”, “params”: [“0x502af56ded80f54fac9920010180dcc6f228306d”, “latest”
The above code is an Ethernet balance inquiry. How do I do a token lookup?


texts: transactionHash returned null sometimes when trying to transfer funds using web3j (random behaviour)

texts:
I am transferring funds using web3j. However, I was getting transactionHash as null. I checked various posts and found that this issue exist when gas price or gas is bad. I increased both the values, and it started working. However, the same code didn't work on other machine. So, again i changed the gas price and value and it worked. But then for some other data, it didnt work. So, its random.

My conerns:
1. I can't keep changing the values dynamically, since I don't know how much gas is required at run time.
2. Most of all, Gas price and limit that i have set are already too high (please check my code below). Even the account balance will never be that much. In reality, I can't set that much value.

Please help me here.

static BigInteger GAS_PRICE = BigInteger.valueOf(new Long(18000000000L));
static BigInteger GAS_LIMIT_ETHER_TX = BigInteger.valueOf(300000);
RawTransactionManager rawTransactionManager =  new RawTransactionManager(web3j ,credentials,100,1000 * 15);

EthSendTransaction send = rawTransactionManager.sendTransaction(GAS_PRICE, GAS_LIMIT_ETHER_TX, "toAddress", "<some  data to save>", BigInteger.valueOf(1));

Even the amount to transfer is not big, and neither is my data to save. Is my gasLimit set in genesis too high, which is why it is expecting this much gas?

{
"config": {
  "chainId": 1994,
  "homesteadBlock": 0,
  "eip155Block": 0,
  "eip158Block": 0,
  "byzantiumBlock": 0
},
"difficulty": "400",
"gasLimit": "2000000",
"alloc": {
    "<root address>":{
    "balance":"1000000000000000000000000"
}}}


texts: I sent Chainlink Link tokens to my ethereum address, how can I recover?

texts:
By mistake I sent Link tokens to my ethereum wallet (kraken) that can not receive them, can I recover those tokens? How?
I think I had to swap them before sending, but I am new, and I think I made mistake. Is there a way to recover those ethereum tokens that I created?
Thanks


texts: Deploying contract to rinkbey does nothing

texts:
I have been trying to deploy my contract to Rinkbey, but nothing seems happening.

I have earlier deployed contracts locally to ganache RPC and used truffle migrate
it worked fine and I was able to call deployed contract's method without any problem.

After that, I added following lines into truffle.js

rinkeby: {
  host: "127.0.0.1", // Connect to geth on the specified
  port: 8545,
  from: "xxxxxxxxxxxxxxxx", // find it from geth console by typing `eth.accounts` use the first one
  network_id: 4,
  gas: 5000000
}

so it became

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*"
    },
    rinkeby: {
      host: "127.0.0.1", // Connect to geth on the specified
      port: 8545,
      from: "xxxxxxxxxxxx", // find it from geth console by typing `eth.accounts` use the first one
      network_id: 4,
      gas: 5000000 // Gas limit
    }
  }
};

My migrations/1_initial_migration.js is as follows:

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

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

and  contracts/Migrations.sol is as follows:

pragma solidity ^0.4.17;

contract Migrations {
  address public owner;
  uint public last_completed_migration;

  modifier restricted() {
    if (msg.sender == owner) _;
  }

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

  function setCompleted(uint completed) public restricted {
    last_completed_migration = completed;
  }

  function upgrade(address new_address) public restricted {
    Migrations upgraded = Migrations(new_address);
    upgraded.setCompleted(last_completed_migration);
  }
}

after that, I stopped local running geth and ran following command to unlock the account to get ready for deploying contract to rinkbey

geth --rinkeby --rpc --rpcapi db,eth,net,web3,personal --unlock="xxxxxxxxxxxxxxxx"

then ran following command in different terminal window

truffle compile; truffle migrate --network rinkeby

and got this output

Using network 'rinkeby'.

Network up to date.

While I was expecting it should have shown me completed migration to rinkbey and contract address, but it
just keep saying Network is up to date. Even I edited my contract a bit thinking, that may fire new migration. But that did not help. Any idea what am I doing wrong here?

UPDATE: I read somewhere, I need to delete the build folder, so I did it. Then ran truffle compile; truffle migrate --network rinkeby and got followings this time:

Compiling ./contracts/Migrations.sol...
Compiling ./contracts/addition.sol...
Writing artifacts to ./build/contracts

Using network 'rinkeby'.

Network up to date.

Still I don't see deployed contract address?


texts: How to transfer transaction and send balance on public blockchain using web3py api?

texts:
I have followed tutorial and setup private Blockchain using geth:

https://medium.com/infrageth/practical-steps-for-go-ethereum-setup-27b8d64903fc

I have used

  web3py

python library for creating web services
I have created own

  genesis.json

So my question is we are giving local address and assigning some
balances so what are these balances
Is it that only through local    address we can send transaction
because i have generated address
I have tried to send transaction using web3 api and also i am not
able to get balance even i have transferred eth i can see balance in

  https://etherscan.io/

but not through api.
so i am confused how is it working any help will be greatly appreciated

my send transaction code is :

        send_transaction = my_provider.eth.sendTransaction(
            {'from': checksum_sendaddress, 'to': checksum_recvaddress, 'value': amt})

My code is executed successfully and it will generate  txhash successfully but when  I am adding  this hash to site
https://etherscan.io/
the transaction is not shown


texts:
Code -

pragma solidity ^0.4.18;

contract CA18 {

address public owner;

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

mapping(address=>uint16) public balances;

function getBalance() view returns (uint16, bytes32) {
    require(msg.sender == owner);
    uint16 mybalance = 1000;
    bytes32 c = keccak256(owner);
    return (mybalance, c);
}

}

> con.getBalance()
[1000, "0x0679d661b585d1b4f0c3fd18f943f19e7fa9777fe23cb96b94f469c20d6f0bd5"]
> web3.sha3(eth.coinbase)
"0x3ba2c5fae04972f5960bd8d1b7f098bf7d4c844da67accd23da00f62e4910fc0"
> con.owner()
"0x46fb9a22689c4a4bfb494baeafbb8b2993725305"
> web3.sha3(con.owner())
"0x3ba2c5fae04972f5960bd8d1b7f098bf7d4c844da67accd23da00f62e4910fc0"

Web3.sha is not the same as keccak256(owner).

The docs state -

sha3(...) returns (bytes32):
alias to keccak256

The outputs show sha3 to be different keccak256. Should they be the same?

(con is the contract instance.)

I just added sha3 for the owner and here is the output -

> con.getBalance()
[1000, "0x0679d661b585d1b4f0c3fd18f943f19e7fa9777fe23cb96b94f469c20d6f0bd5", "0x0679d661b585d1b4f0c3fd18f943f19e7fa9777fe23cb96b94f469c20d6f0bd5"]

function getBalance() view returns (uint16, bytes32, bytes32) {
    require(msg.sender == owner);
    uint16 mybalance = 1000;
    bytes32 c = keccak256(owner);
    bytes32 d = sha3(owner);
    return (mybalance, c, d);
}

Hence the difference is due to web3 and solidity. Has anyone any explanation about this since sha3 is used in the addressing algorithms for storage and they work, and they are also based on keccak256.


texts: Etherscan: How can I verify a contract with multiple imports deployed with Truffle?

texts:
When I deploy a contract with Truffle that has an import statement, and try to verify it on etherscan, my understanding is that I need to paste in the contents of the imported file.

I get an error on etherscan that the bytecodes of the concatenated and deployed files are not the same.
The strange thing is that if I deploy the contract (with imports) on remix then the bytecode matches with the concatenated source file.

Example

Here is a minimal example of contracts that exhibit this behaviour.

Combined.sol is the concatenated file, and Outer.sol contains the contract that is deployed.

Here is what I am doing that gets an error:

Deploy Outer.sol with truffle
Go to deployed contract address on etherscan
Input the Concatenated.sol source code and hit verify

Error, bytecodes do not match.

More info

Using compiler 0.4.11 in remix and truffle.
Ubuntu 16.04.
On Kovan, not that it should matter.
Deployed contract


texts: What is the current state of distributed storage?

texts:
Swarm, IPFS, Filecoin, etc..

What project(s) is typically best practice for dapp storage and what is the current state and future roadmap for dapp storage? Any recommendations on the best dapp stack?


texts: how come web3 send does not require a private key or signature

texts:
I'm building an ERC20 smart contract which will be accessed via node.js with web3 library.
I see that web3.eth.Contract has the send function, which takes the parameter from, which is being mapped to the msg.sender in the smart contract.
As far as I understand (and my debugging supports that), I can change the from field to just about any address, and by that bypass the business logic of the contract, e.g

token.methods.method_only_owner_can_activate(<some_data>).send({ from: <contract_owner_address>, <gas> });

or even set the owner:

token.methods.setOwner(<my_not_owner_address>).send({ from: <contract_owner_address>, <gas> });

since the address should be public, any user can create a process which mimics this behaveiour and bypasses my security logic.

There are other methods which do sign a transaction with the private key, but the fact that the send method is open for bypassing the business logic, seems like a big security concern.

As I missing something?


texts:
I created asset transaction smart contract.

Functions are

Create Assets (asset id, asset details, with owner) and pushing into array list.
Get Assets by owner address: Looping assets array and get count
Transfer asset: Looping assets array and check old owner and replace owner to new owner.

My code:

pragma solidity >=0.4.22 <0.6.0;

contract Asset {
struct asset {
    bytes32 asset_id;
    bytes32 asset_name;
    bytes32 asset_sqfeet;
    address owner;
}

asset[] items;

function createasset(bytes32 asset_id, bytes32 asset_name, bytes32 asset_sqfeet) public {
    address userwallet = msg.sender;
    asset memory m;
    m.asset_id = asset_id;
    m.asset_name = asset_name;
    m.asset_sqfeet = asset_sqfeet;
    m.owner = userwallet;
    items.push(m);
}

function getassetCount(address owner) public view returns (uint){
    uint count = 0;
    for(uint i=0; i < items.length; i++){
        if(items[i].owner == owner){
            count = count +1;
        }
    }
    return count;
}

function getassetOwnership(address owner, bytes32 asset_id) public view returns (bool){
    for(uint i=0; i < items.length; i++){
        if(items[i].asset_id == asset_id){
            if(items[i].owner == owner){
                return true;
            }
        }
    }
    return false;
}

function tranferasset(address new_owner, bytes32 asset_id) public payable {
    require(new_owner != msg.sender);
    address old_owner = msg.sender;
    for(uint i=0; i < items.length; i++){
        if(items[i].asset_id == asset_id){
            if(items[i].owner == old_owner){
                 items[i].owner = new_owner;
            }
        }
    }
}

}

My questions are:

How about performance of this contract, if assets will more then one lakhs? (because i am using for loop.)
Is there other way to do it?
how about security of this contract?

Thanks in advance


texts: TxOriginVictim(msg.sender).transferTo(owner, msg.sender.balance): What is the purpose of Interface and what is TxOriginVictim(msg.sender)?

texts:
I have two contracts in the context of tx.origin Vulnerability:
pragma solidity ^0.5.8;
contract TxOriginVictim {
   address owner;
   constructor() public{
      owner = msg.sender;
   }
   function transferTo(address to, uint amount) public {
      require(tx.origin == owner);
      (bool success,) = to.call.value(amount)("");
      require(success);
   }
   function() external payable  {}
}

and the Attacker's contract:
==
pragma solidity ^0.5.8;
interface TxOriginVictim {
   function transferTo(address to, uint amount) external;
}

contract TxOriginAttacker {
   address owner;
   constructor () public {  owner = msg.sender;}
   function getOwner() public returns (address) {  return owner;}
   function() external payable  {
      TxOriginVictim(msg.sender).transferTo(owner, msg.sender.balance);
   }
}

In the TxOriginAttacker contract, I can’t  understand the purpose of TxOriginVictim’s interface. What is TxOriginVictim(msg.sender) in the statement:
TxOriginVictim(msg.sender).transferTo(owner, msg.sender.balance);
Please guide me.
Zulfi.


texts: What is the purpose of DUP1 at the beginning of contact creation bytecode?

texts:
I am trying to analyse the bytecode of creating a contract and I can't figure out why there is a need for the 006 DUP1 opcode in the snippet below.

000 PUSH1 80
002 PUSH1 40
004 MSTORE
005 CALLVALUE
006 DUP1
007 ISZERO
008 PUSH2 0010
011 JUMPI
012 PUSH1 00
014 DUP1
015 REVERT
016 JUMPDEST
017 POP
...

My understanding is that before executing 011 JUMPI the stack will have three items:

0010
[result of 007 ISZERO]
[value from 005 CALLVALUE]

011 JUMPI will take two items off the stack, leaving [value from 005 CALLVALUE]. The next instruction set will be either:

012 PUSH1 00 -> 014 DUP1 -> 015 REVERT (this opcode takes two parameters, so it will take the original and duplicated 00 generated by 012 PUSH1 00; after that no more code will be executed)
016 JUMPDEST -> 017 POP (at this point [value from 005 CALLVALUE] will be discarded) -> ...

It seems to me that in both cases the value is not used for anything, so 006 DUP1 can be safely removed from the generated bytecode. What am I missing?

EDIT:

This bytecode has been generated in Remix using the 0.6.4 compiler with optimization enabled.


texts:
I already have dapple , how can i install dappsys ?

follow this dapple documentation to install dapple

https://dapple.readthedocs.io/en/latest/


texts:
Not sure how to successfully convert a contract to a payable address..

ERC721 public nonFungibleContract;

function withdrawBalance() external {
    address payable nftAddress = address(nonFungibleContract);
    nftAddress.send(address(this).balance);
}

TypeError: Type address is not implicitly convertible to expected type address payable.


texts:
I am new to IPFS. I added a file in IPFS and then, pinned it. Now, I am trying to retrieve the file.

I am writing the code in React. Hence I used the following code:

ipfs.get('/ipfs/hash_of_the_file');

But, there is no action. I expected the file to be downloaded. How do I get back the file from the hash of the file?

Please help. It's urgent. Thank you.


texts: What does ethereum's blockchain look like?

texts:
What does Ethereum's blockchain looks like? Are there only transactions of the states' changes, or are the accounts in every block?

Thank you


texts: Send transaction with same nonce as another transaction but lower gas price

texts:
I want to send a transaction using web3, and I want this transaction to have the same nonce as other transactions - so far so good. The issue comes when I set a lower gasPrice than the other transactions. When I do this, I get an error:

  Replacement transaction underpriced

I am aware that the transaction is underpriced compared to the existing ones, but still I want it to issue the transaction instead of throwing an error and messing up the whole program.

Is there a way to circumvent this? Should I use any other API for this purpose? or am I doomed to always be the highest bidder?

Thanks


texts: Why do I always get “Returned values are not valid, did it run Out of Gas”?

texts:
I'm new on Ethereum blockchain and I'm working on deploy and using smart contract using truffle on my  private blockchain.

I have followed exactly this guide
 https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts

But every time i call getBalance() function

  truffle(develop)> let balance = await instance.getBalance(accounts[0])
  truffle(develop)> balance.toNumber()

I get the error:
Returned values are not valid, did it run Out of Gas

So I added a simply smart contract getNumber() then return a simply integer (3) and I always get the same error.

But if I invoke sendCoin() function  I don't get any error and i write correctly the transaction.

So i get the error any time i try to get values from blockchain.

Someone can help me?


texts: How to list ALL Ethereum addresses with a positive balance

texts: Using web3 I can query the balance of any fixed account with web3.eth.getBalance. Assuming I have the entire blockchain downloaded, how can I recover the list of all addresses that have a positive balance at this moment?


texts:
I'd like to see a comparison of features (audited, how active it is, last modification, usage in real world, ..) among the known multisig wallets: this for creating a reference comparison for choosing the best-fitting for a given use-case.

I've searched around but people seem to be suggesting different things. For example, this thread Where's the Solidity code for Mist's default multi-sig contract wallet? says dapp-bin is outdated and to use this meteor-dapp-wallet contract. But I see the last modification on Git for dapp-bin is much newer.
https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol

This is another option: https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol


texts:
I have this function from a Solidity contract.

SomeStruct public rr;

function getRatingResult() public constant returns(bytes32) {
    // rr is an instance of a struct variable that has a field winningContestantId
    return rr.winningContestantId;
}

And, I have this function from another contract.

DifferentStruct public lm;

function getAverageNumber() constant returns(uint256) {
    return lm.averageNumber;
}

In both cases the output is correct. However, in the first case I get output as a hex string. Whereas, in second case, I get output that looks similar to a JSON object. How does this variation happen? In general, for cases where there is only value to be returned, how can I get Solidity and web3 to output that value as a name-value pair in a JSON document? Can I?


texts: Calculated Gas Costs of Contract execution

texts:
I have a smart contract that maps a string to a string value and stores it on the Blockchain. I want to analyse the Gas Used by Transaction. One time the execution consumes 92,843 Gas (https://rinkeby.etherscan.io/tx/0x04ac9ef0403d0d9362779de3f15d25942e861270aa53d4896692f68bc06150aa), the other time it only takes
43,043 Gas (https://rinkeby.etherscan.io/tx/0x103693f2d548da60e14470ced0825f5a5263a9e618658e1812d3c84c29571f4a). How does that happen?

Also: The transaction costs 21.000 Gas and the storage operation for 32Byte is 5.000 Gas. Since I store 2 64Byte Strings that is 21.000 + 2*5.000 + 2*5.000 = 41.000. Where does the rest of 2.043 Gas come from?

To narrow it down, I also uploaded an even simpler contract which only stores one uint value:

pragma solidity ^0.5.7;
contract storeNumber{
   uint test;
    function setValue(uint number) public{
        test = number;
    }
}

The transaction https://rinkeby.etherscan.io/tx/0x5327f3a2a74f2589c7f8e323a698f78c17b249cf5090cec74d11e7456cb0ec38 consumes 26,684 Gas - 21.000 + 5.000 is obvious to me, but what about the 684 additional Gas?


texts:
I need to create a contract that will make recurring payments as per user's request, the contract will ask the user to tell the sender and receiver address and it'll transfer some amount of erc20 tokens from sender to receiver in a recurring manner - maybe every month, or daily.

I was reading through ethereum alarm clock, what I understand till now is that it'll schedule the transaction to be run later, but can it be made recurring? like every 2 months?

A quick start link or suggestions would be appreciated, Many Thanks !


texts:
Recently a lot of ERC20 tokens have been created and issued. I have seen also the main exchanges handle the larger tokens for exchange but not the smaller ones.

Has anyone details of exchanging ERC20 based tokens?


texts: Possible ways to search Blockchain using ethereum-java api based on input/output parameters supplied as part of any transaction?

texts: Although we know ethereum-java provides required api support which facilitate us to identify any block or transaction from Blockchain based on either block number or hash of transaction id. Do ethereum-java supports to execute search based on transactional input/output parameters (say my parameters are fixed like SL NO) to identify the history or say in which of the transaction/block its participated? Let me give an example of my need. Say I have 3 node running on one private network. Now each this three node has its own contract deployed, they are exchanging say one item which usually & uniquely identified based on its SL No. So the item baring the unique SL No many transfer from one node to another & the ownership of the same is changed. All this execution are part of transactions & hence part of some blocks. This successful executed transactions hold all the information’s like which SL No item transferred, from where to whom etc. Now do ethereum-java api provides any supports where by passing this input parameter say SL No we can identify which are the blocks or transactions where this has participated?


texts: Why gas required is estimated as infinite?

texts:
I'm having lint check warning in Remix for my smart contract in Solidity: addFeature(int128,uint256,bool,uint256,uint256,uint16,uint16,address) high: infinite. If the gas requirement of a function is higher than the block gas limit, it cannot be executed. Please avoid loops in your functions or actions that modify large areas of storage (this includes clearing or copying arrays in storage)

Feature is a struct with lot's of fields:

struct Feature {
    int128 key;
    uint256 goal;
    bool finishOnGoal;
    uint campaignStart; // timestamp
    uint campaignFinish; // timestamp

    PledgeType pledgeType; // enum
    FixedPledge fixedPledge; // description for enum value #1
    VariablePledge variablePledge; // description for enum value #2

    PrepaymentType prepaymentType; // enum
    FixedPrepayment fixedPrepayment; // description for enum value #1
    PercentPrepayment percentPrepayment; // description for enum value #2

    uint16 maxDevelopmentDelay; // days
    uint16 developmentDuration; // days

    ConfirmationType confirmationType; // enum
    UserConfirmation userConfirmation; // description for enum value #1

    address developer;
}

...

// featureKey => feature
mapping (int128 => Feature) features;

// featureKey => feature
mapping (int128 => FeatureData) data;

...

// common feature data
function addFeature(
    int128 key,
    uint256 goal,
    bool finishOnGoal,
    uint campaignStart,  // timestamp
    uint campaignFinish, // timestamp
    uint16 maxDevelopmentDelay,
    uint16 developmentDuration,
    address developer) public
    ownerOnly
    withState(key, State.NotSet)
{
    Feature memory feature;
    feature.key = key;
    feature.goal = goal;
    feature.finishOnGoal = finishOnGoal;
    feature.campaignStart = campaignStart;
    feature.campaignFinish = campaignFinish;
    feature.maxDevelopmentDelay = maxDevelopmentDelay;
    feature.developmentDuration = developmentDuration;
    feature.developer = developer;

    FeatureData memory featureData;
    featureData.state = State.Deployment;
    featureData.backers = new address[](0);
    featureData.raised = 0;
    featureData.prepaid = 0;

    features[key] = feature;
    data[key] = featureData;
}

Why do i have this warning? What can/should be changed to fix it (without loosing of functionality)? AFAIK there are neither loops nor arrays modifications here (maps only).


texts: How do I combine integers, to save gas on transaction data and storage?

texts:
For example, I have two integers: one is uint128, another is uint64. I want to store those two integers by converting them to bytes24. And when I use them, parse the bytes24 to uint128 and uint64.

How do I do this?


texts: deploying my contract on testnet using geth and truffle without mist/metamask

texts:
It is showing error on migrating to the testnetwork-

  $ truffle migrate --network ourTestNet

Compiling ./contracts/Wrestling.sol...

Compilation warnings encountered:

/home/mayank/Desktop/Truffle/trial/contracts/Wrestling.sol:35:9: Warning: Invoking events without "emit" prefix is deprecated.
        WrestlingStartsEvent(wrestler1,wrestler2);
        ^---------------------------------------^
,/home/mayank/Desktop/Truffle/trial/contracts/Wrestling.sol:68:9: Warning: Invoking events without "emit" prefix is deprecated.
        EndOfRoundEvent(wrestler1Deposit,wrestler2Deposit);
        ^------------------------------------------------^
,/home/mayank/Desktop/Truffle/trial/contracts/Wrestling.sol:75:9: Warning: Invoking events without "emit" prefix is deprecated.
        EndOfWrestlingEvent(theWinner,gains);
        ^----------------------------------^

Writing artifacts to ./build/contracts

Using network 'ourTestNet'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: unknown account
    at Object.InvalidResponse (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
    at /usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
    at /usr/lib/node_modules/truffle/build/webpack:/~/truffle-migrate/index.js:225:1
    at /usr/lib/node_modules/truffle/build/webpack:/~/truffle-provider/wrapper.js:134:1
    at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
    at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
    at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:114:19)

Migration.sol-

 pragma solidity ^0.4.17;

contract Migrations {
  address public owner;
  uint public last_completed_migration;

  modifier restricted() {
    if (msg.sender == owner) _;
  }

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

  function setCompleted(uint completed) public restricted {
    last_completed_migration = completed;
  }

  function upgrade(address new_address) public restricted {
    Migrations upgraded = Migrations(new_address);
    upgraded.setCompleted(last_completed_migration);
  }
}

truffle.js-

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
    networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match any network id
    },
    ourTestNet: {
      host: "127.0.0.1",
      port: 7000,
      network_id: "*"
    }
  }
};


texts: Creating multiple contracts or Single contract with struct

texts:
I would like to understand which of the following patterns is better.

Say my use case is to have two types of users in my platform buyer and seller for a product, with regard to my architecture Im left with two options.

To have one contract which would have a struct defination of types of Users(Buyer/Seller) and Product.
To have dedicated contract for each module. - Have noticed this in git projects

I belive the product can be achived with both ways, However I would like to understand which approach is better in efficently coding using Blockchain.


texts: Can I extend the interface of a contract without redeploying it?

texts:
The case I'm dealing with is a contract which should serve as a Data Abstraction Layer.

So ideally, it should provide only getter functions and setter functions.

For example, my interface is:

pragma solidity 0.4.25;

interface IDataAbstractionLayer {
    function getX(uint key) external view returns (uint);
    function getY(uint key) external view returns (uint);
    function getZ(uint key) external view returns (uint);
}

And my contract is:

pragma solidity 0.4.25;

import "./IDataAbstractionLayer.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";

contract DataAbstractionLayer is IDataAbstractionLayer, Ownable {
    struct Record {
        uint256 x;
        uint256 y;
        uint256 z;
    }

    mapping(address => Record) public records;

    function getX(uint key) external view returns (uint) {return records[key].x;}
    function getY(uint key) external view returns (uint) {return records[key].y;}
    function getZ(uint key) external view returns (uint) {return records[key].z;}

    function set(uint key, uint x, uint y, uint z) external onlyOwner {
        records[key] = Record({x: x, y: y, z: z});
    }
}

The other contracts in my system know this contract only by its interface (i.e., they interact with it only in order to obtain an attribute of a record).

However, since the Solidity compiler adds an implicit getter function for each public variable, this contract also implements the following function:

function records(uint key) external view returns (uint, uint, uint) {
    return (records[key].x, records[key].y, records[key].z);}

So I'm wondering - in the future, if I ever decide that I want to implement and deploy a contract which calls this function, will I be able to simply declare it in the IDataAbstractionLayer interface and then use it in that contract (which will of course know the address of the (already-deployed) DataAbstractionLayer contract)?

Thank you!


texts: Solidity returning address to javascript when uint was requested

texts:
I'm early in learning solidity (that's probably obvious). No idea why I'm getting this result.

medsToBeDeveloped has a length of 0 at begining

 uint [] medsToBeDeveloped;

 function returnProductID() external returns(uint){
    uint randNum = medsToBeDeveloped.length;
    medsToBeDeveloped.push(randNum);
    potentialMedsToManufacturer[randNum] = msg.sender;
    return(randNum);
}

Javascript:

$("#requestID").on('click', function(){
announceButton("request ID");
contract.returnProductID(function(err, id){
  console.log(typeof id);
  console.log("id: " + parseInt(id) + " thatis all");
  });
})

I'm probably doing something very obvious


texts: Several small or one big contract? (deloyment cost)

texts:
Does deploying several small contracts use more gas than deploying them as one, bigger contract with the same functions (that don't interact with each other)?
How much is the difference?


texts:
I would like to simulate and observe an emergent Ethereum network, so I could draw conclusions about the main net and simulate my own code at the infrastructure level. I am looking for the best tool for the job, by best meaning well maintained and not having a very steep learning curve.

TLDR

Are you familiar with a Blockchain simulator that you would recommend?

My own requirements

See the network topology, possibly extrapolate a network graph and run algorithms on top of that graph.
Understand how and how fast the structures that contain neighboring peers information fill.

What I have found

Bitcoin-Simulator

Not Ethereum related but serves as a good reference for what I would like to find.

Found on this link.

The project is not maintained since 2016, uses ns3 and seems to have a very steep learning curve. Did not have luck in running it either.

Vibes

Possibly applicable for Ethereum.

Found on this link.

Seems to be made using React and Scala, non of which I am familiar with.

Geth simulation framework

Found on this commit.

Did not test this yet.

Related questions

How to simulate p2p network for blockchain systems?.


texts: show specific information to specific users in meteor dapp

texts:
if a have a dapp with different users, and each user has his/her own profile page they can log in to. On this profile page, the user should be able to change/add his user information (name, age, etc) which should then be saved on the blockchain. The user should only have access to see and change his own individual information. How can that be done?.
Right now I'm able get the information on he blockchain in to the profile page and change it, but it is the same information/changes for every user.
I'm using metamask and meteor.
Can anyone provide me with an example of how this could be done ? :)


texts: Adding Custom Functions To A ERC20 Contract?

texts:
Im new to contract development and i'm looking for a bit of advice relating to my token contract?

First is it ok to add custom functions to an ERC20 contract?
Do I need to use all the functions listed on this example page? Token Example
Is it ok to create a minting function within the ERC20 contract that only the owner can use?

Thanks


texts: Passwordless account and failed sends on Mist Wallet on Windows

texts:
Does Ethereum have any reliable Wallet software for sending/receiving ether on Windows?

I saw that Mist Wallet was highly recommended so I tried it.

It took 10 hours to start up (since it downloads the entire blockchain)
Somehow it set up a "main account" without asking me for a password. I was going to transfer funds to that account but luckily I googled a bit first and found that if I would have transferred funds to my "main account" I would have lost those funds due to not having the password.
The GUI apparently has no function for checking if you have the password to an account or not. The only way to find out if you can actually access an account is if you send money to the account first and then try to send it out. Personally, I would prefer to know if I have access to an account before I send money to it...
I created some accounts and asked a friend to transfer 0.001 ether to me. Then I tried transferring that ether between my acconts. What usually happens is the transaction shows up in the transaction list with "0/12 confirmations". After a few minutes it just disappears and I get no notification what went wrong. Sometimes the entire Wallet GUI turns white and unresponsive and I have to restart it. After trying for hours I still have not been able to make a transfer with the Mist Wallet.


texts: Mapping address to multidimensional uint

texts:
I'm trying to create an array contains addresses which belongs to particular transaction ID.

Array structure:

transactions[0x12345][0] = 123456
transactions[0x12345][1] = 789101
transactions[0x12345][2] = 865436

Expected output when calling getAccountTransactions():

[0] = 123456
[1] = 789101
[2] = 865436

Code:

mapping (address => mapping(uint => uint)) public transactions;

function getAccountTransactions() public returns (uint[] tx) {

    return transactions[msg.sender];

}

Compiler returns error:

  TypeError: Return argument type mapping(uint256 => uint256) is not
  implicitly convertible to expected type (type of first return
  variable) uint256[] memory.


texts: Could someone recommend which environment (i.e Microsoft or Ubuntu) is a better choice for prototyping proof of concept idea for blockchain using Ethereum together with a short description what they are good for?


texts:
When 2/3 of the validators censor 1/3 of the validators (by not validating their txs), 1/3 would get slashed heavily and 2/3 would get slashed a bit in the Casper protocol.

Isn't it very compelling for the 2/3 to censor 1/3, because the value of possible price-increase due to the heavy slash of the 1/3 is bigger then the value lost by the 2/3 due to the small slash?

How does Casper deal with this Problem?


texts: Web3ProviderEngine does not support synchronous requests on deploy to private network

texts:
I know there are many similar questions, but I've been through all of them and haven't got the answer I'm looking for.
I'm trying to deploy a smart contract (that's already been compiled and deployed in Rinkeby) to a private network.
1_initial_migrations.js
const Migrations = artifacts.require("Migrations");

module.exports = function (deployer) {
  deployer.deploy(Migrations, {from: "[address]"});
};

2_deploy.js
// migrations/2_deploy.js
// SPDX-License-Identifier: MIT
const compsc = artifacts.require("compsc");

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

truffle-config.js

const PrivateKeyProvider = require('truffle-privatekey-provider');
const { projectId, mnemonic } = require('./secrets.json');

const privateKey = "[PK]";

module.exports = {
  networks: {
    rinkeby: {
      provider: () => new PrivateKeyProvider(privateKey, `[PROVIDER_URL]`),
      network_id: 4,
      gas: 4612388,
      timeoutBlocks: 200
    },
    nodalblock: {
      provider: () => new PrivateKeyProvider(privateKey, `[IP:PORT]`),
      network_id: 4660
    },
  },
  compilers: {
    solc: {
      version: "0.8.0",    // Fetch exact version from solc-bin (default: truffle's version)
    }
  },
  db: {
    enabled: false
  }
};

And I'm always getting:
1_initial_migration.js
======================
Current account balance 0

   Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" -- Web3ProviderEngine does not support synchronous requests..

    at /node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
Truffle v5.2.6 (core: 5.2.6)
Node v10.16.0

I've read that there's a problem with some web3 functions being async but being called synchronous by Truffle (at least, I think I understood the problem that way) but I can't get what I need to change/do differently to make it work.
The versions I'm using are:
"dependencies": {
    "truffle": "^5.2.6",
    "truffle-privatekey-provider": "^1.5.0"
  }

Any help would be greatly appreciated.
Thanks,


texts: When to use "View" and "Pure" in place of "Constant"

texts:
According to the solidity 0.4.17 Release Notes

  this release finally checks the modifiers view (used to be named
  constant) and pure on functions. As a rule of thumb, use view if your
  function does not modify storage and pure if it does not even read any
  state information - but the compiler will also suggest the tightest
  restriction itself.

What does that mean in practice?


texts: How to encrypt messages to an account owner with the Ethereum public key?

texts:
As I understand it, an Ethereum account is a public/private key pair.

Is it possible to encrypt a message with the public key (how?) that only the account holder can decrypt it with his private key?

You could establish a forum where you could post such messages, for example to PM an account holder.


texts: Ethereum private chain not able to addPeer

texts:
I created a private chain with my friend with exactly the same genesis block and we wanted to connect through the admin.addPeer method. The problem is that for some reason they are able to connect to me, i.e. after adding me they showed up in my admin.peers, yet when I tried at another time to add them, the method admin.addPeer only returned true and my admin.peers showed empty []. We have tried a couple times and the same thing happened, namely that they were able to add me yet I could not add them. I am really confused about why this happened.

Here is my genesis.json file:

{

"config": {

"chainId": 16,

"homesteadBlock": 0,

"eip155Block": 0,

"eip158Block": 0

},

"nonce": "0x0000000000000042",

"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",

"difficulty": "0x200",

"alloc": {},

"coinbase": "0x0000000000000000000000000000000000000000",

"timestamp": "0x00",

"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",

"gasLimit": "0xffffffff",

"alloc": {

}

}

My friend had the same genesis file.


texts:
When a major change happen in ethereum like Softfork or Hardfork, all nodes may not agree with this. So is this change possible ?
Vitalik is creator of Ethereum. But ethereum is totally decentralized, so now Ethereum is a large network. Now Have vitalik any control over Ethereum network ?


texts: Solidity Error: Struct containing a (nested) mapping cannot be constructed

texts:
My version of solc:
"solc": "^0.7.1",

When I try to construct a struct that contains mapping, I got this error:
"Struct containing a (nested) mapping cannot be constructed"
This is my solidity code.
Campaign.sol
pragma solidity >=0.5.0;

contract Campaign {
    struct Request {
        string description;

        // I declared a mapping inside of a struct.
        mapping(address => bool) approvals;

    }
    constructor(uint256 minimum, address creator) {
        ...
    }

    function createRequest(string memory description) public onlyManager {
        Request memory newRequest = Request({

            // Here the compiler gives me an error

            description : description

        });
    }
    ...

It says
Struct containing a (nested) mapping cannot be constructed.

Please help me.


texts: No events were emitted - Exchanging ERC721 Tokens

texts:
Function to exchange ERC721 Tokens between two addresses. I am implementing this on truffle and openzeppelin 2.10. Two different tokens should be exchanged between two addresses.

Here's my contract function for exchanging ERC721 tokens:

function exchangeStars(uint256 token1, uint256 token2, address starOwner2) public {
    require(this.ownerOf(token1) == msg.sender);

    transferFrom(msg.sender, starOwner2, token1);
    transferFrom(starOwner2, msg.sender, token2);
}

This is the test I am writing for creating Tokens and exchanging between two addresses.

describe('Exchange Stars', () =>  {
  let token1 = 101;
  let token2 = 202;

  it('User 1 creates Star', async() => {
    await this.contract.createStar(starName, story, ra, dec, mag, token1, { from: account1 });
    assert.equal(await this.contract.ownerOf.call(token1), account1);
  });

  it('User 2 creates Star', async() => {
    await this.contract.createStar(starName2, story, ra, dec, mag, token2, { from: account2 });
    assert.equal(await this.contract.ownerOf.call(token2), account2);
  });

  it('Users exchange Stars', async() => {
    await this.contract.exchangeStars(token1, token2, account2);
    assert.equal(await this.contract.ownerOf.call(token2), account2);
    console.log(await this.contract.ownerOf.call(token2));
  });

});

Here's the result for my tests:

Exchange Stars
  √ User 1 creates Star (129ms)
  √ User 2 creates Star (116ms)
  1) Users exchange Stars
> No events were emitted


texts: Does one slow node hold up contract execution in the network?

texts: As I have been reading about smart contracts, I've learned that every node on the network executes every contract.  So is a contract considered executed only after all nodes have verified it?  What if I have a node that is really slow and takes a while to execute contracts (because that node is the resurrection of that Pentium III -- "Intel Inside!" -- box I resuced from my parents basement)?  Does that adversely hold up the folks who are waiting on that contract?


texts: Remix - stuck on creation of contract pending

texts:
I am using Remix in Chrome.

When I click on 'create' my contract gets stuck on 'creation of contract pending'.

Can someone help me please?

Thanks in advance


texts: Benefit of using Infura for deploying smart contract

texts: I have gone through Infura's website, blog and other resources but I am not clear about the benefit I'll get from using it for and after deploying my smart contract for an ICO sale. Do I really need it? Frankly, most of the things are going above my head. Can somebody explain it to me in simple terms?


texts: Does getPastLogs require arvhived parity node?

texts:
Talking about parity here:

--pruning=[METHOD]
    Configure pruning of the state/storage trie. METHOD may be one of auto, archive, fast: archive - keep all state
    trie data. No pruning. fast - maintain journal overlay. Fast but 50MB used. auto - use the method most recently
    synced or default to fast if none synced. (default: auto)

And I use web3.eth.getPastLogs to query old logs.

Do I need to use "archive" node in oder to get all information about past logs?


texts: How does a decentralized application interact with the ethereum network?

texts: I want to build a integrated application focusing on only one contract, the deployment and transactions sending, how can such an application communicate with the ethereum network without geth interface without mist? the RPC interface? any detailed documentations regarding this you recommend?


texts: How to properly call getter methods from a specific keypair in web3

texts:
In some of my getter methods I'm using msg.sender to deal with access rights. However this just gave me errors, because every single call just comes from the first account of web3.eth.accounts. My question is: In my frontend-application I have a keypair of PubK and PK, and I want to call these getter-methods under this identity.

Here some information about how I am calling my contracts methods:

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

  var abiContract = web3.eth.contract([...]);

  var contract = abiContract.at(contractAddress);

And now I can call all the methods from the contract-object. For all state-changing transaction I created a method that uses raw transactions. I am just not sure of how to use these for getter-methods, because all I get returned is the transaction hash, nothing from the return-statements.


texts: Can anybody say for sure, if the events that occur in failed transactions (i.e. before "throw") will not be logged?


texts: a uint storage variable can't be reset to 0

texts:
when test a contract i meet a confusing condition, so i tracked it by commented out per line, and distinguish it's a uint storage variable be reset to 0. To make it clear, i write a test contract like below, and it reappear this error.

pragma solidity ^0.4.18;

contract testReset {

    uint public _num;

    constructor() public {
    }

    function _set(uint newnum) public {
        _num = newnum;
    }

    function _reset() public {
        _num = 0;
    }
}

1) set to any number like 20;
2) reset to 0, but remix report error: "base fee exceeds gas limit."

my environment is remix + ganache-cli, and compiler version is 0.4.24.

is it a solidity's bug?


texts:
I sent this transaction with 74 GWEI and 185421 gas limit. So far my calculations: 74 * 185421 -> about 6.6 USD, at the time of writing.
The screenshot above shows 1.04 USD. Below it says gas used ~15%.
What's going on? Why does the transaction stop at 15% of the limit (if I understand this correctly)?


texts: transfer of litecoin from mobile wallet to metamask

texts:
I have litecoin in an mobile wallet (bx.in.th) and would like to know how to send this to my metamask wallet.  Not finding answers.

Thanks.


texts: How to returns fixed length array in solidity

texts:
I get the following error, how to resolve it?
Expected type name function Array_Data () public view returns (memory uint []) {^ ---- ^.

pragma solidity >=0.5.0 <0.6.0;

contract Lock {
    uint[] public _gas_left;

    function closeAccount() public {
        _gas_left.push(gasleft());
    }

    function Array_Data() public view returns(memory uint[]) {
        uint[] memory arrayOfgas = new uint[](20);
        for (uint i = 0; i < _gas_left.length; i++)
            arrayOfgas[i] = _gas_left[i];
        return arrayOfgas;
    }
}

How can this be resolved?


texts: How to change uniswap router address after deployment of contract?

texts:
I deployed a contract with the wrong router address hardcoded like this:
    IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F);

Now I can't remove liquidity or exchange tokens on pancakeswap. How do I work around this problem? I know it's possible because I copied this contract from ASS Coin and they obviously found a way around it.


texts: Explanation for small variation in gasUsed while recursively deploying same contract

texts:
https://github.com/christianlundkvist/simple-multisig/blob/master/contracts/SimpleMultiSig.sol

I'm deploying the above contract recursively and I find that the gasUsed varies by specifically 12 gas. The array of owners stays the same length between deploys, however the addresses change. Could the change in addresses change effect the computation cost?

gasUsed: 1391022
 gasUsed: 1391010

  constructor(uint threshold_, address[] owners_, uint chainId) public {
    require(owners_.length <= 10 && threshold_ <= owners_.length && threshold_ > 0);

    address lastAdd = address(0);
    for (uint i = 0; i < owners_.length; i++) {
      require(owners_[i] > lastAdd);
      isOwner[owners_[i]] = true;
      lastAdd = owners_[i];
    }
    ownersArr = owners_;
    threshold = threshold_;

    DOMAIN_SEPARATOR = keccak256(abi.encode(EIP712DOMAINTYPE_HASH,
                                            NAME_HASH,
                                            VERSION_HASH,
                                            chainId,
                                            this,
                                            SALT));
  }


texts: Is it possible to put tax lien certificates on the blockchain?

texts:
Tax lien certificates are investment vehicles issued by a county taxing authority secured by unpaid tax liens on property.

Is it possible to put these assets onto the blockchain so they can be traded without the participation of the issuing government agency? If so, how would that occur? The biggest challenge seems like it would be the gatekeeping since the taxing authority will not do anything with the blockchain so a trusted third party would have to do some gatekeeping — at least initially.


texts: How to store value (string or hex) in ethereum blockchain / transaction?

texts:
I have been looking through various tutorials (many of them outdated or with broken links) to figure out how to store and retrieve a simple string or hex value in the ETH blockchain. For my purposes (and intended application I am developing) it would be  best to be able to interface with the blockchain via Python.

I have tried using web3 and pyethereum with not much success. The furthest I have gotten is using the following code with the web3 interface.

What pieces am I missing and how can I properly store and retrieve a value on the ETH blockchain?

How do I create a contract and store / retrieve a value from it?

def eth_black_magic(hex_value):

    web3 = Web3(HTTPProvider('http://localhost:8545')) # what URL should I point at?

    user1 = 'xxx' # what goes here?
    user2  = 'xxx' # what goes here?

    transaction = {'from': user2, 'to':user1, 'data': hex_value}

    transaction_hash = web3.eth.sendTransaction(transaction)


texts:
I am running my private net on localhost and keep getting errors like "Gas price too low for acceptance".

Is it possible to disable "gas" entirely for testing purposes?

TIA


texts: Is it possible to trade BTC and other altcoins on Ethereum's blockchain? If so, how?


texts:
We've created and deployed a contract to mint and issue an ERC721 token. I've gone to our admin page in our dapp and "sent" 3 of them to my personal address.

When I check my address in etherscan I see the 3 listed in my erc721 token txns. When I check for those token id's in truffle console looking at the live network they return my address.

So that all seems good to go. Should I be surprised that the tokens don't show up in a coinbase wallet or enjin wallet?

I'm wondering if there's a wallet that will show them, or maybe if there's something wrong with the contract I deployed and I didn't actually mint a fully compliant 721.

Thanks for any ideas.
Kevin


texts: Solidity. Find whether a key exists in a mapping. Then get its value

texts:
I have a simple mapping:

 mapping(address => string) professorsExam;

How can I check if msg.sender is a key in this mapping, and if it is, get its value? If it isn't I should return something.

string memory professorsExamHash = professorsExam[msg.sender];  // The hash of the exam owned by msg.sender
if(professorsExamHash == 0x0){
    return "No exam hash asociated with this professor address";
}

This doesn't work,

  TypeError: Operator == not compatible with types string memory and
  int_const 0

I have tried many other things. But == isn't compatible between anything so far.


texts: how do etherscan get all the token balance of particular address?

texts:
I want to create service where just by providing address i can fetch all the token (erc 20 & erc721) balance just like etherscan for a private network?
is there any way to do it by writing for loop for somthing?
do etherscan store its data in some database?
how do etherscan work in the core?


texts: Output order changes after the event triggered

texts:
I'm new to solidity so for educational purpose I'm developing EVoting application.
I've written a smart contract for candidate registration and also developed UI for getting the registered candidate list in the form of table on web page.

I've written event such that after registering new candidate the event triggers and by using which I'm adding that record to the table dynamically.

Now what happen is whenever event triggers I get newly added candidate in the table but the order of candidates changes i.e. table rows take random positions like instead of 1,2,3,4 it shows 3,4,2,1 etc.

Then I need to refresh page several times to get it done properly.

This is my table code,

                                #
                                Name
                                Age
                                Street Address
                                District
                                State
                                Pincode
                                Vote Count

This is the JavaScript to add records to table,

App.contracts.RegisterCandidate.deployed().then(function(instance)
      {
        registerCandidateInstance = instance;
        return registerCandidateInstance.candidatesCount();
      }).then(function(candidatesCount) {
        var candidatesResults = $("#candidatesResults");
        candidatesResults.empty();

        for (var i = 1; i <= candidatesCount; i++) {
          registerCandidateInstance.getCandidate(i).then(function(candidate) {
            var id = candidate[0].toNumber();
            var name = candidate[1];
            var age = candidate[2].toNumber();
            var street_address = candidate[3];
            var district = candidate[4];
            var state = candidate[5];
            var pincode = candidate[6].toNumber();
            var voteCount = candidate[7].toNumber();

            // Render candidate Result
            var candidateTemplate = "
" + id + "	" + name + "	" + age + "	" + street_address + "	" + district + "	" + state + "	" + pincode + "	" + voteCount + "
"
            candidatesResults.append(candidateTemplate);
          });
        }

Please Help !!!


texts: Where was the example web app to send Gavin Ether?

texts:
I once found an example webapp where you could send Gavin ether through a webform.
Anyone know where it was?


texts: Pool mining: How is DAG generation possible without knowing the block number?

texts:
This is little bit similar to this: Do i need to be synchronized to blockchain when creating DAG for mining on pool? and this https://github.com/ethereum/go-ethereum/issues/2333

Essentially pool sends seed hash used to generate the DAG, what I don't understand is how is this done without the block number.

In https://github.com/ethereum/wiki/wiki/Ethash the Hashimoto loop expects to know cache size which we can get only with block number.

So my question is: How is mining done with only the parameters from eth_getWork? And ideally keep it in terms of Ethash specification (https://github.com/ethereum/wiki/wiki/Ethash#defining-the-seed-hash)


texts:
Hi I am planing on sniping up a etherum geth full node for querying purposes planing on using

https://github.com/ethereumproject/explorer
block explorer repo

1 - For bitcoind I used  -txindex=1 to enable indexing what should I use here on a geth ?

2 - I want to look up information about etherum tokens(erc20, ether classic) what configurations do I need to change ?


texts: I want to input address (0) in function argument in Remix.org

texts:
function vote(uint index, uint select, address _voter) public onlyActiveProposal(index) returns(bool)

I want to input address(0) in function argument

Like this.


texts:
One thing I try to understand is the limitation of smart contracts. I was looking into ICOs and I always asked a question:

  Is it possible to implement an 'enterICO' function without requiring
  users to call the function?

I will try to explain it with an example out of context:

pragma solidity ^0.4.17;

contract ICO {
    string message; /// just assume we have a function which allows us to set a message

    function enterIco() payable public {
        if(msg.value == 0.00000001 ether)
        {
            return message;
        }
    }

}

For this kind of example, we can assume that on front-end you will have some web3js which will allow you to connect MetaMask on user side and call the enterIco function when a user clicks on the button.

Can we make this function run automatically when the user doesn't have access to the button? For example, the user sends Ethereum from their own wallet to the contract address without clicking on the button and function is automatically executed.

This example can be referred to ICOs. Could a user use their wallet and smart contract address to participate in the ICO?

P.S I know ICOs shouldn't be implemented this way because they require KYC however I am curious to know if they could or if solidity limits this kind of behaviour.


texts: How can I slice bytes, strings, and arrays in Solidity?

texts: Is it possible to slice variables in Solidity?