texts:
I have two contracts, an active contract A is interacting with the external world and many passive contracts P (dynamically added) are designed to trigger some functions when in contract A certain conditions are met.

Therefore contract A is supposed to call a callback function of each of P contracts; I was wondering what would be the best way to register a callback function of newly added P into already deployed contract A?

contract A{

   uint numberOfContractsAdded;

   struct ToCallBackContracts{
     address contractAddress;
     bytes4 contractMethodToCall;
     bytes32 theOnlyArgument;
   }

   mapping(uint -> ToCallBackContracts) contracts;

   constructor A(){}

   function triggeredFromOutside(bytes32 param)public returns (bool){
     for(var i=0; i<numberOfContractsAdded; i++){
       //2- how? call the callback function of each registered contract
     }
   }

   function registerCallback(bytes4 _cMethod, address _cAddress){
      //1- how? to save contract/method, number of parameters to receive?
   }
}

contract P{
    address addressOfA;
    constructor P(address _addressOfA){
        addressOfA = _addressOfA;
    }

    function _callback(bytes32 param){
       //do something
    }

    function callFromOutsideToRegisterWithA(bytes32 param){
       //3- how? to register with A
    }

}

There are 3 HOWs pointed out in the code for better understanding to summarize the question if I understand it right..

disclaimer: code is not tested/compiled/checked for syntax and only for demonstration purposes.


texts: Which provider ethers.js is using as default?

texts:
In ethers.js the provider is
ethers.getDefaultProvider();
Actually I am running nodejs on server and not using any node
Here which provider I am using?
Thank you.


texts:
I am always getting this erros with get calls i am using React, Truffle, metamask and Ganache

  Uncaught (in promise) Error: Invalid number of arguments to Solidity function at Object.InvalidNumberOfSolidityArgs (errors.js:25) at SolidityFunction../node_modules/web3/lib/web3/function.js.SolidityFunction.validateArgs (function.js:74) at SolidityFunction../node_modules/web3/lib/web3/function.js.SolidityFunction.toPayload (function.js:90)at SolidityFunction../node_modules/web3/lib/web3/function.js.SolidityFunction.call (function.js:131)
  at contract.js:135
  at new Promise ()

React:

changeLastName(e){
e.preventDefault();
let id = e.target.dataset.somefield;
this.contarct.getLastName(id).call().then((lastName)=>{

this.setState({lastName:lastName});

solidity:

struct {
string lastName;

}
getLastName(unit256 _id)public view returns (string){
unit256 id = customersIndex[_id];
return customers[id].lastName;

}


texts: Can the stalker attack in TheDAO be stopped?

texts:
https://github.com/slockit/dao/wiki/Why-The-Stalker-attack-is-a-non-issue#a-way-to-guarantee-you-get-your-eth says:

  Assuming the attacker also voted yes in all of the new Curator
  Proposals, in the last possible block move the DAO tokens from you
  main account to one of the 10 other accounts (choose a random one) and
  call splitDAO().

What does "in the last possible block" mean?  How is this a "guarantee you get your ETH" when a transaction can't be forced in a particular block?


texts: How is the output of a contract call encoded?

texts:
Hi I have a proxy contract A which delegates function execution to implementation contract B using the standard OpenZeppelin code:
assembly {
            calldatacopy(0, 0, calldatasize())

            let result := delegatecall(gas(), _implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 { revert(0, returndatasize()) }
            default { return(0, returndatasize()) }
        }

when I tried to call a function getter for a result which is supposed to be [10, 100] I got the string 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000064. What is this encoding and which library I can use to decode it. At first I thought it was RLP encoding but I checked with some RLP decoders but it didn't check out. Thanks


texts: Can I monitor contract attributes without sync the whole block?

texts:
I deployed a contract in my private ethereum network using geth.

Now I am only intrested in some specific atrributes of this contract,

can I only monitor these values without downloading the whole latest block?


texts:
I have trouble understanding the underlying mechanism for the UJO Music Portal, that helped Imogen Heap sell her album online. There is a smart contract that enables people to pay using ETH with MetaMask and in the end they receive a link to download the song.

Is the link to the song stored in the smart contract? If so, can someone access the smart contract to read the link without paying?

I'm basically trying to come up with a mechanism to pair documents and payments in a smart contract. If you don't pay you should not be able to access the document/the link to the document/the decryption key to the document.

Thanks for your inputs.


texts: How do I make my smart contract available for interaction with Metamask?

texts:
I am using OpenZeppelin starter kit. I wrote a smart contract that simply contains two integers which can be called. I compiled and deployed the smart contract to my local Ganache blockchain. I have started my React Dapp and it's connected to Ganache through Metamask (I can see my account balance for example).

Please see my repository: https://github.com/Lennardmulder/ozreact

I now want my Dapp to have a button that allows the user to call the count function and show its results. I suspect I first need to use something like

var myContract = new web3.eth.Contract([...], '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe', {
    from: '0x1234567890123456789012345678901234567891', // default from address
    gasPrice: '20000000000' // default gas price in wei, 20 gwei in this case
});

With the right ABI and address inserted, to allow Metamask to interact with the smart contract? But where exactly do I define this in my code?


texts: Error: exceeds block gas limit undefined (2)

texts:
I am using geth 1.9.12. When I try to deploy any contract (below the code), using the console, I get the error: Error: exceeds block gas limit undefined What exactly is this error?

Thanks in advance.

pragma solidity ^0.4.25;

contract SampleContract {

bytes32 testValue;

function setValue(bytes32 value, uint256 requestCode)
{
    testValue = value;
    ValidationAndPaymentEvent(requestCode);
}

function getValue() public view returns(bytes32)
{
    return testValue;
}

event ValidationAndPaymentEvent ( // STEP 7
    uint256 requestCode
);

}


texts: Node unable to connect to the constellation node (quorum)

texts:
Looking at the 7Node example from:
https://github.com/jpmorganchase/quorum-examples/tree/master/examples/7nodes

and trying to configure my network but have ran into a lot of trouble over the days, trying to get geth to take quorum options or the --permissioned flag having errors in a geth release, trying to rebuild etc. I am frustrated and I am weak. The documentation isn't that great. And it does not tell you how the constellation node and your geth node should interact. I looked at the scripts and I tried but I am not getting anywhere. I only got this far in 3 days.

CONFIG:

Geth: 1.7.2-stable-d4a1b095

go version go1.9.4 linux/amd64

Constellation Node 0.3.2

start constellation node:

nohup constellation-node --url=https://127.0.0.1:9001/ --port=9001 --workdir=qdata/c1 --socket=tm.ipc --publickeys=tm.pub --privatekeys=tm.key --othernodes=https://127.0.0.1:9001/ 2> const1.log

nohup.out:

Unlocking tm.key
Unlocked tm.key

const1.log:

nohup: ignoring input and appending output to 'nohup.out'
16:47:16 [INFO] Log level is LevelWarn
16:47:16 [WARN] tls-server-cert.pem's hostname (127.0.0.) is different from the one given in the configuration (127.0.0.1). This may cause connection problems.
16:47:16 [WARN] tls-client-cert.pem's hostname (127.0.0.) is different from the one given in the configuration (127.0.0.1). This may cause connection problems.

script used to generate:

#!/bin/bash
set -u
set -e

echo "[*] Starting Ethereum nodes"
set -v
ARGS="--nodiscover --raft --rpc --rpcaddr 0.0.0.0 --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum --emitcheckpoints"
PRIVATE_CONFIG=qdata/c1/tm.ipc nohup geth --datadir qdata/dd1 $ARGS --permissioned --raftport 50401 --rpcport 22000 --port 21000 2>>qdata/logs/1.log &

1.log:

nohup: appending output to 'nohup.out'
    panic: MustNew: Failed to connect to Constellation (qdata/c1/tm.ipc): Get http+unix://c/upcheck: read unix @->tm.ipc: i/o timeout

    goroutine 1 [running]:
    github.com/ethereum/go-ethereum/private/constellation.MustNew(0xc42001400f, 0xf, 0xc42001400f)
            /home/ubuntu/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/private/constellation/constellation.go:75 +0x18d
    github.com/ethereum/go-ethereum/private.FromEnvironmentOrNil(0x1054ac3, 0xe, 0xc4201bd3a0, 0xc4201bd380)
            /home/ubuntu/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/private/private.go:19 +0x6e
    github.com/ethereum/go-ethereum/private.init()
            /home/ubuntu/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/private/private.go:22 +0x69
    github.com/ethereum/go-ethereum/core.init()
            <autogenerated>:1 +0x104
    github.com/ethereum/go-ethereum/cmd/utils.init()
            <autogenerated>:1 +0x6e
    main.init()
            <autogenerated>:1 +0x6a

Node static-node.gensis:

["enode://60b56f0bda5047ccb7cc1d18f828da62eb0d13241b213e5ee04e88d8fbfc145da98de8e019faab9a6d76124b92d07b0e92b084137a396b2cf72334024cc1c6dc@[::]:21000?raftport=50401",
"enode://2d34e98237a26e5e1f56ce8909e946df66476b57c8239f9db310de058fe08afc8ea2f40b979830ccf94207a7069175ae2ad1777a9fe2f5683fda2d04c25963d2@[::]:21001??raftport=50402",
"enode://5cda3acad3eb4be84c05d33b973886f152678386c65290281d59f19ff18ee5a7fe95626d47dc909dcb9c3ede1273aa6ff47b03a4d758ba68d02a4b4996e34fa3@[::]:21002??raftport=50403"]

gensis.json

{
  "alloc": {},
  "coinbase": "0x0000000000000000000000000000000000000000",
  "config": {
    "byzantiumBlock": 1,
    "chainId": 1,
    "eip150Block": 1,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip158Block": 1,
    "isQuorum":true
  },
  "difficulty": "0x0",
  "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0xE0000000",
  "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
  "nonce": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": "0x00"
}


texts:
I am looking at an arbitrage bot on BSC and I have noticed something that I quite can't explain. I've seen that every time the bot does a successful trade, various failing transactions with the same input data follow.
Can this be because the bot streams the same transaction to different nodes, in order to increase its likelihood  of having the transaction included in the following block? If someone knows the reason, please explain, thanks!


texts: is light-wallet has problem for keys and addresses?

texts: somebody said for light wallet on github, the address generated and private key is wrong? I saw on post, is that true?


texts: web3j event listening on android project

texts:
I trying to listen events from smart contract but my code isn't working. what's the problem?

Event event = droneChain.UPDATEMISSIONSTATE_EVENT;
String encodedEventSignature = EventEncoder.encode(event);
EthFilter filter = new EthFilter(DefaultBlockParameterName.LATEST, DefaultBlockParameterName.LATEST,contractAddr).addSingleTopic(encodedEventSignature);
droneChain.updateMissionStateEventObservable(filter).subscribe(updateMissionStateEventResponse -> {Toast.makeText(MapsActivity.this, updateMissionStateEventResponse._from, Toast.LENGTH_SHORT);
},Throwable::printStackTrace);

here is my code.

any body help me


texts: Is there a big difference in hashrate between mining on Linux and Windows?

texts: I am wondering if there is an advantage in using an OS over the other? I would like to know if anyone might have run some test. I am mostly interest in performance differences between Windows 10 and Ubuntu for the R9 280x using Genoil's miner.


texts: Flashloan callFunction being called internally

texts:
I had a chance to look at this contract.
contract Flashloan is DyDxFlashLoan {
    uint256 public loan;

    constructor() public payable {
        (bool success, ) = WETH.call.value(msg.value)("");
        require(success, "fail to get weth");
    }

    function getFlashloan(address flashToken, uint256 flashAmount) external {
        uint256 balanceBefore = IERC20(flashToken).balanceOf(address(this));
        bytes memory data = abi.encode(flashToken, flashAmount, balanceBefore);
        flashloan(flashToken, flashAmount, data); // execution goes to `callFunction`
    }

    function callFunction(
        address, /* sender */
        Info calldata, /* accountInfo */
        bytes calldata data
    ) external onlyPool {
        (address flashToken, uint256 flashAmount, uint256 balanceBefore) = abi
            .decode(data, (address, uint256, uint256));
        uint256 balanceAfter = IERC20(flashToken).balanceOf(address(this));
        require(
            balanceAfter - balanceBefore == flashAmount,
            "contract did not get the loan"
        );
        loan = balanceAfter;

        // Use the money here!
    }
}

In getFlashloan() it calls the line flashloan and the comment says

execution goes to 'callFunction'

How does this work? is it somehow calling it internally?


texts: Ethereum's State sharding vs Zilliqa's Network Sharding

texts:
From Zilliqa what I get is they have temporary transactions done in parallel in different shards then merged into a main chain.

What's the difference between the latest sharding specification for Ethereum vs Ziliqa's sharding design?


texts: Can there be a confirmation of disappeared transaction?

texts:
When confirming that a transaction happened, I can simply check if the transaction is 12 or more blocks deep. Can a same approach be applied to confirming disappeared transaction?

With my research, looking for confirmed transactions with higher nonce while the original transaction being gone, proves it.

But I need a simpler approach. Does waiting for 12 blocks right after my transaction getting removed from pending pool, verify a disappeared transaction?


texts: Recreate contract after any changes to code in Remix IDE?

texts:
I'm using Remix connected to the Geth (Rinkeby) Web3 Provider to write and debug a very basic contract.

Question: After making changes to my contract in the IDE, is compiling sufficient to test the changes, or do I need to deploy a whole new contract for the changes? And if compiling alone is sufficient, how do I update the controls (that allow me to interact with my contract) on the 'Run' tab to reflect the changes? Thanks.


texts: How can anyone publish a contract to an address which has been generated in advance?

texts:
There is a contract which source code tells that the contract address had been generated in advance (there is a comment there), before the contract was uploaded to the network.

The address beginning is quite unusual: 0x000000...

As you can see, it shows that address was specially generated to have these zeros. One can think that these zeros are the simple luck, but the contract uses two additional addresses to its purposes and they begin 0x100000... and 0x200000...

How is this possible to upload th contract to the specific address and do this mean that the author have a privat key for the contract as it have been generated in advance?


texts: Create a smart contract with ether balance

texts:
If i want write a smart contract with having a ether balance what should i do?

for example writing a smart contract that send a ether to a address.


texts: what is the best to signing a message , from javascript or solidity?

texts:
I am trying to make a small DApp using web3, ganache, Metamask, javascript and Remix.

My DApp has to sign a message and verify it, and I see two ways to sign a message.

One using web3.eth.sign(...), and the other using a contract function from this link:

  function recover(bytes32 hash, bytes signature)
    public
    pure
    returns (address)
  {
    bytes32 r;
    bytes32 s;
    uint8 v;

    // Check the signature length
    if (signature.length != 65) {
      return (address(0));
    }
    // Divide the signature in r, s and v variables with inline assembly.
    assembly {
      r := mload(add(signature, 0x20))
      s := mload(add(signature, 0x40))
      v := byte(0, mload(add(signature, 0x60)))
    }

    // Version of signature should be 27 or 28, but 0 and 1 are also possible versions
    if (v < 27) {
      v += 27;
    }
    // If the version is correct return the signer address
    if (v != 27 && v != 28) {
      return (address(0));
      //address(0)
    } else {
      // solium-disable-next-line arg-overflow
      return ecrecover(hash, v, r, s);
    }
  }

Is it better to sign local using javascript function or to sign in solidity?


texts: Why Are Balances Not Displaying On An Imported Wallet in Mist? (It Does Appear on Etherscan)

texts:
I just got a new computer, installed Mist 0.8.8, synced the entire blockchain, then copy-pasted a UTC wallet file from my old computer into my new computer's %appdata%>keystore directory. The wallet appears in Mist when I run it. However, all balances are 0. It should have both Ether and DAO Tokens in it (DAO Tokens have already been added to watchlist). When I lookup the address on Etherscan, it shows the correct balances.

How could this occur? How can it be fixed so I make transfers and call contracts in Mist?


texts: How can I trade an ERC-20 token with a specific counterparty?

texts:
To trade an ERC-20 token, I can go on Uniswap and trade with the liquidity pool.
How can I make a trade with a specific wallet? Do I need to find a smart contract that manages the bids and transfers?


texts: Are oracles too slow for DEFI arbitrage?

texts:
It seems that a lot of platforms that make you money via 'arbitrage' rely on Oracles to find a profitable spread opportunity. I assume users are competing against other users (on the same platform) for the opportunity, but they will be limited by the rate that their oracles are updated.
Meanwhile, coders can create their own arbitrage solution mostly off-chain that does not require oracles to get prices, and have near real-time data. Is it fair to say that these solutions will always be the most successful arbiters?


texts: Uploading big contract to the Ethereum blockchain

texts: As far as I understand, there is a limit on the block size. But what if I want to upload a large contract that exceeds the blocksize? Will it not be allowed?


texts: Updated: Is it possible to hide the sender or receiver of transactions by "zk-SNARK" or "Bulletproofs"?

texts:
To support the user privacy, is it possible to hide the sender address or receiver address of transactions by "zk-SNARK" or "Bulletproofs" ? Or we’ll be able only to hide the value that is mapped to an address ?

Assume the following mapping:

mapping (address => bytes32) userData;

Normally, using non-interactive zero-knowledge proofs (like "zk-SNARK" or "Bulletproofs"), we are able to hide the value that is mapped to an address (i.e. userData) as follows:

mapping (address => bytes32) userDataHash;

And then by zero-knowledge proofs, we can prove that if userDataHash meets a condition? For example, prove that an encrypted number is in a given range, without revealing anything else about the number.

However, assume that instead of Data, we want to hide sender of transaction (i.e. address). We want to keep confidentiality of the user/sender himself, instead of their data.

Is it possible ? And if yes, How ?

Is it possible to use Confidential Addresses for this purpose?


texts: Does block difficulty adjust with different gas limits?

texts: Ethereum has a dynamic gas limit, a market governed by the miners. Does the block difficulty change if the gas limit is changed? For example with an increased gas limit from 3 million GAS to 6 million GAS, would the block difficulty increase, or is the miner reward adjusted, or how is the crypto economic game theory balanced for different gas limits?


texts: How to import account form geth console to metamask (private blockchain)

texts:
I want to import accounts from geth console(private network) but I can't. I have UTC file when I create account with geth but when I open file and copy mac and paste to metamask (private key) account not match between geth and metamask.

I want to use account from geth to metamask.


texts: What happens when you don't check your data and ask questions first... should I delete this?

texts:
Take look at my contract transaction history:
https://ropsten.etherscan.io/address/0xe42d26e4a66e9562b40bde44e4ceff706fd67d20

I verified my contract so you can see everything using etherscan interface!!

You will notice I set sell/buy price in this transaction (I called it multiple times).
https://ropsten.etherscan.io/tx/0xd03f3b07cb2ba66d3b9661ce584ff11873c517a830b0dda456863415c7954116

In this transaction I set buy price to 100.
You can read that it is indeed so:
    https://ropsten.etherscan.io/address/0xe42d26e4a66e9562b40bde44e4ceff706fd67d20#readContract

In these transactions I bought tokens for 0.01 ether

https://ropsten.etherscan.io/tx/0x41958bf1de73ece017be737eab94db1040d2a5614048011c95027be4e01e4782
https://ropsten.etherscan.io/tx/0xf57bbbf3ee155a9992c229c473d328e0e7ccbe8f3fd14325d474e22c450a7ec0

and some others.

What is evident from log is that I received 0.0001 tokens in return as if msg.value was 0.01 and not 10000000000000000 wei.
From official docs msg.value (uint): number of wei sent with the message

Why is result interpreted as if msg.value is in ether and not wei?

I am testing a contract on a Ropsten network using geth 1.8.8 with command line:

geth --testnet --datadir="x:\\a\\b\\GethWithRopsten\\"

In order to connect to geth I use web3js version 1, beta 34 running from node.js:

var web3 = new Web3(new web3.providers.IpcProvider('\\\\.\\pipe\\geth.ipc',net));

Compiler I use is solc 4.24 release.

Relevant code is (this code is almost all taken from example ERC20 token):

function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return a / b;
}

function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
    sellPrice = newSellPrice;
    buyPrice = newBuyPrice;
}

function buy() payable onlyIfEnabled public {
    uint256 amount = msg.value.div(buyPrice);
    _transfer(this, msg.sender, amount);
}

and

function _transfer(address _from, address _to, uint256 _value) internal returns (bool){
   require (_to != 0x0);
   require (balanceOf[_from] >= _value);
   require (balanceOf[_to].add(_value) > balanceOf[_to]);
   require(!frozenAccount[_from]);
   require(!frozenAccount[_to]);
   balanceOf[_from] = balanceOf[_from].sub(_value);
   balanceOf[_to] = balanceOf[_to].add(_value);
   emit Transfer(_from, _to, _value);
   return true;
}

Thanks


texts: Specify address for transaction in truffle test

texts:
I want to specify the address I perform a transaction with in my truffle test.

My test looks approximately like this:

contract('Test contract', async (accounts) => {

    let contract;

    before(async () => {
        contract = await Contract.new();
    });

    it("Check something...", async () => {
        await studentV1.addPerson("Jon", "Doe");
        await studentV1.addPerson("Max", "Musterman");

        //....
    });
});

The contract methode addPerson(...) works approximately like this:

function addPerson(string _firstname, string _lastname) public {
    persons[msg.sender] = Person(_firstname, _lastname);
}

Now I want to call my test at await studentV1.addPerson("Jon", "Doe"); with account[0] and the line below with account[1] so my map will also get two different entries. How can I do this? By default truffle test uses for each transaction and call accounts[0].

Im working with the truffle develop chain which automatically creates 10 accounts on startup.


texts: In Web3, why is simply signing transactions with private key more secure than unlocking the account and using sendTransaction?

texts: In Can anybody Point out the Difference between Web3.eth.sendTransaction and web3.eth.signTransaction?, the author of https://ethereum.stackexchange.com/a/73705/61096 mentions how unlocking an account in code is not a good idea and proceeds to sign a transaction using the private key directly. But why is using the private key better than unlocking the account?


texts: What would happen if I would deploy contract as 1st and 129th transaction?

texts:
According to how contract address is computed my 1st and 129th transaction as a contract deployment should have the same address. What would happen if I was to deploy them in that order?

I already tried with ganache but it refuses to send more than 128 transactions.


texts: Auction contract problem regarding highest bid display

texts:
I have an Auction contract which has a function like this:

function bid() payable{
    //calculate and store highest bid value
}

But because each transaction takes time to mine, so when a user bids the highest amount, the highest bid displayed for other users takes time to be updated, which is undesirable because other users can't know what is the current minimum amount they have to bid to win.

So what should be a good solution to this problem? I thought of storing a highest bid variable in the server side that get updated whenever a user bids, but this could run into a problem when the transaction is canceled or violates something and reverted.


texts: Parity --warp stops syncing at block 2,626,057

texts:
The title says it all. I'm testing parity with --warp pruning fast. Was thrilled having started a node in ~10 min and synced the chain in ~1,5 hours. One day later I try to do transactions with the graphical interface (great user interface!), but I can't receive, because my sync stops at block 2,626,057. Restarted several times, but no success until I killed the -warp option. Now it works.

Is this normal or a specific bug of my system?


texts: How to find out the number of Validators of a transaction if i have its transaction hash

texts:
I want to find out how many validators have validated my transaction.My transaction has is 0x051430dc5cd84c44954e43b25f8709c9c1a1c634f384ec6dd7610f6f945732e1

can anyone tell me how many validators validated my transaction in Ethereum blochain.

please help me on this.


texts: public struct showing stack overflow error

texts:
I'm trying to add more then 9 data in public struct it's showing me below error

Internal compiler error: Stack too deep, try removing local variables.

if I remove the public keyword from User public user; then works fine or I maintain 9 data in struct then works fine.

contract UserIndendity{

    struct User {
        address userAccount;
        address photo;
        string fName;
        string lName;
        address signature;
        string email;
        uint mno;
        string street;
        string city;
        string state;
        string country;
    }

    User public user;

    function UserIndendity(address _userAccount,address _photo,string _fName,string _lName,address _signature,string _email,uint _mno,string _street,string _city,string _state,string _country){

        user.userAccount=_userAccount;
        user.photo=_photo;
        user.fName=_fName;
        user.lName=_lName;
        user.signature=_signature;
        user.email=_email;
        user.mno=_mno;
        user.street=_street;
        user.city=_city;
        user.state=_state;
        user.country=_country;
    }
}

any one have solution for above issue?

I have also added issue on Github : Link


texts: Vyper OPCODES gas estimate at compile time

texts: I am trying to dissect Vyper at lower levels to understand how the gas estimates are generated. I tried following the yellow paper and I searched every single line of the compiler but I can't get it right... Is there anyone that can lead me in the right direction? Giving me a hint about how it's done and why the git compiler gives out much higher estimates than the online one? Thanks to anyone who will provide me something.


texts:
I working on Private Block chain and doing code GoLang for all block chain relate functionalities. I am making on API's to interact with  my Pvt Block chain instead of using web3js.
Now I want to view transaction history of specific accounts, how I can achieve that with GoLand and ETH API.

Regards
AKM.


texts:
I came across this statement online in one of the articles "In order to read, you need to verify the chain".  I am not able to comprehend this statement. Does that mean I should always run a node to be able to read?

What about using remote clients? How is using remote clients not trustless?


texts: How exactly is the voting for the winning block regulated?

texts:
When using PoW, after an Ethereum miner has created a block, that block is propagated to peers (for verification and acceptance into the ledger). Obviously, the ETH reward for the mined block is not immediate. Therefore, there is some "voting" which (on success) triggers the payout to the miner.

I struggle to find any detailed and precise explanation of how this "voting" works. As public Ethereum networks are unpermissined, there is no such thing as "required majority". Still, the network must come to a consensus about the winning miner. Likewise, the network must come to a consensus about uncles. Even from the official Yellow Paper, this is not clear to me.


texts: Passing/returning callback function result

texts:
I think I am running into a callback issue as returning the result is saying undefined (despite being shown correctly in the console log).

web3.eth.getBlockNumber(function(error, result){
    if(!error)
    {
        console.log(result)
        return result
    }
    else
    {
        console.error(error);
        alert(error)
    }
})

I'm unable to pass the callback result to another function/variable currently. Please assist. Thanks.


texts: How to get list of Ethereum addresses for Airdrop?

texts: I want to do Airdrop for my tokens and plan to distribute my tokens to 50,000 random Ethereum addresses. How do I get the 50k Ethereum addresses. How do the very well known Tokens airdrops manage to generate such a large list of Ethereum addresses?


texts:
The transaction shows up on my metamask account for minting but the balance of my new coin is zero. When I looked up the new coin, it was able to identify the token symbol and decimal. Why isn't the balance updating?

pragma solidity >=0.5.0 <0.7.0;

contract BestCoin {

    uint constant private MAX_UINT256 = 2**256 - 1;
    // The keyword "public" makes variables
    // accessible from other contracts
    address public minter;
    uint256 public tokenTotalSupply = 0;
    mapping (address => uint) public balances;

    // coin name
    function name() public view returns (string memory) {
        return "TheBestCoin";
    }

    // coin symbl
    function symbol() public view returns (string memory) {
        return "TBC";
    }

    // divide token amount
    function decimals() public view returns (uint8) {
        return 8; // 100000000
    }

    function totalSupply() public view returns (uint256) {
        return tokenTotalSupply;
    }

    function balanceOf(address _owner) public view returns(uint256 balance) {
        return balances[_owner];
    }

    function transfer(address _to, uint256 _value) public returns (bool success) {
        require(balances[msg.sender] >= _value); // TODO must throw
        balances[msg.sender] -= _value;
        balances[_to] += _value;
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        require(balances[_from] >= _value);
        balances[_to] += _value;
        balances[_from] -= _value;
        emit Transfer(_from, _to, _value);
        return true;
    }

    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
        return balances[_owner];
    }

    function approve(address _spender, uint256 _value) public returns (bool success) {
        return true; // TODO
    }

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

    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

    // Events allow clients to react to specific
    // contract changes you declare
    event Sent(address from, address to, uint amount);

    // Constructor code is only run when the contract
    // is created
    constructor() public {
        minter = msg.sender;
    }

    // Sends an amount of newly created coins to an address
    // Can only be called by the contract creator
    function mint(address receiver, uint amount) public {
        require(msg.sender == minter);
        require(amount < 1e60);
        balances[receiver] += amount;
        tokenTotalSupply += amount;
    }

    // Sends an amount of existing coins
    // from any caller to an address
    function send(address receiver, uint amount) public {
        require(amount <= balances[msg.sender], "Insufficient balance.");
        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        emit Sent(msg.sender, receiver, amount);
    }
}


texts: How do we get latest value of a key from blockchain?

texts: I want to understand the basic working of storing a value of a key that can periodically update its value in blockchain. For example, if the value of 'a' is 4 today and is stored in blockchain, then tomorrow i may update it to someother value and it may be recorded in some other block. Now, if i want to get the latest value of the key, how does it work?


texts: Which Ethereum clients/wallets support the ICAP?

texts: The ICAP is a method of representing an Ethereum address with a built-in checksum and in a way that is compliant with most bank software due to compliance with the International Bank Account Number (IBAN) format.  But many block explorers and other tools are still using the raw hexadecimal representation for Ethereum addresses.  Which Ethereum clients/wallets/apps actually support the ICAP?


texts: 1000+ ETH address with a single wallet & transfer all USDC to a single account

texts:
This is what im trying to achieve with little success:
1:) Create 1000+ eth address that belong to a single seed!
( Did this using Mnemonic Code Converter but in ledger i have to use the Derivation index to use them individually. This is a logistical nightmare. )
2:) Manage these wallets or send the USDC from all the wallets to a single address.
3:) Have a primary account or a single address pay for the fees. ( than having eth in all accounts )
I'm a developer but not a solidity developer. Would love some direction!


texts:
already having some ETH on my mist wallet - contributed them a couple of month ago. I can't sync the blockchain as I have to little storage on my computer. Using OS X 10.11.3; ETH Wallet Version 0.8.8. I am only able to sync until 13 % of the blockchain.
Sending ETH (to my Jaxx Wallet) did work two days ago (without synchronization of the  blockchain) - now, however I can't send any. All transactions I am trying to send at the moment are not working, even though they are shown in my mist wallet transaction history (according to etherscan they were not processed). Any ideas how I could manage to get my current ETH form my mist wallet to some other wallet where I dont always have to sync the whole blockchain? Could it work with myEtherWallet by importing my already owned private key? Any other ideas? Thx :)


texts:
I'm running this contract on remix https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/roles/WhitelistAdminRole.sol

There was no error but i saw an warning "Gas requirement of function addWhitelistAdmin(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)".

What can i do to turn the warning off ?
Should i be worry or just let be ?


texts: Is there a blockchain reddit alternative?

texts: Is there a blockchain Reddit alternative? I know of Reddit alternatives like communities.win but it's not blockchain and one cannot create a new community on one's own.


texts: `web3.currentProvider` is undefined with MetaMask

texts:
I am trying to develop a simple UI for my contract using web3.js but I'm falling down relatively early: web3 (and window.web3) is defined but the currentProvider property is not.

var Web3 = require('web3');
var web3 = new Web3();

function init() {
  if (typeof web3 !== 'undefined') {
    console.log('Web3 found');
    window.web3 = new Web3(web3.currentProvider);
    web3.eth.defaultAccount = web3.eth.accounts[0];
  } else {
     console.error('web3 was undefined');
  }
}

The code I am attempting to use is provided above and contains no additional libraries or dependencies (such as ethjs). The init function is called with the window.onload event.

Is there something I'm doing wrong?


texts: Inheritance clarification (Invalid number of arguments to Solidity function)

texts:
I have 3 contracts: User, Patient, and Doctor. Patient and Doctor both inherit from User.

User.sol

contract User {
    // Stuff not relevant for question
    function User() {
        // Constructs
    }
}

Patient.sol

contract Patient is User {
    mapping(bytes32 => bytes32[]) category_Records;
    mapping(bytes32 => Record) id_Record;
    // Records
    struct Record {
        bytes32 id;
        bytes32 category;
        address addedBy;
        address addedByContract;
        uint dateAdded;
        bytes32 _hash;
        bool verified;
    }
    // Adding record
    function addRecord(bytes32 _id, bytes32 _category, bytes32 _hash) {
        Record memory newRecord = Record(_id, _category, tx.origin, msg.sender, now, _hash, false);
        id_Record[_id] = newRecord;
        category_Records[_category].push(_id);
    }
}

Doctor.sol

contract Doctor is User {
    // Adding record
    function addRecord(bytes32 patientID, bytes32 _id, bytes32 _category, bytes32 _hash) {
        // The registry bit is a registry contract which is working
        address _patient = registry.getContractAddress(patientID);
        // From the registry we get the patient contract address
        Patient patient = Patient(_patient);
        patient.addRecord(_id, _category, _hash);
    }
}

I have a button in my front-end which calls

contract.user.doctor.addRecord(publicAddress, contractAddress, pID, _id, category, hash);

which in turn calls (this function is inside an object contract.user.doctor)

function addRecord(publicAddress, contractAddress, pID, _id, category, hash) {
    const input = fs.readFileSync('contracts/All.sol').toString();
    const output = solc.compile(input);
    const bytecode = output.contracts[':Doctor'].bytecode;
    const abi = JSON.parse(output.contracts[':Doctor'].interface);
    const contract = web3.eth.contract(abi).at(contractAddress);
    // Insert gas estimation here, default prob insufficient
    contract.addRecord(patientID, _id, _category, _hash, {from: publicAddress}, (err, res) => {
        if (err) {
            console.log(err);
        } else {
            console.log('tx: ' + res);
        }
    });
}

When I click it, I get back

Error: Invalid number of arguments to Solidity function

The reason I think this is related to inheritance is because I tried, for testing, to make Doctor a standalone (not inherited) contract with only two methods, getBytes() and setBytes(). When I called from my node app, everything worked fine.

I've checked many times and there is the correct arguments to the Solidity function so I have no idea why it gives me back that error.

Any idea?


texts:
I'm trying to serialize a struct off chain so that I can pass it to a function as bytes32[length] that dynamically casts it to a struct (using assembly).

However looking at memory representation of structs in Remix, I don't "get it". How are they encoded?

I have looked at various ABI encoders but couldn't find any solution for structs.


texts: Incorporate calldata inside smart contract

texts:
I'm currently trying to use the 1inch API documented here: https://docs.1inch.io/api/nodejs-web3-example
I would be interested in using the 1inch pathfinder api from a solidity smart contract to make swaps programmatically. The problem is that the way the api works is that you call the HTTP api and you get the transaction calldata already compiled that only needs to be signed and sent to the network. So basically there is no smart contract to invoke from solidity (like with other dexes).
What I was wondering was if it would be possible to use the api to get the calldata for a given swap and then, providing this calldata to a smart contract, integrate this swap as an operation made by the smart contract.
I'm not an expert in solidity and I don't know if what I'm asking is even possible, but anyway thanks to anybody that will answer.
Note: I know originally the 1split protocol was a smart contract deployed on the blockchain but that has been deprecated and is not available on the bsc chain, where I also want to operate, so it isn't a viable option.


texts: Encode method signature and parameters using Go-Ethereum

texts:
Is there any way to use the Go-Ethereum library to get the string I have to send to JSON RPC to call a contract method. I mean, Go-Ethereum comes with a CLI, so there must be some built-in functions that already do this.

I'm currently writing a wrapper in GO for the JSON RPC and would like a simple way to encode the method signature and parameters to prepare them for the RPC call to the contract.

Thanks in advance

EDIT: I just saw that release 1.4.1 added the functionality of binding to Contract ABI and interacting with the contract through Go (https://github.com/ethereum/go-ethereum/releases). I will mark this question as answered


texts: testrpc install on OSX with node-gyp error

texts:
Trying to get testrpc running locally, has anyone run into this?

$ sudo npm install -g ethereumjs-testrpc
npm WARN lifecycle scrypt@6.0.3~preinstall: cannot run in wd %s %s (wd=%s) scrypt@6.0.3 node node-scrypt-preinstall.js /usr/local/lib/node_modules/.staging/scrypt-ffbb6685
/usr/local/bin/testrpc -> /usr/local/lib/node_modules/ethereumjs-testrpc/bin/testrpc

> scrypt@6.0.3 install /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/scrypt
> node-gyp rebuild

  SOLINK_MODULE(target) Release/copied_files.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/copied_files.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0

...

npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the scrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs scrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls scrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Maurice/Eth/solidity/testrpc/npm-debug.log
npm ERR! code 1


texts: Is there a temporal reward in Casper, that the earlier you place bets, the more you are rewarded?

texts: In Casper, the consensus-by-bet proof-of-stake system, is there a temporal reward, that the earlier you place bets, the more you are rewarded?


texts: Solidity Noob: Where can i see the return of a function?


texts: When sending a transaction to a contract, what happens if the contract code takes longer to execute than the block takes to mine? Whether it be computational based or static limits. Would this cause any issues?


texts:
On my site I do not want to use email/pass authorization, but insteand I'd like to use Metamask sign functionality (it is impossible to work with site without Metamask or browser with web3).

I suppose to implement something like this:

client generates any random string/pin code.
on "login" click sign it and sends alongside with pincode to server (I know that I can use any static phrase and it doesn't increases overall security).
there signature checked and public key/address derived.
if user with such public key/address found - generate standard JWT and use it with all following REST requests.

I am wondering is it safe enough or I missed something important?


texts: Remix error "gas required exceeds allowance or always failing transaction" on private blockchain

texts:
I'm trying to test contract interaction using Remix with two basic contract:

contract Callee
contract Caller

Callee function/variable:

uint[] public values;

function storeValue(uint value) {
    values.push(value);
}

function getValues() view returns(uint) {
    return values.length;
}

Caller function:

function storeAction(address addr) returns(uint) {
    Callee c = Callee(addr);
    c.storeValue(100);
    return c.getValues();
}

If I try to execute function "storeAction" I see a different behavior between:

Remix Javascript VM: everything works fine
Remix Web3 provider (http://localhost:8545):

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

The deploy seems to works fine for both the environment.

I've already checked my private blockchain gas limit that is over 4700000.

Can someone explain this?

Thanks


texts: Can I use an Raspberry Pi 3 to mine Ethereum or is it useless?

texts:
I bought my Raspberry Pi 3 to run little Go based programming projects on it I stumbled over Go Ethereum

After I watched some Youtube videos about Ethereum I wonder how much Euros can a Raspberry Pi 3 mine in a month max and is it even worth with the power costs ?


texts: How to prepare VPS enviroment for instalation and running of Ambrosus node?

texts:
I would like to run Ambrosus development node. On Ambrosus github there are sume instructions, but I do not know how to prepare enviroment, what version of Ubuntu I should use and what tools should I install first?

https://github.com/ambrosus/ambrosus-node


texts: How could I write "sendrawtransaction" in Python?

texts:
Since I am using web3 = Web3(HTTPProvider('https://mainnet.infura.io/root@123'))

That's why I have to use sendrawtransaction for ether transaction . Now what is the process of write sendrawtransaction in PYTHON ?

And if there is any other process of transaction using this Httpprovider in pythhon then please mention .


texts:
I am running a private blockchain using Geth, after upgrading the servers- I had stopped the miner and restarted it after upgrading the specs. Now I am getting all sorts of errors, the main one being not being able to HTTP for unlocking wallets; it is a private network. I have to use --allow-insecure and this issue is recent on the git repo as well.
And now I am getting

  Error: Node error: {"code":-32000,"message":"gas required exceeds allowance(8000000) or always failing transaction"}

Anyone face anything similar or have any pointers to give?
Thank you in advance.


texts: Getting ABI interface using solc offline

texts: Suppose I have an inheritance contract (xyz.sol) with three contracts A, B and C such that C is B, I am trying to compile using solc offline in node console. Upon compiling, I have three separate bytecodes and ABI interface generated. For a single contract alone ABI=..... [`:xyz'].interface used to give the ABI alone. Now because there are more ABI present in the output compiled code, it returns an error (undefined). Is it possible to get all the ABI interface together or separate by any indexing method?


texts:
I should click on a button in HTML such that by the clicking a smart contract must be deployed and its function must be run. But when i write the codes of the both operations in Node-js the followed error occurs:
`Error: This contract object doesn't have address set yet, please set an address first.`

By the followed code i deploy the contract and run its function. the contract's function is fill.
    app.post('/send-data', function(q,r){
        var source2='E:/Alireza/contracts/customer.sol';
        var customercompiled=solc.compile(source2)
        var customerJson="E:/Alireza/build/contracts/customer.json";
        var customerJs=JSON.parse(fs.readFileSync(customerJson));
        var ByteCode="...";
        var customer=new web3.eth.Contract(customerJs.abi, null, {data: ByteCode});
            web3.eth.personal.unlockAccount("0x83Ad536099658519ee6A40A3faCAf3dDcEf6178a","Alireza").then(()=>{console.log("Address unlocked");}).catch(console.error);
            customer.deploy().send({from: "0x6Db320B080b956c371c4bC5b00eF74e73bCE7798", gas:2100000, gasPrice:200}).then((instance)=>{console.log("Contract mined at "+instance.options.address);
            customerInstance=instance}//Here, the contract is deployed.
            customer.methods.fill(Arg1,Arg2).send({from: "0x6Db320B080b956c371c4bC5b00eF74e73bCE7798", gas:2000000, gasPrice:200});
            //Above line is to interact with the contract and run its function called "fill".
    );

How can i eliminate the mentioned error and improve the above code?


texts: How to deploy complex Ethereum app split into multiple contracts

texts: If you develop a complex dApp and have to split it into separate individual contracts because of the deployment gas limit, What's a clean process/pattern for deploying and linking the individual contracts together?


texts: Newbie question - What does it mean to download one's Ethereum wallet into a file?

texts:
I am a crypto/Ethereum newbie. I came across LocalCryptos (localcryptos.com), which is a non-custodial platform used mainly for trading ETH.
It says:
Keep your funds secure by backing up your wallet. If LocalCryptos were to ever go offline, you can still access your wallet using this file.
My question is: how would I use that file to access my ETH wallet, if the site goes offline?


texts: Truffle contract name different from filename causes error in test

texts:
I'm trying to use Truffle to deploy/test a cluster of interrelated contracts that call each other.

When I run "truffle migrate" all of the contracts get deployed successfully and the transactions show up in Ganache, but Truffle doesn't seem to have any conception of some of them when I use ".deployed()" in the console or in other migrations; however, the first 2 contracts do show up.

EDIT: The problematic contracts are not all derived from the same base contract; I just tried it with an empty contract (just an empty constructor) and the same thing happened to it.


texts:
I am trying to do a simple curl from the cmd line to my private blockchain.
I have the geth console running on localhost:8545

The curl command I am executing is the following

curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}' http://localhost:8545

I also have tried many other examples from https://github.com/ethereum/wiki/wiki/JSON-RPC

none of them work on my set up as all the responses are

{"jsonrpc":"2.0","error":{"code":-32600,"message":"invalid character '\\'' looking for beginning of value"}}}

I start geth using this:

geth --rpc --rpcapi "eth,net,web3,personal" --datadir c:\privatechain


texts: Is it possible to get an address of a struct in the Library or Contract without using mapping?

texts:
[Q] I was wondering is it possible to get an address of a struct on the memory space? Inside initialise() function after the Node object creation, I want to get is address if it is possible. Since between contracts I can only transfer its address value.

Thank you for your valuable time and help.

library LinkedList {
    uint80 constant None = uint80(0); /// NULL value.

    struct data {
        Node head;
        Node[] node_array;
    }

    struct Node {
        string data;
        uint80 prev;
        uint80 next;
    }

    function initialize(data storage self){
        self.head = Node({prev: None, next: None, data: "",});
        self.head.next = /// self.head's address.
    }
}

Inside initialize() following code piece works:

Node s = self.node_array[index];
uint addr;
assembly {
    addr := s
}

Inside initialize() the following code piece does not work:

  Error: Expected elementary inline assembly operation.

self.head = Node({prev: None, next: None, data: 10,});

uint addr;
assembly {
    addr := self.head
}

or

Node new_node;
new_node.data = d;
new_node.next = h.next;
new_node.prev = h.own;

uint newnode_addr;
assembly {
   newnode_addr := new_node
}

newnode_addr returns 0 instead of a valid address.

I am not able to do following assignment also:

  Error: Type struct Node memory is not implicitly convertible to expected type struct Node storage pointer.

Node newnode = Node({prev: None, next: None, data: 10,});


texts: trying to recover funds from an older ethereum wallet

texts:
I downloaded an older version of ethereum wallet in march. and transferred some ether to the account. I have not uploaded in a few months but when i turn on wallet, it refuses to download new blocks.

i downloaded a newer version of wallet, which works fine, but it does not have my original ether.

I have my "UTC" file under keystore directory. I am basically trying to restore my ether to the updated walllet so i can transfer back to coinbase and move back to cash.

any help would be appreciated as I don't have much technical expertise but can figure out most things.


texts:
We have been trying to use a mapping to store multiple Oraclize queries and their results but it does not seem to be working properly. What is the ideal way to store multiple Oraclize queries by their query ID's?

We have a Oraclize query in which we modify the middle by changing the ID number and need to store these by their number so we can get them later.

mapping(bytes32 => OraclizeQueries) public validIDs;

function fetchMatchResults(uint _matchID) payable onlyOwner {
    bytes32 queryId = oraclize_query("URL",  strConcat(firstHalfQuery,
          uint2str(_matchID), secondHalfQuery));
    validIDs[queryId] = OraclizeQueries("");
    pickWinner(_matchID, validIDs[queryId].result);
  }

function __callback(bytes32 oracleID, string result){
    if(msg.sender != oraclize_cbAddress()) revert();
    require(bytes(validIDs[oracleID].result).length == 0);
    validIDs[oracleID].result = result;
}


texts: Can `rm` be an alternative to `parity db kill`

texts:
In my configuration, I have specified base-path as follows:

[parity]
chain = "chain-spec.json"
base_path = "./parityData"

Can I remove chain data by removing database files in parity?

rm -rf ./parityData/cache ./parityData/chains

My results:

After removal of data directories, when I restart parity, it does not sync from beginning, it resumes from last synced point? Why so?


texts: Returning error message from smart contract

texts:
I am trying to return error messages from solidity. I have this contract:

pragma solidity ^0.4.23;
contract Simple {
    function arithmetics(uint a, uint b){
                     require(a % 2 == 0, "Even value required.");
                    b = b * 3;
            }
}

When I test in remix, it's returning me the following error message:

  transact to Simple.arithmetics errored: VM error: revert.
  revert  The transaction has been reverted to the initial state.
  Reason provided by the contract: "Even value required.".    Debug the transaction to get more information.

However, when I tried calling it from my dApp using web3.js I am  not getting an error message, only this:

  Transaction ran out of gas.


texts: How can an attacker use a replay attack to send value to his own address?

texts:
I'm sure this is a conceptual error on my part. I understood the idea of a replay attack as being the capturing of a txn body with its signature on one chain and 'replaying' it on the other (ETH to ETC or vice versa).

What I don't see is how an attacker can benefit from this assuming the txn body signature has the destination address embedded in it. Wouldn't the attacker have to control that specific address to get the coin value?

How can an attacker use a txn body signature to validly send value to his own address?


texts: Simple way to find the exact address / transaction by the part of the address / transaction hash?

texts:
Imagine I have only a part of the address, for example, 0xa2793n. The rest of the address is unknown. Is there any indexer, that stores this information in any suitable format, so I can find the list of "used" addresses?

I know, that the way geth / parity stores the blockchain data doesn't allow such queries. So most likely I need some third party indexer software which maintains an SQL table with the addresses.
Also I know that there's a huge amount of theoretically correct addresses with the same beginning, so this software should only do a search in already used addresses.

The same question for transaction hash. Thanks in advance!


texts:
What happens if no (unique) longest chain of blocks exists, so that the current state of Ethereum is ambigious?

I know that the longest chain of blocks are always taken to be the current state of Ethereum.

Say, that there are two longest chain of blocks.

Could it happen that 50% of miners dedicate their work on one chain, while the other miners work on the other chain? In this case, it could be that the chains are extended closely in time, so that Ethereum's state remains ambigious for an arbitrary amount of time?

Does the protocol say anything about how to avoid this scenario?


texts: When and where do I set ERC721 tokens' data?

texts:
I am currently working on a smart contract to sell ERC721 tokens. I understand that my code should have a function that allows me (the owner) to mint a token and add it to a list which stores all the available tokens. But what I don't quite understand is when and where do I define which data can be used to mint a token.

Suppose I have a dapp that allows you to buy Colour tokens.
In my frontend, the user will have Red, Yellow and Blue, and they all will have different prices. When they buy one of them, using web3 I will mint a token and transfer it to the buyer.

But how does the frontend know that the available colours are red, yellow and blue? How can I prevent someone creates a green token? Do I have to provide this data (and also the metadata) in the deploy? How?

I hope that my question is clear.

Thank you very much!


texts: Returning ether from a payable function using transfer

texts:
Is it possible to return ether sent to a smart contract payable function, by using transfer to return funds to the sender?

I am experimenting with a use case where a contract keeps a list of buyers who have sent a sufficient quantity of ether, and return any excess ether as 'change'. I have a contract that looks a bit like the following:

pragma solidity '0.4.19';

contract Purchaseable {
  uint public price;
  address[] public buyers;

  function buy() public payable {
    require(msg.value >= price);

    // Keep a list of buyers who have transferred enough ether
    buyers.push(msg.sender);

    // Give the sender some change
    uint change = msg.value - price;
    // This line blows up with VM Exception: revert
    msg.sender.transfer(change);
  }
}

However, the last line msg.sender.transfer blows up. It's hard to debug from there. Why doesn't this work?

One theory I have was that maybe it is impossible to transfer funds back to the sender as part of the same transaction. I can't find any documentation of what transfer actually does in reference to blocks and transactions to know if my approach is even supported. Is there a better way to part refund ether sent to a payable function?


texts:
EIP-155 states:

  If block.number >= FORK_BLKNUM and v = CHAIN_ID * 2 + 35 or v = CHAIN_ID * 2 + 36, then when computing the hash of a transaction for
  purposes of signing or recovering, instead of hashing only the first
  six elements (ie. nonce, gasprice, startgas, to, value, data), hash
  nine elements, with v ...

These are instructions for the hashing party, but not the the original signing party. Therefore, the question arises: when signing a transaction, should one use the first equation (with 35) or second equation (with 36). Practically speaking, sometimes only the former works and sometimes only the latter and I was unable to find a clear rationale.

Could someone explain the logic by which to choose between these 2 options?
A reference to a document which defines the needed logic here would also be much appreciated.

Thanks in advance,

Tal


texts: How to create a mapping of string and struct array in solidity

texts:
I am new to solidity trying to learn it.

I want to create a mapping like

mapping (string=>User[]) public  companyUserMap;

Where User is a struct

struct User {
   string userId;
   uint roleId;
}

Struggling with writing a function for adding / removing/ iterating a user to the mapping.

function addUser() {
    User usr= User("user01",1);
    User usr2= User("user02",2);
    User usr[]={usr,usr2};
    //add the users created above to the mapping
    companyUserMap.push("c1",usr[])
}

  TypeError: Type struct AuthorizationManager.User memory is not implicitly convertible to expected type struct AuthorizationManager.User storage pointer.

Can someone please help me with functions for adding / removing / iterating the users and the mapping


texts: In Ethereum Name Service, once I won an auction, can I assign any address to that name?

texts:
Once I have won the auction, I can set the address for the name I just won. I use the setAddr function in the ENS Public Resolver Contract.

The question is if that address can be any address or it must be the same address I used to make the auction?

What if in the later future I want to set that name to another address?


texts: Is it possible to call a payable function within __callback of Oraclize?

texts:
I want to run an Oracle query periodically and my idea was to call getUTCTimestamp(0) for the first query where getUTCTimestamp is:

function getUTCTimestamp(uint256 delay) payable {
   oraclize_query(delay,"WolframAlpha", "Timestamp now");
}

and then inside the callback call getUTCTimestamp(60) to have a call every 60 seconds. The thing is that the call inside callback is never executed and I imagine that happens because no ether is supplied. Is this correct? Is there any way to achieve what I want?


texts:
I read about transaction malleability and have some questions regarding that, please help:
It states, for transaction malleability a person changes the signature such that the transaction remains valid, so my question is how can any person can see and alter the signature of the sender, although it is a PRIVATE key?
How will the receiver be able to alter the signature?


texts: can I trust transactions in blocks with just 1 block confirmation?

texts:
In my application, I am using events/logs to capture and display information. So, to decrease the response time, I am returning the result as soon as the block is mined and not waiting for 5-6 block confirmations. As waiting for block confirmations will increase the response time.
So can I trust that all transactions in these blocks will be in the main chain?


texts: How can I open an account with a bank in Ethers?

texts: How can I open an account with a bank in Ethereum? Can I trade it? Which banks support cryptocurrencies? Thanks for the help!


texts: How to check If a specific amount has been sent to a wallet?

texts:
So, specifically, the user is supposed to send an amount x of coins to an address I created.
How can I check if the x amount has been sent to the wallet? Is there a specific function to do that?


texts: Why do statically compiled calls and addr.call(data) work differently when recipient has no fallback?

texts:
I always thought these two calls were equivalent:

Receiver(r).onTokenReceived(a, u);

r.call(bytes4(sha3("onTokenReceived(address,uint256)")), a, u);

It turns out they both work if the receiver has onTokenReceived(a,u), and they both work if the receiver has a fallback function. But if the receiver has no fallback function defined, the first line fails with invalid opcode, but the second line runs without error! Why is this?

Here's my full test code. Only test5 fails.

pragma solidity ^0.4.13;

contract Receiver {
    event Log(address addr, uint val);
    function onTokenReceived(address from, uint val)
    returns (bool) {
        Log(from, val);
        return true;
    }
}

contract FallbackReceiver {
    event Log(uint x);
    function () {
        Log(uint8(msg.data[0]));
    }
}

contract NonReceiver {}

contract Sender {
    Receiver rec = new Receiver();
    address fallbackRec = address(new FallbackReceiver());
    address nonRec = address(new NonReceiver());
    address a = 0x1;
    uint u = 1;

    function test1() {
        rec.onTokenReceived(a, u);
    }
    function test2() {
        address(rec).call(bytes4(sha3("onTokenReceived(address,uint256)")), a, u);
    }
    function test3() {
        Receiver(fallbackRec).onTokenReceived(a, u);
    }
    function test4() {
        fallbackRec.call(bytes4(sha3("onTokenReceived(address,uint256)")), a, u);
    }
    function test5() {
        Receiver(nonRec).onTokenReceived(a, u);
    }
    function test6() {
        nonRec.call(bytes4(sha3("onTokenReceived(address,uint256)")), a, u);
    }
}


texts: RPC error when interacting with contract using Ganache GUI, but it works fine when using Ganache CLI

texts:
I have a truffle project, if I migrate it onto ganache-cli and then interact with my contract (via Metamask) it works great. But if I try and do the exact same thing using ganahe-gui the contract deploys fine, but interacting with it fails.

This is the error:

Error: [ethjs-rpc] rpc error with payload {"id":406503133755,"jsonrpc":"2.0","params":["0xf8ab06843b9aca008303cb1794071faee0d32e420c88295802a65758a924b5626201b844d6febde800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000822d45a087a8df0b863c944ad2f79551800f21289efac79e74d62a8b0c3d7d5580ec4df5a01d92fd24ee5a418df0184bc61db21dd36719ce2a234d11638e092a9c4eb08bca"],"method":"eth_sendRawTransaction"} [object Object

This is not anything to do with my contract code or it would not work with the cli. I think the problem may be metamask? I am using the same 'chain' on Metmask for both gui and cli- localhost:8545. Metamask is detecting the chain properly because I can see that I have 100 ether (99.9 after contract deployment).

Metmask does not give any errors prior to submitting the tx, it is only when I press Send that it gives me the error. If it wasn't detecting the chain, I wouldn't be able to send as I'd have a 0 balance.

Wat do?


texts: Generate private key and address using web3j

texts: How can i generate private key and address using web3j instead of creating keystore json file


texts: How to represent the complete big number (all e)

texts:
When I convert a variable using the functions toNumber() or toString() I obtain this result: x.toNumber()

1e+27

But I want to see the entire number with all the figures. Because If I don´t convert the number, the big number format it´s something like this:

BigNumber { s: 1, e: 26, c: [ 9999999500000 ] }


texts: When use Nethereum C# Library there are many CLOSE_WAITs in TCP Stack at node side

texts:
When I use Nethereum methods (GetBlockWithTransactionsByNumber,GetBlockWithTransactionsByNumber and etc ) in loop, In TCP stack at node side accumulates a lots of CLOSE_WAIT. How can I fix this issue ? Please help this issue is very Significant for me

Here is example code:

Web3 etheriumService = new Web3(config.Address);
var lastBlockHashById = await EtheriumService.Eth.Blocks.GetBlockWithTransactionsByNumber.SendRequestAsync(new BlockParameter(ulong.Parse(savedBlockId)));
var dbBlock = await this.EtheriumService.Eth.Blocks.GetBlockWithTransactionsByNumber.SendRequestAsync(new BlockParameter(0));
//and etc

https://i.stack.imgur.com/GMiAG.jpg


texts: Ethereum Wallet (Mist) not showing ETH balance

texts:
I decided to try out Ethereum and installed Ethereum Wallet for Linux. I created an account and sent some ETH from my Coinbase account. I can see the balance in Etherchain, but my Ethereum Wallet account has a balance of 0.

Ethereum Wallet shows:
2 peers
~1.6mil blocks left
6%

Is this typical of an Ethereum application? Are there better alternatives for Linux?

Thanks!


texts: How Merkle trees are implemented in a database exactly

texts:
I have just checked out these resources:

What is a Merkle Tree? Beginner’s Guide to this Blockchain Component
Using Merkle trees to detect inconsistencies in data
Exploring the use of Hash Trees for Data Synchronization - Part 1
Understanding the ethereum trie (still working on this one).
Main specification: Merkle Patricia Trie

I sort of understand the basic diagrams such as these:

That image is in regards to Cassandra database in which it says:

  Cassandra maintains a perfect compact binary hash tree of a certain depth which it can share with its replica neighbours at any time. A hash tree at its base level holds the hashes of individual rows and each parent then is the hash of its two child nodes. This could get pretty big so Cassandra compacts the tree and maintains to a limited depth with groups of rows at the base.

So that sort of makes sense. Each row is hashed, I get that, but then not sure where the parent comes in in the database, though I can imagine how a Merkle tree in this binary tree situation would store a hash of the two child nodes. I would be interested to know how they compact it, but that's a different story :).

Another image is from here:

So now it sounds like there is 1 Merkle tree per block, in this blockchain example, as opposed to the Cassandra example where it had 1 Merkle tree per table or something like that.

What I would like to clarify the following:

Exactly what is being hashed in the database (Cassandra) example.
What sort of performance impact this has both in terms of speed and size.
If Ethereum uses a sort of Cassandra-like system, or if it's quite different. This is just for introduction, I have a lot more reading to do on its Merkle Patricia Trie.

In terms of (1), I am a bit confused as to what exactly is hashed. If it's like imagining a SQL database with tables, I'm wondering if they are basically literally running the table row cells individually through a hash function and then combining them into a final "hash". This seems like it would come at a significant performance penalty if you were doing massive amounts of writes like with analytics, since it would be hashing every field of every row that was written to the database, vs. if it wasn't doing that it would be what seems like orders of magnitude faster / better performance. Wondering if I'm missing something here or if it is actually this sort of a performance impact.

Which leads me to (2), which is the performance impacts of keeping a Merkle tree for the database or tables updated.


texts: Can Blockchain Be Effectively used for Freelancing industry?

texts: As more people are joining the work from home force, I want to ask if the blockchain can be put to use for freelancers and something really effective like Upwork can be created based on this amazing technology


texts:
I want to understand how function call should be converted to the hex.

I have to sign transaction on the client side. Web3 provides this function:

web3.eth.accounts.signTransaction(tx, privateKey)

Tx is transaction which has data field. Data field represents function call with arguments in hex format.

The question is how to convert function call into this hex representation? What kind of format I should follow?

At this moment I'm looking at this https://github.com/ethereumjs/ethereumjs-abi


texts: Given a contract address, can I determine when the contract was deployed?

texts:
Ideally the solution would use web3, but other solutions are acceptable.

Motivation:

Event lookups can be passed fromBlock field. If I know the block a contract was created, I can more accurately do an event lookup (rather than searching the whole chain)


texts: I was transferring 2 ETH from Gemini to Exodus, it end up in Etherscan ?? Help!

texts:
On 9/18/2019 12:53am, I made a transfer of 2 Eth from Gemini to Exodus, it did not go through, bet end up in Etherscan.
How did that happened?
and How to transfer Eth out out Etherscan?
Thanks to all of you smart people. Please help!


texts: How do the protocols used in Ethereum (e.g. Whisper, P2P protocol suite) map onto the OSI model?

texts:
It would be useful to have a mapping of all of the protocols involved with the Ethereum implementations on to the OSI model (or equivalent). The protocols might include:

Whisper, devP2P, IPC, RPC, ABI, Wire, RLPx

This would help new users quickly get an understanding of the function of each protocol/application and assess what the options are (if any) within each layer.

How do the protocols used in the Ethereum implementation map onto the OSI model?


texts:
i've codded a script using js to trigger a buy on uniswap.
the way i achieved this is through importing uniswaps smart contracts using this line of code:
const router = new ethers.Contract(addresses.router,['function getAmountsOut(uint amountIn, address[] memory path) public view returns (uint[] memory amounts)',
'function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)'

],
in any case unfortunately I was met with an error saying unable to estimate gas limit , and after setting proper parameters for 'gasPrice' and 'value'
I receive this error:

Error: insufficient funds for intrinsic transaction cost (error={"code":-32000,"response":"{"jsonrpc":"2.0","id":4,"error":{"code":-32000,"message":"insufficient funds for transfer"}}"}, method="estimateGas"

this is the code i used for my Uniswap Trade:
async function Buythis(){
const token0 = addresses.WETH; //Etherium
const token1 = '0x358aa737e033f34df7c54306960a38d09aabd523' //Desired Coin Address
const amountIn = ethers.utils.parseUnits('0.1', 'ether'); //Amount you wish to buy with. (0.15 eth in wallet currently.)
console.log('Amount in Passed')
const amounts = await router.getAmountsOut(amountIn, [token0, token1]);
console.log('Amounts out calculated')
const amountOutMin = amounts[1].sub(amounts[1].div(5)); //slippage
console.log('Slippage is set.')
var options = {gasPrice: ethers.utils.parseUnits('50', 'gwei'), value: ethers.utils.parseUnits('0.04', 'ether')};
console.log('Initiating Order.')
const tx = await router.swapExactETHForTokens(
  amountOutMin,
  [token0, token1],
  addresses.recipient,
  Date.now() + 1000 * 60 * 10,
  options
  );

EDIT : yes it logged 'Initiating order' so the error is in the swapExactETHforTokens


texts: Connecting the wallet of to your dApp and different Ethereum wallet types

texts:
How users can use connect their different wallets, like MetaMask, mobile wallets and hardware wallets with a dApp?

What wallets are supported?


texts: Using AbiEncoderV2 for encoding data in raw transactions

texts:
I've come across a use-case to need to pass a struct into a Solidity function. I know this can be done via tuples. However, I need to sign and send this transaction from my node.js back-end using Infura as a provider.

Currently, I use encodeABI() from web3.js to encode the function call. However, in this case where it has a struct as a parameter using encodeABI() doesn't properly do it, and I'm assuming it's because encodeABI() only supports V1 of AbiEncoder.

Is there any functions in web3.js or ethers.js etc. that do what encodeABI() does, but using the V2 of AbiEncoder?

I would just pass a flattened struct to get around this problem but I run into the infamous stack to deep error, since the struct has 10 values, and I can't separate the function into many functions since the only code is forming the struct inside the function.

EDIT: I realized I could just pass the values in arrays to solve the flattening problem. However, I'm still curious on how to properly encode the data.

Thanks for any help or suggestions!


texts: truffle migrate stop at the first contract

texts:
When I tried to run "truffle migrate" with geth (private network), the migration process stop at this point:

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... 0xff148f4b640cc595a41b01ec6f43deb62542fe11df397079c6af2b4a13a5f9fd

how to solve it?


texts: How to check state of the contract after some time?

texts:
I am writing a contract where I need to check that if in 5 minutes no new token get purchased then the sale should be ended. What I mean exactly is that, lets say user A has purchased 100 tokens and now I want to see if no one purchase tokens in next 5 minutes then sale will be closed.

I am looking forward to gas efficient and automatic way.

can someone help please?


texts: How can you share a struct definition between contracts in separate files?

texts: I can't declare a stand-alone struct in its own file, what gives?


texts: Calling debug_traceTransaction from web3 API

texts:
I want to use debug.traceTransaction to get internal transactions from NodeJS using web3 API.
I'm using web3 0.17 beta and I don't see any debug_traceTransaction on the code. Am I missing something or I have to call directly to the RPC?


texts: How to get pending and failed transaction from web3?

texts:
I want my front end to show the status of my solidity functions. When my functions are successful I fire a "success" event. I can watch for that event and respond to it like so:

const events = myContract.allEvents({ fromBlock: 0, toBlock: 'latest' })
      events.watch( (err, evt) => {}

However, I would also like to display when these functions are pending and when they have failed, but I cant figure out how.

I notice that when I do this:

await web3.eth.filter("pending").watch(
      function(error,result){
          if (!error) {
              console.log("pending" + result);
          }
      }
    )

I can see various transactions as they are pending, but I'm not sure how to tell if one of them corresponds to one of the functions I care about.

I'm not even sure how I would figure out if a transaction has failed.

Any help would be great thanks!


texts: Parity issue with personal.lockAccount() - Method Not Found Problem

texts:
personal.lockAccount(web3.eth.accounts[0])

Error: Method not found

at web3.js:3104:20
at web3.js:6191:15
at web3.js:5004:36
at <anonymous>:1:1


texts: If view or pure function doesn't cost any gas, would they be abused/free ride?

texts:
So if I understand this correctly, view function only read data from ethereum and doesn't mutate any state and pure function doesn't even read data and they are intended for cases like return 1+1;

If this is the case, would they be abused since they don't cost any gas? Like could I just use them for free computation? What happen if I have a infinite loop in a view or pure function?

TLDR: They won't.


texts: Regarding Ethereum Private Blockchain Network

texts:
I'm trying to understand how the private blockchain network concept works.

Scenario:

Lets say I have two nodes connected to the internet but not in the
same network
On the first node using geth I initialize using a new
genesis config
Then I start the first node with network id set to
5501
Now on second node I don't initialize any genesis config
Just start the second node geth with same network id i.e. 5501
As you can see I am using network id starting with 5 so the block chain is
started in a private network

Questions:

Will the second node get connected with the first as a peer and be part of that private blockchain?
How to create a private block chain network where one can only join after getting the approval or am I thinking in wrong perspective


texts: Trigger a payable function to send ipfsHash back to sender

texts:
I want to make a testnetwork, a supply chain, with 10 manufacturers/addresses. For that I want to make a function that sends the saved ipfsHash, which is the information about the product that will be send to the manufacturer, back to the sender when the function receives a certain payment.
Does anyone know how to do that?

Thank you very much


texts:
I have a problem with my node. I have set up a remote node which was working for a few months but recently the synchronisation has stuck. So I deleted the db to resync and this is where my problems started. The VPS I am using is running Debian 9 btw. I cannot get my node to sync whatever I do. Either the node syncs without warp and gets stuck between block 2.4M and 2.6M or when warp works it syncs up to block 4.5M but the remaining 300k blocks get synced with a speed of 2 blocks per second. Today after a fresh reinstallation of the server I tried syncing the light client which got stuck at block 3,099,999. Steps to reproduce what I am doing:

apt-get install gcc g++ libssl-dev openssl libudev-dev pkg-config git make curl
curl https://sh.rustup.rs -sSf | sh
reboot
git clone https://github.com/paritytech/parity
cd parity
cargo build --release

also I wanted to try to build a stable version of parity but it didn't work as well. I always end up with the unstable version. I tried:

git checkout tags/v1.7.11
git checkout stable

but no success. how do I install a stable version of parity and how can I fix my syncing issues


texts:
Is there a list of improvements that we will have in ERC223?

Are there examples of contracts?

Is there a migration path for existing ERC20 tokens?


texts: What proof of work function does Ethereum use?

texts: The Ethereum frontier network currently uses a proof of work (PoW) based consensus algorithm.  But which specific PoW function does that algorithm use, and why was it chosen?


texts:
im using web3j with angular 5 connection working perfectly and balance showing perfectly. but when i write transfer function it throw error

var tx = this._web3.eth.sendTransaction({
  from: this._account,
  gasPrice: "20000000000",
  gas: "21000",
  to: textetheraddress,
  value: textetheramount,
  data: ""
 }).then(function(err, transactionHash) {
  if (!err)
    console.log(transactionHash);
});

error

  ERROR Error: The MetaMask Web3 object does not support synchronous methods like personal_newAccount without a callback parameter. See https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client for details.


texts:
I‘m having trouble with successfully mining Ethereum / Ethereum classic on a 4 GPU rigs consisting of:

1x Intel® Pentium® G4520,
1x Mushkin DIMM 4 GB DDR4-2133
1x GIGABYTE GA-Z170-Gaming K3-EU
4x Palit GeForce GTX 1060 DUAL
2x Kolink ZURC-007 Riser PCIe
1x Enermax Revolution X't II 750W
1x Intenso TOP SSD 128 GB

Running on Ubuntu 16.04 x64 with proprietary Nvidia driver 375.66.

Unfortunately one GPU connected over a riser is freezing all the time, sometimes after 3 h, 7 h, 20 h or even 5 min. I‘ve no idea what is happening. I swapped one GPU from a riser to the problematic slot (Riser energy, USB cable, Riser, PCIe bus, GPU energy) and the “replaced” GPU is freezing as well. I try to run 3 cards by using this slot and it hangs again. By using 3 cards without this “broken slot” it seems to work.

First I thought that I’ve an issue with the power supply but since a PSU calculator confirms that 750 Watt should be enough ( http://www.coolermaster.com/power-supply-calculator/ ) end Enermax guarantees 744 Watt over 12 V (even 850 Watt for seconds) I’m continuing my search. I measured 510 Watt at wall…

Under-clocking doesn’t helped so I’m running the cards on their default settings (except constantly 100 % fan speed). Temperatures are about 62-72° C all the time.

However I tried to use different programs for mining (ethminer, claymore) and I’m still having trouble with freezes. Claymore send “WATCHDOG: GPU 2 hangs in OpenCL call, exit” and ethminer just hangs up. Nvidia-smi doesn’t start up till a reboot.

Now I try to replace the “working” slot with the unstable components (~32 variations) in order to identify the problematic part. Due to the random freezes this could take 10 days or several weeks ( I’ve a job :-/ ).

Can someone help me? I appreciate any helpful suggestion!

Thanks!


texts: How to approve spending limit on Metamask or Etherscan to complete a swap on Balancer Exchange?

texts:
Hope you can help unstick this transaction...
I recently used Balancer Exchange to swap USDC for KYL via Metamask. The transaction shows as successful on Etherscan but my Metamask balance has not updated. I didn't receive any popup from Metamask for further action but it appears I need to approve my spending limit to release my USDC.
How can I do this please??
And in future is there a way to pre-approve spending limits on Metamask?


texts: How to record every transaction forwarded to my node（geth）?

texts: With a geth client,how can i record every transaction forwarded to me by other nodes (hash, node IP, timestamp) ,in the network layer?It does not mean I am the receiver of the transaction.I just want to know who i am connected to and who propagated a transactiion to me? a little curious.Thanks very much!!!!!!


texts: Transaction reverts while adding role to an account

texts:
I have Roles.sol library that uses RBAC template.
//SPDX-License-Identifier: MIT
pragma solidity 0.7.0;

/**
 * @title Roles
 * @dev Library for managing addresses assigned to a Role.
 */
library Roles {
    struct Role {
        mapping(address => bool) bearer;
    }

    /**
     * @dev Give an account access to this role.
     */
    function add(Role storage role, address account) internal {
        require(!has(role, account), "Roles: account already has role");
        role.bearer[account] = true;
    }

    /**
     * @dev Remove an account's access to this role.
     */
    function remove(Role storage role, address account) internal {
        require(has(role, account), "Roles: account does not have role");
        role.bearer[account] = false;
    }

    /**
     * @dev Check if an account has this role.
     * @return bool
     */
    function has(Role storage role, address account)
        internal
        view
        returns (bool)
    {
        require(account != address(0), "Roles: account is the zero address");
        return role.bearer[account];
    }
}

My Permission.sol looks like
//SPDX-License-Identifier: MIT
pragma solidity 0.7.0;
import "../libraries/Roles.sol";

contract PermissionHandler {
    using Roles for Roles.Role;

    Roles.Role private _owner;
    Roles.Role internal _superAdmins;
    Roles.Role private _admins;

    event LogAdminRoleAdded(address indexed account);
    event LogAdminRoleRemoved(address indexed account);

    event LogSuperAdminRoleAdded(address indexed account);
    event LogSuperAdminRoleRemoved(address indexed account);

    modifier onlySuperAdmin() {
        require(isSuperAdmin(msg.sender));
        _;
    }

    modifier onlyOwner() {
        require(isSuperAdmin(msg.sender));
        _;
    }

    function isSuperAdmin(address account) public view returns (bool) {
        return _superAdmins.has(account);
    }

    function isOwner(address account) public view returns (bool) {
        return _owner.has(account);
    }

    /*
     * addAdmin - only super admin adding account as an admin
     */
    function addAdmin(address account) public onlySuperAdmin {
        _admins.add(account);
        emit LogAdminRoleAdded(account);
    }

    /*
     * removeAdmin - only super admin removing account as an admin
     */
    function removeAdmin(address account) public onlySuperAdmin {
        _admins.remove(account);
        emit LogAdminRoleRemoved(account);
    }

    /*
     * addSuperAdmin - only owner adding account as an superadmin
     */
    function addSuperAdmin(address account) public onlyOwner {
        _superAdmins.add(account);
        emit LogSuperAdminRoleAdded(account);
    }

    /*
     * removeSuperAdmin - only owner removing account as an superadmin
     */
    function removeSuperAdmin(address account) public onlyOwner {
        _superAdmins.remove(account);
        emit LogSuperAdminRoleRemoved(account);
    }
}

When I try to addAdmin following issue occurred

transact to PermissionHandler.addAdmin errored: VM error: revert. revert The transaction has been reverted to the initial state. Note: The called function should be payable if you send value and the value you send should be less than your current balance. Debug the transaction to get more information.

Could not figure our what is not working here.


texts:
I want to setup a private testnet. I followed the guide in:

http://ethdocs.org/en/latest/network/test-networks.html

With the following CustomGenesis.json:

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

If I run the command

geth --identity "MyNodeName" --rpc --rpcport "8080" --rpccorsdomain "*" --datadir "C:\chains\TestChain1" --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 init /path/to/CustomGenesis.json

with my specific information I get the follwoing error message:

Fatal: invalid genesis file: hex string has odd length

What am I doing wrong?


texts: Myetherwallet Insufficient balance for transactionGas limit set dangerously high. Approving this transaction is likely to fail

texts:
I'm trying to buy a cripto kittie that costs 0.0035 ETH which is around 3.14 dollars. I'm using my ether wallet for the transaction and when I set up the Gas Limit I get the following error on Metamask:

  Insufficient balance for transactionGas limit set dangerously high.
  Approving this transaction is likely to fail.

I tried setting Gas Limit to 2100, 1, 2 ,3, 0.5 and I still get the same error.

I also don't understand where is the 303.04 dollars estimate coming from if the price of the Kittie is 0.0035 ETH. How to calculate Gas Limit I used ethgasstation.info and still I can get the Gas Limit to get this transaction to pass.


texts: How to return bytes array in Solidity Contract

texts:
I'd like to input & output an array of bytes (of approximately 56 characters each). The input works but the compiler gives a TypeError on bytes[] for the output function:

TypeError: Internal type is not allowed for public or external functions
function iterator() constant returns (address[],uint256[],uint256[],bytes[]){
                                                                    ^_____^

How do I return bytes from a function?  Below is the code:

  CustomMap ledger;
  struct CustomMap {
     mapping (address => uint256) maps;
     address[] keys;
     bytes[] newKeys;
  }

  function createTokens(address recipient) public payable {
    ...

    if (contains(recipient)) {
       ledger.maps[recipient] = ledger.maps[recipient].add(tokens);
    } else {
       ledger.maps[recipient] = tokens;
       ledger.keys.push(recipient);
       ledger.newKeys.push("");
    }
    ...
  }

  function contains(address _addr) constant returns (bool) {
      if (ledger.keys.length == 0) {
         return false;
      }
      uint256 len = ledger.keys.length;
      for (uint256 i = 0 ; i < len ; i++) {
          if (ledger.keys[i] == _addr) {
            return true;
          }
      }
      return false;
  }

  function register(bytes key) returns (bool) {
      if (ledger.keys.length == 0) {
         return false;
      }
      uint256 len = ledger.keys.length;
      for (uint256 i = 0 ; i < len ; i++) {
          if (ledger.keys[i] == msg.sender) {
              ledger.newKeys[i] = key;
              return true;
          }
      }
      return false;
  }

  function iterator() constant returns (address[],uint256[],uint256[],bytes[]){
      uint256 len = ledger.keys.length;
      address[] memory keys = new address[](len);
      uint256[] memory values = new uint256[](len);
      uint256[] memory values2 = new uint256[](len);
      bytes[] memory newKeys = new bytes[](len);
      for (uint256 i = 0 ; i <  len ; i++) {
         address key = ledger.keys[i];
         keys[i] = key;
         values[i] = ledger.maps[key];
         values2[i] = token.balanceOf(key);
         newKeys[i] = ledger.newKeys[key];
      }
      return (keys,values,values2,newKeys);
  }


texts: Can I start mining before my node is fully synced?

texts:
I'm trying to mine some Ether on Ropsten, using a Geth node configured as follows:

--verbosity=3
--networkid=3
--testnet
--mine
--fast
--cache=8192
--datadir=./data
--etherbase=0xMyAccountAddress
--bootnodes=enode://20c9ad97c081d63397d7b685a412227a40e23c8bdc6688c6f37e97cfbc22d2b4d1db1510d8f61e6a8866ad7f0e17c02b14182d37ea7c3c8b9c2683aeb6b733a1@52.169.14.227:30303,enode://6ce05930c72abc632c58e2e4324f7c7ea478cec0ed4fa2528982cf34483094e9cbc9216e7aa349691242576d552a2a56aaeae426c5303ded677ce455ba1acd9d@13.84.180.240:30303,enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303,enode://3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99@13.93.211.84:30303,enode://78de8a0916848093c73790ead81d1928bec737d565119932b98c6b100d944b7a95e94f847f689fc723399d2e31129d182f7ef3863f2b4c820abbf3ab2722344d@191.235.84.50:30303,enode://158f8aab45f6d19c6cbf4a089c2670541a8da11978a2f90dbf6a502a4a3bab80d288afdbeb7ec0ef6d92de563767f3b1ea9e8e334ca711e9f8e2df5a0385e8e6@13.75.154.138:30303,enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303

I don't see any change in my account's balance when I view it on https://ropsten.etherscan.io.

Is this possibly because my node is not yet fully synced?

In the Geth console, I see the following types of printouts, which I think are relevant to my question:

imported  187 receipts in  54.968ms. #640580
commit new work on block 1 with 0 txs & 0 uncles. Took 999.2µs
mined potential block #1
mined block #1

Those numbers vary of course (block numbers are gradually incrementing, while others are just changing "sporadically").

But I think that this block-mining is not the Ether-mining which I've been aiming at.

So how can I determine whether or not any Ether-mining is actually taking place, and if it's not, then how can I determine the cause (or should I wait for the node to be fully synced, as stated in the title of my question)?

Thank you very much!


texts: How do you execute smart contract with future date and not now?

texts: Let's say I am paying to someone some assets, and I want those assets to be in his wallet in 10 days and not immediatelly. We agree with these terms on both sides. For target to agree with that, he has to see that transaction is on blockchain(the one that is going to execute my payment to his wallet), to do his service for me. I have to write a smart contract that will put transaction on blockchain and executed in 10 days, so my receiver sees it that he will get his asset in 10 days, but not yet receive it in his wallet. How does blockchain has a transaction on blockchain, and only executes it in 10 days and not now?


texts: Create Private blockchain network using ganache

texts: I am working on Truffle framework for creating DApps. My Question is that,In ganache can I use my private blockchain network address instead of testrpc accounts.Suppose I use private blockchain network address in ganache how can I access it publicly.


texts: How is this possible from only one worker/PC?

texts:
So I was clicking around on the Ethermine.org site the other day to check out some folks's ETH performance levels and came across one that has me deeply pondering on how he is doing his mining.  I mean, how the hell is this guy mining ETH at 4-8GH/s with only one worker/machine?...

https://ethermine.org/miners/ccf6450724e3271a62f1fa751a381fb3c58e68f2/dashboard

I mean the most PCEI 1X slots I've even seen on one board is 12 and the fastest GPU cards out there mine around 50MH/s per GPU when heavily OCed, so how is this guy doing this?

Is he some how cheating the system or something possibly? Any thoughts on this folks?


texts: Parity - Permission Denied, Cannot write version file

texts:
I am trying to run a Parity daemon. Here is my shell command:

sudo parity --db-path . --port=20000 --ws-port=20001 --jsonrpc-port=20002 --jsonrpc-apis web3,parity,parity_accounts,personal,eth daemon parity.pid

with or without sudo permissions, I am receiving the error message:

Error upgrading parity data: CannotWriteVersionFile(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })

I have also given 777 permissions to my db-path folder with the (spicy and dangerous) command

sudo chmod 777 -R .

I am still receiving this error. What am I missing?


texts:
I am using keccak hashing algorithm for converting documents to hashes, the algorithm is producing hashes like:     **8185f41244d1a00110cff37b60732228623a82e7da905cac00777029887816ff**

  I want to store this hash in a smart contract in bytes32 rather than
  string (bytes32 consumes less gas then string) but I am getting error message as:  Given parameter is not bytes