texts: Error: VM Exception while processing transaction: out of gas. error while processing transactions

texts:
MY CONTRACT :

pragma solidity ^0.4.6;

contract TestContract{
    string coaf;
    string choice;
    string info;
    string isin;
    string recordDate;
    string exDate;

    function TestContract(string _coaf, string _choice, string _info,string _isin,string _recordDate,string _exdate){
        coaf = _coaf;
        choice = _choice;
        info = _info;
        isin =_isin;
        recordDate=_recordDate;
        exDate=_exdate;
    }

    function getFields() constant returns(string, string, string,string,string,string){
        return(coaf,choice,info,isin,recordDate,exDate);

    }
   function SetFields(string _coaf,string _choice,string _info,string _isin,string _recordDate,string _exdate){
     coaf=_coaf;
     choice=_choice;
     info=_info;
     isin=_isin;
     recordDate=_recordDate;
     exDate=_exdate;
   }
    function setChoice(string _choice) {
        info = _choice;
    }

}

MY CALL :

 TestContract.deployed().then(function(instance) {
    return instance.SetFields(coaf,choice,info,isin,exDate,recordDate,{gas:3000000},{from:web3.eth.accounts[1]});
  }).then(function(result) {
    save_th(result.tx,type);
    console.log("Transaction:", result.tx);
    console.log("Finished!");
    //done();
  }).catch(function(e) {
    console.log(e);
  //done();
  });

MY DEPLOYMENT :

    var TestContract=artifacts.require('TestContract');
    module.exports = function(deployer) {
    // Pass 42 to the contract as the first constructor parameter
    deployer.deploy(TestContract,"Default","Default","Default","Default","Default","Default");
};

NEED URGENT HELP !!!!


texts:
I try to search on ERC 223 receiving contract implementation online but most of them just providing the interface. I am wondering if it is possible to do something like this for ERC 223 receiving contract.

Eg: I send token from transfer function in the main token contract. And based on the value (probably sig of functions in the receiving contract and values), the functions in receiving contract is call from tokenFallback and if the functions fail halfway all transaction reverted.

contract ERC223Receiver {
    function tokenReceiveLogic1() internal {
        require(tokenReceiveAmount > 3);
        // logic here
    }

    function tokenReceiveLogic2() internal {
        require(tokenReceiveAmount > 1);
        // logic here
    }

    function tokenFallback(
        address _sender,
        uint256 _value,
        bytes _extraData) returns (bool) {
        if (condition 1) {
            // trigger tokenReceiveLogic1()
            // if tokenReceiveLogic1 fail halfway, revert all transaction
        } else if (condition 2) {
            // trigger tokenReceiveLogic1()
            // if tokenReceiveLogic1 fail halfway, revert all transaction
        }
    }
}


texts: What value does Solidity return if a record is queried that doesn't exist?

texts:
If you have a function querying a flat file record:

function getData(address _storageContract) constant returns(uint256){

    return dataStorage(_storageContract).getUIntValue(sha3("RecordID"));

}

and this RecordID doesn't exist: What is the value returned by Solidity?


texts: Can a Smart Contract read an XML file or an XML Stream?

texts:
Since Smart Contracts are event driven, can a new XML file thats generated by some remote system be an event source input to the smart contract?

I.e., when the XML file is generated on a folder e.g., /dir/ethereum, this smart contract is automatically evoked via web3j, javascript etc.


texts: Is it possible to create a button "connect to wallet"?

texts:
I'm learning web3 and blockchain in general. I'd like to create a button that says "connect to wallet " in order to connect with metamask wallet, but I do not know if
1- I need to connect first with web3 and generate de smart contract deployed, and then when the users clicks the connect to wallet i just need to pull the accounts
2- That button will trigger everything (web3 initialization, smartcontract deployed in the provider with truffle-contract, and then get the accounts)
how should be the behavior?


texts: Architecture best practices for decentralized, multi-seller sales platform

texts:
My question revolves around contracts creating subcontracts, and best practices with contract creation.

The Story: I'm creating a tool to help people buy Widgets, Gizmos and Ratchets, all of which are generic commodities. Let's call the tool ACME Industries. Now, ACME doesn't supply the products - other entities send ACME a deposit of ether, along with the prices they charge for each product, and they're listed as sellers. A buyer comes along and clicks on Widgets, chooses from a list of sellers, deposits ether into a contract. Some logic happens and then he gets physical stuff and the seller gets ether and a review with ACME.

The Questions:

ACME Industries is itself a contract (I think) - it has functions like registerSeller{} that need to be decentralized and transparent. It also needs to hold mappings like uint => address[]. Or can it be just a JS framework for creating contracts (like acmePurchase{})?
Should Widgets, Gizmos and Ratchets all have a separate address for contract creation, or should that information be appended to the order data?

Example:

// Product type contained in message
{"value": 555, "sender": "0x0...", "data": {"seller": 23, "product": 2}}

// Product and seller defined by address ether is sent to
{"value": 555, "sender": "0x0..."}

I think I'm having trouble wrapping my head around the fundamental differences in architecture here (versus a centralized transaction database).


texts: Link between ICO, Mining and the Technology platform

texts:
this is not a question about markets or how to mine, but rather about the lifecycle of a coin on the platform. WHY would anyone purchase coins on an ICO? Is the aim to pick an ICO that might just hit the jackpot? Seems like a bit of gambling, and seems like a way for a startup to get capital without actually giving away any shares.

Now, what does one do with the coins? Unless they want to use the software platform which is built on this coin, in which they can just spend the coin to use the service (e.g. Veredictum).

I understanding the mining, you provide computational power and get paid for it, a block you mine gets used by someone on the platform and they pay you for it. Or you hang onto it until the price goes up, because so many people are using the platform that the price fluctuation happens due to supply and demand.


texts: Is it possible to change the gas price during contract method execution?

texts:
Is there any way in Solidity to change the gas price during contract method execution?

For example using Assembly?


texts: Solidity Browser Compiler — Error: Assertion failed

texts:
Here's the code:

contract C {
    function a(uint x){}
}

I try to call C.a(1000000000000000000);

and get an error:

Error encoding arguments: Error: Assertion failed

while C.a(100000000); is perfectly fine

What's the problem there?


texts: Why are the dataset and MixHash required for Proof of Work?

texts:
From the yellow paper; for a block to be accepted as valid, an 8 byte number, n_rand, must be found that satisfies equation 253:

 = block header without n_rand and MixHash
 = difficulty
 = nonce

My interpretation is that d is the dataset - a value cryptographically derived from the number of previous blocks. From this, the Mixhash is calculated in the PoW function

Why are the dataset and MixHash values required?

If the network were to agree to accept the PoW function with d set to 0, wouldn't the system still be cryptographically dependent on valid state transistions, as there must be consensus on H_n? Would the system not, therefore, still work?


texts: I can't find my address from MEW when i want to connect my ledger nano s

texts:
I have been holding for 6 or 7 months now and when I went to check myetherwallet today, I was unable to find my wallets with all my ETH and my ERC-20 tokens. I plugged in my ledger like I always did, and connected it to MEW, but the addresses I'm used to seeing are no longer there. I scroll through the list of addresses but can't find them.

I have my addresses written down, and when I check them I can see my coins in there, but like I said I am unable to find the address on MEW when I plug in my ledger nano s. Is there a way to manually search for my address or something?

Anyone else having this issue? I'm guessing it has something to do with Ledger Nano S updates or MEW updates, but I can't figure this out and it's super scary, because I'm afraid I won't be able to get my tokens out of those addresses.

Any help on this would be much appreciated. Thank you so much.


texts: Solidity: How to get the hash of head block in private chain?

texts:
I'm trying to get the hash value of the head block in an Ethereum private chain. I use the following method in my smart contract:

   blockNumber = block.number;
   blockHashNow = block.blockhash(blockNumber);

BUT, the value of

  blockHashNow

is always this:

  0x0000000000000000000000000000000000000000000000000000000000000000

Also, in the private chain, it seems the number of blocks keeps increasing but I'm not sending any transaction to it.

Question 1: How to get the hash value head/current block in a private chain?

Question 2: Why the number of blocks keeps increasing in a private chain even though no transaction is being sent to the chain?

Edit: I found the answer to the 1st question here:

Inside a smart contract, is it possible to get latest mined block's number and its hash?

In short, I should've done:

  blockHashNow = block.blockhash(blockNumber-1); // -1 has been added now


texts: Solidity. Truffle test not passing "expected { _events: {},..." to equal

texts:
I can't get a test to pass, for me it is very clear but I am missing something obvious:

This is the smart contract:

function getContractOwner() public pure returns (string memory contractOwnerAddress) {
    return "0x67F4CfB03aA5E2E71De1470ae26adB7e33B7892E";
}

This is the test:

contract("Exams", async accounts => {
  it("should pass this test", async () => {
    assert.equal("0", "0", "LOGICAL!")
  });
  it("should keep the contract owner", async () => {

    let instance = await Exam.deployed();
    let address = instance.getContractOwner.call(accounts[0]);
    // console.log(address);
    assert.equal(address.valueOf(), "0x67F4CfB03aA5E2E71De1470ae26adB7e33B7892E", "the address is not correct");

  });
});

I get this error:

 Contract: Exams
    ✓ should pass this test
    1) should keep the contract owner
    > No events were emitted

  1 passing (74ms)   1 failing

  1) Contract: Exams
       should keep the contract owner:
     AssertionError: the address is not correct: expected { _events: {},   emit: [Function: emit],   on: [Function: on],   once: [Function: once],   off: [Function: removeListener],   listeners: [Function: listeners],   addListener: [Function: on],   removeListener: [Function: removeListener],   removeAllListeners: [Function: removeAllListeners] } to equal '0x67F4CfB03aA5E2E71De1470ae26adB7e33B7892E'
      at Context.<anonymous> (test/TestExams.js:15:15)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)


texts: Are number of transactions in Merkle Tree always "even"?

texts:
According to definition and structure of the Merkle Tree, apparently, the number of transactions in a block that inserted in a Merkle Tree structure must be even (and not odd), is not it?

Please see the following figure which shows a Merkle Tree:

All the examples that I have seen, are like this one, meaning that apparently always number of transactions in a Merkle Tree are even (ex. in the example above there are four transactions). Is there an example in which number of transactions would be odd? And what happens if number of transaction are odd? (ex. how to insert 5 transactions in above example?)


texts: how can I get the data returned from solidity function from transaction id in web3js when a solidity function is callled?

texts:
I want to get the return data written in solidity function in web3js .
I am using the web3.min.js from the truffle pet-shop package as the web3 library . Everything is working fine when calling the function it is returning the transaction data from which I used web3.eth.getTransactionReciept to get the details and the gas is also used. Now I want the data which is returning
my solidity method

 function helloworld() public returns (string) {
        return "helloworld";
    }

The js part

<script>

    if (typeof web3 !== 'undefined') {
    web3 = new Web3(web3.currentProvider);
    } else {
    web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"));
    }
    web3.eth.defaultAccount = web3.eth.accounts[0];
    console.log('web3.eth.accounts :', web3.eth.accounts);
    var walletContractJSONabiGlobal;
    $.getJSON('./contracts/Wallet.json',async function(walletContractJSONabi) {
        walletContractJSONabiGlobal = walletContractJSONabi;
        var walletContract = web3.eth.contract(walletContractJSONabi.abi);
        var walletInstance = walletContract.at('0xc74c8d941494495a4f65c42bebc556398e1f028d');
        walletInstance.helloworld((err,data)=>{
            if (err) {
                console.log('err :', err);
            } else {
                console.log('data :', data);
            }
        })

    })

</script>

I getting the data in console

  data :
  0x988d4bd3169a4d752f6e4ac230d01840f2f7b4cc8e87d768a8e41b6fe867740d

I did the web3.toAscii(this transaction is) but it is not coming proper result which is expected as this is not a hex value

When output of web3.eth.getTransactionReciept

  blockHash :
  "0x552a93b0035571b93e4a1a89daa445663b0ddb29974078cdf9a250b7f873ca96"
  blockNumber : 10 contractAddress : null cumulativeGasUsed : 21899
  gasUsed : 21899 logs : [] logsBloom :
  "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  status : "0x01" transactionHash :
  "0x988d4bd3169a4d752f6e4ac230d01840f2f7b4cc8e87d768a8e41b6fe867740d"
  transactionIndex : 0

Please Help in this Thank YOu


texts: Why did the Fast sync stop at 2.4 million blocks when updating my Geth?

texts:
My goal is to be able to access my Mist Wallet on my iMac (which I installed 8 months ago, and bought some Ether on then). I deleted my Blockchain and ran Geth through the Terminal, with this:
./geth --fast --cache 1024

However, it stopped the Fast Sync at 2.4 million blocks. And then went very slow (to my calculations: 41 days until all of the blockchain has been downloaded.

What is the solution do getting access to my Mist wallet faster?


texts:
I was scrolling around Ethereum StackExchange and I came across with an interesting thought that I have never read or seen anyone talk about.
I'm perfectly aware of how contracts work and are compiled, generating the ABI and Bytecode. I was thinking, is there a way to store the ABI struct and Bytecode (the outputs of the compilation)  as variables inside the smart contract itself?

I drew a scheme in a paper, and it seems that I end up on a paradigm of "who comes first, the chicken or the egg?". Because to get the ABI and Bytecode, I need the compilation to occur... and for the compilation to occur, I would need the ABI and bytecode stored in variables previously. So My conclusion is that this ain't possible to do. I searched a bit and couldn't find anything about this. Did anyone ever ask this? Any idea if this is actually achievable?


texts: Sending ether to a contract without data throws an error

texts:
I'm trying to deploy a smart contract that allows users to buy tokens that can be used to pay fees on its platform.
In case someone is going to send ETH directly to the contract address without calling a public function I want to provide a fallback that automatically buys tokens by calculating the amount from the value sent by the user.
The code is as follows.
pragma solidity >=0.4.22 <0.9.0;

import "./BEP20Token.sol";

contract DappTokenSale {
    address payable admin;
    BEP20Token public tokenContract;
    uint256 public tokenPrice;
    uint256 public tokensSold;

    event Sell(address _buyer, uint256 _amount);

    constructor (BEP20Token _tokenContract, uint256 _tokenPrice) public {
        admin = msg.sender;
        tokenContract = _tokenContract;
        tokenPrice = _tokenPrice;
    }

    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when (div)iding by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    function multiply(uint x, uint y) internal pure returns (uint z) {
        require(y == 0 || (z = x * y) / y == x);
    }

    function buyTokens(uint256 _numberOfTokens) public payable {
        require(msg.value == multiply(_numberOfTokens, tokenPrice));
        require(tokenContract.balanceOf(address(this)) >= _numberOfTokens);
        require(tokenContract.transfer(msg.sender, _numberOfTokens));

        tokensSold += _numberOfTokens;

        emit Sell(msg.sender, _numberOfTokens);
    }

    function() external payable {
        uint256 _numberOfTokens = div(msg.value, tokenPrice, 'Division by zero');
        buyTokens(_numberOfTokens);
    }
}

If I send ether to the contract deployed on Ganache I receive the following error:
Error while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0x4ac3ca04afe9549e2576c012ed81b8414d92c2b19ec8365c1d52ef31275a7d15":{"error":"revert","program_counter":720,"return":"0x"}
I have almost zero experience with solidity but I guess the fallback function doesn't get called and Ganache throws an error and reverts.
I tried to use the newer fallback syntax. fallback() external payable {...} but get a compile error ParserError: Expected identifier but got '('.
The solidity version being used by truffle is 0.5.0.


texts: Transaction remains pending on RINKEBY network

texts:
var Web3 = require('web3');
var Tx = require('ethereumjs-tx');
const fs = require('fs');
const solc = require('solc');
const generateWallet = require('ethereumjs-wallet');
var toAccount = 'TO ACCOUNT';
var contractAddress = 'CONTRACT ADDRESS';
var myAddress = 'MYADDRESS';
var privateKey = Buffer.from("PrivateKey","hex");
var web3 = new Web3();
web3.setProvider(new                                                                             web3.providers.HttpProvider("https://rinkeby.infura.io/ACCESS TOKEN"));
const input = fs.readFileSync('icoToken.sol');
console.log(input,"INPUT");
const output = solc.compile(input.toString(), 1);
const bytecode = output.contracts[':FixedSupplyToken'].bytecode;
const abi = JSON.parse(output.contracts[':FixedSupplyToken'].interface);
const contract = new web3.eth.Contract(abi,"CONTRACT ADDRESS");
var balance = contract.methods.balanceOf(myAddress).call();
console.log("BALANCE:",balance);

var transacTObject = {
to: '0x897bb6a4f3e7c334d42f355a88fbdfbf8ce05bf2',
value: '10000000000000000',
}
web3.eth.getGasPrice(function (err, price) {
if (err) {
    return err.message;
} else {
    console.log(price, "gas");
    gasPrice = 21000000000;
    gas = web3.utils.toHex(price);
    console.log(gasPrice, "gasprice");
    gasPriceHex = web3.utils.toHex(21000000000);
    gasLimitHex = web3.utils.toHex(21000000000);
    console.log('limitHex', gasLimitHex);
    console.log('Current gasPrice: ' + gasPrice + ' OR ' + gasPriceHex);
    web3.eth.getTransactionCount(myAddress, function (err, data) {
        if (err) {
            return err.message;
        } else {
            console.log(data, "NONCE");
            nonce = data + 6;
            nonceHex = web3.utils.toHex(nonce);
            console.log('nonce (transaction count on fromAccount): ' +       nonce + '(' + nonceHex + ')');

            tokenTransfer =  contract.methods.transfer('RECEIVER ADDRESS',"1000000000000000000").encodeABI();
            if (tokenTransfer) {
                console.log(tokenTransfer, "tokenTransfer");
            }
            var rawTx = {
                nonce: nonceHex,
                gas: 100006,
                gasPrice: gasPriceHex,
                gasLimit: gasLimitHex,
                to: contractAddress,
                from: myAddress,
                value: '0x00',
                data: tokenTransfer,
                chainId: 4,
            };
            var tx = new Tx(rawTx);
            tx.sign(privateKey);
            var serializedTx = tx.serialize();
            console.log(serializedTx, "SERIALIZETX");

            web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), function (err, hash) {
                if (err) {
                    console.log('Error:');
                    console.log(err.message);
                } else {
                    console.log('Transaction receipt hash pending');
                    console.log(hash);
                    web3.eth.getTransaction(hash, function (err, hash1) {
                        if (err) {
                            console.log('Error:');
                            console.log(err.message);
                        } else {
                            console.log('Transaction receipt:', hash1);

                            web3.eth.getTransactionReceipt(hash, function (err, hash2) {
                                if (err) {
                                    console.log('Error:');
                                    console.log(err.message);
                                } else {
                                    console.log('Transaction receipt:', hash2);
                                }
                            });
                        }
                    });
                }
            })
        }
    })
}

})


texts: What can I use to allow users to send transactions through a website?

texts: I am trying to build a website that will allow multiple users to send Ethereum transactions without having to install a node. My server is running a node, which is configured to accept requests from any internet address, and it seems that I should be able to connect to the node from any device through a web browser. Is the Ethereum JavaScript API useful to doing this? Thank you!


texts:
Am a developer and of late most projects being posted are on ico creation an example,

  1.Need someone to create a complete ICO website including ERC 20 token creation via Ethereum.

  2.Need ICO, ucoincash script, lending and staking

Looks simple enough, but the problem is there is very few documentation on the subject. Am trying to learn the ethereum but need guidance on how to go about this jobs.

I do not have a clue on how to handle this jobs any help on how to tackle them will be greatly appreciated.


texts:
I am new to blockchain and am having certain doubts.
Can we substitute cryptocurrency to carry out blockchain operations in any way ?
Actually what i feel is that the volatility in cryptocurrencies and the hustle to create and manage crypto wallets is what makes layman stay away from using blockchain based solutions. If we use an alternative to cryptocurrencies then it could help simplify things further..
Requesting thoughts on the same.


texts: How to update multiple values in a mapping without a loop?

texts:
if you have a mapping like:
mapping (uint => bool) owned;

How would you go through and update 1000 items in that mapping to set them all to true?
Without using a loop due to gas prices.
Is there a way to do this?
Is there another way with another structure besides maps? Arrays? mapping to a struct?
An example might be - I want to set items 500 - 1,500 to true and the rest are false. How would you achieve this?
edit: a good example would be batch minting ERC-721 tokens. How would you create 1000, or 20k tokens? You obviously can't do a loop to update the owner mapping.


texts:
So, for my studies, I am supposed to interact with a contract function that has the following built in condition:

if (ecrecover(_h, _v, _r, _s) == msg.sender && _h == sha3(this))

I am supposed to provide _h, _v, _r and _s via contract transaction so that the statement equals true.

Our uni has a test server node which we can connect to via mist --rpc and we can also open a web3 provider via http to that node.

I know how to sign messages in web3 and how to extract r, s and v so that ecrecover returns my address. But I can only get the right signature if I use the ethereum signature prefix and thus the condition _h == sha3(this) will always fail. I don't know what to do. I've been trying to somehow access my private key so I can use ethereumjs-util to sign the message but I can't get it.

How can I get a signature with my testnet address that doesn't automatically add the prefix??!


texts:
I understand that there needs to be an incentive for the nodes to be keeping the blockchain up and running by validating blocks, and mining rewards is that incentive.

I fail to understand why does mining reward not get drawn from the sum of transaction fees in that block? That is what will happen on the Bitcoin network once all the 21million coins have been mined

In that respect, why doesn't Ethereum have a higher limit? Will it ever exist? If so, why? Wouldn't uncapped coins have an inflation effect?

I'm sorry i think i have clubbed in multiple questions here, but they are doubts arising from the same mental model.


texts:
I made a delegatecall to the REP contract to approve my contract to spend tokens on behalf of a user and my transaction is failing for some reason here is my code:

(bool b,) = REPAddress.delegatecall(abi.encodeWithSignature("approve(address, uint256)", this, noShowBondPayment));
require(b, "delegatecall failed");

Am I using delegatecall correctly?


texts: I get some “POST 404 (Not Found)” when I deploy the IPFS webui in production

texts:
I followed all the guidelines to deploy property this helpful tool. When I make it in my local machine, all works fine. But when I try to deploy the same in a production server, it shows me some 404 errors that I don't understand why.

Here is my ipfs config file (the important lines):

"API": {
   "HTTPHeaders": {
   "Access-Control-Allow-Credentials": [
      "true"
   ],
   "Access-Control-Allow-Methods": [
      "HEAD",
      "PUT",
      "GET",
      "POST"
   ],
   "Access-Control-Allow-Origin": [
      "*"
   ]
}

"Addresses": {
   "API": "/ip4/127.0.0.1/tcp/5001",
   "Gateway": "/ip4/127.0.0.1/tcp/8080",
   "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001"
   ]
}

"Gateway": {
   "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
         "X-Requested-With",
         "Range"
      ],
      "Access-Control-Allow-Methods": [
         "GET"
      ],
      "Access-Control-Allow-Origin": [
         "*"
      ]
   },
   "PathPrefixes": [],
   "RootRedirect": "",
   "Writable": false
},

Here is my nginx config file (the important lines, in order to set the proxypass):

server {
   listen 80;
   server_name gorillafirma.com;

   location /ipfsui {
      proxy_pass http://127.0.0.1:5001/webui/;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
   }

   location /ipfs {
      proxy_pass http://127.0.0.1:5001;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
   }
}

So, when I try to deploy the URL, http://208.68.36.4/ipfsui. I have getting this:

As you can see I am getting some 404 Errors that i don't understand. Taking into account that 208.68.36.4 is the IP for the gorillafirma.com domain


texts:
If I use --fast syncing, will the contract execution Event logs be
  available?

I wish to setup a private node to make RPC request.


texts: What happens if demand for bonded validators is greater than 256?

texts:
This answer suggests there will be a maximum of 256 bonded validators for Casper. What if 257 nodes want to become bonded validators?

Is there a race? What's the consensus mechanism to pick 256 bonded validators? Can this lead to instability in Casper?


texts: What happens if a token decides to leave the ethereum blockchain?

texts: Let's say I send some compatible ERC-20 tokens to myetherwallet (not ether). Two years later, the developers/miners/company that control the token decides to move from the ethereum blockchain to their own one that they just created. In this scenario, what would happen to the tokens in myetherwallet?


texts:
I am using web3 v1.0.27 and trying to send erc20 tokens. These tokens have a decimal of 18 but might have a different decimal. Trying to keep it generic. I have tried the following.

  const amountToSendinDecimal = amountToSend * Math.pow(10, decimal);
  const amountToSendinDecimalBN = new BigNumber(amountToSendinDecimal);

With a decimal of 18 and value of 3178.44. I keep on getting the following error.

[BigNumber Error] Number primitive has more than 15 significant digits: 3.1784400000000003e+21

Cannot seems to find a work around for it.

Any suggestions.


texts: What are the transaction ordering options in ganache?

texts:
I saw this got Geth and Parity but I am just wondering if the are transaction ordering options in ganache too?
I yes what are these, what is the default one and how to enable them?


texts: Infinite gas estimate for an empty function

texts:
I have an empty function like below:

function myFunction(int[24] param1, int param2) public returns (int s) {
}

When I calculate the estimated gas value of this empty function, Remix is telling that it is infinite. Does anyone know why?

PS: I realized that if I remove param1, the estimated gas value is not infinite but 269.


texts: Is it good approach to interact with smart contract using c# library instead of Web3-js?

texts:
I'm learning Ethereum, and having web application development experience mostly with Microsoft Technologies such as ASP.NET MVC and WebAPI.

I've learned Solidity recently!. After reading about deployment of smart contract, what I found is we need to deal with other js, framework(s) and many other tools. One essential thing is Web3-js. To interact with smart contact, you need to learn Web3-js too!

But does it really required to learn Web3-js?(bit hard for newbie)

As I've knowledge of .NET, is it good approach to interact with smart contract using C# library(i.e Nethereum) and what are the disadvantages to use that library?


texts: Issue in installing truffle-hdwallet-provider

texts:
I am trying to install "truffle-hdwallet-provider" using the command "npm i truffle-hdwallet-provider --save".

I am getting the beow mentioned error. Please assist me in resolving this.

truffle-hdwallet-provider@0.0.6 requires a peer of truffle@4.x but none is installed

Version details:
NPM - 5.6.0
NODE - v8.11.3


texts: Source File requires different compiler version

texts:
I am using solidity version "pragma solidity ^0.4.20;". When I checked JSON files of contract, compiler version shows :

"compiler": {
    "name": "solc",
    "version": "0.4.21+commit.dfe3193c.Emscripten.clang"
  }

Still I am getting error :

  Source file requires different compiler version (current compiler is
  0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version

Command 'truffle version' gives :

 Truffle v4.1.5 (core: 4.1.5)
 Solidity v0.4.21 (solc-js)


texts: I have an ethereum wallet. How can I get the public key? I am getting the only private key.


texts: How to register truffle contract with ENS(Ethereum Name Service)?

texts:
I am wondering how I can publish my smart contract to ENS via truffle. I think I might need to include a smart contract called ENS.sol, but I am not sure.

Is it the same as publishing a package to ethpm, do I use truffle publish?

Does truffle have build in ENS support like Embark.


texts:
I have some transaction that is sent and from time to time when I call the eth_getTransactionReceipt I get a null.

I see esentially two approaches for handling this:

I could reiterate the call to eth_getTransactionReceipt in order to eventually get a non null TransactionReceipt. This approach works in some cases but will not handle the case where the transaction fails.
Resending the exact same transaction with eth_sendRawTransaction results in a "nonce too low" in the case where the transaction is still pending.

How could one handle those two possible scenarios (transaction not yet implemented, or transaction did not pass)?

I have two questions on the error codes:

I saw in some cases the "known transaction" as error instead of "nonce too low". Indeed if a transaction is resent then one would expect to get a different error than in cases of nonce too low.
By the way what could be the list of possible error codes? Standard references such as https://github.com/ethereum/wiki/wiki/JSON-RPC do not give the list of possible errors.

Is there a recommended way to handle error cases of transactions?


texts: Incorrect return value from tuple with fixed-length array

texts:
Why does the function below return [[1, 2], [2, 3]] instead of the expected [[1, 2], [3, 4]]? Tested in browser-solidity.

contract Contract {
    function test() constant returns(uint8[2], uint8[2]){
        uint8[2] memory a = [1, 2];
        uint8[2] memory b = [3, 4];
        return (a, b);
    }
}

Returning a fixed-length array as the first element in the return tuple appears to throw off the indexed memory location of the following elements, regardless of their type:

function test() constant returns(uint8[2], uint8) {
    uint8[2] memory a = [1, 2];
    uint8 b = 3;
    return (a, b); // WRONG: [[1, 2], 2]
}

This is also confusing:

function test() constant returns(uint8[4], uint8) {
    uint8[4] memory a = [1, 2, 3, 4];
    uint8 b = 3;
    return (a, b); // WRONG: [[1, 2, 3, 4], 2]
}


texts:
I incorrectly sent some ETC from my bter account to an ETH address on Poloniex.

https://etherscan.io/address/0xa257d73760c8918aac1367ee983c1b4341f6c357

https://minergate.com/blockchain/etc/transaction/0x7a89c339c16b18536465a45554cbb55ccd9c76af16a73f64001dff11a6553149

After waiting for a couple of months on a response they told me: "I'm sorry, your ETH deposit address is blockchain specific so ETC can not be recovered from it."

Is there still anything I can do, or are the coins really lost forever?

What is a blockchain specific deposit address anyways?

edit:

Thanks for the responses. I mentioned the private key, but they specifically replied with the fact that my ETH address is "blockchain specific". What does that mean?

edit2:

I keep getting a flag that the question has been asked before, but I see no mention of contracts in the one I'm referred to. How is it a duplicate question then?


texts: When i deployed my contract in binanace Mainnet,it is deployed.But when i calling stake function it gives gas estimation error.can anyone suggest me some steps for staking contract.


texts: Data persistence in ethereum smart contract across deployments

texts:
I have developed a SmartContract using ethereum which has an internal struct to store some of the privilege mapping. I find that whenever there is any change in the smart contract and the deployment is happening, the data is lost across upgrades.

SmartContract

contract PrivilegesContract is SuperAdminContract {

    struct Privilege {
        uint Id;
        string Name;
    }

    uint private privilegeId;
    mapping(uint => string) private Privileges;

    function Add(string name) public EnsureSuperAdmin returns (uint) {
        Privileges[privilegeId] = name;
        privilegeId = privilegeId +1;
        return privilegeId;
    }
}

Is there any persistent store that we can use so that i can retrieve the data after a new deployment or be unaffected by the deployments. If there is no persistent datastore, we should have a mechanism to read and initialize the data from the previous transactions in the block. Kindly share the behavior to be followed.


texts: Transaction/Function Call Gas consumption

texts:
I've read in the documentation that reading data from the blockchain does not cost gas. It costs gas only when saving data to the blockchain or when executing operations like +, -, * etc (see the opcodes).

BUT,
I've created this simple contract:

pragma solidity ^0.5.0;
contract A{
    uint public x = 10;
    function get_x() public view returns(uint){
            return x;
    }
}

When calling get_x() in remix it says:  execution cost: 413 gas (Cost only applies when called by a contract). What does it mean? Do I have to pay gas for calling get_x(). If yes, why?

More that that, if I get the value of x whitout calling the get_x() getter function (it's a public variable so a getter with the same name x() is automatically created) I get another gas value:  execution cost: 383 gas (Cost only applies when called by a contract)


texts:
I have read the following:

Gene is working on his laptop with several tabs open in his browser.
He unlocks his MetaMask wallet to make a transaction. An attacker uses
the open tabs to see that Gene is using MetaMask.
The attacker sends Gene a pop-up message saying that his transaction
has failed. This happens sometimes, so Gene isn’t worried. He enters
his password to remake the transaction. The attacker now has access to
Gene’s wallet.

I quite don't get how an attacker uses the open tabs to see that Gene is using Metamask.
I'd appreciate it if you explain this a little bit further.


texts: Faucet and wallet deployment on a private PoA set up using puppeth

texts:
I'm trying to setup a private PoA BC using puppeth. While in the background, nodes (sealers and tx submitters) are working fine, I'm facing a problem with deploying a faucet and a wallet using puppeth. Actually these services are marked "service offline", and when I go on their webpages I'm getting "503 Service Temporarily Unavailable". Here's my network stats

I also have a question about blockchain explorers for private networks, why is puppeth giving the possibility of having a BC explorer only for PoW networks (ethash only, impossible for clique)? Also, is it possible to deploy an etherscan like BC explorer for private networks? I've been using etherparty, but etherscan is definitely better.
Thanks in advance for your answers.


texts:
How do I know if openethereum syncing is done and what should I do next?
This is what my current state looks like


texts:
My private network is not EIP155 enabled. It does runs the latest version of geth, but the blockchain has EIP155 field set to nil .

I used MyEtherWallet and submitted a EIP155 transaction (to test what happens) and now this transaction is stuck:

> eth.getTransaction("0x31189dbbe5fbd5fcb779889f0c31c670a2ccbabcfdd94c130d9ac9f32e526af4")
{
  blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  blockNumber: null,
  from: "0x7b5576dfeb32429899732a4183ea106407899a68",
  gas: 100000,
  gasPrice: 32000000000,
  hash: "0x31189dbbe5fbd5fcb779889f0c31c670a2ccbabcfdd94c130d9ac9f32e526af4",
  input: "0x",
  nonce: 1,
  r: "0xaf51eeec11f04fbb1801ebf00945ab770c511d8c7531ecde6b460cbfde381328",
  s: "0x251b0b1be78600de8ff8604eb5b4809091341a67819d5534c86221a5da8860ca",
  to: "0x73a0e252e5114c21d5e601fcb7f3b6e341da29fd",
  transactionIndex: 0,
  v: "0x1f6",
  value: 990000000000000000
}
>

I submitted it yesterday, 20 hours have passed but it still pending. The network isn't busy , so there is no problem with gas limits, also I increased the gas on purpose. So, what is going to happen now, will this transaction be there forever? How could I remove it? And why it was accepted in the first place, why didn't the node reject it?


texts: Could we fork Ethereum and make Ether ERC-20 compliant?

texts:
Is it possible for some future fork to make Ethereum ERC-20 compliant?
Since ERC-20 didn't exist at the beginning of Ethereum, I'm curious if it would be beneficial for Ether to interact more directly with ERC-20 tokens, without the need for Wrapped Ethereum.


texts: Is Ethereum the only way to develop Dapps?

texts: I have searched a couple of resources about the implementation of Dapps, most of them redirected to ethereum itself. Is Ethereum the de facto platform for developing Dapps or do we have any other?


texts: Can ether be used as any crypto for paying things? like in a e-shop

texts: My understanding is that ether cannot be used that way, like other cryptocurrencies. is that correct?


texts: Why does this payable address fail to transfer funds?

texts:
contract MyContract {
  address payable public owner;
  address payable public withdrawAddress = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;

  constructor() public {
    owner = msg.sender;
    ...
  }

  function totalBalance() external view returns(uint) {
    // CAST CONTRACT TO PAYABLE ADDRESS
    return payable(address(this)).balance;
  }

  function withdrawFunds() external withdrawAddressOnly() {
    msg.sender.transfer(this.totalBalance());
  }

  modifier withdrawAddressOnly() {
    require(msg.sender == withdrawAddress, 'only withdrawer can call this');
    _;
  }

  ...

contract MyContract {
  address payable public owner;
  address payable public withdrawAddress = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;

  constructor() public {
    owner = msg.sender;
    ...
  }

  function totalBalance() external view returns(uint) {
    // PAYABLE ADDRESS SET ABOVE
    return owner.balance;
  }

  function withdrawFunds() external withdrawAddressOnly() {
    msg.sender.transfer(this.totalBalance());
  }

  modifier withdrawAddressOnly() {
    require(msg.sender == withdrawAddress, 'only withdrawer can call this');
    _;
  }

  ...

This first one's withdrawFunds works, but the second doesn't.
The only difference is the totalBalance function.

First example: casts the contract to payable address, and get's it balance
Second example: uses the owner state variable, and get's it balance

The owner variable is already a payable address, so I don't understand why the first one succeeds and the second one fails?


texts: web3.eth.getAccounts() does not return all addresses

texts:
so I'm trying to retrieve all the account addresses that are currently present on MetaMask.
So I tried to do that using window.web3.eth.getAccounts(console.log) but that seems to be returning just an array of size with the current address selected in MetaMask. Is there anyway I could get all the accounts?


texts:
I have one interface like the following:

pragma solidity ^0.4.11;
interface TokenInterface {
    function transfer(address recipient, uint amount) external returns(bool);
}

And the implementation in another contract:

pragma solidity ^0.4.11;
import "./TokenInterface.sol";
contract TokenImpl {
    function transfer(address recipient, uint amount) public returns(bool)
    {
         return true;
    }
}

The problem is that if I change to the following the code. Remix don´t tell me nothing related to. The method not correspond to the interface.

pragma solidity ^0.4.11;
import "./TokenInterface.sol";
contract TokenImpl {
    function transfer(address recipient, uint amount) public returns(bytes32)
    {
         return "true";
    }
}

Just with the import tag the Impl is applying the Interface structure??

I´m not doing the interface call in the rigth way??

I have to add a constructo qith the address of the Interface?? (But a interface can´t deploy)

I´m a lit confused


texts: can I broadcast transaction to 10 node with 10 nonce?

texts:
Will eth nodes be able to broadcast multi transactions signed by different but correct nonce in a same time?

example: there are 10 nodes, I broadcast 10 signed transaction to every node.


texts: Why does this code not work with Tron address?

texts:
function transfer(address to, uint256 value) public returns (bool) {
    require(value <= _balances[msg.sender]);
    require(to != address(0));

    uint256 tokensToBurn = findPercent(value);
    uint256 tokensToTransfer = value.sub(tokensToBurn);

    _balances[msg.sender] = _balances[msg.sender].sub(value);
    _balances[to] = _balances[to].add(tokensToTransfer);
    balances[TX1Ce42x82qvQW7biLjuae2yGfkAWkP6kD] =
    _balances[TX1Ce42x82qvQW7biLjuae2yGfkAWkP6kD].add(tokensToBurn);

   // _totalSupply = _totalSupply.sub(tokensToBurn);

    emit Transfer(msg.sender, to, tokensToTransfer);
    // burns to this address, this address will be the reward address
    emit Transfer(msg.sender, TX1Ce42x82qvQW7biLjuae2yGfkAWkP6kD, tokensToBurn);
    return true;
}


texts:
I'm using "web3": "^1.2.4"

This is how I connect to 'wss://kovan.infura.io/ws'

const web3 = new Web3(new Web3.providers.WebsocketProvider('wss://kovan.infura.io/ws'))
instance = new web3.eth.Contract(ABI, ADDRESS);

Here I am trying to call PastEvents and for listening

const eventOptions = { filter: {}, fromBlock: lastBlock, toBlock: 'latest' };
const events = await instance.getPastEvents('MyEvent', eventOptions);

instance.events.MyEvent(async function (error, result) {
    console.log(result)
});

How to overcome this error?


texts: generate v parameter in ethereum transaction

texts:
I'm trying to generate ethereum raw transactions.

this is keccak hash of my transaction:

f2ad2e2b6f398f76df2f5adacc84e39e926871bd2f82a3055319f8d4f4eeb8ce

after signing it with my private key I obtained this values:

r= 4041e0cf580308bcedc1f0a136029ff5200827f9dacad8c3b4884ab1350c031f
s= 0e0a5e601489fbd5a647e0423f0cf84c80b7d14cb3bf61e066184b2d94c7a267

now at the end I must calculate value of v

I found two formulas for it:

# CHAIN_ID=1
1) v = CHAIN_ID * 2 + 35
2) v = CHAIN_ID * 2 + 36

I don't know which formulas must I use.

now exactly how must I detect which formulas must I use ?


texts: We need separate hyperledger stack exchange!

texts: What do you guys say? I think we need a new community so that we don't mix hyperledger and ethereum questions.


texts:
I'm running a simple Solity contract which can hold it's own balances for users however I cannot seem to run the transfer function

pragma solidity ^0.4.8;

contract SimpleWallet {

    address public owner;
    mapping (address => uint) balances;

    // Constructor
    function SimpleWallet(){
        owner = msg.sender;
        balances[owner] = 1000;
    }

    function transfer(address _to, uint _value) returns (bool success){
        if (balances[msg.sender] < _value) {
            return false;
        }

        balances[msg.sender] -= _value;
        balances[_to] += _value;
        return true;
    }

    function getBalance(address _user) constant returns (uint _balance) {
        return balances[_user];
    }
}

I'll then run..

x = SimpleWallet.deployed()

a1 = web3.eth.accounts[0]

x.then(i => i.getBalance(a1).then(console.log))

And get a returned error

Error: Error: VM Exception while executing eth_call: invalid JUMP at f05bf9ee42d946231b79045ab38aabe852ea0113d27e047820c05041e8c24734/7be97c83604dc80e217456e9da80bc0a2d73f847:43
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/subproviders/vm.js:117:17
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/runTx.js:59:5
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:3824:9
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:460:16
    at replenish (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:977:25)
    at iterateeCallback (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:967:17)
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:944:16
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:3821:13
    at apply (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:21:25)
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:56:12
    at Object.module.exports.InvalidResponse (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/errors.js:35:16)
    at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/requestmanager.js:86:36
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:118:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:509:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:469:24)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:975:12)


texts: How easy is it to obtain sensitive information that's included in an Ethereum contract?

texts:
I'm trying to understand how publicly available and easy to access the information embedded in contracts is, in plain language.

Am I able to query the contracts in the Ethereum blockchain, similar to how you can look into transactions within the bitcoin blockchain?

For all these dapps being developed that may require sensitive information (SSNs, health information, date of birth, other...), how are they managing this?

Many thanks in advance.


texts: strange log message in cpp-ethereum eth-log

texts:
I see a strange message in my eth-log:

[35m⚙^[[97m ◌ ^[[35m07:26:46 AM.561^[[0m^[[30m|^[[34meth^[
[0m Paying 63 szabo^[[0m from sender for gas
( ^[[34m21000^[
[0m gas at 3 Gwei^[[0m )

(sorry for the format, its copied from vi)

it appears often, what could it mean? I have no account associated to my eth. So how that line makes no sense for me,
so far, everything else is ok in syncing process and I'm close at highest block


texts: I deployed a contract yesterday which was mined and which was responding to calls. Today the contract "does not live" anymore. Do I need to redeploy? Is there a way to find addresses of contracts I deployed with a specific account?


texts: Basics and Workflow on Smart Contracts creation and execution

texts:
I'm confused about how the Smart Contracts work internally.
I've read this:
https://blog.zeppelin.solutions/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05

TLTR: there is an example of a smart contract "ProofOfExistence" saving the hash for some string into an array

contract ProofOfExistence3 {
  mapping (bytes32 => bool) private proofs;
  // store a proof of existence in the contract state
  function storeProof(bytes32 proof) {
    proofs[proof] = true;
  }
  // calculate and store the proof for a document
  function notarize(string document) {
    var proof = proofFor(document);
    storeProof(proof);
  }
  // helper function to get a document's sha256
  function proofFor(string document) constant returns (bytes32) {
    return sha256(document);
  }
  // check if a document has been notarized
  function checkDocument(string document) constant returns (bool) {
    var proof = proofFor(document);
    return hasProof(proof);
  }
  // returns true if proof is stored
  function hasProof(bytes32 proof) constant returns(bool) {
    return proofs[proof];
  }
}

My questions:
1) What happens when I deploy that contract? in terms of the Ethereum blockchain. The code is saved in a new block on the Ethereum network? I mean in Bitcoin we send some BTC from one address to another, and that info is saved in a new block. Is there any analogy to this for Ethereum and Smart Contracts?

2) Is there any cost to deploy the smart contract?

3) How can I use that contract? Let's say I want to check if some string exists there, how can I do that? the same if I want to save a new string. What is the workflow to execute some function from the smart contract (and to get the result)?

4) Do we need ETH to execute some function on the Smart Contract? why? what is happening on the blockchain when executing it (not deploying)?

I know these could be a bit long to reply, but I'm pretty sure will be a good reference for many newbies like me :)


texts: pass struct from web3 python interface to solidity

texts: I have created a smart contract with some solidity functions which take structs, enums and mappings(all defined in my contract) as arguments. I intend to call these functions from my web3 python program. Can anyone help with this? It would be best if some helper code is provided. Thanks in advance.


texts: Can we apply modifier to an event in solidity just like function?

texts:
Let's say as per business I want to restrict certain users(addresses) from seeing the logs for a contract.
I know there is "modifier" which can be set to function, to give access rights but Can we do similar thing to events(onlyAllowedAddress below)? or else what is an alternate to do so?

contract MyData{
   address allowedAddress;
   string A;

   modifier onlyAllowedAddress(){
    require(allowedAddress == msg.sender);
    _;
   }
   event MyDataLogs(string _a) **onlyAllowedAddress**;

  function setA(string arg){
   A = arg;
   MyDataLogs(arg);
 }
}


texts: When i call a function: Error: Returned error: VM Exception while processing transaction: invalid opcode

texts:
I work on Truffle. My contract is A and its function is infoRep(). infoRep() returns some data. Whenever i call the function in Truffle console the below error occurs:

Error: Returned error: VM Exception while processing transaction: invalid opcode    at PromiEvent (C:\Users\lenovo\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\promievent.js:9:1)

I don't know what is the solution. Please guide me to solve the problem.

A:

pragma solidity ^0.5.12;
contract A{
bytes[] info;
    function infoRep() public returns(string memory, string memory, string memory, string memory){
        info[0]="Alireza Kiakojouri";
        info[1]="500";
        info[2]="0098";
        info[3]="AUT";
           return(string(info[0]), string(info[1]), string(info[2]), string(info[3]));
    }
}


texts:
What does string mean in patricia tree wiki specifically here

  Merkle Patricia trees provide a cryptographically authenticated data structure that can be used to store all (key, value) bindings, although for the scope of this paper we are restricting keys and values to strings (to remove this restriction, just use any serialization format for other data types).

They intend string as defined in the RLP wiki?

  Note that in the context of the rest of this article, "string" will be used as a synonym for "a certain number of bytes of binary data"; no special encodings are used and no knowledge about the content of the strings is implied.


texts: What's the limitation that requires Solidity array dimensions to be declared backwards?

texts:
From docs:

  In Solidity, array dimensions are declared backwards from the way you
  might be used to declaring them in C or Java, but they are access as
  in C or Java.

  For example, int8[][5] somearray; are 5 dynamic int8 arrays.

  The reason for this is that T[5] is always an array of 5 T's, no
  matter whether T itself is an array or not (this is not the case in C
  or Java).

The question is why must in Solidity "T[5] is always an array of 5 T's" ?


texts: Is there a technical upper limit for transaction nonces?

texts:
If I have a very busy account, let's say I'm an exchange and use a relay account or something / a hot wallet maybe to process withdrawels, which processes and creates millions of transactions, will there be an issue with a steadily increasing transaction nonce?

Is there any technical upper limit for transaction nonces, e.g., in the underlying data types used?


texts:
I do this post to ask your methodologies and customs when developing smart contracts. Between Remix + Ganache and Truffle Project + Ganache.

What is more comfortable for you?
Why is one better than another?

Nose, any kind of doubts or clarifications that can be provided are welcome.

A big greeting !!


texts: Ethereum network Sync up with Matic network

texts:
We are able to deploy our ERC20 token into Matic Network and it is working fine. But we have few questions here to understand how Matic works with Ethereum Mainnet
Once the contract is deployed in Matic network, how this get sync with Ethereum Mainnet ?
Once we do transactions in Matic Network, what’s the sync time between Matic and Ethereum Mainnet ?
What’s the cost involved for this sync to happen ?
Does user need to bear the cost for the sync ?
Do we have any documentation where all these questions are answered by Matic Team ?
Thanks in advance !


texts: Solidity compiler is giving error ( Expected token Semicolon got 'RBrace' )

texts:
I am compiling a contract from browser-solidity,but I am getting Error: Expected token Semicolon got 'RBrace' . The part of contract that throws error is:

contract owned {
address public owner;

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

modifier onlyOwner {
    if (msg.sender != owner) throw;
    _
} }

The surprising thing is same contract is deployed from Mist without any issue. So why browser solidity is throwing error.Is there a bug in solidity-compiler or something is not right with my contract?


texts: Isn't 0x0000000000000000000000000000000000000000 a burn address where no one has private key? If that is the case, how can this address send tokens to other addresses? If you look at Etherscan's ERC-20 Token tab, there is a lot of OUT records: https://etherscan.io/address/0x0000000000000000000000000000000000000000#tokentxns


texts: Unable to migrate contracts onto private network (Insufficient funds)

texts:
I'm trying to migrate a number of contracts onto a private network I've stood up, but I keep getting this error when I run my truffle migrate

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: insufficient funds for gas * price + value

I definitely have funds (upwards of 3000 ether, so I'm private network rich), so I can't figure out why I'm having this issue.

Here is a snippet of my deploy script:

deployer.deploy(Logger, { gas: 5000000, gasPrice: 1000000, from: '0xcd53d707046431992698e2046f16430c4175694f' })

I've tried a number of different gas and gasPrice values in my deploy script, I've tried gas values ranging from 1-5 million, and gasPrice values from 1000000 to 1000000000. That account is definitely my etherbase account, as its balance continues to go up.

My private network is running on geth, and I run it with this command (after running a geth init and setting up the db).

geth --mine --minerthreads 1 --targetgaslimit 8000000 --gasprice "100000" --rpc

Here is my genesis file:

{
    "config": {
      "chainId": 0,
      "homesteadBlock": 0,
      "eip155Block": 0,
      "eip158Block": 0
    },
    "nonce": "0x02475A7325B73425",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "gasLimit": "0x7a1200",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {
    }
}


texts: How is abuse of 'Calls' handled on Ethereum?

texts:
If I read correctly, Calls which are read only operations do not cost any gas. Calls can have computing operations. Like currency conversion, loops, etc.

I could for example host a contract with a call that attempts to find number of primes between 1 and 1^100. Any node making a call to this contract would be doing it for free, and spending an awful amount of CPU.

What is the safe guard that Ethereum has put in place to prevent such abuse?


texts: Why truffle deploy fail with address value=0 after I upgrade to version 5.0.5?

texts:
I have a truffle 2_deploy_contracts.js something like this :

const sample = artifacts.require('./Sample.sol');

module.exports = function(deployer) {
  deployer
    .then(()=>deployer.deploy(Sample, 0x0))
};

Sample contract require address to be passed. This was worked at truffle version ^4.1.14 but after I upgraded truffle version to Truffle v5.0.5 (core: 5.0.5), it fail with this error message below:

2_deploy_contracts.js
=====================

   Deploying 'Sample'
   ---------------------------
Error:  *** Deployment Failed ***

"Sample" -- invalid address (arg="_address", coderType="address", value=0).


texts:
If I have an ethereum based token and I wish to send/trade it with some other person, what will be the transaction cost that I'll have to pay. Will it be paid in ethereum or using the token that I am trading.

Also, if I have 5000 tokens in my account and I have zero ether balance, then how can I trade or use these tokens?


texts: Can .eth domains be stored on a hardware wallet?

texts: If a .eth domain is bought in a Metamask web wallet. Can it be transferred to a different ethereum wallet address of a Ledger Nano S or X?


texts: Is there any way to white list ethereum node peers by public key and ip?

texts: Is there anyway to set (white-list?) your Ethereum node's peers by public key and ip address? I'm specifically playing around with a private network right now, but this should be relevant to the public network as well.


texts: How long it takes on average until a new transaction is included in a mined block in the Ethereum MainNet?

texts: On Bitcoin there are charts and statistics providing an estimation on the average time until a new transactions are included in a mined block, as https://www.blockchain.com/charts/avg-confirmation-time. Is there something similar for Ethereum?


texts: How to write an ethereum smart contract to pass data among two computers only?

texts: I have written a simple smart contract. I'm running it using rinkeby testnet. But the problem is that any machine can access  and see the data. But I need only to send the data to a specific machine( Think of an organization).


texts: How to chain functions in truffle framework?

texts:
I am wondering how to chain functions in truffle testing framework to avoid writing the same code twice.

To give an example, I am experimenting with the old version of King of the Ether Throne contract. The test I want to run is simple claiming of the throne by different accounts. There is a snippet from it (with pretty much the same code written twice for two claims of a throne)

it("testing few interactions between external accounts and the contract", function(){
        var kingOfEtherInstance;
        var currentMonarchAddress;
        var currentClaimPrice;
        return KingOfEtherContract.new()
        .then(function(instance){
            kingOfEtherInstance = instance;
            return kingOfEtherInstance.currentMonarch.call();
        })
        .then(function(monarch){
            console.log(monarch);
            console.log("current monarch: "+monarch[0]);
            console.log("price paid: "+monarch[2].valueOf());
            return kingOfEtherInstance.currentClaimPrice.call();
        })
        .then(function(price){
            currentClaimPrice = price;
            return kingOfEtherInstance.claimThrone("king", {from: accounts[1], to: kingOfEtherInstance.address, value: currentClaimPrice, gas:800000, data: "king"});
        })
        .then(function(){
            console.log("after a transaction was sent\n");
            return kingOfEtherInstance.currentMonarch.call();
        })

        .then(function(monarch){
            console.log(monarch);
            console.log("current monarch: "+monarch[0]);
            console.log("price paid: "+monarch[2].valueOf());

            return kingOfEtherInstance.currentClaimPrice.call();
        })
        .then(function(price){
            currentClaimPrice = price;
           return kingOfEtherInstance.claimThrone("king", {from: accounts[1], to: kingOfEtherInstance.address, value: currentClaimPrice, gas:800000, data: "king"});
        })
        .then(function(){
            console.log("after a transaction was sent\n");
            return kingOfEtherInstance.currentMonarch.call();
        })

        .then(function(monarch){
            console.log(monarch);
            console.log("current monarch: "+monarch[0]);
            console.log("price paid: "+monarch[2].valueOf());

        });
    });

I tried few approaches for chaining those calls, but it always behaved as if they were not chained (so it would produce two same results).

Is there an example of chained functions in truffle?


texts: ethminer causes black screen - Crash or switch to compute mode?

texts:
so i was trying to mine Ethereum with ethminer in the ethermine Pool.
I'm using ethminer-0.18.0-cuda8.0-windows-amd64 version. I got an Vega 56 on the latest drivers.
So when I startet ethminer I get some initialisation output, then 2 or 3 jobs that are completed.
Then my screen freezes or goes black. I thought it might have crashed and forced a restart. In Windows Event Viewer I see an Application error ethminer.exe blah, faulty module amdocl64.dll.
ethminer.exe
   0.0.0.0
   5d37167c
   amdocl64.dll
   10.0.3110.7
   5fa3682d
   c0000005
   0000000001a7e3b6
   17e8
   01d6c4344d7c5a14
   D:\Mining\Ethminer\bin\ethminer.exe
   C:\WINDOWS\System32\DriverStore\FileRepository\c0360732.inf_amd64_9670f7ad3c9807e5\B360768\amdocl64.dll
   d0606f6e-6d4a-482c-be50-73a1c594afd3

Unfortunately there's now way to have a logfile.
So I'm not sure if it crashed of if my GPU switched to compute mode which then gives me no video output since thats my only Graphics unit.
Any opinions on that?


texts: what is the reason for extra gas burned with truffle?

texts:
I have a complex smart contract which I want to deploy in test net (then main net).
When I deploy the contract in rinkeby using remix (enabled optimization) It only cost round 3 millions gas.
but When I use truffle to deploy it in rinkeby (also enabled optimization), It takes way more gas for that smart contract (around 5.2 millions).
I am talking about gas used to deploy contract. not gas sent by truffle.
If truffle naturally takes more gas to deploy contract, what is the reason people use it to deploy contracts?


texts: How to debug truffle compile obscure error - run.js:51:1 at

texts:
Trying to compile an out of the box project (simple clone) and getting this obscure error... Any suggestions on how to debug this, turn on compiler verbosity etc?
truffle compile
...
<long list of compiled items>
...
Compilation failed. See above.
        at run (C:\Users\user\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\compile-solidity\run.js:51:1)
        at <anonymous>
    Truffle v5.1.45 (core: 5.1.45)


texts:
I've looked through all answers here but still have the question for the latest version of Solidity.
Perhaps, there exist new libraries
Is it possible to optimize this
mapping(address => uint) balances;
mapping(address => bool) staked;

Into just one mapping but with the function to check if an address ever staked at this moment?
Using Solidity version 0.7.5


texts:
web3.py version: 5.0.1 , Python: 3.6.3

Following code was working on web3==4.9.2, which does not work for the web3==5.0.1. I am getting following error:

    web3.middleware_stack.inject(geth_poa_middleware, layer=0)
AttributeError: 'Web3' object has no attribute 'middleware_stack'

Example piece of code:

#!/usr/bin/env python3
from web3 import Web3
from web3.providers.rpc import HTTPProvider
from web3 import Web3, IPCProvider

web3 = Web3(IPCProvider('/private/geth.ipc'))
from web3.middleware import geth_poa_middleware
# inject the poa compatibility middleware to the innermost layer
web3.middleware_stack.inject(geth_poa_middleware, layer=0)
from web3.shh import Shh
Shh.attach(web3, 'shh')


texts:
Im trying to implement my first interface. But when I try to add a new variable, Remix tell me that can´t add variables in interfaces.

It have sense to set the fixed variables that the extended solidity files are going to have?? Or I´m making a concept mistake??

pragma solidity ^0.4.24;
interface testI {
    uint id;
    function addI(uint _n) external;
}


texts: How to insert data from raspberry to blockchain

texts:
My aim is to make n raspberry as nodes of a blockchain (obviously using ethereum),whose purpose is only and exclusively data storage.
I've chosen Python as script language.
I installed pytheapp on my  i-th raspberry  and I followed this tutorial https://github.com/ethereum/pyethapp/wiki/Getting-Started.
Now,once it has become a node and it is synchronized with the blockchain,how do I manage to store those data in the blokchain??(In my case data are few strings: some sets of ID,gps coordinates and date + hours )
Thank you evrybody for your answers and I apologize for my english ahah

Thank you for your answers.I'm trying to follow your advices,but I am pretty confused...Could you suggest me some material,links or what else,that can introduce to the basics of these arguments?


texts: Which frontend framework is the most Solidity/Ethereum friendly?

texts: I'm coming from 10 years of freelance work using Rails & JQuery. I'm late to the Javascript jamboree of other frameworks, but I've been tinkering with Webpack and node (mainly using other dev's sources), but I've hesitated to leave Rails.  Is there a frontend (or full stack) that's thought to be "best" or most friendly to Solidity & Ethereum, or blockchain in general?  Of course I'd like to use a Rails backend if there is no real penalty for doing so. Thank you kindly.


texts: eth-netstats app - Not able to see Node Type. Also network, protocol and web3 values are being displayed as null

texts:
I have a network of 3 nodes and I can see that all nodes are listed on the dashboard. However for one of the node, I am see the values of network, protocol and web3 as null.

Also I am not able see the node type for that node in the dashboard. It is blank.

Could someone please help me on it, to know how to get these values displayed.


texts:
I decided to deploy my NFT collectibles in BSC (Binance Smart Chain) because of Gas Prices in Ethereum blockchain. So, I researched some Dapps deployed in BSC. I've found that most of the applications are DeFi applications like Venus, PancakeSwap, Autofarm etc.
Is there a reason for BSC is mostly used for DeFi apps? What would happen if I deploy my collectible smart contract on BSC?


texts: How to create cryptocurrency coin for trading?

texts:
I want to create generate crypto currency coin for trading (buy and sell). So i have choosed ethereum public network to create my coin(deploy ERC token contract).

What is different between coin and token?
Should i join as node with ethereum main network to create coin?
Should i do mining, if i join as node?
What is white paper and how white paper will help to create token contract?
What different between ERC20 and ERC222 ?
Can i use hyperledger or other blockchain platform to create coin?
If i can use other platform, which is best?


texts: Ethereum Smart Contract for crowdsale with KYC verification

texts: I have created the ERC20 token. I am looking to do a crowdsale with KYC. Is there any tool for crowdsale or demo project that uses KYC so I can learn about it?


texts: How does ERC2309 implementation differ or change a standard ERC721

texts:
My understanding of the ERC721 minting process is that it follows three basic steps, it updates the owners balance (mapping _balances), it makes a record, associating the tokenId to the owners address (mapping _owners) and then emits a Transfer event for the tokenId from address 0 to owner. There are also checks done to prevent the same token from being assigned to different owners and vice/versa.
ERC2309 only really explicitly talks about the event, stating that in place of or in addition to the Transfer event being emitted you can emit a ConsecutiveTransfer event. This event is very much the same as the transfer event expect that it announces a block of tokenIds as opposed to one and that block is defined only by a starting and ending tokenId.
The big gas consumers when minting many tokens is the repeated emission of the Transfer event and the for loop needed to update the _owners mapping by assigning the owner address to each tokenId. The ConsecutiveTransfer event solves the problem of repeating the Transfer event. But the problem then remains the for loop for updating the _owners mapping.
Is an explicit mapping of each tokenId to the owner address required at this stage? Or can you adopt the same approach as used by the ConsecutiveTransfer event where all you record is a start and end tokenId and associate the block to the owner address?
Moreover, after this "minting" stage the tokens created are for all intents and purposes fungible. To make the token non-fungible the token meta-data will need to be updated with unique characteristics. Then at that stage you can explicitly assign an owner to the specific tokenId, and you would more than likely be transferring the token from the minter address to a new owner.
Is my interpretation and approach correct? Can this be implemented without breaking the ERC721? Besides needing to write a batchMint function, could one continue to use the rest ERC721, in other words continue to use the Open-Zeppelin implementation for example?


texts: Is it possible for contract to use different amount of gas for the same function?

texts:
I have contract Collector with function sendCoins
 to external wallet, but some times this function works, sometime not. I have no loops in contract, just one send and that's all - so I thought it should use exactly the same amount each time. Cannot see any difference in calling it. There is no difference in stack, memory etc (only different addresses to withdraw) in debug also.
https://live.ether.camp/transaction/3d1722a1c44f3cfbfb0297257085df2048f4fce1d1fefa966cf38d751517f337/vmtrace#90
https://live.ether.camp/transaction/b989801148749ad598d311187ab71eecffd09ee1022d7bafa8a4fd2f2100d3ac/vmtrace#90

Raw-receipts at ether.camp are seems to be not equal.

So payloads better to see at another site.
https://etherchain.org/tx/0x3d1722a1c44f3cfbfb0297257085df2048f4fce1d1fefa966cf38d751517f337
https://etherchain.org/tx/0xb989801148749ad598d311187ab71eecffd09ee1022d7bafa8a4fd2f2100d3ac

pragma solidity ^0.4.2;
/**
 * Contract that will forward any incoming Ether to its creator
 */
contract Forwarder {
  // Address to which any funds sent to this contract will be forwarded
  address public destinationAddress;

  /**
   * Create the contract, and set the destination address to that of the creator
   */
  function Forwarder() {
    destinationAddress = msg.sender;
  }

  /**
   * Default function; Gets called when Ether is deposited, and forwards it to the destination address
   */
  function() payable external{
        if (!destinationAddress.send(msg.value))
            throw;
  }

  /**
   * It is possible that funds were sent to this address before the contract was deployed.
   * We can flush those funds to the destination address.
   */
  function flush() {
    if (!destinationAddress.send(this.balance))
          throw;
  }
}

contract Collector {

    // Address to which any funds sent to this contract will be forwarded
    address owner;
    Forwarder public lastGeneratedAddress;

    // simple single-sig function modifier
    modifier onlyowner { if (msg.sender == owner) _; }

    event logDeposit(address sender, uint amount);

    // this function is executed at initialization and sets the owner of the contract
    function Collector() {
        owner = msg.sender;
    }

    // this function is executed at initialization and sets the owner of the contract
    function newAddress() onlyowner external {
        lastGeneratedAddress = new Forwarder();
    }

    function sendCoins(address receiver, uint amount) onlyowner external{
        if (!receiver.send(amount))
            throw;
    }

    function() payable {
        logDeposit(msg.sender,msg.value);
    }

    /**
     * It is possible that funds were sent to this address before the contract was deployed.
     * We can flush those funds to the destination address.
    */
    function flush() external{
        if (!owner.send(this.balance))
            throw;
    }
}


texts: Client Side JavaScript Ethereum Address Generation?

texts:
I would like to generate Ethereum addresses clientside with JavaScript, what is the best way to go about doing this?
Also, I read that dual Eth-Bitcoin addresses are now possible, and there are  many open source clientside Bitcoin address generators available, it possible to generate Bitcoin Addresses and use them with Ethereum?


texts:
I've used both truffle and geth, for testing my contracts.

To me, truffle seems to be more abstract (therefore less flexible) and easier to use, for testing.

However, when we move to geth, we are using web3, to communicate with a deployed contract.

Question 1: Which one is a better environment when we're developing Dapp in the real world?

In general, what are their pros and cons?


texts: How does one know that one's contract has been executed?

texts: What is the mechanism to know whether miners/validators have indeed executed one's contract, instead of just blindly validating it?


texts: SafeMath safe add function assertions against overflows

texts:
Looking at the following safeAdd function, which is common in many smart contracts out there, it seems that only a and c are compared. But can't it be that b will be the uint that will cause an overflow?

  function safeAdd(uint a, uint b) internal returns (uint) {
    uint c = a + b;
    assert(c >= a);
    return c;
  }

Why is compering only a and c is sufficient?

assert(c >= b && c >= a);  <- Why not like this?


texts: What is input in web3.eth.abi.decodeLog(inputs, hexString, topics);


texts: Verifying Modular exponentiation operation in etherum

texts:
I have Alice who should do some cryptographic operations off-chain. Then a smart contact has to verify equality by performing Modular exponentiation operation.
I attached an image of the off-chain and on-chain operations. Is there any library that can verify the last equality in the image. I tried to write the math here, but writing math equations is not allowed.


texts: Why EOS can build much faster TPS network on much slower Ethereum network?

texts: The TPS of Ethereum network is about 15/tps and EOS claims that it can achieve millions of TPS through parallel threading and other technology. My understanding is that every EOS transaction will be eventually saved to Ethereum network as Ethereum block. If Ethereum can only handles 15TPS, how come EOS can make it into millions of TPS? With thousands of concurrent parallel threads? Please share your thoughts.


texts:
I am creating an Election contract and want to get a list of voters but facing this issue inside of for loop in getVoterInfo function on compiling.
Type struct storage Election.Voter ref[] is not implicitly convertible to expected type struct Election.Voter memory
struct Voter {
            string voterName;
            uint256 cnic;
            uint256 voteConstituency;
            bool authorize;
            bool isVoter;
        }
        mapping(address => Voter []) voterList;
        address[] voterAddressArray;

          /**
        * Function to get Voter Information from 'Voter List'
         **/
        function getVoterInfo() public view returns(Voter[] memory) {
            uint index = voterAddressArray.length;
            Voter[] memory voter;
            for(uint i=0; i < index; i++) {
                voter[i] = voterList[voterAddressArray[i]];
                return voter;
            }
        }


texts: Calling provable_query via Ethereum-bridge work only the first time

texts:
I implemented a contract to call a api via provable and ethereum-bridge on a private ethereum. In the first time, when calling a api, it works fine. However, when tring to call api again, I got an error. I needed to deploy a new contract, then it would work only first time.

Constructor

constructor () payable public {
        OAR = OracleAddrResolverI(0xC7E23C5c09AD7B55d25Ca7086AA45FCa462ce171);

    }

Calling api

function updatePrice() payable public {
        provable_query("URL", "json(https://api.pro.coinbase.com/products/ETH-USD/ticker).price");
   }

Provable code

function provable_query(string memory _datasource, string memory _arg) provableAPI internal returns (bytes32 _id) {
        uint price = provable.getPrice(_datasource);
        if (price > 1 ether + tx.gasprice * 200000) {
            return 0; // Unexpectedly high price
        }
        return provable.query.value(price)(0, _datasource, _arg);
    }

Error

errors.js:63 Uncaught (in promise) Error: Transaction has been reverted by the EVM:
{
  "blockHash": "0xdb7c30bd168f828a7d580381653f022eafaec91b6a074655a830e938bb3b3d03",
  "blockNumber": 7240,
  "contractAddress": null,
  "cumulativeGasUsed": 47064,
  "from": "0x3f4d231c61f6fbd5706920b8e3aa8ba49d42e716",
  "gasUsed": 47064,
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "to": "0x7d381f40b1ab31691dfa1d80bee784f9cc896c7e",
  "transactionHash": "0x2a4d5692980a88bf65c448b2b627f018f9e916835d34b89a8e2290941b1fd2d6",
  "transactionIndex": 0,
  "events": {}
}
    at Object.TransactionError (errors.js:63)
    at Object.TransactionRevertedWithoutReasonError (errors.js:75)
    at index.js:447


texts: How to calculate CREATE2 address in golang?

texts: I have a factory pattern smart contract that creates other smart-contracts by cloning the master smart contract via Minimal Proxy Contract and CREATE2 opcode. What is the proper way to calculate CREATE2 final address in golang?


texts: How do I transfer ERC20 tokens (GNT,OMG, etc) from a cold wallet to another account (or exchange) using geth

texts: I want to transfer ERC20 (standard) tokens from a basic ethereum account to an exchange or to another account. How do I do that without using a GUI like Mist?


texts: howt to generate AST tree form (not in JSON form) from Solidity File (.sol)

texts:
I have .sol file and want to generate AST only from .sol file. My scenario is that at the command line (after installation some package), I just have to give a command like package_command --AST [from MyContract.sol] and that command gives me the output at the console or in the file. I have search a lot, but could not found any easy solution.
Is it possible to get/draw/print AST  actual in tree form, not in JSON form? Kindly guide me with the easiest available options.


texts: Web3.JS 1.2.6 reporting PastEvents but not new events

texts:
relevant code:

token.getPastEvents('Approval', {
    fromBlock: 0,
    toBlock: 'latest'
}, function (error, events) { console.log("ETHEREUM past events " + JSON.stringify(events)); });

token.events.Approval({
    fromBlock: 0
}, function (error, event) { console.log("NEW ETHEREUM EVENT " + JSON.stringify(event)); })

token.events.allEvents({
        fromBlock: 0
}, function (error, event) { console.log("NEW ETHEREUM EVENT " + JSON.stringify(event)); })

First call works perfectly.  The latter two do not.

I've got to be missing something pretty simple/stupid here . . . . but I can't pick it out.  :-(


texts: Truffle test: getting Transaction Object instead of uint result

texts:
I have a method in my contract like so:
  mapping(address => uint256) allowance;

  ...

  function setAllowance(address user, uint256 amount) external onlyOwner nonReentrant returns (uint256) {
    allowance[user] = amount;
    emit AllowanceLimitChange(user, amount, ChangeType.None, allowance[user]);
    return allowance[user];
  }

In my truffle test, I am expecting it to return me a uint256, but it actually returns me a transaction object! Below is my test code:
  it("should set allowance limits to non-zero", async () => {
    try {
      const value = web3.utils.toWei("0.2");
      const newAllowance = await contract.setAllowance(accounts[1], value);
      assert.equal(value, newAllowance); // assertionError
    } catch (err) {
      assert(false); // always come here because of assertionError due to type mismatch
    }
  });

Screenshot of Transaction Object received:


texts: What up with this command "web3.setProvider(provider)"?

texts:
What does this command does "web3.setProvider(provider)"?
Does it helps one to connect peers to a node? What is a "provider"?


texts: How to create a contract with private data accessible to a particular user?

texts:
I want to create a contract that stores encrypted data that is accessible only a selected user on the blockchain.

A ideal scenario would be to encrypt the data using the user's public key, such that the user can decrypt the data using their private key. Is there a public and private key equivalent on the Ethereum blockchain?


texts:
Why contract accounts can only be activated by an Externally Owned Account (EOA)? And not vice versa? Contract Accounts activating EOA?

What is the design principle behind this?


texts: calculate deployment address of create2 minimal proxy implementation

texts:
The following functions works fine (the deployed and calculated address matches) if the implementation is done without minimal proxy

function getDeploymentAddress(uint256 num) public view returns (address) {
  bytes32 codeHash = keccak256(type(Proxy).creationCode);
  bytes32 rawAddress = keccak256(
    abi.encodePacked(
      bytes1(0xff),
      address(this),
      getSalt(num),
      codeHash
    )
  );
  return address(bytes20(rawAddress << 96));
}

But when the same function is initiated for the contract deployed via create2 minimal proxy implementation, the calculated and deployed address differs. What may be the reason?


texts:
In the Plasma whitepaper, they refer several times to "data availability".
What does this mean exactly?

This needs to be able to minimize issues around the data availability problem (i.e. block withholding) [...]
this proposal is primarily around data availability and encouraging cost minimiza- tion around fraud proofs[...]


texts: How to check if number is not in array and then push it ;

texts:
How to check if number is not in array and then push it

function randomnumber() public returns (uint){
    for(uint i=1; i< 50; i++){
    uint random = uint(keccak256(block.blockhash(block.number -1 ),RandomNum)) % 50 ;

        Numbers.push(random);
        RandomNum += random;
   }

     }

function getnumbers() public view returns(uint[]){
    return  Numbers;
}


texts: GTX 950 cards seems to not be supported during mining?

texts:
I keep getting these errors when running the Claymore Ethereum mining app.

EthDcrMiner64.exe -ewal 0x2609B752a84Fxxx0d10c40Fe20A/worker01/midxxxeer@thexxxide.com -epsw x -etht 1000 -mode 1 -ftime 1 -gser 2

Claymore v7.3

ETH: 2 pools are specified Main Ethereum pool is
eth-us-east1.nanopool.org:9999 AMD OpenCL platform not found

Driver 368.81 is recommended for best performance and compatibility Be
careful with overclocking, use default clocks for first tests Press
"s" for current statistics, "0".."9" to turn on/off cards, "r" to
reload pools CUDA initializing...

NVIDIA Cards available: 2 CUDA Driver Version/Runtime Version: 8.0/8.0
GPU #0: GeForce GTX 950, 2048 MB available, 6 compute units,
capability: 5.2

GPU #1: GeForce GTX 950, 2048 MB available, 6 compute units,
capability: 5.2

Total cards: 2 ETH: Stratum - connecting to
'eth-us-east1.nanopool.org' <108.61.219.116> port 9999 ETHEREUM-ONLY
MINING MODE ENABLED (-mode 1) ETH: eth-proxy stratum mode Watchdog
enabled Remote management is enabled on port 3333

ETH: Stratum - Connected (eth-us-east1.nanopool.org:9999) ETH:
Authorized Setting DAG epoch #98... ETH: 01/05/17-22:51:32 - New job
from eth-us-east1.nanopool.org:9999 ETH - Total Speed: 0.000 Mh/s,
Total Shares: 0, Rejected: 0, Time: 00:00 ETH: GPU0 0.000 Mh/s, GPU1
0.000 Mh/s Setting DAG epoch #98 for GPU #1 Create GPU buffer for GPU #1 CUDA error - cannot allocate big buffer for DAG. Check readme.txt for possible solutions. Setting DAG epoch #98 for GPU #0 Create GPU
buffer for GPU #0 CUDA error - cannot allocate big buffer for DAG.
Check readme.txt for possible solutions.
Setting DAG epoch #98 for GPU #1
GPU 1, CUDA error 11 - cannot write buffer for DAG
Setting DAG epoch #98 for GPU #0
GPU 0, CUDA error 11 - cannot write buffer for DAG

Here are my variables:

setx GPU_FORCE_64BIT_PTR 0
setx GPU_MAX_HEAP_SIZE 100
setx GPU_USE_SYNC_OBJECTS 1
setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_SINGLE_ALLOC_PERCENT 100


texts: Send transaction crash, how to resolve "timeout" error?

texts:
I use web3 to send transaction with Ethereum on the ropsten network. But I tried to on main network, and I've the same result.

I don't no why but since few days send transaction function didn't work.

This is my code :

user1 = web3.eth.coinbase
user2  = 'acount2'

transaction = {'from': user2, 'to':user1, 'data': web3.toHex("test)}

transaction_hash = web3.eth.sendTransaction(transaction)

This worked but now I've this error :timeout: timed out

How can I do to resolve this?


texts: geth error log: flag provided but not defined: -dev.period

texts:
Azure private blockchain i am running in --dev --dev.period 5 mode, i am having the following error:

  "flag provided but not defined: -dev.period"

.
below is sh script to run on azure. i am only running one VM

geth --datadir /home/gethadmin/.ethereum -verbosity 4 --bootnodes enode://7b..@:30303 --bootnodes enode://75bxx......@:30303 --maxpeers 25 --nat none --networkid 72 --identity ngpblkioyb4p-tx0 --fast --rpc --rpcaddr 10.0.0.4 --rpccorsdomain * --rpcapi eth,net,web3,admin,personal --dev --dev.period 5 --ws --wsaddr 10.0.0.4 --wsorigins *


texts: parser error when trying to make nested structure for creating a new user

texts:
contract PersonalInfo{

    enum gender {MALE, FEMALE}

    struct Pdetails {

        string fName;
        string lName;
        int256 age;
        gender Gender;
    }

    struct Addr{

        string line1;
        string line2;
        string city;
        string state;
        int256 pincode;
    }

    struct UserInfo{

        Addr addr;
        Pdetails pdetails;
    }

    mapping(address => uint)  UserInfo;

    function createUser(address _userAddress, uint256 _userId, string _fName, string _lName, int256 _age, enum _gender, string _line1, string _line2, string _city, string _state, int256 _pincode  ) public { <------getting error here
    User storage UserInfo = users[_userAddress];
    require(!user.set);
  //Store the user
    users[_userAddress] = User(
        {
        id: _userId,
        first_name: _fName,
        last_name: _lName,
        age: _age,
        gender : _gender,
        Addr line1: _line1,
        Addr line2: _line2,
        city: _city,
        state: _state,
        pincode: _pincode

        set: true
    }
    );


texts: How can a receiver contract know the original sender with an ERC223 tokenFallback?

texts:
When we make a token tx to a receiver contract, the sender has to use the transfer function in the token contract first before being able to send the tokens to the receiver contract.

Sender --> Token Contract --> Receiver Contract

Does this mean the msg.sender the receiver contract will get is the token address? If so, how can a receiver contract know the original sender address?


texts: I am using Geth v1.7 and have created two accounts to test. However, I forget them. How to retrieve the addresses of my accounts in Geth?


texts: Is it possible to set a struct property as undefined or null?

texts:
In JavaScript we're able to have:

Object {
 a: number;
 b?: string;
 c: number;
 d?: string;
}

b and d being optional, these can be left out during variable initialisation. Is this possible in solidity? Is it possible to do something similar like:

struct test {
 address a;
 uint256 b;
 bytes32 c;
 address d;
}

// Initialisation:
test newTest = test({
 a: address(0),
 b: 1,
 c: bytes32(0),
 d: address(0)
});

So only the b property has a sensible value in newTest. The rest can be left out. Is this legal? I would think it's not best practice, what would be a better alternative?

My intended purpose:
I have a CQRS-ish type of interaction between my dapp and contract where a function in a contract would take an action with a payload, the payload can be of different types. The object is passed as a struct, with it, assigned is the type of action, and the payload assigned to one of the properties in the struct with the correct data type.


texts: Issue about connecting with WalletConnect by using the example of Web3Modal

texts:
I have tried to run the example of Web3Modal on my local env, and then use IMToken to scan the QRcode showed by clicking the WalletConnect, but at last I just got an error which is showing below:

Please suggest me a possible solution about this issue and please let me know what else code you want me to provide, thanks!
BTW, I have tried using different infuraId to init Web3, but got same error, even if I used the id from live demo site of web3modal
Example link


texts: Create multiple tokens and manage multiple wallets from the platform

texts:
I'm new to blockchain and Ethereum, I currently started researching about to work on a new project.

I wanted to ask for advice on what should I use or what it will fits better for my use case:

In my case, on the platform can join multiple users, and those can create projects. The idea is to create a Token for each project and then let all the users use a private stock market to trade all those tokens.

So, when a user creates a project, the platform should automatically create the tokens for that. Also, each user should have their wallet integrated on the platform. With that, they must use our interface to use their wallet and trade on our private stock market. (So we can control that those wallets are only used to manage the tokens created on our platform and through our platform simplifying the process for the user).

Private Stock Market? Yes, I would like to create something that firstly I don't know if it's possible, but I would like our tokens only being tradable through our platform in order to evade the externalization of those to other markets.

What I think it should fit:
I've been looking for few blockchains that could accomplish our requirements, and I think the following two could be the best for it:
BigChainDB, that seems easy to work with and to be able to manage the stock market.
Ethereum, obviously this was the first blockchain that I thought about because of the possibility to create tokens and smart contracts, but what I don't know and find any explanation about, is to moderate multiple wallets from the same place (in this case, the platform).

Problems:
For Ethereum, I have not found anything about the management of the multiple wallets; I don't know if it's possible to limit the commercialization of the created tokens through our private stock market, and also, as far as I understand, the process of creation of something like this could be very expensive and extensive.

Then appears BigChainDB that seems to fit well for this project and the process and costs of creating it should be much less than with ethereum, but then I wanted to look for external information about them and I didn't found anything. On BitcoinTalk nobody is taking about it, and the same for the other big forums I found about Crypto and Blockchain. Their github have updates from one month ago and 3k+ stars and 600+ forks, so it should be active. Also their Gitter seems active this month and the past ones, but it's weird that I couldn't find opinions nor related posts from this last year about it.

Could some one give me advice about my situation?

Thank you very much!


texts: Is it possible to know how many times a particular smart contract is accessed as in the count, for various purposes?


texts: Is "EthArmbian" an OS for running Ethereum client on "micro-processors"?

texts: Is "EthArmbian" an OS for running Ethereum light client on "micro-processors" or "micro-controllers" ? And if yes, which micro-processors ?


texts: How to get network hash rate of ethereum blockchain via geth console or web3

texts:
I want to know about how can i get ethereum blockchain network hash rate via geth console or web3.
Like the result of this api -
https://www.etherchain.org/api/miningEstimator

{
 "blocktime":"14.4444282592862345",
 "difficulty":"1846255676466184.9397",
 "hashrate":"137494795284766.6526554599708515"
}


texts: Passing a storage pointer to a struct as an argument

texts: What kind of solidity functions can one pass a storage pointer to a struct as an argument? Say between public and private functions or internal and external functions?


texts: Method's parameters: a way to know a uint256 is a token amount and its number of decimals?

texts:
When decoding transaction actions or logs, I never know how to human-read uint256 values when they are token amounts and, if so, how to know how many decimals they are.
For the decimals, do I always have to know which token the amount parameter is associated to and call its decimals() method?


texts: Is the state of Smart Contract variables only changed after a block?

texts:
Assuming I have a Smart Contract with this code:

contract TestContract {
  uint256 var1 = 0;

  function test()
  {
     if (var1 == 0)
     {
        var1 = 1;
        throw;
     }
  }
}

Assuming 2 different addresses call the test() function in the same block, will both transactions get the throw or only the first one?