texts:
I am using truffle tests for my smart contract.I guess there is no problem with contracts because I can compile and deploy them in Remix.

I can also run truffle migrate --reset successfully, and it runs successfully sometimes, other times it gives the error:

node[26189]: ../src/timer_wrap.cc:107:static void node::{anonymous}::TimerWrap::Stop(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `HandleWrap::IsAlive(wrap)' failed.
 1: node::Abort() [node]
 2: 0x11e83db [node]
 3: 0x127169a [node]
 4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node]
 5: 0xb7a9ac [node]
 6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x18df548042fd
Aborted (core dumped)

Truffle migrate --reset is behaving randomly.

But even if truffle migrate runs successfuly and I try to run test cases, I get error:

  The contract code couldn't be stored, please check your gas amount

Compiling ./contracts/TradeWeapon.sol...
(node:26546) UnhandledPromiseRejectionWarning: Error: The contract code couldn't be stored, please check your gas amount.
    at Object.callback (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/contract.js:147:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/method.js:142:1
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:89:1
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:225:1
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:26546) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26546) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Details

token.test.js

var Token = artifacts.require("./Token.sol")

contract('Trading', function(accounts){
  const  gasLimit = 6000000

  beforeEach(async function () {
    let token = await Token.deployed( {gas: gasLimit});
    }
  })
})

2_deploy_contracts.js

var Token = artifacts.require("./Token.sol")
var Tokenize = artifacts.require("./Tokenize.sol")
var Trade = artifacts.require("./Trade.sol")

module.exports =  function(deployer) {
  deployer.deploy(ConvertLib);
  deployer.link(ConvertLib, MetaCoin);
  deployer.deploy(MetaCoin);
  deployer.deploy(UpdateName);

  deployer.deploy(Token, {gas: 6000000}).then(()=>{
    deployer.deploy(Tokenize, {gas: 6000000}).then(() => {
      deployer.deploy(Trade, Tokenize.address, Token.address, {gas: 6000000});
    })
  })
};


texts: What happens if the block time changes to 5 seconds?

texts:
Related to this and this.

The difficulty adjustment algorithm is:

  block_diff = parent_diff + parent_diff // 2048 *
        max(1 - (block_timestamp - parent_timestamp) // 10, -99) +
        int(2**((block.number // 100000) - 2))

  where // is the integer division operator, eg. 6 // 2 = 3, 7 // 2 = 3, 8 // 2 = 4.

From what I understand, a 10 second threshold was chosen to keep the block time in the range of 10-20 seconds. Also, the source code is available here. So, can I modify the algorithm (maybe change //10 to //5) and create a blockchain network which takes 5 seconds to confirm a block? Is this achievable? I hoped to get an answer to this question through this blog post but couldn't figure out the exact downfalls in doing this.

P.S: Basically, I have an application running on a private blockchain which requires less block confirmation time. I started the blockchain with low difficulty (0x400) but it increased over time to maintain a 15 second average block time. So, I am looking for a way to prevent this difficulty from increasing. Is this possible to achieve without a compromise in security?

I'm using geth-1.4.9


texts: Get Ethereum private key from loom private key

texts:
I deployed my contracts to a local dapp chain with the private key generated by Loom. Since that private key is not compatible with the Ethereum one, I cannot use web3.eth.accounts.privateKeyToAccount to create an account associated with the address that deployed the contracts. The reason I want to do this is because I have a NodeJS server and I plan to add that account to Web3 wallet so I can call functions with onlyOwner modifier from my server. Please let me know if you have the solution to this problem.

Thank you.


texts:
I read that there is a cost that should be paid when deploying a smart contact to the etherum. Is there is a cost for an end user to interact with a certain smart contact ?? For example : if I build a contract for a renting company , id end users who are looking for certain rental offers who need to interact with that contact, do they need to pay ethers ??

And if yes, that not make sense to let users who need to use smart contact to pay fees. How it can be avoided ??


texts: Access struct object of one contract from another

texts:
I have 2 contracts:

contract Student{
    uint ID;
    struct stu{
        string name;
        uint age;
        bool tookTest;
    }
    mapping(uint => stu) StudentNames;
    function Student(string _name,uint _age) {
        //ID is incremented
        stu s = StudentNames[ID];
        s.name = _name;
        s.age = _age;
        s.tookTest = false;
    }
}

contract ClassRoom {
    address studentAddr;
    Student student;
    function ClassRoom(address addr) {
        studentAddr = addr;
        student = Student(addr);
    }

    //some function that performs a check on student obj and updates the tookTest status to true
}

I don't want to inherit any contract. I want to access object of struct student of contract Student from contract ClassRoom. How to go about this?


texts:
I try to override ERC20 methods ... The doc says it should be possible but I get the error:
CompileError: @openzeppelin/contracts/token/ERC20/ERC20.sol:96:5: TypeError: Trying to override non-virtual function. Did you forget to add "virtual"?
function totalSupply() public view override returns (uint256) {
^ (Relevant source part starts here and spans across multiple lines).

The method:
function totalSupply() public view override returns (uint256) {
    return _totalSupply;
}

OpenZeppelin version: 3.3.0
Any idea of what could it be? (I'm very new to Solidity but I think that should work?)
EDIT Taked a bad excample... but I get this error for every function thats in ERC20 ...


texts: How to speed up transaction confirmation time?

texts: I recently ran some tests on one of my testnet nodes and found out that my average transaction takes between 30 seconds to 2 minutes to confirm, despite the block times being at around 15 seconds. I wonder what would be the be the best way to speed up transaction confirmation time to make sure they get into a block faster. Connect directly to miners, some relay services, etc?


texts: How does one tell if your paying a ETC or ETH address?

texts: How can you tell if your paying an ETC or ETH address? Which wallets can check for you? It's scary if I have both eth and etc wallets and when I make a payment it deducts from both.


texts: Ethjs-contract package providing transaction related error when calling get function

texts:
I am integrating MetaMascara to my lottery DApp.
HTML

<script src="https://wallet.metamask.io/metamascara.js"></script>
<script src="/javascripts/ethjs-query.min.js"></script>
<script src="/javascripts/ethjs-contract.min.js"></script>

Javascript

  const ethereumProvider = metamask.createDefaultProvider()
  ethQuery = new Eth(ethereumProvider);
  CONTRACT = new EthContract(ethQuery);
  contract = CONTRACT(contractAbi, contractByteCode, {from: window.METAMASK_ACCOUNT, gas: 300000});
  contractInstance = contract.at(contractAddress);
  const accounts = await ethQuery.accounts();
  window.METAMASK_ACCOUNT = accounts[0] || 'locked'

Here's success script(when getting a variable defined in contract).

  contractInstance.threshold();// success providing correct threshold

Here's error script(when calling a contract function, that is not transaction related)

  contractInstance.Function1(startTicketToSync);

  Uncaught (in promise) Error: [ethjs-rpc] rpc error with payload
  {"id":6135743116650,"jsonrpc":"2.0","params":[{"gas":"0x493e0","to":"0x9b7e002a05efebe6e6c4fb8d15c9203dfc1e605f","data":"0xdb493a6b0000000000000000000000000000000000000000000000000000000000000001"}],"method":"eth_sendTransaction"}
  {"message":"Undefined address - from address required to sign
  transaction.","code":-32603}

When I call the function in Metamask extension available space it is providing appropriate information.(using web3)

  contract = web3.eth.contract(contractAbi);
  contractInstance = contract.at(contractAddress);
  contractInstance.Function1.call(startTicketToSync, callback);

Smart contract solidity script

contract Contract1 is Ownable {
    uint public threshold;
    ...
    function Function1(uint start) public returns (uint, uint, uint, bool ) {
       require(start >= 1 && start <= currentTicket);
        uint i;
        for (i = start; i <= currentTicket; i++) {
            if (tickets[i].holder == msg.sender && tickets[i].winAmt > 0) {
                return (i, tickets[i].ref, tickets[i].winAmt, tickets[i].paid);
            }
        }
        return (currentTicket + 100, 0, 0, false);
    }
 }


texts: Forking Ethereum for an Initial Token Offering

texts:
Ethereum Dev Community,

Please help verify or correct these statements. I am hoping to improve my conceptual knowledge of the Ethereum Blockchain in the following regards, and I hope that the verification or corrections to these statements will help others too.

Regarding starting an initial token offering, my current thinking is that:

forking insulates us from happenings on the main ethereum network
such as excessive CryptoKitty traffic;
forking mean that we must start out initially with our own mining;
GPU miners that like us will likely seek to mine our token;
A forked ethereum token's transaction speed is proportional to its volume of miners.

Again, I am seeking to have these perceptions verified or corrected.

Thanks!


texts: Is there an ethereum android wallet where I don't have to manually add in tokens I have and just auto detects it?

texts: Using coinomi or even metamask on chrome is quite annoying as I need to manually add in tokens I have in my account and it doesn't auto show up. Is there an android or desktop ethereum wallet that auto adds the tokens without manual input of the token contract?


texts: Is it possible to check a token transaction history for an account with web3js?

texts:
If I have an account that has sent and received specific tokens, say ExampleToken (EXT), can I use web3js to see a list of EXT transfers and receipts for my address (or any other address)?

I am looking through the documentation but cannot find anything about token transaction history.

Thanks for any help.


texts: How to create a Dapp from scratch on Ethereum?

texts:
Let's say we have someone who knows about blockchain but who doesn't have any background in blockchain-based application.
That person wants to code an ethereum-based Dapp (decentralized application) as a proof of concept.

How to get started? What would be the first steps? (advice, best practices, interesting material etc.)


texts: Is there a way to use Geth as a blockchain explorer without downloading the blockchain?

texts:
I imagine downloading the blockchain ends up being just asking for transactions and getting their states, receipts, etc. Functionally, I would hope there is a way to do that without initiating a blockchain sync from Geth.

Is there a way to use geth to download one specific transaction state with receipt, without initiating an entire blockchain sync? Essentially using it as a blockchain "explorer."

I have no need to create or use a wallet. Just a need to look up transactions for verification at times.


texts: Ethereum Clique RPC Call | web3.clique undefined issue

texts:
To access the functionality of Clique through geth javascript console is easy, like clique.getSnapshot(), clique.propose("address",bool) etc.
But I'm not able to access those functionality using RPC call through web3. When I'm trying using web3.clique.getSnapshot() I'm getting error as  can not read property of undefined. Is there any way out to use those functionality?


texts:
Might be this is the common question asked! , but still i have lots of confusion over here, As far as my knowledge all the tokens are released from Smart contract,
so my question are :

For every Pre-Sale  do we have to launch different contract if yes then the contracts are launched on Main Contract address ?
If any contract have lock-down period time then, when the tokens are released from them do we have to pay Ethereum  to that smart contract ?
How is private sale work ?
Do we have to run Whole Geth Block chain over system in order to deploy Smart Contract ?
i have seen some ICO give free tokens upon registration ? How they avail their transaction since the tokens are released from Smart contract ?


texts: getTransaction returns null for some pendingTransactions subscribe results

texts:
I have subscribed to ETH pendingTransactions in mainnet.
I am doing getTransaction for each received pendingTransaction like below.

web3.eth.subscribe('pendingTransactions', function(error, txnid){
            if (txnid) {
                web3.eth.getTransaction(txnid, function(err, txn) {
                        if (!err) {
                                        console.log(txn);
                         }
                        else
                                console.log(err);
                        });
            }
            else
                console.log(error);
        });

My Issue is, I am getting txn=null for some of the txnid. and if we try after sometime, they get proper response.

So wanted to ask if we can have any other method where we can listen all new incoming transactions and getTransaction for them?


texts: How to get the error message from a failed transaction with web3?

texts:
My smart contract has the following piece of code:
# check if the election has begun. begin and end time must be in the future and in unix timestamp
assert block.timestamp < self.elections[_election_id].begin_unix_timestamp, "The election has already started"

On the block explorer (https://goerli.etherscan.io/tx/0xef2d5fe12514ecfe582e191b97316a4c99f5b24c4213ea0a1940dde179ec8f1e) I can see that the transaction has failed with the error message:

Status: Fail with error 'The election has already started'

How can I access this error message using web3? All I have access to is the status code in the transaction receipt, but not the error message:
signed_transaction = w3.eth.account.sign_transaction(transaction, private_key=goerli_account_private_key)
sent_raw_transaction = w3.eth.send_raw_transaction(signed_transaction.rawTransaction)
receipt = w3.eth.waitForTransactionReceipt(sent_raw_transaction)
print(receipt.status)
# print(some_transaction_object.fail_message) # I'm looking for something like this


texts:
I am trying to call view only function, not sure whether this is correct procedure or not. Getting success in result but the result is in different format. Is this wrong ?

const NODE_ADDRESS = config.web3Provider;

    const sourceCode = fs.readFileSync('path_to_contract', 'utf8').toString();
    const compiledCode = compiler.compile(sourceCode, 1).contracts[':ContractName']
    const abi = JSON.parse(compiledCode.interface);

    async function send(web3, transaction) {
        while (true) {
            try {
                const options = {
                    to: transaction._parent._address,
                    data: transaction.encodeABI(),
                    gas: 210000,
                    gasPrice: 10000000000,
                };
                const receipt = await web3.eth.call(options);
                return receipt;
            }
            catch (error) {
                return error
            }
        }
    }

    async function run() {
        try {
            const web3 = new Web3(NODE_ADDRESS);
            const contract = new web3.eth.Contract(abi, contractAddr);
            const transaction = contract.methods.getBuyerInfo();
            const receipt = await send(web3, transaction);
            console.log(JSON.stringify(receipt, null, 4));
            if (web3.currentProvider.constructor.name == "WebsocketProvider")
                web3.currentProvider.connection.close();
            if (receipt) {
                next(null, receipt)
            }
        } catch (error) {
            next(error, null)
        }
    }
    run();

Result :-

{
    "status": 1,
    "message": "Success",
    "data": "0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f61343ef22bbccc7221dcda85c5a69219ea00c2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c50756e656574204b756d61720000000000000000000000000000000000000000"
}


texts:
I'm trying to understand the algorithms underlying the ethereum overlay network and how do the peers communicate between each other.
By looking around I arrived finally to the RLPx and devp2p protocols' specification. In the former the "encrypted handshake" is explained, while in the latter the Hello message is explained. I cannot understand if they are the same thing with different names, or if they are different things.

According to the go ethereum (geth) source code (subdirectory p2p) the devp2p Hello message, is named handshakeMsg (the devp2p packet codes are defined in the file p2p/peer.go). In the file p2p/rlpx.go the function doProtoHandshake is defined and corresponds exactly to what is described as Hello in devp2p protocols specification. Therefore I can conclude that the whole RLPx handshake is performed in two phases: firstly, the "Encoding Handshake" and secondly the protohandshake which contains the exchange of the capabilities and is already "part" of the devp2p protocol. I'm wrong?


texts:
After a few hours the socket to Infura seems to drop and we get the error, Error: Connection error: Connection is not open on send() Why does this happen or what is the best way to solve it?

version: 1.0.0-beta.52

This is how the app connects.

const contractConfig = require('./contract_config.js')

if (process.argv[3] == 'ropsten') {
  var network = 'ropsten';
} else {
  var network = 'main'
}
var web3 = new Web3(new Web3.providers.WebsocketProvider(contractConfig[network].url));


texts: How to distinguish a "ether pay" transaction with a "function call" transaction

texts:
So basically we can find many transaction histories within each block, like this:

https://etherscan.io/txs?block=1506816

So my question is that, since on Ethereum we can do the following four kinds of transaction, how I can figure out which transaction it is, by just looking at their transaction page on etherscan?

account -> account
smart contract -> smart contract (could be a function call, or simply send some ethers and trigger its call back)
account -> smart contract
smart contract -> account


texts:
So I've been trying to do this for days now, and It says I have to configure ~/.sethrc and change the C, --chain to testnet. But I don't know which github repo to clone and do all of this on. There is testnet-dai.js, mcd-cdp-portal, etc. If anyone knows how to deploy MakerDao onto local environment +/ Kovan testnet, please let me know!

https://github.com/makerdao/testchain
https://github.com/makerdao/mcd-cli#installation


texts: What should I do if I want to add a new method to the token that has been deployed to ethereum

texts: I have issued a token in the ethereum,but now I need to add a new function to this token,Is there any good case to refer to?


texts:
I have created a smart contract that expects to receive ether via Etherum Wallet desktop app or MyEtherWallet site. The contract then sends equivalent amount of tokens to the ether sender on the same transaction/immediately.

Is it possible to alter the contract code to send the tokens after 6 blocks from the current transaction?


texts: Supply gas from contract to execution of function

texts:
let's say I have something like this

function usuallyCheapFunction() external {
    ... do something cheap...
    if(rareCondition == true) {
        expensiveCleanupFunction();
    }
}

function expensiveCleanupFunction() internal {
   ... shuffle around some storage ...
}

Users would call usuallyCheapFunction() to do something, expecting cheap transaction price. Sometimes the contract needs to do some expensive cleanup - is it possible in this case to supply gas from the contract to call expensiveCleanupFunction() so that the call does not cause out-of-gas? If so, how would this look like?


texts: Can I use money raised from Pre-ICO before start the ICO?

texts:
I was reading this article

  Most serious projects have some sort of pre-ICO funding to finance the
  marketing costs linked to the launch of an ICO.

I thought this funds (Pre-ICO funds collected
) were bound until the ICO end (how else can investors be guaranteed?).

Back to the main question, can I use money raised from Pre-ICO before start the ICO?


texts: Error processing transaction request: already known

texts:
I'm developing an application with which you can make ERC20 token transfers. When you make transfers from one account to another with a reasonable time between transfers it works correctly.
But when you make many transfers in a very short period of time from one account to another, like making 100 transfers one after another.
To make the transfers I am using the web3j library with version 4.5.15 and connects to the blockchain through Infura.
Why does this happen, and how can I fix it?
I leave you the code where the transfers are executed:
StaticGasProvider staticGasProvider = new StaticGasProvider(gasPrice, gasLimit);
TransactionManager transactionManager = new FastRawTransactionManager(web3j, "my_credentials", new NoOpProcessor(web3j));
ERC20 tokenContract = ERC20.load("token_address", web3j, transactionManager, staticGasProvider);
TransactionReceipt transactionReceipt = tokenContract.transfer("to_address", "amount").send();

Thanks for your help.
Regards


texts: erc20 token stop trading after minting tokens

texts:
hi i need help im the contact owner i did mint tokens but after i made mistake and trading stoped on uniswap can any one help me out will be rewarded big
@carlosnond is my telegram or email megazino1@gmail.com
enter image description here


texts: How to call functions from a Smart Contract, without using web3?

texts: I am trying to find out if there is a way to call functions from a smart contract which is already deployed on mainnet/testnet, without using web3. If so, how to do that?


texts: How to quickly check Ethereum Hashing Speed?

texts: I have 4-5 different GPUs with me. What would be the easiest way to quickly run a Hashing Speed Test on those cards assuming I already have the Drivers for them installed?


texts: how to calculate 1% of erc20 18 decimal token?

texts: I am building a system that should calculate the 1% of the tokens sent to it. I am thinking that it is ok to deal with large numbers but when it comes to smaller numbers like 1 token or 2 token [not the complete token], how can we calculate 1% of them? The token is 18 decimal places. I am looking for a chunk of code snippet for calculating 1% of the tokens value entered.


texts: transaction failed - out of gas (when receiving REAL tokens)

texts:
I have participated in an ICO and should receive the REAL Tokens in my MyEtherWallet. The transaction failed due to out of gas. After this error, I added the necessary ETH in my MyEtherWallet to cover the TX fee for the transaction to be completed.

How can the transaction be reloaded and the contract to be executed and to receive my REAL Tokens ? Please help me...
TX etherscan 0x70fc74551a132a301e5b4a6c1c6dbbfe23d4a6479501b60c6468cd2f6ba0cf3b


texts: Once i use selfdestruct(owner) then `Attempting to run transaction which calls a contract function, but recipient address is not a contract address`

texts: How do I fix this? I've already tried truffle migrate --reset and/or deleting the .json files.


texts: Is it okay to munge deployables in a single migration?

texts:
I'm hoping to use openzeppelin-solidity contracts. One of them uses Ownable. Is the following okay to do (via truffle compile and migrate)?  Thank you.

var OmniCAT = artifacts.require("./OmniCAT.sol");
var Ownable = artifacts.require("./Ownable.sol");
module.exports = function(deployer) {
  deployer.deploy(Ownable);
  deployer.deploy(OmniCAT);
};


texts: Sending an extra percentage of a token someone is trading to a cold wallet storage address

texts: I have an erc20 token I want to start trading.  In the smart contract, can you make it send 1% of the transaction amount in the token being sent to a "company wallet" storage along with the wallet it is going to?  Not in gas, but 1% of the amount of the token being traded, or should that be handled in the custom wallet?  Yes or no, will be fine, I'm gonna have to have somebody write it!


texts: web3 recover address from signature signed by digital bitbox

texts:
I use digital bitbox to sign some data and would like to use web3.js to recover the account address. Following https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#recover I couldn't successfully recover the address so far. I think the main issue is whether I have to prefix the data with web3.eth.accounts.hashMessage(message); and if yes, when exactly. This is what I currently do:

let data = ...

let data_hash = web3.utils.sha3(data, {encoding: 'hex'});
signature = sig.signData(data_hash.substring(2)) //signing by digital bitbox
let v;
if (signature.recid === "00") {
     v = "0x1b";
} else {
     v = "0x1c";
}
const r = "0x" + signature.sig.slice(0, 64);
const s = "0x" + signature.sig.slice(64, 128);

const signatureObject = {
messageHash: data,
   v: v,
   r: r,
   s: s
};

const recover = web3.eth.accounts.recover(signatureObject);
//recover should equal the address used by bitbox

I tried many combinations of web3.eth.accounts.hashMessage(data); and when to call web3.utils.sha3 on data but nothing seemed to work.

What did I miss?


texts: Retrieving key value while setting mapping

texts:
Im new to solidity and trying to figure out if there is any way to retrieve a mappings key value for example from the transaction data in which you set it?

mapping (uint => bool) private solution;

function setSolution(uint _number){
    solution[_number] = true;}

Would it be possible for anyone to find the current value of _number in any way while or after I have set it, or is it hidden?


texts: Can we enter our private key for decrypting a message in the react (frontend) part of a dapp?

texts:
We are planning to make a dapp in which we receive the encrypted hash of a file stored on ipfs.
We need to decrypt it using our private key stored on the local computer.
Is it safe to enter our private key in the front end part of the dapp and put the decrypting logic in the react ?
For the public key ,can we use the ethereum account's public key and decrypt it using the respective private key?
Also safer methods for storing private keys will be helpful


texts: Bought Ether from ethereum presale (genesis) Forgot password

texts: I bought ethereum from the presale. I have the json file but unfortunately forgot the password. Is there a way I can access the wallet?


texts: Web application for remote users to create Ethereum account

texts:
Say that a machine is running an Ethereum client (geth or Parity), and it also has a web application (running as a NodeJS server, say) that provides a front-end to users and communicates with the local Ethereum node using web3 calls from within its Javascript code. If the web application wants to provide a feature for the users to create an account on Ethereum, it could provide a form to the user to do that, and implement it by calling web3.personal.newAccount(<password>), using IPC on the local Ethereum node. However, the keys would be generated on the Ethereum node and would have to be managed by the web application.

Is there another way to do this such that the key-pair is generated on the user's machine so that the private key remains exclusively with the user? One way could be by using MetaMask, which (I have read) is a Chrome extension that "injects web3" into the browser. That would make it possible to generate keys on the user's machine. MetaMask would also be needed later for user to send signed transactions because the signing has to be done on the user side. Would that also be mean that the signed transaction would be sent directly from browser to the Ethereum node by calling web3.eth.sendRawTransaction(...) (web3 being provided by MetaMask) and not via the web application as a proxy ?

But then all this would force the user to use the Chrome browser and have the MetaMask extension installed. Is there a way to remove this limitation? Or is it true that a web application (i.e. running on a centralized server) that lets remote users create Ethereum accounts has to manage the keys itself?


texts: How can I set owners in constructor when create contract

texts:
I have a contract, and I want set owners for my contract without using set address in code.
Code of costructor contract:

function StepanToken2 (address _ownerFirst, address _ownerSecond){
       ownerFirst = _ownerFirst;
       ownerSecond = _ownerSecond;

       balances[ownerFirst] = SafeMath.div(totalTokens, 3);
       balances[ownerSecond] = SafeMath.sub( totalTokens, balances[ownerFirst]);
    }

Can I set owners in myEtherWallet or other way?


texts: Geth web3j How to set the correct gass price on a standard eth transaction

texts:
I'm having issues getting any transactions to confirm on Rinkeby with geth and web3j.  Question what is the best way to programmatically determine the best gas and gassLimit prices ?

Should I use the value of GassPrice returned from geth ?
MyEther wallet is setting GasPrice to:41000000000
Geth api call is  returning            1000000000

  echo '{"jsonrpc":"2.0","method":"personal_sendTransaction","params":[{"from":"0xf1b0725bd64cbe62a5160357d53e92c54788f2e5","to":"0xB1C26AB1c159F60AFa21A7c24D313fA4aA05812F","gas":"0x6208","gasPrice":"0x3b9aca00","value":"0x470de4df820000","nonce":"0x5"},"PRIVATE_KEY"],"id":15}' | nc -U ~/Library/Ethereum/rinkeby/geth.ipc
  {"jsonrpc":"2.0","id":15,"result":"0x00e44a5a6f6994c9e0494be9541faea873b9234117de26c76d0dcddc3f33cb3b"}

This transaction was accepted however is not mined. The Api has gas and gasPrice, but no GassLimit value, What would be the best way to set these values to ensure this transaction is mined with out paying over the top fees ??


texts: A way to track latest interactions with the contract?

texts: I need a function which will track latest interactions with my contract on the server side. So let's say something like getRecentTransactions() which will return transaction hashes of interactions with the contract in the last 5 minutes. Any API or anything that can help in this case? Ideas?


texts: Generating Transaction Traffic for Testing

texts: Is there a command line arg,  tool or script to automatically generate transaction traffic from multiple nodes on a private test network?


texts: ETH from Rinkeby to Poloniex Not Credited

texts:
I sent 1 ETH from my Rinkeby to Poloniex account on 18 Dec. It is withdrawn from Rinkeby on 18th itself, but still not shown in Deposits of Poloniex account (as on 9 Jan). I am able to see that ETH in Etherscan account checker. I have raised a ticket with Poloniex Support but they have not responded still. Please help me retrieve by ETH. The transaction hash is 0xcadd372f2b280b37dcd6328bf1f4160770858da7da0fd7addfa8c8086e084bdb.

P.S.: I see that other similar questions have been closed as being off-topic, if mine is also that case please guide me another forum to post this. Also I wanted to understand if this transaction from Rinkeby is any different from other questions.

Your help is much appreciated!!


texts:
I want to make a contract-to-contract call paying gas not from the user but from the calling contract's balance.
Possible? How?


texts: MetaMask listed as "web wallet" on official Ethereum website

texts:
MetaMask is listed only in the "web wallets" section of the official Ethereum wallet guide. Obviously, MetaMask is written in Javascript and runs in a web browser. But this is also true of the MyCrypto desktop client, which runs in an stripped down version of Chromium via Electron. The MyCrypto Desktop client is listed in the desktop wallets section of the guide.

Is there some additional aspect of the way MetaMask works which may have caused its inclusion in the web wallets section? Maybe the fact that it auto updates like all browser extensions? Or does it load remote javascript files when it runs, posing a security risk even if it is set not to auto update?


texts: Wondering about an etherscan transaction, did not receive swapped coin

texts:
May be a bit of an noobie question, as I am not super confident navigating etherscan at the moment.
I used the Bitswap dex from within the Trust Wallet app and swapped RSR for USDC.
On etherscan the transaction is showing a success but the USDC has not shown up in my wallet yet, nor is it showing the RSR has left the wallet nor any pending transaction.
Just wondering if someone wouldn't mind having a quick look and letting me know what might have gone wrong?
Thanks and much appreciated.
Here is the transaction hash:
0x3b52d2ff79d0b392f7bb1639a410017e1069883c041cbb96a10b53a5bc411c2f


texts: Deploying a smart contract with several solidity files

texts:
I have a contract contains 4 .sol files and when I generate its bytecode and api as follows:

> solc --bin GreenToken.sol
> solc --abi GreenToken.sol

I receive:

======= BasicToken.sol:BasicToken =======
Binary:
6060604052341561000f57...

======= GreenToken.sol:GreenToken =======
Binary:
6060604052341561000f5760...

======= Ownable.sol:Ownable =======
Binary:
6060604052341561000f5760008...

======= SafeMath.sol:SafeMath =======
Binary:
604c602c600b82828239...

The smart contract contains these 4 .sol files

BasicToken.sol , GreenToken.sol , Ownable.sol , SafeMath.sol

I receive also 4 api. The question is for deploying the contract I must use which bytecode and api ? In case, I have to use all of them how to merge ?


texts: How does Ethereum/Solidity handle overflows in contracts?

texts:
Say I have a smart contract with variable of type uint256. I write a function to increment this variable.

How does the EVM handle trying to increment the variable to store values beyond 256 bits?

The Solidity docs say the following:

  Number literal expressions retain arbitrary precision until they are converted to a non-literal type (i.e. by using them together with a non-literal expression). This means that computations do not overflow and divisions do not truncate in number literal expressions.

So apparently it won't overflow, so what does it do?


texts:
What is the algorithm to produce a bootnode's enode url ?

For example, I have this data:

Node key:  59233b25bfa4c214a8713e07a395a5d11478de10f36c6c80ba5369541f73bc44
IP: 127.0.0.1
Port: 30303

From these 3 fields how do I create the enode url ? What is the process?


texts: Is it possible in theory to generate the private key for the 0x0000000000000000000000000000000000000000 wallet?

texts: Is there any chance, although extremely low, to generate the private key for the 0x0000000000000000000000000000000000000000 wallet? Does the system allow it at all?


texts: Several question about understanding of input data for input of the contract

texts:
I need to get input data from transaction. Here is original question Here is original question, here is official documentation which gives some insights.

At the first sight it should be a big deal. We have a string, we know types and their order, we know how much chars each types takes - parse it and that's all. However when I dig dipper things become more complicated. Here is the list of questions I would like to address:

Why uint256 doesn't contain 256 bytes (512 chars as I exact here)?
Why is bytes10 padded to 32 bytes when I expect to see here 10
bytes(20 symbols)?
Why values in most cases right aligned, in some
cases - left aligned?
What is the head and tail? How to calculate
them?


texts: How will the number of confirmations for security change with Casper?

texts: How will this answer change when Casper is deployed?


texts: How can I set the gas price using ethers.js on uniswap

texts:
I'm trying to create a transaction but I can't figure out how to set the gas price.
Here's my current code, but according to https://uniswap.org/docs/v2/smart-contracts/router02/#swapexacttokensfortokens there is nowhere to define gas price if I'd like to have a fast transaction
  const tx = await router.swapExactTokensForTokens(
    amountIn,
    amountOutMin,
    [WETH_ADDRESS, CONTRACT],
    RECIPIENT,
    Date.now() + 1000 * 60 * 10 //10 minutes
  );

Code below is how I create the router
const router = new ethers.Contract(
  UNISWAP_ROUTER,
  [
    'function getAmountsOut(uint amountIn, address[] memory path) public view returns (uint[] memory amounts)',
    'function swapExactTokensForTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)'
  ],
  account
);


texts:
Is there any function inside MetaMask or Web3JS to detect if the node is down? For example, let say the private node that the user is connected to is down, how my app can know about it?

Steps to reproduce in local environment:

Launch your Dapp in local mode
Connect to a private node i.e.
Ganache
Unlock MetaMask
Quit or kill the private node i.e. Ganache
Go back to Dapp, check MetaMask

In above scenario, MetaMask doesn't produce/show any error to user mentioning the node is down. MetaMask still keeping a state of that node and assumes the node is still alive.

I try to handle this manually by creating a 'ping'-like function. But, due to the nature of CORS, that's not possible because in order to comply with CORS, it assume both Dapp and private node are on same protocol, host and port number. So, my 'ping'-like function didn't work.

So, my question here is, does MetaMask or Web3JS provide any function to call to detect if the RPC node is down/not reachable?


texts: Generate Ethereum address with private key

texts: How can I generate ethereum account address and private key that works on ethereum main network using web3 in nodejs?


texts: Why did this txn not transfer balance, I passed the exact same string same hex as response set in question

texts:
I called
/**
 *Submitted for verification at Etherscan.io on 2021-02-21
*/

contract m_quiz
{
    function Try(string memory _response) public payable
    {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(abi.encode(_response)) && msg.value > 1 ether)
        {
            payable(msg.sender).transfer(address(this).balance);
        }
    }

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string calldata _question, string calldata _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(abi.encode(_response));
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        payable(msg.sender).transfer(address(this).balance);
    }

    function New(string calldata _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] memory admins) {
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;
        }
    }

    modifier isAdmin(){
        require(admin[keccak256(abi.encodePacked(msg.sender))]);
        _;
    }

    fallback() external {}
}

contract's Try function by passing the same string which was passed in Start function. I checked hex. Can someone help me why Try function call https://etherscan.io/tx/0x096a060d64d833c55fd83b2ea4ec209578dc3316d863de3a3de63692e8476628 did not initiate balance transfer. Although txn got executed, still balance transfer didn't happen


texts: Truffle test failing due to different data type than expected

texts:
I am using truffle and ganache to make a token demo for myself. I'm following this guide then making my own changes according to my project.

When I try running tests to verify that my contract is running properly I am presented with an interesting return of data that I was not anticipating.

When I mint a token using this test:

describe("mint", () => {
    it("Created token with specified attributes", async () => {
        let instance = await Token.deployed();
        let owner = await instance.owner();

        let tokenId = await instance.mint(5, 2, 5, 10, 5);

        describe("Expected output: ", tokenId);

        let attributes = await instance.getToken(0);
        assert.equal(attributes, [5, 2, 5, 10, 5]);
    });
});

I was expecting this function to return [5, 2, 5, 10, 5]:

function getToken( uint _TokenId ) public view returns(
    uint256 value1,
    uint256 value2,
    uint256 value3,
    uint256 value4,
    uint16 value5
    ){
    Token memory _token = tokens[_TokenId];
    value1 = _token.value1;
    value2 = _token.value2;
    value3 = _token.value3;
    value4 = _token.value4;
    value5 = _token.value5;
}

But instead the variable attributes reportedly returns this weird data structure which appears to be an array of 5 with 3 mappings of the characters "c", "e", "s" to a variable. "c" contains the value I was hoping for:

{"c" : [5]  "e" : 0 "s" : 1}
{"c" : [2]  "e" : 0 "s" : 1}
{"c" : [5]  "e" : 0 "s" : 1}
{"c" : [10] "e" : 1 "s" : 1}
{"c" : [5]  "e" : 0 "s" : 1}

My question is why I am I getting this data structure? Shouldn't I be receiving my expected results? I believe the "e"'s mapping is the number of digits - 1, but I don't know what "s" represents. I could go through and make an array with each of the "c" mappings, but I don't know if this is the best way of handling this.


texts:
Following this tutorial on writing a voting contract and deploying on testrpc I created the below js code into voting.js and ran it by:

> node
> require('./voting.js');

After printing web3.isConnected() in some places it seems that after requiring the solc package the connection looses. Any idea why? how to solve?

voting.js:

Web3 = require('web3');
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
console.log(web3.eth.accounts);
console.log(web3.isConnected());

fs = require('fs');
console.log(web3.isConnected());
code = fs.readFileSync('Voting.sol').toString();
console.log(web3.isConnected());

solc = require('solc');
console.log(web3.isConnected());
compiledCode = solc.compile(code);

console.log(web3.isConnected());

abiDefinition = JSON.parse(compiledCode.contracts['Voting'].interface);
byteCode = compiledCode.contracts['Voting'].bytecode;

console.log(web3.isConnected());
VotingContract = web3.eth.contract(abiDefinition);
console.log(web3.isConnected());
deployedContract = VotingContract.new(['Rama','Nick','Jose'],{data: byteCode, from: web3.eth.accounts[0], gas: 4700000});
console.log(deployedContract.address);
contractInstance = VotingContract.at(deployedContract.address);

contractInstance.totalVotesFor.call('Rama');

The output:

> node
> require('./voting.js');
[ '0xabefa5873fe5c980a2b7ffe84a6726386a1c6c3a',
  '0xe4bf2c9df073808c187066adac463f2b2a4a3847',
  '0x49d61cad7ad214f968a4d5b402e936aa3eef1ef5',
  '0xbb3ae1453c1c843f28952611c3948691376003bc',
  '0xb57b5c0f2ec7869c2371831c11a4d1f8c54086bb',
  '0xb14fad57e7ab17d378499e8aa0f2bbefa9f70344',
  '0xc911f8c0f1d2e2e4a08d0c5eaf3390d54cb6ce93',
  '0x6ee5769268c665f0c9541ecd0216041af111dced',
  '0x79a88a34d78151d9d79b997b51f14ea4211faacd',
  '0x8a287c6e4407ed53723cc9cde6741125efdbc8ba' ]
true
true
true
false
false
false
false
Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545.
    at Object.InvalidConnection (/home/bush/hello_world_voting/node_modules/web3/lib/web3/errors.js:31:16)
    at HttpProvider.send (/home/bush/hello_world_voting/node_modules/web3/lib/web3/httpprovider.js:83:22)
    at RequestManager.send (/home/bush/hello_world_voting/node_modules/web3/lib/web3/requestmanager.js:58:32)
    at Eth.get [as accounts] (/home/bush/hello_world_voting/node_modules/web3/lib/web3/property.js:107:62)
    at Object.<anonymous> (/home/bush/hello_world_voting/voting.js:24:93)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
>


texts: Getting confirmations on web3.eth.Contract events

texts:
I'm listening for an event emitted by a contract using myContract.events.MyEvent([options][, callback]). In ganache-cli, callback seems to only fire as soon as the event is detected, as opposed to after some number of confirmations.
I'd like to perform logic in that callback once the transaction has n confirmations. Even the returned EventEmitter only has "data", "changed", and "error" events, in contrast to the "confirmation" event on methods.myMethod.send.
Is there a way to wait for confirmations on events, or do I have to manually wait for n blocks and then check the receipt for the transaction hash?


texts: EIP 2 is a fork cleaning the protocol a little. When will the fork kick in?


texts: Is this the only way that I can tell if a transaction is success / failed?

texts:
My solidity:

function Test(address to, uint amount) public {
    require(amount == 1000000000000000000);
}

In Nethereum

var r = contract.GetFunction("Test").SendTransactionAsync(<Owner Address>, <to Address>, Value).Result;
var rcpt = web3.TransactionManager.TransactionReceiptService.PollForReceiptAsync(r).Result;

The solidity will fail if I send any transaction with value that is not 1000000000000000000

I compare the differences between the successful / failure response:

BlockNumber=Nethereum.Hex.HexTypes.HexBigInteger
CumulativeGas=0.000000000000073064
GasUsed=0.000000000000073064
HasErrors=
TransactionHash=0x39a78915d2f0278399ea8e16c5b423ea150f4ec3d35122a8ba8e70b7965b9ad6
TransactionIndex=Nethereum.Hex.HexTypes.HexBigInteger
Status=

And the failure response:

BlockNumber=Nethereum.Hex.HexTypes.HexBigInteger
CumulativeGas=0.000002100000000000
GasUsed=0.000002100000000000
HasErrors=
TransactionHash=0xe2cb3949d76314f1dcd100e7232add1d3588d5849a0aa7975e5188a5beb94236
TransactionIndex=Nethereum.Hex.HexTypes.HexBigInteger
Status=

Is it true that the only way I can tell if a transaction had failed is to check the amount of gas used? If it is exhausted, means it is failed?

I really having a hard time figuring this out. Hope someone can help!


texts: Truffle: How to detect test environment while running smart contract test cases?

texts:
I'm trying to run some test cases in Travis CI using truffle but I want some of them not to run if the test environment(localhost:8545) is
 running via "testrpc" because some of my test cases only work with geth, not with testrpc.

If somehow I know the test environment while running test cases, I can skip test cases using "if condition in code" as per Mocha JS documentation -

it('should only test in the correct environment', function() {
  if (/* check test environment */) {
    // make assertions
  } else {
    this.skip();
  }
});

my turffle.js looks like this -

networks: {
    development: {
      host: 'localhost',
      port: 8545,
      network_id: '*'   // Match any network id
    },
    geth: {
      host: 'some ec2 url',
      port: 8545,
      network_id: '*',
      gasPrice: 20e9,
      gas: 0xfffffff,
    }
  }

development environment is running on testrpc(localhost) and geth environment is talking to a geth node on an EC2 instance.

In test case, if detected environment is development then only my test cases should run, otherwise not. So can someone help me that how do I find the truffle environment while running testcases?


texts:
I have been reading here about the withdrawal process. A friend of mine has participated in DAO and he needs some help - a couple of days ago found that DAO has failed and wants to withdraw.

All he has is :

the DAO password
the DAO address, which verified from the above links is entitled to some refunds.

So my most important question here is - that he should need a keystore/private key to get those back into an ether wallet right? Where should he have that? Should he have downloaded them/kept a backup from DAO or are these something else? Without those is there any way for getting back his deposited ether?

Update : There is no private key in his laptop - used shapeshift to convert BTC to ETH, and then send the ETH to DAO from within the DAO website.

Any way he can do anything?


texts: If geth sync is interrupted (network downtime), will restartin sync from where it left off cause a corrupt chain?

texts:
I'm on Ubuntu 14.04.
MSI Z97 Gaming 5 board
Haswell G3258 CPU
Corsair Vengeance 8GB DDR3 RAM
Sapphire Radeon 390 Tri-x OC GPU X5
EVGA 1000G PSU X2
Samsung EVO 120GB SSD

I'm not sure what else to add here. If I am missing anything, let me know.


texts: Create a new contract by JSON-RPC of cpp-ethereum

texts:
I want to create a new contract by JSON-RPC and cpp-ethereum.

I find out  eth_sendTransaction can help me to do this.

And let do it, I need to set "to" parameter like that:

to: DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.

But when I try to work on it with sample code with port 8079(own setup):

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{
  "from": "0x009fbfed8d5ca3b7c1fe680e1dd61fc726ef177b",
  "to": "0x005fecaea1b18f5247fdb457793f3da72df12e61",
  "gas": "0x76c0",
  "gasPrice": "0x9184e72a000",
  "value": "0x9184e72a",
  "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}],"id":1}' http://localhost:8079

I received nothing from above command.

I also know another way to create a new contract by solidity.

But I really want to use only JSON-RPC API.

Please give me advise to create a new contract by this way.


texts: The most famous opensource pool uses eth_getBlockByNumber method with parameter "pending" to get block template and generate jobs from it. But now, in parity, I found that this parameter is deprecated and I would like to understand why. Also, if this is really bad way to get a block template from the node, I would like to know how to do it right? Perhaps I need to use another method?


texts: anyone know how oraclize api is working. I read the source code files on github.com/oraclize/ethereum_api . it need a "__callback" function in my contract to receive the result, is it means there has a off-chain application on watching events, and provide the result?


texts: eth-netstats and eth-net-intelligence-api communication mechanism

texts:
How does eth-netstats work with eth-net-intelligence-api internally?

To run https://ethstats.net/ like  monitoring dashbard in Ethereum Blockchain we need to run eth-netstats and eth-net-intelligence-api simultaneously. But I can't understand how does eth-netstats connect with eth-net-intelligence-api under the hood.


texts: Should I limit the amount of tokens a person can buy/sell per transaction/per 24 hours

texts:
I'm creating a token and want to solve the big whale issue of pump and dump, or just the dump problem. As such, I thought about limiting how much an address can sell per transaction or per 24 hours. Is this possible in a Bep20 smart contract? And if it is, does this affect the amount a person can also buy?
Would there be unknown negative consequences of this type of restriction?
Lastly, Are there any tokens currently implementing this?
Thank you for any advice.


texts: From what I've seen, constant and view functions do cost gas to run, since there is compute power involved. But geth will allow you to use up to 50,000 gas without asking. Is this correct? Does Metamask have a similar limit for their nodes?


texts: How to use Truffle HDWallet Provider with WebSocketProvider

texts: Truffle HDWallet Provider works well with HttpProvider, but doesn't work with WebSocketProvider.


texts: How to get access to the storage mapping through the solidity assembler?

texts:
referencing the question How to get access to the storage array through the solidity assembler? I have been trying to figure out how to access the mapping (or variable y from the question).  The documentation has an example, but of course it has to be overly complicated and access a 2d mapping.  However it does say that to get the value of a key (k) of a mapping you hash k . p and load this slot.  Does this mean to get the mapping from the similarly asked question you would do:

contract Foo {
  uint internal x; // Storage slot #0
  mapping (uint => address) internal y; // Storage slot #1
  uint [] internal z; // Storage slot #2

  function zElement (uint key) public view returns (uint r) {
    assembly {
      sload(keccak256(add(key, y_slot), 32))
    }
  }
}

EDIT:  fixed the link to go to the correctly mentioned question.
EDIT2: should compile now i think.


texts: Connecting to crypto wallet from a mobile app

texts: I am building a mobile app with react native and I am having users register by connecting to a crypto wallet (like Opensea or Rarible do). Only things I have seen online use a QRcode as a private key which is scanned by crypto wallet. Problem is that, since they are already on their phone they can't scan the qrcode on the same device. Any ideas for a solution?


texts: Invalid Address error when call setFoo() function

texts:
my remix

pragma solidity ^0.4.24;

contract Foo {
    bytes32 foo;

    function setFoo(bytes32 _foo) public {
        foo = _foo;
    }

    function getFoo() public constant returns (bytes32) {
        return foo;
    }
}

my script

var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
web3.eth.defaultAccounbt = web3.eth.accounts[0];

var fooContract = web3.eth.contract([{
    "constant": true,
    "inputs": [],
    "name": "getFoo",
    "outputs": [{
      "name": "",
      "type": "bytes32"
    }],
    "payable": false,
    "stateMutability": "view",
    "type": "function"
  },
  {
    "constant": false,
    "inputs": [{
      "name": "_foo",
      "type": "bytes32"
    }],
    "name": "setFoo",
    "outputs": [],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function"
  }
]);

var foo = fooContract.at('0xe884fb988c3242bcd16a0e187b10e6261733477e');

my chrome console

foo.setFoo("hello world");


texts:
Is there any way to hide a transaction on the Ethereum blockchain?

Some blockchain have protocols that implement this by default, like Monero and Zcash. Is something similar possible on Ethereum?


texts: Can increasing a tx gas fee slow down a transcation because it'll be put into the end of a queu in a pool?

texts:
I send a transction, then, every 1-2 hours, I keep increasing the gas fee. I've done it a few times. I've noticied that after several hours that my gas fees isn't still high enough. However, at some point the estimate time has descreased while the current gas fees have increased. Does this mean that the longer a transcaction remains in a pool, the closer it gets to the point of being processed? Or is it simmply the gas fees that matter?
In there's indeed a queue, because increasing gas fees creates a new Tx, does this mean that simply creasing them will put my Tx at the end of the queue in a pool and therefore may not help much? And if I had stuck with my 1st Tx with the lowest gas fees, it'd have been proceesed with that low gas fees, faster that the new "speed up" Tx?


texts: Private Network Handshaking With External Pools

texts: I am trying to run a private network and I'm doing this by providing a bootnode for all my nodes. Every now and then I notice on my nodes that I will receive peers from outside the network. Upon further inspection admin.peers I notice that they are handshakes with public pools. I do not understand how this is occurring as I have overridden the default bootstrap nodes by providing the --bootnode flag so my nodes should not be able to find other nodes outside my network to handshake with?


texts:
I recently created this token on mainnet. https://etherscan.io/address/0xef54d5a930fd31d4a9e8975ffd2522c295d4cc1c#code
It's total supply is 50,000,000 tokens, with 18 decimal places.

However, when i add token to metamask I see 50000000000000000000000000 (18 too many zeros) .

Have i done anything wrong?


texts:
I've got an idea for a dApp, but not sure if it's possible or practical. the questions that sound similar that have been answered on here doesn't help with what I'm trying to do, at best, makes it all the more confusing.

I'd like to create my own token and be able to accept it on a website / app where one could spend that specific token, along with some data they'd enter in a text field.

There are not many guides out there that I could find that demonstrate how to accept an ERC20 token with web3.js in a web app. Mostly the tutorials I find are about creating tokens solely for an ico for token swaps. I want to build a web app that accepts them.

Is this possible?


texts: Problem with mist Wallet 0.7.6 (Beta 20) "vulnerability release"

texts:
After updating to Wallet 0.7.6 (Beta 20), running mist start syncing mainnet from the beginning, which is very bad, because syncing ~1,7MBlocks took me 4 days last time ...

Is that due to the "vulnerability release" ? Can I speed up the sync (... no, 'geth --fast' doesn't help).

It also give me ntp server errors which I didn't get with Wallet 0.7.5,
here it is a log snippet:

[2016-06-26 22:32:27.913] [ERROR] main - Couldn't get time from NTP time sync server. Error: can't find 'ntp enabled:' line in timedatectl output
    at /home/lsoave/Ethereum-Wallet-linux64-0-7-6/resources/app.asar/node_modules/os-timesync/index.js:47:19
    at ChildProcess.exithandler (child_process.js:205:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)
Error: can't find 'ntp enabled:' line in timedatectl output
    at /home/lsoave/Ethereum-Wallet-linux64-0-7-6/resources/app.asar/node_modules/os-timesync/index.js:47:19
    at ChildProcess.exithandler (child_process.js:205:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)

NOTE: crossposted here


texts:
Worth buying a pc with 2 GPU's in a crossfire to mine Ethereum? I plan to spend ~$1000 on that pc.

What client to use? What os is better to use? Ubuntu?


texts: How do two nodes discover each other by a third node in a private blockchain?

texts:
I'm using geth in three different containers.

Note: start a container means start geth and start mining.

Each container has its ports exposed.

A: -p 30303:30303 -p 8545:8545;
B: -p 30304:30303 -p 8546:8545;
C: -p 30305:30303 -p 8547:8545.

They are started in the following way:

Start the containers A, B and C;
Stop containers B and C;
Get the first node address and start containers B and C using it:
--bootnodes "enode://<first_node_address>@<host_ip>:30303".

After that, I can see the block mining is synchronized in each container. So far so good.

Then stop the container A. The problem is here, containers B and C are mining but not synchronized. There is no communication between them.

How do I make the nodes B and C know each other using A so they can continue to sync even if the node A fall.

I tried to use the bootnode service but they never synchronized.

I generated the bootnode key and started the bootnode service in A. Then I started A, B and C with the bootnode address of A using --bootnodes "enode://<bootnode_address>@<host_ip>:30303".


texts:
I have MEW and Metamask installed.

When I am trying to send a transaction using:

web3.eth.sendTransaction()

It always uses Metamask. May I know how can I specify I want to use MEW instead?


texts:
I'm using web3 v1.0 beta33 ethereum packages to do some signing and address recovery in a javascript/Angular5 app. I picked this version because I didn't see this function in 0.2x web3 versions' documentation. They only mention an "ecrecover" when referring to Solidity, which I'm not using, so I thought I had to be able to get to it from a v1.x web3 environment. I invoke the function with:web3.eth.personal.ecRecover. Compiling results in the error:....component.ts(77,38): error TS2339: Property 'ecRecover' does not exist on type 'Personal'. I previously had problems ("does not exist", expecting 0 args but got 3) invoking eth.personal.unlockAccount, where I had to add some argument info into its declaration in node_modules/web3/types.d.ts, and add "personal" to the list of "--rpcapi" options in the "geth" invocation to get everything to work. I think I matched any edits I did for unlockAccount in trying to fix ecRecover. I thought I was still in the app's web3/typescript world from the look of the error, but I now think it may be the web3 versions that are being used. In the app, I have "web3": "1.0.0-beta.33" in its package.json. But in the geth I'm using, its version of web3 is the 0.x version:

> web3.version
{
  api: "0.20.1",
  ethereum: "0x3f",
  network: "2429",
  node: "Geth/TestNode1/v1.7.3-stable/darwin-amd64/go1.9.3",

So is TypeScript tripping over its own typings/specification files, or is it actually communicating with geth to see that this function does not exist, and I would need to go to a later geth that uses web3 1.x (if it even exists yet)? Thanks for any help or guidance.


texts: Contract testing works in solidity but fails in truffle - testrpc

texts:
I have a contract like this:
PublishService.sol, the strings.sol is taken from here.

pragma solidity ^0.4.0;

import "./strings.sol";
contract PublishService
{

using strings for *;
struct ServiceListStruct {
string _cloudID;
address _gatewayID;
string _serviceProducerID;
string _serviceProducerMetadata;
string _serviceConsumerMetaAttr;
}
ServiceListStruct[] BCServiceList;

function countEntries() public returns (uint)
{
    return BCServiceList.length;
}

function addEntry(string cloudID, address gatewayID, string spID, string spMetadata, string scMetaAttr) public returns (uint)
{
require(msg.sender==gatewayID);
var sls = ServiceListStruct(cloudID, gatewayID, spID, spMetadata, scMetaAttr);
BCServiceList.push(sls);
return 1;
}

function deleteEntry(string cloudID, address gatewayID, string spID, string spMetadata, string scMetaAttr) public returns (uint)
{
require(msg.sender==gatewayID);
int pos = -1;
for(uint index = 0; index< BCServiceList.length; index++)
{
  if(compareStrings(cloudID, BCServiceList[index]._cloudID))
  {
    if(gatewayID == BCServiceList[index]._gatewayID)
    {
      if(compareStrings(spID, BCServiceList[index]._serviceProducerID))
      {
        if(compareStrings(spMetadata, BCServiceList[index]._serviceProducerMetadata))
        {
          if(compareStrings(scMetaAttr, BCServiceList[index]._serviceConsumerMetaAttr))
          {
            pos = int(index);
          }
        }
      }
    }
  }
}
if(pos > -1)
{
  for(uint i = uint(pos); i < BCServiceList.length -1 ; i++)
  {
    BCServiceList[i] = BCServiceList[i+1];
    delete BCServiceList[BCServiceList.length-1];
    BCServiceList.length--;
  }
return 1;
}
else
return 0;
}

function compareStrings(string s1, string s2) internal returns(bool)
{
var slice1 = s1.toSlice();
var slice2 = s2.toSlice();
var result = slice1.compare(slice2);
if(result == 0)
return true;
else
return false;
}
}

And I tried to test it using Remix IDE and it works as expected.

  tried to add a service from an account other than the one deployed the contract and deleted the service entry using the same account and it worked.
  tried to add service from one account and deleted from other account and the require statement failed as expected

But, when I try to test it using truffle, it fails. The test file is as follows:

const PublishService = artifacts.require('PublishService');
contract('PublishService', function(accounts) {
  it("addEntry function call from a valid account", function() {
    return PublishService.new({from: accounts[0]}).then(instance => { return instance.addEntry.call("LC1","0xca6e598bac8319860c663926f98096fdb279e55e", "LC1SP1", "SP1MD", "SC_ATTR",{"from": accounts[1]}); }).then(result => {
      assert.equal(result, 1, "[E] addEntry function test failed");
    });
  });
  it("deleteEntry function call from a valid account", function() {
    return PublishService.new({from: accounts[0]}).then(instance => { return instance.deleteEntry.call("LC1","0xca6e598bac8319860c663926f98096fdb279e55e", "LC1SP1", "SP1MD", "SC_ATTR",{"from": accounts[1]}); }).then(result => {
      assert.equal(result, 1, "[E] deleteEntry function test failed");
    });
  });

});

The second parameter of the call function is the account1 id from the testrpc network
Here is the result of it.

The addEntry function succeeds but the deleteEntry failed. I can't figure out the reason. Any help is appreciated.


texts: What's the difference between "Deploy New Contract" and "Custom Token"?

texts:
Can someone please explain what the difference between Deploying a new contract versus a custom token. This is on wallet.ethereum.org and when you go to the contracts tab, you will see it there. So let's say I am working in Remix and I have finished making my token, should I use "deploy new contract" or "Custom Token" to officially release my token. I have watched a few tutorials and the different videos show some using the Deploy new contract and some show using Custom Token.

What exactly are the differences between these two and if I was to release my own Token that I made in Remix, which one should I go with?

Thanks


texts: How to recover ERC777 tokens from a ERC20 account

texts: I have transferred some ERC777 tokens to an ERC20 Ethereum account on my Ledger wallet. The transaction was successful and confirmed by etherscan. However, I cannot find the tokens in my Ledger Ethereum account. Although they said ERC777 is compatible to ERC20, but it does not show up. However, when I log into the same address using MEW, it showed that the token is there. Can anyone advise how to recover the ERC777 tokens?


texts: ERC725 adopting/extending ERC721 non fungibility attribute for unique decentralized identifier (DIDs)

texts:
Like the ERC20 standards, which is a great standard, I am imagining a future where there will be full of erc725 based token/identities. For decentralized identities to be unique, is there some way to adopt and leverage ERC721 for its non-fungible attributes?

Is there a possibility of ERC725 adopting/extending ERC721 non fungibility attribute for truly truly unique decentralized identifier (DIDs)?


texts:
Are there any official information about request limitations? I know for example that there is a limit for the amount of results in getLogs: https://infura.io/docs/ethereum/json-rpc/eth_getLogs

  requests are currently limited to 1000 results

But are there also limits in terms of json-rpc requests in general? E.g. how many getBalance requestst can I do per day / per hour?


texts: Does fast sync download all past event logs?

texts: If I do a fast sync when connecting to Ethereum the first time, will all past Events (written into smart contracts) be downloaded along with the block headers?


texts: Deploy contract on live testnet using private key + truffle

texts:
I want to deploy my contract on live testnet ( rinkeby) using private key instead of mnemonic of my account and truffle.
I have some configurations in truffle.js but I am getting error on migrate :

require('dotenv').config();
const Web3 = require("web3");
const web3 = new Web3();
const WalletProvider = require("truffle-wallet-provider");
const Wallet = require('ethereumjs-wallet');

var rinkebyPrivateKey = new Buffer(process.env["RINKEBY_PRIVATE_KEY"], "hex");
var rinkebyWallet = Wallet.fromPrivateKey(rinkebyPrivateKey);
var rinkebyProvider = new WalletProvider(rinkebyWallet, "https://rinkeby.infura.io/dLqHiBy4LivAhq6bHTiS");

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    },
    rinkeby: {
      provider: rinkebyProvider,
      network_id: 4
    },
  },
  solc: {
    optimizer: {
      enabled: true,
      runs: 200
    }
  }
};

I am getting follow error :

/home/rails/Desktop/DeveloperCrowdsale/node_modules/web3/lib/web3/errors.js:35
        return new Error(message);
               ^
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/home/rails/Desktop/DeveloperCrowdsale/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/home/rails/Desktop/DeveloperCrowdsale/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/rails/Desktop/DeveloperCrowdsale/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/home/rails/Desktop/DeveloperCrowdsale/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/home/rails/Desktop/DeveloperCrowdsale/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/home/rails/Desktop/DeveloperCrowdsale/node_modules/xhr2/lib/xhr2.js:414:24)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Is there any another way to deploy your contract using private key of your account ?
or any update needed in my truffle.js file .


texts: Deploying contracts in truffle while passing parameters of it constructor results in an error

texts:
I have managed to successfully compile a solidity token contract, the constructor is shown below :

function token(uint256 initialsupply, string symbol, string name, uint256
buyPrice, uint256 sellPrice) public {

    totalSupply = initialsupply * 10**decimals;
    tokenBalance[msg.sender] = totalSupply;
    tokenSymbol = symbol;
    tokenName = name;
    buyprice = buyPrice;
    sellprice = sellPrice;
    require(buyprice <= sellprice);
    owner = msg.sender;

When using truffle to migrate and deploy the contract I run into an error which is

  Error: VM Exception while processing transaction: revert

Here is the deploy_contracts.js :

var token = artifacts.require("./token.sol");
var newtoken = artifacts.require("./newtoken.sol");

module.exports = function(deployer) {
deployer.deploy(token, 10000, "TOK", "ExampleToken", 20, 10);
deployer.link(token,newtoken);
deployer.deploy(newtoken);
};

However, when I add an additional sixth parameter to the constructor in my contract and then deploy the contract with only the above 5 parameters inputted in deploy_contract.js, the contract has no problems migrating the blockchain. So my constructor is now :

  function token(uint256 initialsupply, string symbol, string name, uint256
  buyPrice, uint256 sellPrice, uint256 dummy) public {

Is this an issue with truffle when deploying contracts ?

I am using truffle ganache 1.0.0


texts: How can I access the methods of an object in a contract using web3?

texts:
I am creating a front end, and right now I am trying to appove the token for transfer. I have an object, say token, instantiated in my contract as follows:
ERC20 private token = ERC20(existing_token_address);
I know I can access the methods of my contract using contract.methods.methodname().call(), but how can I access the token.approve(spender, amount) method from the instantiated token object?


texts: Issue in the creation of DAG "bash create_dag.sh".... need help..?

texts: While i go with this command "bash create_dag.sh", i found some errors which are shown in snapshot. how can i overcome this issue..?


texts: how to calculate the correct amount with decimal

texts:
I have total token 99,999,999.99999457, It is 8 decimal, but when I do like below I get 99999999, I expected 99,999,999.99999457:

  const decimals = await this.contract.methods.decimals().call();
  const decimalsBN = this.web3.utils.toBN(decimals);
  const divisor = this.web3.utils.toBN(10).pow(decimalsBN);
  const balanceWei = await this.contract.methods.balanceOf(address).call();
  const balanceWeiBN = this.web3.utils.toBN(balanceWei);
  return balanceWeiBN.div(divisor).toString();


texts: k-d tree in solidity for efficient search operation

texts:
Let us consider the following example

contract Courses {

    struct Instructor {
        uint age;
        string fName;
        string lName;
    }

    mapping (address => Instructor) instructors;
    address[] public instructorAccts;

}

If I want to search instructor by fName or lName I will have to iterate all the records stored in mapping instructors.

The time complexity of search operation sequentially is O(N). The time complexity of search operation can be reduced using a data structure k-d tree. Is there any example available for the same in solidity?


texts: Why my function named SubmitHash shows in Etherscan input field but not PublishHash?

texts:
I deployed my contract in Ropsten Testnet with submitHash as a function name. I get function Name with value passed in Etherscan.
function submitHash(bytes32 pHash) external onlyOwner() {
       emit Submitted(pHash);
    }

and I get this in Etherscan input field
Function: submitHash(bytes32 proofHash) ***

MethodID: 0x08891a32
[0]:  69a013f23c52f5415ae41e64561a6948e08df59904925db53f0df74fd64a3833

But when I use publishHash as a function name in the Ropsten testnet and in mainnet
function publishHash(bytes32 pHash) external onlyOwner() {
       emit Submitted(pHash);
    }

I get this in input data field which is only a hash :
0x4d26695f69a013f23c52f5415ae41e64561a6948e08df59904925db53f0df74fd64a3833

I dont understand it as my code is all same except for the function name.
Can someone tell me the reason or a way to get publishHash in etherscan input field?


texts: Is it possible to run Ethminer on more than one GPU of different types

texts:
I have a system with a GTX 1080Ti which I am experimenting mining with. I have a couple of GTX 970 cards floating around that I haven't got round to selling yet.

If I installed a GTX 970 card alongside my 1080Ti would I be able to mine on both at the same time?

Would I run into any issues with other programs or games if I had 2 different chipsets of GPU installed?

Thanks


texts: Why doesn't ETH allow a contract to read another contract / account's state?

texts:
Been thinking about this for a while, and came on this question: Can a contract access another contract's storage?.

What is the design rationale behind NOT allowing these types of reads? It seems trivial to implement on ETH currently. Now if ETH decided to shard later on then yes there might be problems with concurrent ordering between shards, but right now in a single monolithic chain, this is trivial to do.

Can someone explain to me if this design decision to NOT allow a contract to read another account's state is driven by technical or philosophical reasons? Thanks!


texts:
No tutorial can help me, I have watched almost every major tutorial on Youtube and read a ton of results from Google...

I have on my HTML file imported the web3.min.js (copied from Truffle pet-shop because web3 does not come with this anymore!)

And then on a script tag below that, for testing, I manage to connect it with Metamask, I thin, with

    window.addEventListener('load', () => {
  if (typeof Web3 !== 'undefined') {
    web3js = new Web3(Web3.currentProvider);
  } else {
    console.log('No web3? You should consider trying MetaMask!');
    web3js = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
  }
});

But still Web3.eth is undefined, so I can't connect to a contract or make calls.

Can anyone help me with the basic steps to interact with the contract from a front end?...


texts:
How to solve the out of gas problem in executing a complex solidity function consisting  lots of iterations and operation.

This is my code


texts: How do I fix this error when deploying a contract?

texts:
The error is "The called function should be payable if you send value and the value you send should be less than your current balance."
When I clicked on "debug" on remix, it points to the constructor. This is the constructor:
constructor () {
    _rOwned[_msgSender()] = _rTotal;
    IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);       // binance PANCAKE V2
    //IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F);     // binance PANCAKE V1
    //IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);     // Ethereum mainnet, Ropsten, Rinkeby, Görli, and Kovan
    uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
    uniswapV2Router = _uniswapV2Router;
    _isExcludedFromFee[owner()] = true;
    _isExcludedFromFee[address(this)] = true;
    _isExcludedFromReward[address(this)] = true;
    _isExcludedFromFee[BURN_ADDRESS] = true;
    _isExcludedFromReward[BURN_ADDRESS] = true;
    emit Transfer(address(0), _msgSender(), _tTotal);
}

This contract is a fork of NotSafeMoon. I'm using Remix and trying to deploy to testnet. I can't tell what I should make "payable".
I've tried looking at similar questions in the forum but has so far hasn't figured it out. thanks for any help!


texts: Doubt in terminologies used in Ganache Interface

texts:
I am developing a DApp (an e-commerce app) based on Ethereum. I wrote the solidity contract and interact it with a NodeJS server/web3js API. I am running a Ganache Ethereum RPC client locally. The app is running fine. I am making all the contract calls from the default account (web3.eth.accounts[0]).

I just have a few questions regarding the terminologies shown in this image of Ganace Interface.

What does the From Address and To Contract Address signifies?
What does Value mean? Why is it 0?
Who paid for the gas when I did a contract call(which resulted in a transaction and then a block) via the web app?
Who is the Miner of this Block 5?


texts: How much ethereum does one need for Proof of Stake?

texts: Is there a minimum to have in order to qualify for this proof of stake?


texts: Problem retrieving ABI array from API of etherscan

texts:
I deployed my contract on ropsten through metamask and solidity browser and published it on etherscan so I can import ABI code for my nodejs app and work accordingly. When I open my contract's ABI through the api link it gives me this-

What could be the problem??Its same for all contracts launched in ropsten..its working fine for mainnetwork. Does etherscan not support the APIs for testnetworks??


texts: How to create a memory array in a struct?

texts: I am receiving the "stack too deep" error when compiling my smart contract. I know it has to do with too many variables, and I've heard of creating a memory array to "group" variables together. I'm looking for an example of this in a struct that I can follow. I can post code if it would help. Thanks, Rob


texts: Do Truffle methods automatically raise time-out exceptions?

texts:
Do the Solidity library functions automatically raise exceptions if a time-out error occurs? For example, what happens if the sendCoin() method call in this Truffle doc page times out (never completes)?:

http://truffleframework.com/docs/getting_started/contracts

If so, where can I read up on best practices for structuring your exception/error handling code to handle time-outs and on what the suggested recovery measures are to take for this specific type of error?


texts: The sequece of operations on blockchain nodes

texts:
I have been trying to understand the sequence of operations that happens on nodes participating in the network,when a transaction is initiated in both mining or non-mining nodes.

What is the sequence of operation happens when a transaction is initiated by a node ?

The following links helps a little.

How does the system enforce correct execution of smart contracts?

The following entities needs to be part of the sequence to draw a complete picture how things works. For example; miner,full node,block,global state( address vs nonce) etc


texts: What kind of micro-processor / micro-controller are able to run Blockchain light client?

texts:
Is there any kind of micro-processor / micro-controller that can run Blockchain light client?

An example can be Samsung ARTIK: https://www.artik.io

However, it's too big. Is there any other similar but smaller micro-controller that is able to run Blockchain light client?

P.S. 1 : For example, I do not know NODEMCU and ESP8266 are a good choice for this purpose? (example: https://hackaday.com/2018/05/02/using-blockchain-explorer-apis-on-nodemcu/)

P.S. 2 : The projects seem run a blockchain client on a micro-controller:

(1) EthEmbedded
(2) Elkrem
(3) EthArmbian

P.S. 3 :  And also can we consider Raspberry PI as a micro-rocessor / micro-controller? Since apparently, it's possible to install Ethereum Blockchain on it. (more information: https://ethraspbian.com/)


texts: How to set ${CMAKE_INSTALL_PREFIX}/bin in the path?

texts: I want to develop smart contracts and started from scratch and i couldn't find a solution to set my CMAKE_INSTALL_PREFIX/bin environment path!


texts: How can I implement a custom blockchain?

texts:
I am doing a research project which requires me to implement a blockchain with pBFT consensus algorithm. The blockchain would be very simple - A client should be able to send 2 values, the validators or secondary miners would verify the value by checking the blockchain, i.e. previous verified values. If, the value is reasonably close than it would add it to the blockchain by creating a new block. I am thinking of using the Hyperledger Sawtooth, because it has pBFT algorithm. Please suggest a starting point. I am reading the sawtooth docs but could not implement my version of the blockchain. Any resource would be helpful.

Please help.


texts: Error: "The contract code couldn't be stored, please check your gas limit"

texts:
It's seem that is a very common topic but I couldn't find the solution in other questions, sorry for asking it again. I'm following a beginner example, trying to deploy a contract in Rinkeby Network through Infura node.

This is the contract I want to deploy:

pragma solidity ^0.4.22;

contract Inbox {
    string public message;

    constructor(string initialMessage) public {
        message = initialMessage;
    }

    function setMessage(string newMessage) public {
        message = newMessage;
    }
}

This is the Deploy.js

const HDWalletProvider = require('truffle-hdwallet-provider');
const Web3 = require('web3');
const { interface, bytecode } = require('./compile');

const provider = new HDWalletProvider(
    '  //Mnemonic ',
    'https://rinkeby.infura.io/3qmjTiDl43PDhvdhm4WB'
);
const web3 = new Web3(provider);

const deploy = async () => {
    const accounts = await web3.eth.getAccounts();

    console.log('Deploy from account', accounts[0]);

    const result = await new web3.eth.Contract(JSON.parse(interface))
        .deploy({ data: bytecode, arguments: ['Hi there!'] })
        .send({ gas: '1000000', from: accounts[0] });

    console.log('Contract deployed to', result.options.address);
};
deploy();

When I try node deploy.js, the console print the first Console.log of the Deploy function but after waiting it says:

(node:13776) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: The contract code couldn't be stored, please check your gas limit.
(node:13776) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I hope you can help me guys, sorry if it's an easy peasy thing, trying to learn it.


texts: How can I store the hash of a record stored in mysql, as a transaction in ethereum network?

texts: Suppose, I have a database that stores all the student details in mysql. To confirm and seal any manipulation in the database I want to store the changes in the blockchain network as a transaction and using the hash of the transaction I want to get back the details of the transaction. Can anyone assist me in finding how can I do this?


texts: integrate icoengine into zeppelin crowdsale contract

texts:
I have the following functions

// from https://github.com/eidoo/icoengine/blob/master/contracts/KYCBase.sol
function buyTokens(uint64 buyerId, uint maxAmount, uint8 v, bytes32 r, bytes32 s) public payable returns (bool)

// from https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/crowdsale/Crowdsale.sol
function buyTokens(address _beneficiary) public payable

I need to make the buyTokens function revert and make it possible only to call the one from KYCBase (see link above).

As per instructions on eidoo/icoengine repository, the releaseTokensTo function must be overriden to implement the crowdsale logic.

I am really confuse about integrating the open-zeppelin crowdsale into eidoo icoengine KYCBase model. Anybody can help me?

I tried various ways:

Making an internal version of buyTokens

// weiAmount is passed by the caller function as msg.value
function buyTokensInternal(address _beneficiary, uint256 weiAmount) private

after that using it into the KYCBase releaseTokensTo, but I get errors I cannot debug.
Making the Crowdsale's buyTokens revert

// kinda like this
function buyTokens(address _beneficiary) public payable {
    revert();
}

In any case I always get the following results from truffle tests

buyTokens : Expected to be fulfilled but got error: VM Error - revert

can anybody help me?


texts: If 2 transactions are included in the same block, which one is faster?

texts:
Suppose I have 2 transactions calling the same contract with a very high gas price, let's say 1000 gwei for tx a and 1001 gewi for tx b. If tx a is sent first before tx b, will tx b be faster to execute the contract since it has higher fee?

In my testing on the testnet however, tx a is faster to reach the contract when they are included in the same block. So my assumption is if 2 tx are included in the same block, then instead of picking up the the one with higher fee it will be "first come, first served". Is my assumption correct?


texts: How do I decode the transaction's log with Web3.py?


texts: Return a response from selfdestruct function

texts:
I'm trying to have some sort of confirmation after I kill a contract by returning true, but when I run my kill command it always returns false. Is there any reasoning why, or is the contract not being killed?

Here is my contract code:

function killContract() constant returns (bool) {
    require(msg.sender == owner);
    selfdestruct(owner);
    return true;
}

Here is my truffle code that I'm trying to have return true, but it keeps returning false:

MyContract.at('0x...')
    .then(instance => {
        c = instance;
        return c.getOwner()
    })
    .then(owner => {
        console.log(`Owner: ${owner}`);
        return c.killContract()
    })
    .then(killed => {
        console.log(`If killed return true: ${killed}`);
    })
    .catch(error => {
        console.log(`${error}`);
    })


texts: Truffle migrations - UNABLE TO MIGRATE (Error: Deployment Failed)

texts:
The compilations goes well on the Rinkeby testnet using the command

geth --rinkeby --rpc --rpcapi="personal,eth,network,web3,net" --ipcpath "~/Library/Ethereum/geth.ipc" --syncmode light --cache 64 --maxpeers 32

but after that when the migration starts, it exits giving the error:

The geth console gives this:

Truffle Configuration goes like this:

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match any network id
    },
    rinkeby: {
      host: "localhost",
      port: 8545,             //port for GETH
      network_id: 4,        //network ID of Rinkeby TestNet
      gas: 7000000
    }
  }
};


texts: Web3 constant functions require password

texts:
I have two simple constant functions in a contract:

function fun1 (address A) constant returns (uint) {
    return mappingAS[A].length;
}

function fun2 (address A, uint V) constant returns (string, uint) {
    return (mappingAS[A][V], mappingBE[mappingAS[A][V]][(mappingBE[mappingAS[A][V]].length)-1].timeStamp);
}

(Note: the first returns a length of an array (from mapping "address => string[]") and the other one returns values from an exact position in another array (which is as well stored in a mapping "string[] => struct[]")

Now both of these constant functions seem to work in the Mist GUI (contract watch) but if I try to call them through web3:

contractA.fun1(address).call()

contractA.fun2(address, position).call()

I still have to sign those calls as transactions (with password) and a transaction hash gets returned instead.

Contract and ABI are correctly assigned:

var contractA = web3.eth.contract(contractABI).at(contractAddress)

I'm using standard Mist's geth parameters. Should I somehow change the parameters of geth?

Thanks for any hints.


texts: Ethereum Token: How to decide gas price and gas limit using token transaction?

texts:
I made ERC20 token.
And I am going to implement to send token using web3.py.
Here I want to calculate gas price and gas limit using token transaction.
If anyone know about that, please help me.

Thanks.


texts: Is it possible to deploy contracts to live ethereum network using Blockapps?

texts: I've been exploring Blockapps Strato & bloc APIs and tried deploying contracts to their private blockchain. I now started was wondering how I can use this to deploy a contract to the actual Ethereum blockchain. Any links to documentation on this (beyond the Blockapps API documentation) or examples would be very welcome.


texts: Create map of existing objects in mint function for a smart contract

texts:
I'm really new to solidity and there is still alot I dont fully get. I have created this smart contract. I am getting an error while performing a test stating that the id to be set by the push cant be performed due to the following:
Error: Different number of components on the left hand side (1) than on the right hand side (0).
        uint _id = arts.push(_art);//create ids
        ^------------------------^

I understand that the push receives only one atribute and should be able to stablish the index to the id variable. Nontheless this bugg occurs, I'm not sure if its the version or something else. I'm currently using truffle for the tests with version: "^0.6.0". I would really appreciate your help. Thanks in advance!
Here's my code:
pragma solidity >=0.4.21 <0.7.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract Art is ERC721{

    string[] public arts;

    mapping(string => bool) _artExists;//similar to json or hash

    constructor() ERC721("Art", "DATA") public {
    }

    //E.G color = "#FFFFFF"

    //create art restrict in the future to mentors
    function mint(string memory _art) public{
        //Require unique Art
        require(!_artExists[_art]);
        uint _id = arts.push(_art);//create ids
              //address

        _mint(msg.sender, _id);
        _artExists[_art] = true;

        //Art - track it & add it
        //Call the mint function
        //Art - track it

    }

}
//mint function


texts:
There is setData variable. This is Struct array variable. Now, anyone can access data contents in setData. So, I want to add access restriction to setData. I want to make access setData only by owner. Is that possible?

pragma solidity ^0.4.0;

contract SimpleStorage {

address owner;

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

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

struct Sample {
    uint256 id;
    string data;
}

uint256 public id;
Sample[] public setData; // ← I want to add "onlyOwner" modifier. Can I do it?
function set(string data) {
    setData.push(Sample({
        id: id,
        data: data
    }));
    id++;
}
}


texts: Only int128 and uint256 int types in vyper

texts:
I have read vyper documentation and there is something strange: I only see uint256 and int128 data types for integer values.
There is no way to create an uint8 for example in vyper ?
Thanks


texts:
Hi I'm trying to make a voting module which the user can cast votes by pressing radio button. But when I run this error comes out.

Uncaught TypeError: this._eth.sendTransaction is not a function

This is my script

    if(typeof web3 != 'undefined'){
    web3 = new Web3(web3.currentProvider);
     web3.eth.defaultAccount = web3.eth.accounts[0];}else {
      web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"));
 }
    web3.eth.defaultAccount = web3.eth.accounts[0];

  var SuffrageContract = new web3.eth.contract([
  {
    "constant": true,
    "inputs": [],
    "name": "getInstructor",
    "outputs": [
      {
        "name": "",
        "type": "string"
      },
      {
        "name": "",
        "type": "string"
      },
      {
        "name": "",
        "type": "string"
      },
      {
        "name": "",
        "type": "string"
      }
    ],
    "payable": false,
    "stateMutability": "view",
    "type": "function"
  },
  {
    "constant": false,
    "inputs": [
      {
        "name": "_id",
        "type": "string"
      },
      {
        "name": "_president",
        "type": "string"
      },
      {
        "name": "_vice",
        "type": "string"
      },
      {
        "name": "_party",
        "type": "string"
      }
    ],
    "name": "setInstructor",
    "outputs": [],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function"
  }

    ]);
    var Suffrage = SuffrageContract.at('0x3b2e13c156ebb392074066ee414f42c4c59b761d');
        console.log(Suffrage);

  $("#submit").click(function(){

     var president,vp,party;
     //Get President
      if($('#pres1').is(':checked')){
        president = $('#pres1').val();

      }
      else if($("#pres2").is(':checked')){
        president = $('#pres2').val();
      }
      else if($("#pres3").is(':checked')){
        president = $('#pres3').val();
      }
      else if($("#pres4").is(':checked')){
        president = $('#pres4').val();
      }
      else if($("#pres5").is(':checked')){
        president = $('#pres5').val();
      }
      else if($("#pres6").is(':checked')){
        president = $('#pres6').val();
      }
        //Get Vice President
       if($('#vp1').is(':checked')){
        vp = $('#vp1').val();

      }
      else if($("#vp2").is(':checked')){
        vp = $('#vp2').val();
      }
      else if($("#vp3").is(':checked')){
        vp = $('#vp3').val();
      }
      else if($("#vp4").is(':checked')){
        vp = $('#vp4').val();
      }
      else if($("#vp5").is(':checked')){
        vp = $('#vp5').val();
      }
      else if($("#vp6").is(':checked')){
        vp = $('#vp6').val();
      }

      //Get Party List
       if($('#party1').is(':checked')){
        party = $('#party1').val();

      }
      else if($("#party2").is(':checked')){
        party = $('#party2').val();
      }
      else if($("#party3").is(':checked')){
        party = $('#party3').val();
      }
      else if($("#party4").is(':checked')){
        party = $('#party4').val();
      }
      else if($("#party5").is(':checked')){
        party = $('#party5').val();
      }
      else if($("#party6").is(':checked')){
        party = $('#party6').val();
      }
      else if($("#party7").is(':checked')){
        party = $('#party7').val();
      }
      else if($("#party8").is(':checked')){
        party = $('#party8').val();
      }
      else if($("#party9").is(':checked')){
        party = $('#party9').val();
      }
      else if($("#party10").is(':checked')){
        party = $('#party10').val();
      }
      else if($("#party11").is(':checked')){
        party = $('#party11').val();
      }
       else if($("#party12").is(':checked')){
        party = $('#party12').val();
      }

          Suffrage.setInstructor('sample id', president, vp, party, function(err,result){

                console.log(err,result);
            });

  });

</script>

I dont know whats wrong please help me. Any answer will be accepted and appreciated. Thank you. :)


texts: How to get new transactions by addresses?

texts:
I have an array of addresses on my server which I need to track. What method should I use to do that via websockets? I’m new to eth and cryptocurrency at all, and I don’t understand “blocks”, “gas price” meaning  :(

I expect some method which will return data like {from: "", to: "", amount: ""}, but didn’t find it for now