texts:
I was reading the contract creation part from the Ethereum Yellow paper and came across following statement:

  For a normal STOP code,
  or if the code returned is otherwise empty, then the state
  is left with a zombie account, and any remaining balance
  will be locked into the account forever.

Can someone help me understand how an account transforms into a zombie account?


texts:
For calculating the transaction fee using web3js I am using it's gas price:

eth.getTransaction("txhash").gasPrice

multiplied by how much gas was actually used:

eth.getTransactionReceipt("txhash").gasUsed

Is it correct? Is there a simpler way?


texts: How merkle tree is used to verify transaction in blockchain

texts:
May any one give example how merkle tree is used in blockchain to verify the transaction? I confused because validation of data in ethereum is done through the proof of work where you find the nonce(hash of block + nonce) value that will less than and equal to target hash value.
If I am wrong than please correct me as I am new to blockchain technology.


texts: How do you get the balance of an account using truffle/ether-pudding?

texts: Is there an ether-pudding way to get the balance of a contract/account, or should I just use web3.eth.getBalance(account)?


texts: does the transaction trie include the contract internal transactions?

texts: Does the transaction trie include the contract internal transactions besides the transactions collected from the network? if not, how the contract internal transactions are handled in the EVM and being stored in the block?


texts: Can a single token built on Ethereum’s blockchain be more valuable than Ethereum itself?

texts:
As in the question, from an economics point of view, is it possible to ever have a single token (REP/BAT or something completely unforeseen currently) takeover the underlying's platform market cap or the network economics of the matter will always make it so the platform(ETH) that said token is built on to have more value (given it facilitates said token plus all other tokens)?

If there is any research done on this, I would be grateful to be pointed that way.


texts: Contract deployment workflow with truffle/ether-pudding

texts:
I've managed to deploy a contract on geth by unlocking the account of the node. (How this would work in production I have no idea, as I think it would pose a security risk)

Now I connect with my truffle app to the local geth node (connecting my  truffle app to the testrpc works completely, with callbacks etc.)

What I'm missing is the 10 accounts & 10 private keys that I get with testrpc on my geth account.

Correct me if I'm wrong, but I could add these in my genesis.json, but they are different each time I start the testrpc, but the same when I start geth.

What I'm missing, or can't see any clear instructions or workflow for, is switching between the two.

Where would I start when I want to test it on a geth (or other eth node) instance?

Main issues:

I can't influence the accounts being used/created with testrpc, only the number of default accounts.
When I successfully deploy contracts and compile .sol.js files and the addresses match the ones registered in the geth instance, I do a transfer, but the promise callback (then) doesn't get triggered, whereas on the testrpc it does.

The callback in question:

    shares.sendShares(destinationAccountId, amount, {from: accountId}).then(function() {

       return getShares(accountId, function(val){
         store.dispatch(setSendStatus("Shares Sent!", val))
       })

       return getDestinationShares(destinationAccountId, function(val){
         store.dispatch(setDestinationStatus("Shares received!", val))
       });

  })

Right now, I'm just retrieving the accounts array and use the 0 and 1 of that, what if I want a default existing account integrated in testrpc?

Not sure how relevant, but my genesis.json: (from: http://tech.lab.carl.pro/kb/ethereum/testnet_setup)

  {
    "nonce": "0x0000000000000042",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "difficulty": "0x4000",
    "alloc": {},
    "coinbase": "0x0000000000000000000000000000000000000000",
    "timestamp": "0x00",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "Custem Ethereum Genesis Block",
    "gasLimit": "0xffffffff"
  }


texts: getsockopt: connection refused when running a bootnode

texts:
Geth version: v1.6.0-unstable-1018bf6a/linux/go1.7.3
OS & Version: Linux/Ubuntu 16.04.1 LTS (x86_64)

I want to set up a private distributed blockchain network. I am failing to make nodes (running on different machines) recognize each other.

Both nodes have the same genesis file and are connected to the same networkId.

INFO Successfully wrote genesis state  hash=X (hash equal on both nodes)

The UDP Port 30301 of the bootnode is open

> netcat -u -z -v <PUB-IP> 30301
Connection to <PUB-IP> 30301 port [udp/*] succeeded!

When I start the bootnote I pass the following arguments:

--nodekey <FILE> —addr :30301 --nat extip:<PUB-IP> --verbosity 9

The logs confirm that it is successfully created and listening:

INFO Mapped network port    proto=udp extport=30301 intport=30301 interface=ExtIP(<PUB-IP>)
DEBUG UDP listener up       self=enode://<PUB-ID>@<PUB-IP>:30301

When I start the node I pass the following arguments:

--cache=512 --verbosity=6 --datadir <DIR> --nat extip:<PUB-IP> --networkid=<VAL*> --rpc --rpcaddr=0.0.0.0 --rpcapi=eth,net,web3,personal,db --rpccorsdomain '*' --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --bootnodes enode://<PUB-ID>@<PUB-IP>:30301 --identity node1

*(I am using a big networkId but it is inside the BigInteger range)

The logs on the node confirm that the bootnode is well identified

INFO  Starting P2P networking
# >> Info about the current node:
DEBUG UDP listener up             self=enode://<PUB-ID>@<PUB-IP>:30303
INFO  Mapped network port         proto=udp extport=30303 intport=30303 interface=ExtIP(<PUB-IP>)
# >> Info about the bootnode:
TRACE Starting bonding ping/pong  id=<PUB-ID-SHORT> known=false failcount=0 age=XmXs

But connection fails and admin.peers shows no peers

TRACE >> PING/v4                 addr=<PUB-IP>:30301 err=nil
TRACE Starting bonding ping/pong id=<PUB-ID-SHORT> known=false failcount=0 age=XmXs
TRACE >> PING/v4                 addr=<PUB-IP>:30301  err=nil

When I try adding the bootnode manually, admin.addPeer("enode://..") returns true but the logs show:

DEBUG Adding static node    node=enode://<PUB-ID>@<PUB-IP>:30301
TRACE New dial task         task="staticdial <PUB-ID-SHORT> <PUB-IP>:30301"
TRACE Dial error            task="staticdial <PUB-ID-SHORT> <PUB-IP>:30301" err="dial tcp <PUB-IP>:30301: getsockopt: connection refused"
DEBUG Resolving node failed id=<PUB-ID-SHORT> newdelay=2m0s
TRACE Dial task done        task="staticdial <PUB-ID-SHORT> <PUB-IP>:30301"
TRACE New dial task         task="staticdial <PUB-ID-SHORT> <PUB-IP>:30301"
TRACE Dial error            task="staticdial <PUB-ID-SHORT> <PUB-IP>:30301" err="dial tcp <PUB-IP>:30301: getsockopt: connection refused"
TRACE Dial task done        task="staticdial <PUB-ID-SHORT> <PUB-IP>:30301"

I have tried as well to connect via static-nodes.json, where I indicate the bootnode's address in all nodes; and also without the --bootnodes flag, where somehow my nodes are not being recognized either, yet there are some random external nodes that are displayed as peers sporadically. I have tried specifying --maxpeers (following BokkyPooBah's advice) as well and seems to make no difference.

Please, help me.


texts:
for dynamic array in solidity

uint[][] public test;

how can I insert the dynamic element?
if test.length is 3, does this mean test[3][] or test[][3]?
if I insert an element,

test.length++;
len=test.length;
test[len][test[len].length++]=my_int;

is this correct? thanks


texts: What underlying protocols are used to send packets between nodes, and how are messages encrypted?

texts:
In Ethereum, when we make transactions, which underlying protocol is used to send the packages over the network? And another question, are those messages are encrypted or not?
TCP, UDP, others? All?

Is there a reference you can show me that provides this information? I was unable to find it.


texts: Problem with import of ether.li wallet into Mist

texts:
I am unable to follow the guide provided from the creator of ether.li: https://masonborda.com/etherli-wallet-recoveries/.

I managed to import both accounts via the console into Mist but I am unable to continue. Which account should be set as the owner and which adress should be imported?
I tried every possible combination and everytime a message pops up saying: The adress has no wallet-contract. Could someone explain to me what I am doing wrong?

I would be grateful for any help.

EDIT: Switching to Parity solved the Problem, there was a problem with the block syncing in Mist.


texts: REMIX: ParserError: Expected identifier but got 'payable' address payable target

texts:
Hello i have the follow contract:

https://pastebin.com/dQJY55hs

I want add this code tu the code above:

    constructor(uint _totalSupply) public {
    totalSupply = _totalSupply;
    balanceOf[msg.sender] = totalSupply;
}

// your standard token transfer function with the addition of the share that
// goes to your target address
function transfer(address _to, uint amount) public {

    // calculate the share for your target address
    uint shareForX = amount/100;

    // store the previous balance of the sender for later assertion
    // (check that all works as intended)
    uint senderBalance = balanceOf[msg.sender];
    // check the sender actually has enough tokens to send
    require(senderBalance >= amount);
    // reduce sender balance first to avoid that the sender sends more than
    // he owns by submitting multiple transactions.
    balanceOf[msg.sender] -= amount;
    // store the previous balance of the receiver for later assertion
    // (check that all works as intended)
    uint receiverBalance = balanceOf[_to];

    // add the amount of tokens to the receiver but deduce the share for your
    // target address
    balanceOf[_to] += amount-shareForX;
    // add the share to your target address
    balanceOf[target] += shareForX;

    // check that everything works as intended, specifically checking that
    // the sum of tokens in all reladed accounts is the same before and after
    // the transaction.
    assert(balanceOf[msg.sender] + balanceOf[_to] + shareForX ==
        senderBalance + receiverBalance);

}

The problem is i dont know whats wrong but i receive this error in REMIX:

browser/savingcoin.sol:79:13: ParserError: Expected identifier but got 'payable'
address payable target = 0x158de12EE547EAe06Cbdb200A017aCa6B75D230D;
        ^-----^

This code just send 1% of tokes to X address so i dont know whats wring so please help to me.

Thanks


texts: Not getting getPastEvents or once function using contract instance

texts:
I have followed Web3 documentation to subscribe an evnet, I have created Instance of web3 using infura url as argument.

Created contract object using,

const contract = web3.eth.contract(abi, address)

Where abi and address containing Contract ABI and Contract Address respectively.

All documents and tutorials used web3.eth.Contract but it give TypeError: web3.eth.Contract is not a Constructor, so I have replaced it with 'c' web3.eth.contract.

The contract object returns,
ContractFactory -> eth -> (List of functions) -> abi -> new
In object structure.

I am not able to get an Event as object structure. Referred this tutorial also.

I have web3 version: 0.20.7, is there any problem with web3 version?


texts:
Questions.
How to import an account in FireFox on Android?

Description:

According to the instructions, I downloaded the JSON file.
I received an email code.
I went to the "Import Account" page.
I have added JSON.
I registered the code that I received on Email.
I click the "Import" button.
Result: under the buttons, I get the message "You must select a file to import."

Used by:

Android Model - Mi PAD 3
Android Version - 7.0 NRD90M
MIUI Version -
MIUI 8.3 by xiaomi.eu 7.5.25
Browser - FireFox

Picture-2

Picture-1


texts: In Quorum, Does contract resides on all the nodes or a majority subset of the nodes?

texts:
"A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific
address on the Ethereum blockchain." - Solidity Documentation

In Quorum, Does the deployed contract resides on all the nodes or a majority subset of the nodes? Say 3/4? And when a transaction is sent to a node, it is executed by one node and the result of the state change is propagated. OR the execution is done by all the nodes so the state change is immediately updated.


texts: Web app to call a payable function with parameter

texts:
Let suppose we have a contract with a payable function like this:

function join(address sender) payable {};

So I have an user to join, invited by a presenter which address is address.
I want to create a way people can interact with my smart contract, ideally a web app, but how can I? since function require some ether transfer, how can the user connect his own address to my application?


texts:
I'm using geth on a linux VM, and Ethereum Wallet on my Windows. I had no problem at all switching to Ropsten on linux, but my Wallet refuses to change.

I used geth --datadir /path/to/testnet/data init genesis.json; geth --datadir /path/to/testnet/data --networkid 3 console, it managed to sync but when I run geth --testnet console it's back on Morden, same with the wallet.

As I wanted to change the Wallet, I used the version of geth in Users\me\AppData\Roaming\Ethereum Wallet\binaries\Geth\unpacked, but I don't know if it's the right one. I'm also not sure what /path/to/testnet/data is, I used ...\Roaming\Ethereum\testnet\

I used this blog post, this question worked on linux but not windows, and this question is an unrelated problem of absolute and relative paths.

Update : Honestly I'm speechless. The wallet seemed to work (synced to ~60k blocks) even though I don't think I did anything useful, and now it's trying to download the 1,800k blocks of the old blockchain back. Why.

Update2 : I managed to get work done by restarting my wallet everytime it went crazy and back to the 1.800k blocks, and I realized my geth console (not even on the same machine) went crazy at the same time, also setting top block to 1.800k. I don't know if it's syncing on Morden or if it's just a bug and it still uses Ropsten, I can't tell. It seems to stay at 69k.

Update3 : It doesn't work anymore to close and restart the wallet. Now it looks for peers and downloads the 1,800k Morden blockchain. If I start geth alone, (with no parameters other it does show networkid=3 but can't find the blockchain data.

Update4 : I found a temporary fix. I can alway rerun the whole switching (get --datadir ... --networkid 3 console), but I lose all my wallet data (contracts and have to reload the blockchain. The "fix" I found is after reseting and starting Eth Wallet, I actually run geth --testnet console with a command prompt in the background, and it seems to keep the blockchain correctly synced, avoiding the Wallet to fall back to syncing Morden (which is weird because I couldn't run geth and the Wallet at the same time before). And when it does, just run exitand geth --testnet console again. I don't know what happens after you reboot your pc but at least I can work 2+ hours in a row without losing my data. I'm starting to think it's not going to go away until the next version of Mist...


texts: Account creation in private testnet vs mainnet

texts: When we setup geth private testnet, we define one genesis file. Suppose after mining 100 blocks I want to create one more account. In this case I will update the alloc key of genesis file with new account address. When I will restart the geth node, a new blockchain will be started because genesis file has been changed. So my question is "What happened when someone create the new account on livenet (mainnet)." Because a new blockchain is not started there. Correct me if I am wrong in any concept. Thanks in advance.


texts:
I'm currently making use of my own GETH node to get pending transactions and process them as follows:
this.web3.eth
            .subscribe('pendingTransactions', function (error, result) {})
            .on('data', function (transactionHash) {
                //Do stuff
             }

My GETH node startup script looks as follows:
--syncmode "fast" --maxpeers 200 --cache 16384 --ws --ws.origins "*"ws.origins "*"

The machine has 32GB ram, SSD and 8 CPU cores.
Now my problem is as follows:

Pending transactions are expected to come through at a steady pace
It's unfortunately not the case
For some reason the GETH node server CPU goes to 60 - 100% at random times for a few seconds and that blocks the pending transactions in some way as the pending transactions stop to come through.

Any idea what this is and how I can stop these "freezes" from happening?


texts:
I saw this -

  "The first time a node connects to the network it uses one of the
  predefined bootnodes. Through these bootnodes a node can join the
  network and find other nodes."

At https://github.com/ethereum/go-ethereum/wiki/Private-network

It says the bootnode enables the nodes to join. Has anyone more details about bootnodes and exactly what they actually do? They must enable joining somehow. They must be some mechanism to enable joining the network. Why not just enable all nodes to allow joining? Are bootnodes all full nodes?


texts: Can I transfer and deposit my ethereum in etherdelta wallet?

texts:
Can I transfer and deposit my Ethereum in myetherwallet?

I have not been able to move my Ethereum from the transfer mode to my etherwallet in etherdelta. Please help..


texts: Create a two-dimensional array in Solidity

texts:
How to create arrays addresses using solidity? And we can write two-dimensional array?

bool[2][] m_pairsOfFlags;

Here is an example of the array, but it does not work


texts:
I'm trying to send a batch request of transactions to my contract from web3. Using Typechain, my contract's methods are of type NonPayableTransactionObject<void>, which doesn't appear to support typing for that pesky .request method required of batch.add(). For example...
let batch = new web3.eth.BatchRequest();
for (let id of tokenIDs) {
    batch.add(myContract.methods.myMethod(id).send.request({ from: defaultAccount })
}
batch.execute();

This produces Property 'request' does not exist on type '(tx?: NonPayableTx | undefined) => PromiEvent<TransactionReceipt>'.ts(2339).
Is there another way of sending transactions to a contract via Batch Request using Typescript/Typechain?


texts: Quorum - oversized data during contract creation - contract code size limit

texts:
While creating contract, I am getting the error "oversized data" during contract creation.

Other than modifying the go-ethereum code file to increase the maxCodeSize, or splitting the contracts up, are there any other workarounds?

Why should there be a contract code size limit in a private blockchain in the first place?


texts: Using a Non-Fungible token to gain access to a file

texts: Please excuse me, I'm a layperson, not a programmer. At this time is there a way to issue NFT's to be used as a 'key' to gain access to a file on the internet? For example you create and sell an NFT which would allow the holder to access a photograph, video, program, document etc. Is this possible now, will it be possible in the future? Thanks for any information on this subject.


texts: how to inject web3 on webapp with "window.ethereum.enable()"

texts:
here is my code, i dont get any pop for permission to connect metamask with the site. for more clearity visit enter link description here

        connect

        $('document').ready( async function(){
        window.addEventListener('load', async () => {
// Modern dapp browsers...
if (window.ethereum) {
    window.web3 = new Web3(window.ethereum);
    try {
        // Request account access if needed
        window.ethereum.enable();
        // Acccounts now exposed
        web3.eth.sendTransaction({/* ... */});

    } catch (error) {
        // User denied account access...
    }
}
// Legacy dapp browsers...
else if (window.web3) {
    window.web3 = new Web3(web3.currentProvider);
    // Acccounts always exposed

}
// Non-dapp browsers...
else {
    console.log('Non-Ethereum browser detected. You should consider trying MetaMask!');
}

});
})


texts: How to obtain all transaction of a contract?

texts:
I'm trying to obtain all the transactions of a contract, but in all cases I only obtained [] or undefined.

I'm following this posts:

Common useful JavaScript snippets for geth
web3 filter option not working

And I read others posts too, but i can't solve my problem.

I try to use this:

var filter=web3.eth.filter({fromBlock: 866705, toBlock: 909023, address: contractAddress});
filter.get(function(error, log) {
  console.log(JSON.stringify(log));
});
filter.stopWatching();

With different values of fromblock, to block and the others options ('latest',fromblock: 0 , ...). But i don't obtain any result.

I'm trying to do this :

var filter = web3.eth.filter({fromBlock:9000, toBlock: 'latest', address: contractAddress});
filter.get(function(error, result) {
  if(!error){
    var info = web3.eth.getBlock(result , function(error, result){
       if(!error){
         var trans = web3.eth.getTransaction(result.transactions[1], function(error,result){
           if(!error){
             var str = web3.toAscii(result.input,);
             console.log(str);
           }else{
              console.log(error);
           }
         });
       }else{
          console.log(error);
       }
     });
 }else{
    console.log(error);
  }
})

(If i forget some token sorry)

All of this only for obtain the data of a transaction like "from", "to" and "input". Where is the problem?

More information:

I'm using metamask and meteor.js
I'm running this in Ropsten test-net
If I use the function web3.eth.getBlock wiht a correct blocknumber I can obtain all the data, the problem is the filter and how I use it.


texts: Is it possible to create new wallet account in Solidity contract?

texts: I want to create a new wallet account and send some my own currency to it whenever someone sends me some ether to my contract. Is it possible to do this via contract itself or I need to do it in another way. Any help regarding this will be highly appreciated.


texts: What's the meaning of "dirty" in Geth's INFO logs "Importing new chain segment..."

texts:
I am trying to understand the logs I see when I journalctl -fu my Geth service, which I restarted after it was offline for two days. This is less a troubleshooting question and more an extension to this question: Meaning of Imported New Chain Segment
I can see (as expected) its INFO logs where it's importing the new chain segments. What I am wondering now - and I could not find this info anywhere on the web so far - is what the parameters at the end of the line mean. Specifically, mgas, mgasps and dirty?
Especially dirty increases the longer geth is running, what does it mean?
INFO [04-05|18:33:07.751] Imported new chain segment               blocks=5   txs=1117  mgas=62.453  elapsed=9.376s    mgasps=6.660  number=12156068 hash="e34b89…3f9846" age=3d19h2m   dirty=367.91MiB

I might have been just blind and missing some obvious documentation where this is explained, if that's the case, it would be wonderful if you could point me to the right place where this is documented!
Thanks a lot! :)


texts:
I am trying to implement a voting system in nodejs. My server needs to be able to create transactions and send them to the ethereum blockchain when provided with the user private key. I have tried doing so using different modules however I seem to always run into the same issue.
 - The connection with the RPC works fine
 - The transaction seems to be created just right
 - Transaction is registered as sent to the network by my local node but will never appear in the blokchain.

I have managed to have transactions registered while using web3 but I can't do it the same way if I want to be able to sign transactions myself. Tests were done using both a local or remote ( infura ) node on the testnet ( ropsten and kovan ). I may have a hint of the problem :
 - When creating a transaction (succesful) with web3 my local node sees the transaction hash as '0x456515...' and the address as '0xcfnsk55sghHG...'
 - When doing the same with ethereumjs-tx to sign the transaction, the node sees it as '456515...' and '&cfnsk55sghHG...'
I am looking for any information  / help as to what the problem is or how to solve it =)

var Web3 = require('web3');
var Tx = require('ethereumjs-tx');
var _ = require('lodash');
var SolidityFunction = require('web3/lib/web3/function');
var keythereum = require("keythereum");
var web3 = new Web3();

web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));

var toAccount ='0x2824dD13D388ed0Df7Ae1b5697b7b66E737E021a';
var fromAccount = '0x4129c6A02caB77DeEdBDC221904a3dc1ab7cAAfE';
var privateKey = Buffer.from('My Private Key', 'hex' );
gasPrice = web3.eth.gasPrice;
gasPriceHex = web3.toHex(gasPrice);
gasLimitHex = web3.toHex(300000);
console.log('Current gasPrice: ' + gasPrice + ' OR ' + gasPriceHex);
nonce =  web3.eth.getTransactionCount(fromAccount) ;
nonceHex = web3.toHex(nonce);
console.log('nonce (transaction count on fromAccount): ' + nonce + '(' + nonceHex + ')');

var rawTx = {
    nonce: '0x85555',
    gasPrice: gasPriceHex,
    gasLimit: gasLimitHex,
    to: toAccount,
    from: fromAccount,
    value: web3.toHex(web3.toWei ( 1, "ether")),
    data: '0x7f7465737435000',
    chainId: '0x3',
};

var tx = new Tx(rawTx);
tx.sign(privateKey);
var serializedTx = tx.serialize();

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

Thank You

-


texts:
Basic question on distributed Smart contract.
Let us assume , I am writing a smart contract and deploying it in public network.

My Contract Specification
•   My contract would allow anyone to register.
•   Fund 10 Ether to the contract
•   Contract will in turn return 12 Ether on Dec 31st 2017

Contract owner by mistake instead of capping it to Dec 31st , he mentioned Jan 31st in the contract.

Scenario :

•   Owner A sits in USA, deploys the contract in public chain
•   User B from Australia funds 10 ether to the contract on August 31st, 2017
•   User B now expects 12 Ether on Dec 31st but he never receives it .

Question

Even though the contract is distributed among all the nodes,
1.  How would user B come to know what is written in the contract ( assuming B has zero coding knowledge) ?
2.  If only User B is interested in this contract, who will verify this smart contract


texts: Full node disconnected in a whole country

texts:
Why is it important to have at least a few full nodes running in a specific country? Does e.g. Spain have any advantage to run ETH full nodes?

Thank you.


texts: Gas price and limit with Truffle deployment in Ethereum

texts:
I am developing a smart contract in truffle. I'm having some trouble understanding how GAS works in Ethereum. I used the following parameters in my Rinkeby test net:
gas limit: 4600000
gas price: 10000000000 (10Gwei)

This means that the Gas limit is set at:
4600000 * 10000000000 ~ 0.046 ETH ~ 17 $
On the other side, I have 0.0303 ETH (~11$) on the mainnet and according to this site https://ethgasstation.info/ I put 100Gwei as gas price and then I set 30000 as gas limit (because 100Gwei * 30000 is about 10$).
I've got this error during deploy in dry run:

My question is: what values I need to use to deploy and use a contract? Who decides these values? Gas price seems to change very fast. Do I need to constantly update these values? Do I need to have more money in my wallet to deploy a contract ? How can I estimate all costs?


texts: How to deploy a contract from another contract constructor?

texts:
I have the following Interaction contract which should deploy a new DataStorage contract in the constructor, but when I run my test dataStorage is undefined. What am I doing wrong?

contract Interaction is Owned {
  DataStorage dataStorage;

  function Interaction() public {
    dataStorage = new DataStorage();
  }
}

The test (contract.dataStorage is undefined)

it('should deploy an initial DataStorage contract', async () => {
  const contract = await create();
  const dataStorage = await contract.dataStorage.call();
});


texts: Strange noise while dual mining - Claymore

texts:
I have 2 MSI GTX 1070 8 GB. I tried dual mining ETH + Sia -- but when I dual mining I hear strange noise out of video card. When I mine just ETH there is no noise.

Can anyone tell me what I get that noise? is this dangerous for my cards? anyone else getting noise in dual mining?

Thanks  in advance


texts: Send ERC20 Tokens from Fixed Supply Token Contract to TokenCrowdSale Contract

texts:
For ICO Crowd Sale I have created 2 contracts one is MyToken.sol & other is MyTokenCrowdSale.sol.
MyToken.sol creates fixed supply ERC20 tokens.

contract MyToken is DetailedERC20, StandardToken {

    /**
    * Init token by setting its total supply
    *
    * @param totalSupply total token supply
    */
    function MyToken(
        uint256 totalSupply
    ) DetailedERC20(
        "My Token",
        "MYE",
        18
    ) {
        totalSupply_ = totalSupply;
        balances[msg.sender] = totalSupply;
    }
}

The other contract MyTokenCrowdSale is a crowdsale contract on which the buyer/beneficiary send ether & in return after verification onlyAdmin transfers corresponding tokens to the buyer.

pragma solidity ^0.4.21;

import "../node_modules/zeppelin-solidity/contracts/crowdsale/Crowdsale.sol";
import '../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol';
import '../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol';

contract MyTokenCrowdSale is Crowdsale, Ownable {
    using SafeMath for uint256;

    //Decimal Facotor
    uint256 private constant decimalFactor = 10**uint256(18);

    // Map of all purchaiser's balances
    mapping(address => uint256) public balances;

    uint256 public tokensIssued;

    ERC20 public tokenReward;

    // Amount raised in PreICO
    // ==================
    // uint256 public totalWeiRaisedDuringPreICO;
    // ===================

    function MyTokenCrowdSale(
        uint256 _rate,
        address _wallet,
        ERC20 _token
    ) Crowdsale(
        _rate,
        _wallet,
        _token
    ){
        tokenReward = ERC20(_token);
    }

    // Token Purchase
    // =========================
    function () external payable {
          buyTokens(msg.sender);
    }

    /**
     * @dev Checks whether the period in which the crowdsale is open has already elapsed.
     * @return Whether crowdsale period has elapsed
     */
    function hasClosed() public view returns (bool) {
        return closed;
    }

    /**
     * @dev Closes the period in which the crowdsale is open.
     */
    function closeCrowdsale(bool closed_) public onlyOwner {
        closed = closed_;
    }

    /**
     * @dev Overrides parent by storing balances instead of issuing tokens right away.
     * @param _beneficiary Token purchaser
     * @param _tokenAmount Amount of tokens purchased
     */
    function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
        require(!hasClosed());
        balances[_beneficiary] = balances[_beneficiary].add(_tokenAmount);
        tokensIssued = tokensIssued.add(_tokenAmount);
    }

    /**
     * @dev Deliver tokens to receiver_ after crowdsale ends.
     */
    function withdrawTokensFor(address receiver_) public onlyOwner {
        emit Test("Testing withdrawTokensFor ");
        _withdrawTokensFor(receiver_);
    }

    /**
     * @dev Withdraw tokens for receiver_ after crowdsale ends.
     */
    function _withdrawTokensFor(address receiver_) internal {
        require(hasClosed());
        uint256 amount = balances[receiver_];
        require(amount > 0);
        balances[receiver_] = 0;
        emit TokenDelivered(receiver_, amount);
       _deliverTokens(receiver_, amount);
    }

}

My Problem here is I am not able to transfer tokens to the user. It repeteadly says:

Error: VM Exception while processing transaction: revert
    at Object.InvalidResponse

When I debugged the issue , I found the only problem is in the

_deliverTokens(receiver_, amount);

It is not allowing to send tokens to user. Probably because the MyTokenCrowdSale has no tokens accessible or something.

Need Help!


texts:
I have thinking of the wonder that an application could offer if it could prove that some of its data are truly random and so not controlled.
Can the ethereum blockchain offer such a service and how would it happen, can I for example display a number on my website linked with an hash linked to a smart contract that executed a random number ?


texts: How to send tokens to a address with a specific contract?

texts: I want to send tokens from my wallet to a crypto-currency exchange website wallet with a specific contract used by the crypto currency exchange website. For example- I want to send token to this address 0x1d47b9fe35359cb8ba56d3570941bc94066cb0ef and contract is 0xd070e8D24743d19bb2Fb4d0b6f574A173B2bd06B. Please help.


texts: Solidity Browser: Invalid JSON RPC response: "" where parity works on the background

texts:
On my solidity browser I get following error: Invalid JSON RPC response: ""

The way I use solidity browser:
Download solidity-browser from the following link: unzipped the files and loaded index.html into the browser. /user/Downloads/browser-solidity-gh-pages/index.html.

Based on the following guide and guide-2, I run parity as follows: Please note that parity works perfectly fine, I can deploy a contract from parity's browser (localhost:8080).

parity --chain parity.json --network-id 23422 --reserved-peers myPrivateNetwork.txt --jsonrpc-apis web3,eth,net,parity,parity_accounts,traces,rpc,parity_set --rpc --rpcport  8545 --rpccorsdomain '*' --rpcaddr 127.0.0.1

Even I added following parameters as suggested on the guides: --rpc --rpcport  8545 --rpccorsdomain '*' --rpcaddr 127.0.0.1 it did not fix the Invalid JSON RPC response: "" problem.

When I run parity with this flag: --rpcaddr localhost instead of --rpcaddr 127.0.0.1 it also gives following error: Invalid JSONRPC listen host/port given: localhost:8545

Thank you for your valuable time and help.


texts:
I'd like to test a contract internal functions. I used to inherit the contract and test it with truffle but that involved Solidity test files.
Can I do the same with my current stack (hardhat/mocha/ethersjs/typescript) or are there better alternatives?
Thanks


texts: Converting to/from per-second and annualized interest rates with BigNumber.js

texts:
In the MakerDao contracts, there are conversions between annualized percentage rates and per-second percentage rates. For example, their Stability Fees documentation gives this example:

If the Stability Fee is set to 2%, it will accumulate at 1.0000000006279371924910298109948% per second. At the end of year one, the user will owe exactly 2% on the principal.

The basic way to convert from the annualized format to the per-second format and vice-versa is like so, where 31536000 is the number of seconds in a year:
1.0000000006279371924910298109948^31536000 = 2%
1.02^(1/31536000) = 1.0000000006279371924910298109948%
Since Solidity only supports integers, one may use fixed-point arithmetic for converting between the annualized rate and the per-second rate. My first question: what is the integer representation of these two rates (in ray)?
My next question is how would one go about using the BigNumber.js utility to convert to-and-from the per-second/annualized rates?
The JavaScript code I have below is not working.
PER_SECOND_RATE.pow(toBN(SECONDS_IN_YEAR).toString())
ANNUALIZED_RATE.pow(toBN(-SECONDS_IN_YEAR).toString())


texts: How to make sense of the 'Downloading blocks' status and numbers?

texts:
I want to build mist from source. I started  the mist application for the very first time following the instruction here: https://github.com/ethereum/mist#run-mist. I did not have any wallet so I did not import any. This is the splash screen I see:

I don't know how to make sense of the numbers as seen in the lower right hand corner.

Why does it mean by Chain structure 99.50%)? It does not correspond to 1,844,506 divided by 4,6430,330.

Additionally, if I want to run my wallet locally, the splash screen seems to suggest I have to download the all the blockchain history. Is it correct?


texts: When is a "shard block" cross-linked into a "finalized beacon block"?

texts:
In Ethereum 2.0, a shard block for being finalized needs to be linked into a finalized beacon block.

Under which conditions a "shard block" cross-linked into a "finalized beacon block"?
Having 2/3 of validators' signatures in its committee is enough? Or other additional conditions is required as well?


texts: How to replace Metamask Pop-Up with my own UI

texts:
I was wondering if I can replace the Metamask pop-up with my own pop-up/user interface.

Example: Currently on my dApp a user clicks "Buy Token" and a Metamask modal pops up and says the usual confirm/reject. Instead of this pop-up with the Metamask UI/logo is it possible when the user clicks "Buy Token" my own company branded personal pop-up happens instead?

Essentially I want to have the pop-up be re-branded to my own logo and add some information explaining what's happening.

Thanks for any clarification!


texts: Can't injected MetaMask Web3 Provider to page served via XAMPP

texts:
The title pretty much gives everything away, but I'll repeat it here for completeness. I'm new to Ethereum and am developing an Ethereum Dapp that's accessed through a frontend, written in Javascript, and using Web3 to communicate with Rinkeby. As I heard that MetaMask can't connect to any site hosted on file://, I hosted the frontend on an XAMPP Apache server (file:///C:/xampp/htdocs/voterScreen.html) for testing purposes. Now that I think about it, that's still running on file:// ... perhaps that's what's causing the issue?

My actual frontend is working fine, in terms of being able to read from my Contract, and in terms of all the methods working as they should. There's just one hiccup - I can't write to the Chain, because my Web3 isn't being injected from Metamask, even though I'm logged in and I'm searching for it. I've got this standard bit of code in my frontend:

 if (typeof web3 !== 'undefined') {
        web3 = new Web3(web3.currentProvider);
        console.log("Metamask logged into successfully");
    } else {
        console.log("Metamask NOT logged into successfully");
        // set the provider you want from Web3.providers
        ***(other attempts at finding provider)***
}
(rest of code)

and in fact, whenever I run the thing, I see "Metamask NOT logged into successfully", which confirms to me that Metamask's not being injected. This is a bit of a problem since I need that information to sign the Vote transaction that I want the frontend to be able to send. For reference, in the console, the following deprecation warning showed up:

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its
detrimental effects to the end user's experience. For more help, check
https://xhr.spec.whatwg.org/.

I doubt this has anything to do with the problem, but I mention it just in case.

Either way, does anyone have a clue why MetaMask is consistently failing to be injected? Thanks.


texts:
I need to retrieve time from depositTime and now in seconds
Example Deposit Time 3/10/2020 18:00:05 and now 3/10/2020 18:00:08
Output: 3 second.
 uint256 RetrieveSecondsTime = invest.depositTime - now ??

I don't have idea how to do this.


texts: What is the unit of measurement used in GasPrice and GasLimit?

texts:
I did a check, in ethgasstation the current safeLow = 15GWei, which is equal = 15,000,000,000 wei

However, when I issue eth.getBlock("latest") what I get was:

> eth.getBlock("latest")
{
  difficulty: 3462313604051830,
  extraData: "0x73656f3130",
  gasLimit: 8000029,
  gasUsed: 7991485,

The gasLimit and gasUsed here are way lower than the safeLow value. So I can only guess that they are using different units in measurement.

Otherwise I really do not know what might had gone wrong. Because I had never enter so many zeros when I wanted to send an ETH transaction.


texts: If i pay some service on certain dapp, does this tx can be reverted because of confirmation?

texts:
I paid and got service from dapp.
does dapp wait until enough confirmation is settled?
or not, is it possible that tx can be reverted?


texts:
When creating a simple token, this code is suggested in the Ethereum website:

contract MyToken {

    mapping (address => uint256) public balanceOf;
    function MyToken(uint256 initialSupply) {
        balanceOf[msg.sender] = initialSupply;// Give the creator all
    }
}

This works as expected in the testnet (the creator receive the tokens), but if you change the name of balanceOf to, let's say, balances, the contract does not send the token to the creator (or the mist wallet does not see them).

It happen to be that balanceOf is the name of a function in the ERC20 standard interface (https://theethereum.wiki/w/index.php/ERC20_Token_Standard). However, in this code it is defined as a variable.

Any explanation? Is solidity assuming things based on the name of the variables?


texts: Why public variables aren't able to implement interface functions?

texts:
I'm curious why interfaces don't accept public variables as implementations, since public variables have getter functions generated for them.

For example why couldn't the ERC20 balanceOf interface function be implemented by a public balanceOf variable.

  interface

function balanceOf(address tokenOwner) public constant returns (uint256 balance);

  implementing contract

mapping (address => uint256) public balances;


texts: I just want to deploy and call a simple sample smart contract only for testing purpose. Do I need to download the entire ethereum blockchain? Its too huge and takes too long to download. Can someone suggest a better option?


texts: Unable to Compile Contract in Brownie (not receiving a .json file in "build" folder )

texts:
I'm currently running Brownie in Studio Visual Code. My problem is that when I write a smart contract and try to compile it using command "Brownie Compile" I don't' receive a .json file in the "build" folder afterwards. I receive a message that says:
"INFO: Could not find files for the given pattern(s).
Brownie v1.14.2 - Python development framework for Ethereum
Project has been compiled. Build artifacts saved at C:\Users\Brian Lee.brownie\New folder\build\contracts"
It says project has been compiled but I don't see the .json file anywhere. Do you have any suggestions? I think I may have set up my folders incorrectly. I'm new to coding in general so I'm experiencing a lot of confusion. Thank you!


texts: Migration from PoW to PoA Clique on geth

texts:
After reading chapter "Repurposing header fields for signing and voting" at https://eips.ethereum.org/EIPS/eip-225 I've understood the nonce field of blocks in PoW consensus blockchain is reused for another purpose in PoA Clique consensus blockchain so it makes impossible a direct import of PoW blocks into a PoA Clique blockchain.

Has anybody here managed to migrate blocks of a PoW blockchain into a PoA blockchain ?

Would it be possible to import the blocks of PoW blockchain without importing the nonce ? The nonce of PoA Clique blocks can only be full of 0 or full of f.

Thank you for your attention, I would be glad to read your comments.


texts: why there is two function "_transfer" and "transfer" in solidity erc20?

texts:
in almost all erc20 contract "_transfer" and "transfer" there are two functions and "transfer" calls internal "_transfer" why? Is there any security benefit of it ? in another words I have seen this approach not only with this particular function but with many functions call is being un necessary forwarded to some internal separate function for example just for checking who is msg.sender like below
modifier onlyOwner() {
    require(isOwner(), "Ownable: caller is not the owner");
    _;
}

function isOwner() public view returns (bool) {
    return _msgSender() == _owner;
}

function _msgSender() internal view returns (address payable) {
    return msg.sender;
}

why this modifier is extended to isOwner() and _msgSender() why not the same check done inside modifier itself ? Is there any security angle behind it ?


texts: Invalid number of parameters for "undefine". Got 0 expected 1!

texts:
I start my trial token sale contract, but it keep pop out this error when i test it with truffle.

Here my token sale contract:

pragma solidity ^0.5.0;

import "./DappToken.sol";

contract DappTokenSale {

    address admin;
    DappToken public tokenContract;

    constructor (DappToken _tokenContract) public {
        admin = msg.sender;
        tokenContract = _tokenContract;

    }
}

Here my test js file:

var DappTokenSale = artifacts.require('./DappTokenSale.sol');

contract('DappTokenSale', function(accounts) {
    var tokenSaleInstance;

    it('initializes the contract with the correct values', function() {
        return DappTokenSale.deployed().then(function(instance) {
            tokenSaleInstance = instance;
            return tokenSaleInstance.address
        }).then(function(address) {
            assert.notEqual(address, 0x0, "has contract address");
            return tokenSaleInstance.tokenContract();
        })..then(function(address) {
            assert.notEqual(address, 0x0, "has token contract address");
        });
    });
});

and here my contract file:

pragma solidity ^0.5.0;

contract DappToken {
    string public name = "Dapp Token";
    string public symbol = "DToken";
    string public standard = "DToken v1.0";
    uint256 public totalSupply;

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

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

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    constructor(uint256 _initialSupply) public {
        balanceOf[msg.sender] = _initialSupply;
        totalSupply = _initialSupply;
    }

    function transfer (address _to, uint256 _value) public returns(bool success) {
        require(balanceOf[msg.sender] >= _value);
        balanceOf[msg.sender] -= _value;
        balanceOf[_to] += _value;

        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) public returns(bool success) {
        allowance[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns(bool success) {

        require (_value <= balanceOf[_from]);
        require (_value <= allowance[_from][msg.sender]);

        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;

        allowance[_from][msg.sender] -= _value;

        emit Transfer( _from, _to, _value);
        return true;
    }

}

I use web3js 1.0.x, what should i do ?


texts: I know there are some opcodes that have negative gas costs (see this). So if I send a transaction that calls one (or multiple) instance(s) of these opcodes, will the gas used be negative? i.e. will my balance increase?


texts: Rinkeby Network transferred reald funds from exchange

texts:
I made by mistake a transfer from an exchange to an Rinkeby test network that is not appearing to my Testnet wallet.

This is the transaction:
https://etherscan.io/tx/0xa09c745269e3b3c5ba76c8d667c859f4e54510150e5145699247267b9ff51edc

Is there some way to make this back to my real ether wallet.

I see the rinkeby wallet but I cannot see the ether funds?

Thanks in advance.


texts: Connecting a contract in a testchain to a front-end

texts:
I'm new using Ethereum. I set up a testchain to play around and have deployed some contracts there. My goal now would be to do something simple, like getting the balance of some of my testchain accounts in a website.

I found this code on the Ethereum documentation here (slightly adapted to get the scripts for web3 and bignumber):

<!doctype>

coinbase balance

    <button type="button" onClick="watchBalance();">watch balance</button>

I have been running the following command to start geth:

geth --identity "TestNode" --genesis testchain/customGenesis.json --rpc --rpcport "8123" --rpccorsdomain "*" --datadir testchain --port "30303" --nodiscover --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --autodag --networkid 1378 --nat "any" console

I thought that by adding

web3.setProvider(new web3.providers.HttpProvider('http://localhost:8123');

to the HTML file above it could work but if I navigate to http://localhost:8123 I get the following error:

{"id":-1,"jsonrpc":"2.0","error":{"code":-32600,"message":"Could not decode request"}}

I realize my question is probably related to some basic error but I have been reading and haven't managed to figure it out.
Any answer or pointers to guides would be greatly appreciated!


texts:
Why transactions are rejected in MetaMask after conforming it?
When a transaction is carried out in metamask it first get approved. after sometime it shows rejected.
metamask is showing something like this

anyone know the reason for rejecting these transactions???


texts: Ether transaction does not reflect in ganache

texts:
Hi am developing a etherium DAPP.

In that for every user registration some ether will get transfer from user to contract...

Everything work perfect but the transacted ether is not reflecting in ganache accounts....

Account balance should be 144.44

Metamask transaction is fine for 5.5 Ether

Transaction details in Ganache

JS CODE

createUser: function (){
        console.log("First Name: "+ $('#firstName').val());
        console.log("Last Name: "+ $('#lastName').val());
        console.log("Age: "+ $('#age').val());
        console.log("Is city: "+ $('#city').val());

      if ($('#firstName').val() && $('#lastName').val()  && $('#age').val()  && $('#city').val() ){
           web3.eth.getAccounts(function (error,accounts){
          if (error){
              App.showError(error);
          }
         App.currentAccount = curacc;
         // App.currentAccount = "0xAa1e9e6f830c2C07FCA79D9cE2ebC81310541A1b";
          console.log("curr acc: "+ App.currentAccount);

          let tipAmount = window.web3.utils.toWei('5.5', 'Ether');
          console.log("tipAmount" + tipAmount);

          App.contracts.HelloWorld.deployed().then(function(instance){
            return instance.createUser.sendTransaction($('#firstName').val(), $('#lastName').val(),
            $('#age').val() , $('#city').val(), {from:App.currentAccount , value: tipAmount})
          }).then(function(result){
              App.showMessage('Submitted data saved Successfully....');
              App.ShowSavedUser();
          }).catch(function (error){
              App.showError(error);
          })
        })
      }
      else{
        console.log("Data not filled for all fields....");
          App.showError('Please fill all fields...');
      }
    },

SOLIDITY CODE

pragma solidity ^0.5.0;

contract HelloWorld {

uint public userCount = 0;

constructor() public{
    createUser ("Monicka", "Akilan", 30, "Chennai");
}

  struct User {
    uint id;
    string firstName;
    string lastName;
    uint age;
    string city;
    uint tipAmount;
    address payable author;
  }
event profileTips(string firstName, string lastName, uint age,
 string city, uint tipAmount, address payable author);

mapping(uint => User) public Users;

 function createUser(string memory _firstName, string memory _lastName, uint _age,
 string memory  _city) public payable{
    userCount ++;
    // address(msg.sender).transfer(msg.value);
     Users[userCount] = User(userCount, _firstName, _lastName, _age, _city, 20, msg.sender);
    emit profileTips(_firstName, _lastName, _age,  _city, msg.value,  msg.sender);
 }
}

Can anyone help me solve this sync issue....

Thanks in Advance


texts: What's the possible errors (or warnings) that a developer can face when deploys a smart contract into the Ethereum network?

texts:
it's my first post here.
I would like to ask, what's the possible errors that a developer can face while trying to deploying their smart contract into the Ethereum network.
For example, can it be "Out of gas"? and why does this happen?
Could you please let me know or summarize any errors that will prevent them of properly deploying their contracts to the network?
Thank you in advance.


texts: ERC20 Token balance isn't showing up in metamask

texts:
I'm making an ERC20 Token using OpenZeppelin, and I keep running into the same issue. My balance shows up in remix when I call "balanceOf," however, when I add the coin to my metamask wallet, it shows that my balance is 0. I am running this on Ropsten. Here is the code:

import './ERC20.sol';
import './ERC20Detailed.sol';

contract TrueOPEC is ERC20, ERC20Detailed {
    constructor () public ERC20Detailed("TrueOPEC", "TOPEC", 18) {
        uint256 initialSupply = 1663000000000;
        _mint(msg.sender, initialSupply);
    }
    event _minted(address _to, uint256 _amount);
    function minting(address to, uint256 amount) public {
        _mint(to, amount);
        emit _minted(to, amount);
    }
    event _burned(address _to, uint256 _amount);
    function burning(address to, uint256 amount) public {
        _burn(to, amount);
        emit _burned(to, amount);
    }
    event _burnedFrom(address _from, uint256 _amount);
    function burningFrom(address sfrom, uint256 amount) public {
        _burnFrom(sfrom, amount);
        emit _burnedFrom(sfrom, amount);
    }
    event _tranferFrom(address _from, address _to, uint256 _amount);
    function transferringFrom(address sfrom, address to, uint256 amount) public {
        transferFrom(sfrom, to, amount);
        emit _tranferFrom(sfrom, to, amount);
    }
    event _transferring(address _to, uint256 _amount);
    function transferring(address to, uint256 amount) public {
        _transfer(msg.sender, to, amount);
        emit _transferring(to, amount);
    }
}

If any of you know what this could be, please let me know. Thanks!


texts:
I am trying to compile OwnedRegistrar contract using Solidity. It's like

import "./owned.sol";
import "./Registrar.sol";

contract OwnedRegistrar is Registrar, owned {
          // ...
}

However solc does not produce a binary for this contract nor does it give any error message. Only binary for owned contract is given. Am I missing something? Do I need to run a separate link step somewhow? What could be reason for missing binary?

[~/code/wattcoin/websauna.wallet/websauna/wallet/ethereum/contracts]% solc ownedregistrar.sol --bin

======= OwnedRegistrar =======
Binary:

======= Registrar =======
Binary:

======= owned =======
Binary:
60606040525b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b600a80603d6000396000f360606040526008565b00


texts: Why array.pop() doesn't work on my private network?

texts:
I have deployed a PoA network using Hyperledger Besu and I'm using Remix in order to code a very simple smart contract.
Here is the smart contract code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;

contract management {
    address [] public addressArray;                           // List of accounts agents
    constructor( ) public {
        addressArray.push (0x5170147D2e73C876Ab19dA687fBBC0fDD7d5C24B);
        addressArray.push (0x81537B2D16C0107E4E5368a96C34CddE631f6574);
        addressArray.push (0x3A1efCfF3C76BF5a4EF07264C7b13097f3111d8e);
        addressArray.push (0x4048cA94C733470FD968C849Df0BD61C4d472550);
        addressArray.push (0xa021Fbd79c01419F1867058597713D25fEb0cC91);
        addressArray.push (0x4637EC7fe8C8Eb7Dd6B5B087070B99b4c4b86137);
    }

    function removeAgent () public {

        addressArray.pop();

    }

    function addAgent (address _newAddress) public {
        addressArray.push(_newAddress);
    }
}

When I deploy the smart contract, I can access to array elements and I can use addAgent method, but if I try to send the transaction of removeAgent method, I get this error on Remix:

transact to management.removeAgent errored: Error: Returned error: Intrinsic gas exceeds gas limit

I have tried to use a large number of gas (6000000000), but the error persists. If I comment the addressArray.pop() code line, I can use the method.
So, what's the problem with addressArray.pop()? Any idea?


texts: How can we lock ETH in user wallet without escrow contract?

texts:
I know the logic of using an escrow contract in which 2 or more users send their wagered ETH to a smart contract acting as escrow proxy, and then after some decision contract executes we release the funds according to that decision logic.
But what I want to know is if there's any way of not transferring any ETH to the escrow contract, but to actually lock the particular amount directly inside the user's wallet? Let's say user A bids 1 ETH so then the smart contract gains access to their wallet only over said amount and locks it without any transfer of the bid amount.
For example, user A could execute this smart contract by sending a tremendously small amount of WEI to it only to send a message stating the bid amount. Then the smart contract gains access to lock the bid amount from the user's message, directly inside the user's wallet. Is this possible?


texts:
In a array that the values are never repeated. Is there a function/library or something similar that you give the value to remove. And the function the empty space in the array??

function remove(uint _valueToFindAndRemove, uint[] _array)  returns(uint[]) {}


texts: What are the steps to send ERC-20 tokens?

texts:
I need to send USDT and other ERC-20 tokens via Geth on Ethereum. I'm using PHP and Web3.php library to work with Ethereum. So far, it worked well for everything. Now, I need to start sending tokens based on contracts.
In the official documents of Ethereum, it said about data parametere:

  The compiled code of a contract OR the hash of the invoked method signature and encoded parameters

I thought I could use sendTransaction() to send ERC-20 tokens directly, so I used the given USDT encoded ABI in the data parameter, but it did not work. Then I came back to Web3.php project, and saw there are different codes for contracts like this:

use Web3\Contract;

$contract = new Contract('http://localhost:8545', $abi);

// deploy contract
$contract->bytecode($bytecode)->new($params, $callback);

// call contract function
$contract->at($contractAddress)->call($functionName, $params, $callback);

// change function state
$contract->at($contractAddress)->send($functionName, $params, $callback);

// estimate deploy contract gas
$contract->bytecode($bytecode)->estimateGas($params, $callback);

// estimate function gas
$contract->at($contractAddress)->estimateGas($functionName, $params, $callback);

// get constructor data
$constructorData = $contract->bytecode($bytecode)->getData($params);

// get function data
$functionData = $contract->at($contractAddress)->getData($functionName, $params);

Unfortunately, as I am new in contracts, I do not know which one of the codes above should be used for my project (Sending USDT). All of them? or just some of them?
And unfortunately, the provided document for the methods inside this section did not have details about used parameters! This made me more confused.
May you help me please?


texts: Location of public and private keys of Ethereum account

texts:
I want to know the details about key generation and handling in Parity. The questions listed are all related, so I put them all in this one question post.

When a new Ethereum account is created on Parity, a new file is created under .../ethcore/<node-name>/keys/<chain-name>. As an example, the contents of such a file are:

{
    "id":"eca798d8-8e68-a096-a35f-174133f86e43",
    "version":3,
    "crypto":
    {
        "cipher":"aes-128-ctr",
        "cipherparams": { "iv":"45092c0a2032250e66a9d0bd2a33acaa" },
        "ciphertext":"0385fd52dfc528713d7b0b72073b992b93aa78f32b0576848a9de69d6e836c3d",
        "kdf":"pbkdf2",
        "kdfparams":
        {
            "c":10240,
            "dklen":32,
            "prf":"hmac-sha256",
            "salt":"e04e80b6174ca47c86e9174fd952949e53c900852d5c3cb62b863c5241e54f28"
        },
        "mac":"178d2c012e1970b853e1551fa9bb0a51b86955cc4ed8db53a9b60cbbdbca8c7b"
    },
    "address":"00faf16e4909296f5cca76e1ccd7cd811fba93d0",
    "name":"User-007",
    "meta":"{}"
}

Looks like the KDF is PBKDF2, i.e. password-based KDF. I guess the account password is used to derive the keys and the parameters for that are given in "kdfparams".

So, I am looking for answers to the following questions:

Is the private key derived using this KDF and the given param values, on-demand whenever the password is supplied?
What is the public key, or how is it generated? The password should not be needed for that.
What is the plain text that "ciphertext" is the encryption of?
This file is generated and saved on the Parity node. Doesn't that mean that the private key is not completely and solely in the hands of the account owner?

Thanks for throwing some light on this issue.


texts:
When I try to install web3 using 'npm install ethereum/web3.js --save' command, I get the following error messages-

npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/ethereum/web3.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent


texts: Problem of interacting with Smart Contract via HTML and JavaScript application

texts:
I followed and tested "Creating a Web UI for our Smart Contract" tutorial and it works well.

However, when I do exactly what I did in the above tutorial for THIS SMART CONTRACT, I do not see the output in its HTML page. (You can find all of this contract files HERE)

Gere is what I do step by step :

create a new file in remix and copy smart contract code from here.
open a cmd window.
type "testrpc", then press "Enter".
from "Environment" menue, select "Web3 provider".
click on "Deploy" button. See screen shot please.

copy "account" and "contract address" and replace them with ones are written in viz.js file. I mean var account and var contractAddress You can see this file content here.
then I open index.html file to invoke functions.

However, I do not see any output or result. Please see screen shot below.

What is my mistake to interact with this contract ? The problem is using testRPC ?


texts: I think Metamask gas fee showing has an error. Please have a look!

texts:
1) This is the 5 Gwei gas price, and the Metamask is showing it well.

2) This is also 5 Gwei gas price, but the Metamask is showing much expensive ETH on it.

So, when the second Metamask window pops up, it says there is transaction error, so the transaction can't be processed. These two pop ups are from same action(so from calling same function of the contract) from my DApp. I have no idea why this shows differently with same gas price. Please help me guys!


texts: Why does a permanent chain split occur only in a Hard Fork?

texts:
Have read a number of articles on what hard fork and soft fork actually are. But couldn't really get the essence of it. My understanding is Hard Fork brings a change in the core Blockchain code (Accounts, Transactions, Blocks). So the consensus actually breaks cuz the nodes those upgraded and not upgraded have two separate versions of Blockchain.

Whereas in case of Soft Fork, the core Blockchain code remains the same  but may be the mining client has some restrictions applied on it. Basically if I want to soft fork say Block Gas Limit from 1.5 mil to  1 mil, instead of changing the core Blockchain code itself, the mining clients and full nodes just apply an external filter to accept only till 1 mil Gas Limit. So no matter if all the nodes upgrade or not, they are governed by the same Blockchain code. Hence any splits shall occur on the same chain and be resolved through GHOST protocol.

Am I clear with my understanding? Someone pls clarify


texts: How many transactions are executed on the Ethereum network per day, and what are the daily transaction fees?

texts: This question was prompted by the Reddit post Reminder: Ethereum has been doing roughly 40-50k transactions daily for the past 8 months.


texts:
I am new to ethereum and trying to wrap my head around how it works and how I can get involved. I have been keeping an eye on ethstats.net and trying hard to understand what all of it means. Could you help me out  ?

What does "Last Block" mean ?

What are "Gas Limits" ?

What is "Best Block" ?

What is "Difficulty" ?

Also, where do these stats come from ?


texts: Metamask connection with private node with rpc

texts:
i am trying to connect metamask with private node but its fails to connect

geth --rpc --rpcaddr 127.0.0.1 --rpcport 8545 --rpccorsdomain "*" --rpcapi admin,db,eth,debug,miner,net,ssh,tapool,personal,web3 --datadir NODEDATA --networkid 123456 console


texts: (Error): Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract

texts:
I am trying to interact with a smart contract I deployed to a testnet with my react app locally, but for some reason I keep getting this error.
I am able to connect metamask to the dapp, but when I try to approve the contract to interact with it - the "approve contract" button does not change. However, the transaction goes through on the blockchain and I can interact with the smart contracts fine on etherscan.
I also certain I am using the correct ABI for the contract as well as the right address in the config file.
Im using
"web3": "^1.3.1"
MetaMask Version
9.1.1
I deployed the smart contracts with truffle solc version 0.6.12.
Any help would be much appreciated. Thank you!
Full Error:
Uncaught (in promise) Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.
at ABICoder.push../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParametersWith (index.js:298)
at ABICoder.push../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParameters (index.js:285)
at Contract.push../node_modules/web3-eth-contract/lib/index.js.Contract._decodeMethodReturn (index.js:470)
at Method.outputFormatter (index.js:760)
at Method.push../node_modules/web3-core-method/lib/index.js.Method.formatOutput (index.js:147)
at sendTxCallback (index.js:523)
at index.js:308
at XMLHttpRequest.request.onreadystatechange (index.js:98)

node_modules/web3-eth-abi/src/index.js
ABICoder.prototype.decodeParametersWith = function (outputs, bytes, loose) {
    if (outputs.length > 0 && (!bytes || bytes === '0x' || bytes === '0X')) {
        throw new Error('Returned values aren\'t valid, did it run Out of Gas? ' +
            'You might also see this error if you are not using the ' +
            'correct ABI for the contract you are retrieving data from, ' +
            'requesting data from a block number that does not exist, ' +
            'or querying a node which is not fully synced.');
    }
    var res = ethersAbiCoder.decode(this.mapTypes(outputs), '0x' + bytes.replace(/0x/i, ''), loose);
    var returnValue = new Result();
    returnValue.__length__ = 0;
    outputs.forEach(function (output, i) {
        var decodedValue = res[returnValue.__length__];
        decodedValue = (decodedValue === '0x') ? null : decodedValue;
        returnValue[i] = decodedValue;
        if (_.isObject(output) && output.name) {
            returnValue[output.name] = decodedValue;
        }
        returnValue.__length__++;
    });
    return returnValue;
};
/**
 * Decodes events non- and indexed parameters.
 *
 * @method decodeLog
 * @param {Object} inputs
 * @param {String} data
 * @param {Array} topics
 * @return {Array} array of plain params
 */


texts: How to filter an indexed event parameter using web3j?

texts:
I am planning to use ethereum logs as a data storage on my private blockchain. I have defined event in my contract like this:

 event logDomainFilter(uint128 indexed _campaignId, uint128 indexed _orderId, string _whiteListDomains, string _blackListDomains);

Now in my java code, I am using following code:

 EthFilter eventFilter = new EthFilter(
                                DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST,
                                contract.getContractAddress()
                        );
                        eventFilter.addSingleTopic(EventEncoder.encode(contract.LOGDOMAINFILTER_EVENT));
eventFilter.addOptionalTopics(campaignId, orderId "", "", "");

how to filter an indexed event parameter? Do I have to use "TypeEncoder.encode" as well?

Also, how can I check if event is empty?


texts:
Importing presale wallet into Geth without downloading all the blockchain

I was wondering if it is possible to import a presale wallet into Geth without downloading the whole blockchain. I mean, is it possible to import the wallet immediately after starting Geth without syncing the whole blockchain

I am using Linux Ubuntu 15.10 and my harddrive space is a bit limited.

If the above if possible I am also wondering if it is possible to transfer the funds without syncing the whole blockchain.


texts: How do I run javascript code that interacts with deployed contract on ganache test network?

texts:
This truffle deployment page describes how to interact with a deployed contract using javascript.

But I can't figure out how to execute this code. Should I be using the truffle console?


texts: Has it been more profitable to mine or buy Ethereum?

texts:
Given all the posts speculating about future performance of Ethereum, I figured I'd ask and answer a question about past performance:
Historically, would I have ended up with more Ethereum if I had mined it or if I had bought it?

Somewhat related to Mining or buy Ether?


texts: List holders and tokens for an ERC-721 contract

texts:
Given a contract, I want to map the holders to their token ids.

For example, the contract 0xFBeef911Dc5821886e1dda71586d90eD28174B7d is an ERC-721 contract for KnownOriginDigitalAsset. Etherscan offers a nice interface that maps the holders with the amount of tokens they own. I'd like to create something similar, but instead of the total tokens owned, I want to show the list of tokens.

Each time an ERC-721 token is transferred, it triggers a Transfer event. A first approach is to listen to all past and future Transfer events and use them to create and update my map of holders to token ids.

I synchronized my node running parity with the default options (note that the default pruning strategy is fast). Then, I run the following script

const Web3 = require('web3')
const web3 = new Web3(new Web3.providers.WebsocketProvider('ws://localhost:8546/'))
const erc721abi = require('./ERC721.json')
const contractAddress = '0xf26A23019b4699068bb54457f32dAFCF22A9D371'
const contract = new web3.eth.Contract(erc721abi, contractAddress)
const acc = []
contract.events.Transfer(
  {fromBlock: 0, toBlock: 'latest'},
  (err, data) => !err && acc.push(data)
)
console.log(acc.length)

At the time of writing, the script emits 31 Transfer events, while Etherscan states there are 81 holders. (Note: minting a token emits a Transfer event as well.)

Is this the correct approach? Should I synchronize the blockchain using parity --purge=archive to see all events?


texts:
I’m working on a card game. Right now it is really simple. There are orcs and cards. Both should be implemented as ERC 721.

What would be the most natural way to make the orc an ERC-721 token?

Actually the users should be allowed to do with it whatever they want. But only I or some other contract should be able to create new orcs.

Here is the code that I already have.

contract OrcBase is InterfaceOrcs {
    struct Orc {
        uint health;
        uint strenth;
    }

    Orc[] orcs;

    function createOrc(uint _health, uint _strenth) public returns(uint) {
        // TODO security checks and mapping similiar to orcBase & orcOwnership
        Orc memory _orc = Orc({
            health: _health,
            strenth: _strenth
        });
        uint256 newOrcId = orcs.push(_orc) - 1;

        return newOrcId;
    }

    /// @notice Returns the total number of Cards currently in existence.
    /// @dev Required for ERC-721 compliance.
    function totalSupply() public view returns (uint) {
        uint length = orcs.length;
        return length;
    }

    function getOrcHealth(uint id) public view returns (uint) {
        uint health = orcs[id].health;
        return health;
    }

    function getOrcStrenth(uint id) public view returns (uint) {
        uint strenth = orcs[id].strenth;
        return strenth;
    }
}


texts: "Uncaught ReferenceError: TodoList is not defined" as I tried to call Todolist.deployed() in truffle console

texts:
I was trying this Beginner tutorial on smart contracts and solidity. I typed truffle compile, truffle migrate and they ran without any error and I got my gas cost used up in Ganache. When I opened truffle console and typed TodoList = await TodoList.deployed() as per the tutorial, I faced this error below:
Uncaught ReferenceError: TodoList is not defined     at evalmachine.<anonymous>:1:7
As per the tutorial, my 2_deploy_contracts.js looks like this
const TodoList = artifacts.require("TodoList.sol");

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

Let me know what am I doing wrong, thanks in advance!


texts:
I don't know where i'm doing mistake. I have deployed my contract through remix and truffle and it was deployed without any mistake but now i'm deploying it from web3 solc@0.4.24 version and EVM is reverting my transaction.

Here's my code.

    let privateKey = req.body.from_private_key;
    let fromAddress = req.body.from_address;
    let _startTime = req.body.startTime;
    let _endTime = req.body.endTime;
    let _goal = req.body.goal;
    let _wallet = req.body.wallet;

    _goal = web3.utils.toWei(_goal, 'ether');
    web3.eth.defaultAccount = fromAddress;

    let count = await                                                                           web3.eth.getTransactionCount(web3.eth.defaultAccount);

    let gasPrice = await web3.eth.getGasPrice();
    let gasLimit = 3000000;

    const result = await new web3.eth.Contract(JSON.parse(interface));

    const deployData = result.deploy({
      data: bytecode,
      arguments: [_startTime, _endTime, _goal.toString(), _wallet]
    }).encodeABI();

    let tx = {
      from: fromAddress,
      nonce: web3.utils.toHex(count),
      gasPrice: web3.utils.toHex(gasPrice),
      gasLimit: web3.utils.toHex(gasLimit),
      data: deployData,
      chainId: 0x04
    };

      web3.eth.accounts.signTransaction(tx, privateKey).then(signed => {
      web3.eth.sendSignedTransaction(signed.rawTransaction).on('receipt', console.log)
    });

Compiling from here:

const path = require('path')
const fs = require('fs');
const solc = require('solc')
const inboxPath = path.resolve(__dirname,'contracts','MyContract.sol')
const source = fs.readFileSync(inboxPath,'utf8');/
console.log(solc.compile(source.toString(),1));
module.exports =
solc.compile(source.toString(),1).contracts[':MyContract']

And Response is :

  (node:22390) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Transaction has been reverted by the EVM:
  {
    "blockHash": "0xb6cbb03fcf1ea74b6dfa09d8fef7ed28fb3ec176a5b174de2d40ebabf1825965",
    "blockNumber": 4375769,
    "contractAddress": "0x33301cc2B245528D5F5720594148F16b05De1910",
    "cumulativeGasUsed": 3000000,
    "from": "0x57a9ce9d1e4834d43507ba77cb9d30f7dd0da307",
    "gasUsed": 3000000,
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": false,
    "to": null,
    "transactionHash": "0xa99d769d4965738eba5ebc33ccaf52c5b171bd66f758072bec55b7260932161c",
    "transactionIndex": 0
  }
  (node:22390) [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.


texts: Solidity inheritance can't read parent's value correctly

texts:
I found a strange error in my contract and tried to resolve it, but it's so unreasonable.

contract parentContract {

    uint num = 1;

    function setNum(uint _n) public returns(uint) {
        num = _n;
        return num;
    }
    function getNum() public view returns(uint) {
        return num;
    }
}

import "./parentContract.sol"

contract childContract is parentContract {
    /* Same name but IDE don't report error
    *function getNum() public view returns(uint) {
    *    return num;
    *}
    */

    function getNum2() public view returns(uint) {
        return num;
    }
    function getNum3() public view returns(uint) {
        return getNum();
    }
    function getNum4() public view returns(uint) {
        return parentContract.getNum();
    }
}

They are simple contracts in two .sol files for testing. I hope the getNum2() will return the num in parentContract, but it always return 1 that I set first.  Both getNum3()/getNum4() get the same result with getNum2().

I used truffle V4.1.14 for deploying. Here are my code interacted with contract, in the Command Terminal.

parentContract.deployed().then(function(instance){return instance.setNum(2);});**//Set the num**
parentContract.deployed().then(function(instance){return instance.getNum();}).then(function(value){ return value.toNumber();});**//Get num in parentContract**
childContract.deployed().then(function(instance){return instance.getNum2();}).then(function(value){ return value.toNumber();});**//Get num through child**
childContract.deployed().then(function(instance){return instance.getNum2.call();}).then(function(value){ return value.toNumber();});**//Another method, use call() for testing, same with above.**`


texts: Signing Multisig Wallet Contract transactions Offline in geth console

texts:
I have setup a multisig contract using the standard Wallet Contract and have been interacting with it on my geth console successfully as per the Mist Wallet Contract wiki entry.

So far I've been able to successfully call "execute" and "confirm" on the contract via the console. However, I now want to do this completely offline.

My code currently does the following:

var myAddress = "0xContractAddress";
var myContract = eth.contract("contractABI_here");
var myInstance = myContract.at(myAddress);
toAddress = "0xDestinationAccount";
amtGas = 100000;
requestAddress = "0xSigner1Address";
requestAddressNonce = someNonce; // Get the correct nonce
valueWithdrawn = web3.toWei(someValue, "ether");
personal.unlockAccount(requestAddress)
myInstance.execute(toAddress, valueWithdrawn, "", { from: requestAddress, gas: amtGas, nonce: requestAddressNonce } );

However, that last instruction returns in an off-line, unsynced node:

  Error: exceeds block gas limit

If I set amtGas to less than 5001 then it returns in the offline node:

  Error: insufficient funds for gas * price + value

I saw people had a similar problem when signing regular transactions and this stackexchange post suggests to use signTransaction but I can't figure out how to sign the transaction generated by myInstance.execute(....)

Your help would be much appreciated!


texts: What is the correct way to deploy a React app that uses MetaMask?

texts:
I am learning hardhat and ethers, so I made a create-react-app to interact with contracts on rinkeby. The react app works fine locally, but when I deploy it to Surge, I get an error and can't access the contracts anymore. I am not sure if this is because of ethers or the provider that metamask gives to ethers.
Here is the code that sets up the provider and signer by going through metamask:
  useEffect(() => {
    const init = async () => {
      const provider = await detectEthereumProvider();
      if (provider) {
        startApp(provider);
      } else {
        alert('Please install MetaMask!');
        setIsLoading(false);
        return;
      };

      async function startApp(provider) {
        if (provider !== window.ethereum) {
          alert('Do you have multiple wallets installed?');
          setIsLoading(false);
          return;
        };

        const ethersProvider = new ethers.providers.Web3Provider(provider);
        const signer = ethersProvider.getSigner();

        let signerAddress = await signer.getAddress();
        setCurrentMetaMaskAccount(signerAddress);

        const _myToken = new ethers.Contract(
          myTokenContractAddress.MyToken,
          MyToken.abi,
          signer
        );
        setMyToken(_myToken);

        const _faucet = new ethers.Contract(
          faucetContractAddress.Faucet,
          Faucet.abi,
          signer
        );
        setFaucet(_faucet);
      };
    };
    init();
  }, []);

The deployed React app produces this error:
Uncaught (in promise) Error: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION, version=providers/5.1.2)

I have followed the Ether.js documentation for working with metamask:
const provider = new ethers.providers.Web3Provider(window.ethereum)
const signer = provider.getSigner()

What should I do to set up ethers.js and metamask so they work on a deployed react app?


texts: How to Connect IPFS client in xamarin forms.?

texts:
i need to start ipfs client in My xamarin forms app.Now with the emulator it is working but when it comes to device i don't know how to connect.?I want to connection for both platform(ios and android).

My Code to start IPFS client on Genymotion

CancellationToken token = new CancellationToken(false);
IpfsClient ipfs = new IpfsClient("http://10.0.3.2:5001");

var options = new AddFileOptions { OnlyHash = true };
var fsn = await ipfs.FileSystem.AddFileAsync(fileData.FilePath, options);
Console.WriteLine((string)fsn.Id);


texts: What are the required platform to make mobile app that has dapp features?

texts:
I recently went over dapp with ethereum block chain but most of the coureses and documentation follows example in webApps. I want to know what are the possible frameworks/library, technology/ languages etc that i would need if i want to develop a android/ios app that has dapp feature of implementing smart contracts and communication with the ethereum or any other network.
P.S. for cross-platform development i wanted to use react native and would to work with domains that are compatible with react-native


texts: Can you send a token and get ether back?

texts: If a user sends a token, let's call it ABC, to the contract that issued that token, can the contract send back ether to the user?


texts: How do define the account addresses when running truffle test?

texts:
By default truffle uses testrpc / truffle develop which has a list of predefined addresses:

Truffle Develop started at http://localhost:9545/

Accounts:
(0) 0x627306090abab3a6e1400e9345bc60c78a8bef57
(1) 0xf17f52151ebef6c7334fad080c5704d77216b732
(2) 0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef
(3) 0x821aea9a577a9b44299b9c15c88cf3087f3b5544
(4) 0x0d1d4e623d10f9fba5db95830f7d3839406c6af2
(5) 0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e
(6) 0x2191ef87e392377ec08e7c08eb105ef5448eced5
(7) 0x0f4f2ac550a1b4e2280d04c21cea7ebd822934b5
(8) 0x6330a553fc93768f612722bb8c2ec78ac90b3bbc
(9) 0x5aeda56215b167893e80b4fe645ba6d5bab767de

How can I overwrite or add addresses ?


texts: Geth 1.4.10 invalid command line parameters

texts:
I've upgraded my geth client to version 1.4.10-stable-5f55d95a (from 1.3.5) and now it won't run with the following command line arguments (the documentation is lackluster when it comes to describing the init parameter):

geth --datadir "./data_dir" --networkid 13 --rpcapi eth,web3,personal --rpc --maxpeers 0 init "gen.josn" --etherbase "0x0000000000000000000000000000000000000000" --mine --minerthreads 2

which worked in 1.3.5.

I've tried the following variations:

geth --mine --minerthreads 2 --datadir "./data_dir" --networkid 13 --rpcapi eth,web3,personal --rpc --maxpeers 0 init "gen.json"

which gives:

I0727 11:44:43.892926 ethdb/database.go:82] Alloted 16MB cache and 16 file handles to single_bootstrap_node_geth/chaindata
I0727 11:44:43.917096 core/genesis.go:92] Genesis block already in chain. Writing canonical number
I0727 11:44:43.917411 cmd/geth/main.go:299] successfully wrote genesis block and/or chain rule set: 2279317df6aed704d8d46771ed06fbe4b7a935f7005d341b091b7957bc374def

and also running as:

geth init "gen.json" --mine --minerthreads 2 --datadir "./data_dir" --networkid 13 --rpcapi eth,web3,personal --rpc --maxpeers 0

which gives:

Incorrect Usage.

init [arguments...]

The init command initialises a new genesis block and definition for the network.
This is a destructive action and changes the network in which you will be
participating.

flag provided but not defined: -mine

Where can I find the documentation of version 1.4.10?


texts: how to do trading using ethereum and smart contract

texts:
how to build a trading bot that trade automatically on ethereum smart contract .

here is question in detail:

i wanna do trading like buying or selling stocks using smart contract. how to deal with this kind of problem.


texts:
for using web3.js  it is necessary to install geth into your system or it automatically connect with geth or ethereum blockchain?

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

here we connect something.
In this command we are connecting to what?
are we connecting to ethereum public chain or something else?


texts: how to correct this code with pragma solidity^ 0.5.8? thx

texts:
pragma solidity ^0.5.8;

contract HelloWorld {

    function test() pure returns (string) {
        return "HelloWorld";
    }

}


texts: Disable mining/gas/ether or set really low

texts:
When building a private ethereum network, with trusted Nodes (companies, investors, etc.) who all contribute to verifying the transactions.

Three related questions/options:

Would it be better/possible to disable gas, or set it to 0? Or to set it really low and mining reward really high, so it should never matter how much something costs, since all nodes should be trusted anyways. Although you still need to somehow prevent loops or crashing contracts.
Is it possible to disable mining, and give every new node in the network a ridiculous amount of ether or gas, so they would realistically never run out? Or is this a very naive idea? And can you have gas without ether?
Is it possible to disable ether altogether and have gasprice at 0, so you still would have to give an amount of gas for each transaction.


texts: Use DNS TXT records for wallet address resolution?

texts:
Are there any Ethereum wallet projects using DNS TXT records to resolve wallet addresses?

Setting a TXT record would allow users to have a human readable wallet "address", eg

$ dig example.com TXT
example.com.    3600    IN    TXT   "eth:0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae"

Some proposals for formatting have been made by OpenAlias and ma.ttias.be


texts:
I'm using a html code connected to my smart contract via testrpc node, where users submit temperature data.

How can I view that data from the smart contract, each time I view from the contract I see the last data entry not all entries?

How can I see all?


texts: How can I use geth to browse through the blocks in a local testnet?

texts: I have installed a local Ethereum testnet and I need to browse the blockchain to search for some information without using any smart contract. How can I do that?


texts: warning about security/enforce-explicit-visibility: No visibility specified explicitly for multiply function

texts:
my ide is vs(can find solc version is 0.4.17),but my solcjs is 0.4.24.when I run this simple code

`pragma solidity^ 0.4.45;
contract test{
    function multiply(uint a) constant returns(uint d){
        return a*7;
    }
}

there is warning "security/enforce-explicit-visibility: No visibility specified explicitly for multiply function."

When I run another simple code a warning come with "[solc] Function state mutability can be restricted to pure".

Is there some wrong with version conflict about solc/solcjs? How I solve it?


texts:
What's the need so that some dapp websites ask you to sign messages via metamask the first time you get on their website ?
as I read, it's so that they make sure you get authenticated. So you sign the mesage.

can this message that you sign be anything as long as it's not the hack transaction ?
where does the signature that metamask gets after we sign the message go ? does the website store it ? or does the website just wait if the signature was generated and if so, what does it do so that for each next request, it thinks that user is already authenticated ?
maybe, dapp doesn't store signature at all and all it cares is if user can sign the message or not and if the signing returns true, then user is authenticated. but then for the second and 3rd and so on requests, how does user stay authenticated ?

A nice explanation would be appreciated.


texts: How to deploy contract in Mist Browser connected to Ganache?

texts:
I connected Mist to my Private Ganache Blockchain, but when I try to deploy it it gives the following error:

Returned Error: Method personal sign_Transaction not supported

I can deploy contracts just fine using Ganache with Remix and EtherAtom. Mist seems to be the only one where this issue arises.


texts: How can I decline a smart-contract-transaction?

texts:
Is it possible to decline a transaction to a contract in Ethereum (with Solidity) (written here

This is a part of my code:

  function accept() public payable {
    if (msg.value == 1e18) { //1e18 wei = 1 ether
      // do smth. special
    } else {
      // do nothing
    }
  }

I would like to decline a transaction of less than 1 ether, but I can only filter it that way. So if someone does not read that he must send 1 ether and sends more or less, how can I decline it completly?


texts: How is Tezos enforcing the minimum contribution amount?

texts:
The Tezos fundraiser mentions that

  Minimum Tezos amount is 500. That's 0.1 XBT and 0.923 ETH.

Yet the smart contract at the contribution address does not seem to enforce that. How does this enforcement happen? Off-chain, e.g. do my Tezos later get rejected if I contribute to little?


texts: How would I collect fees from an liquidity pool on pancake swap?

texts:
I understand that to start collecting fees you need to add liquidity to a pool e.g. BNB/BUSD Liquidity pool.
So I have a smart contract that uses the uniswapv2 interface to add liquidity to the BNB/BUSD pool.
How would I check how much fees has been generated and what functions / order of functions would I need to collect these fees without removing liquidity.? I don't know if removing liquidity collects fees. Any examples you guys can share / provide? There isn't much learning material for this. Any learning resource, documentation or easy to follow tutorials would be great.
Also do you get fees in the Token A provided (as seen in the code below)?
function addLiquidity(address _tokenA, address _tokenB, uint256 _amountA, uint256 _amountB) external


texts:
$ npm show web3

web3@1.2.5-rc.0 | LGPL-3.0 | deps: 8 | versions: 115
Ethereum JavaScript API
https://github.com/ethereum/web3.js#readme
...

$ node app/test.js
VERSION { api: '0.18.4',
  node: [Getter],
  getNode: { [Function: get] request: [Function: bound ] },
  network: [Getter],
  getNetwork: { [Function: get] request: [Function: bound ] },
  ethereum: [Getter],
  getEthereum: { [Function: get] request: [Function: bound ] },
  whisper: [Getter],
  getWhisper: { [Function: get] request: [Function: bound ] }

Here is app/test.js:

let web3js = require("web3")

let web3 = new web3js(new web3js.providers.HttpProvider('http://localhost:8545'));

console.log("VERSION", web3.version)

Why do two different tests (run in the same directory) show two different versions of web3.js: 1.2.5-rc.0 and 0.18.4?!


texts: geth eth_sendRawTransaction return "invalid sender"

texts:
I am not very good at English ! Please forgive me .

I use the sendRawTransaction to send a signed transaction .

The geth returns an error and I can not find the reason


texts: Transaction consumes more gas using MetaMask's injected web3

texts:
I have a simple contract:

pragma solidity ^0.4.4;

contract Counter {
  uint public count;

  function Counter() {
    count = 0;
  }

  function inc() {
    count++;
  }
}

And some javascript that loads web3 in the usual way:

window.onload = function () {
  if (typeof window.web3 !== 'undefined') {
    window.web3 = new Web3(window.web3.currentProvider)
  } else {
    window.web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))
  }
}

I then call the inc method in the contract (I load it using truffle-contract).

If I have MetaMask enabled and connected to the testrpc, this costs 41614 of gas, but if I disable MetaMask and use the HttpProvider, then it costs 26614.

Is this behavior expected? If it is, why does it happen?


texts: Deleting an array element. Need to resize to return correct length?

texts:
I want to get rid of the last item of a storage array, and have array.length return the proper value.

Currently I'm using delete to zero it out. However, when I then call array.length, it returns the old length.

I assume I then need to resize the array using array.length = whatever. Is that correct, or is there a better way to do this, maybe something like array.pop?


texts: Why my contract silently fails on "throw" or out of gas exception?

texts:
When I run method that throws or runs out of gas I get nothing in error variable in callback. Method acts like everything's ok, but no changes are made.

For example I call:

Test.methodThatThrows({gas: 4752390,from: web3.eth.coinbase}, function(err, res) {console.log(err, res)});

I get output like

null 0x6d5a561224940daa70d6d56c60909255b86af7b9e93a0d8a4f98cacddf0d722b

This is very confusing, especially when you silently run out of has and don't know what's wrong.

I don't know if it's some compiler or geth option or something, couldn't find out.

I'm using

geth 1.4.12-stable-421df866
solc Version: 0.4.1+commit.4fc6fc2.Darwin.appleclang or
0.4.3-develop.2016.9.22+commit.c06ba011.Darwin.appleclang

EDIT: Note, using testrpc would give you back error in such case. With normal network you need to use practices described in the answer.


texts: I'd like to build unit tests for a Quorum project including the Quorum specific part that is the privateFor attribute in the transactions. Is there a tool like testrpc specific to Quorum ?


texts:
I would like to initialize an array of structs:
struct person {
  string firstName;
  string lastName;
}
person[3] family = [
  person("Will", "Smith"),
  person("Jada", "Smith"),
  person("Brad", "Pitt")
]

I get a compile error:

"UnimplementedFeatureError: Copying of type struct [...] memory to storage not yet supported.

I just want to initialize an array of Structs. I'd rather not push new instances of "person" one by one in a constructor. Any ideas on what I should do?


texts:
I had this code previously in which I was trying to create a struct to store 13 strings and I was getting error CompilerError: Stack too deep, try removing local variables..

Code:

  pragma solidity ^0.4.18;

  contract TEST {

  struct Test {
    string a;
    string b;
    string c;
    string d;
    string e;
    string f;
    string g;
    string h;
    string i;
    string j;
    string k;
    string l;
    string m;
  }

  mapping (uint => Test) test;
  uint totalTests;

  function totalTestsCount() view public returns (uint) {
    return totalTests;
  }

  function createTest(string a, string b, string c, string d, string e, string f, string g, string h, string i, string j, string k, string l, string m) public returns (uint) {

    uint test_id = totalTests++;

    test[test_id] = Test(a, b, c, d, e, f, g, h, i, j, k, l, m);

    return test_id;
  }

  function showTest(uint test_id) view public returns (string, string, string, string, string, string, string, string, string, string, string, string, string){

    Test t_test;
    t_test = test[test_id];

    return (t_test.a, t_test.b, t_test.c, t_test.d, t_test.e, t_test.f, t_test.g, t_test.h, t_test.i, t_test.j, t_test.k, t_test.l, t_test.m);
  }

}

Then I tried to store all the strings in just one string with a special character to separate them and would parse them out on the client side. But this gave me the error of Infinite gas requirement in the Remix IDE.

Code:

  pragma solidity ^0.4.20;

  contract TEST {

  string Test;

  mapping (uint => string) public test;
  uint totalTests;

  function totalTestsCount() view public returns (uint) {
    return totalTests;
  }

  function createTest(string test_data) public returns (uint) {

    uint test_id = totalTests++;

    test[test_id] = test_data;

    return test_id;
  }

  function showTest(uint test_id) view public returns (string){

    string memory t_test = test[test_id];

    return (t_test);
  }

}

Can please someone tell how to get rid of the errors or suggest a better approach to achieve this ?