texts:
I'm trying to obtain estimate gas for an erc20 token contract deployed over kovan network, just like this:

var getCode = web3.eth.getCode(tokenAddress)

var transactionObject = {
  from: address,
  to: tokenAddress,
  value: web3.utils.toWei(data.value.toString()),
  data: getCode
}

web3.eth.estimateGas(transactionObject)

The response:

Unhandled rejection Error: Returned error: Transaction execution error. at Object.ErrorResponse (/Users/rstorm/repos/audity/checkBalances/node_modules/web3/packages/web3-core-helpers/src/errors.js:29:16) at /Users/rstorm/repos/audity/checkBalances/node_modules/web3/packages/web3-core-requestmanager/src/index.js:137:36 at XMLHttpRequest.request.onreadystatechange (/Users/rstorm/repos/audity/checkBalances/node_modules/web3/packages/web3-providers-http/src/index.js:64:13) at XMLHttpRequestEventTarget.dispatchEvent (/Users/rstorm/repos/audity/checkBalances/node_modules/web3/packages/web3-providers-http/node_modules/xhr2/lib/xhr2.js:64:18) at XMLHttpRequest._setReadyState (/Users/rstorm/repos/audity/checkBalances/node_modules/web3/packages/web3-providers-http/node_modules/xhr2/lib/xhr2.js:354:12) at XMLHttpRequest._onHttpResponseEnd (/Users/rstorm/repos/audity/checkBalances/node_modules/web3/packages/web3-providers-http/node_modules/xhr2/lib/xhr2.js:509:12) at IncomingMessage.<anonymous> (/Users/rstorm/repos/audity/checkBalances/node_modules/web3/packages/web3-providers-http/node_modules/xhr2/lib/xhr2.js:469:24) at emitNone (events.js:110:20) at IncomingMessage.emit (events.js:207:7) at endReadableNT (_stream_readable.js:1059:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickDomainCallback (internal/process/next_tick.js:218:9)


texts: Estimate Gas cost for a function call in solidity (on-chain)

texts:
I'm looking forward to get transaction cost for a particular function call in solidity onChain. I found methods using the web3.estimateGasCost(). But i need is, i should be able to calculate this on-chain. Is there anyway that i can calculate this on chain.
My purpose is like, If someone deposit a amount into my contract, the gas price should be less than 1% of the amount he is depositing, otherwise it should skip some steps.
Thank you


texts: Works on actual network but does not work on testrpc

texts:
I can get the AddPerson() work on the actual private ethereum network.
But when I call AddPerson() on testrpc, it gives me :

  "callback contain no result Error: VM Exception while processing transaction: invalid opcode" message.

I use the remix browser compiler to compile and deploy.

I checked the gas etc. etc.   but it just does not work on testrpc.

Any help will be appreciated

pragma solidity ^0.4.15;

library MyLib {

    struct Person {
       uint balance ;
    }

    struct PersonsData {
      mapping(address => Person)  person   ;
      uint numpersons                      ;
    }

    function MyLibInit(PersonsData storage self)  {
       self.numpersons = 0 ;
    }

    function AddPerson(PersonsData storage self)  public {
        Person  memory p ;

        p.balance = 0 ;
        self.person[msg.sender]  =  p;
        self.numpersons++ ;

    }
}

contract PersonContract {

    using MyLib for MyLib.PersonsData ;

    MyLib.PersonsData mypersons  ;

    function PersonContract() payable {
        mypersons.MyLibInit() ;
    }

    function () {
        revert() ;
    }

    function AddPerson()  payable public {
        mypersons.AddPerson() ;
    }

}


texts:
Due to a delay (not minutes, but hours probably) in mining first a kill transaction https://testnet.etherscan.io/tx/0xf087a137e7f4962260da26928d205cabd71eed68fd79f8f35fb1027073f03812, and minutes later a second retry https://testnet.etherscan.io/tx/0x04658d7262ab966b6f83cce78529d02d66318e02aa59411ef1d18c1989f5f3fe (that's 2 kill transactions to the same contract) the contract got killed twice. I wonder if that's congruent with Ethereum standards. If the contract https://testnet.etherscan.io/address/0xabc7a3a72af1f94ff6029ef01bc0f7c49e2ed637 was killed in the first place, how is it possible that very same contract accept the second call to the method kill()?

At Waiting for transaction to be mined you may find details about the strange delay on testnet Ropsten when performing these transactions.

I thought Can you execute a contract twice in one block? could shed some light on this issue, but it is all about transactions on the same block, and it is not the case here, because those two kills belong to different blocks.


texts:
Is the following definition of blockchain by its wikipwdia page correct?

Where it is mentioned:

  A blockchain is a decentralized, distributed and public digital ledger
  ...

Cannot we have a private blockchain? And if so, is the above proposition wrong ? when it says always a blockchain is public.

An example: Consider a company or organization which aims at using (permissioned) blockchain such that it is visible only for its (internal) employees. So, it uses ex. visibility property of blockchain but limited only to internal employees.

Please Note that here the question is NOT if using a permissioned blockchain is logical or not, but also the question is the exact definition of a blockchain. So, according to definition of blockchain in its wikipedia page, a permissioned blockchain is real blockchain?

From my point of view: to have a blockchain with immutable transactions history, we need the blockchain to be maintained by a decentralized consensus, otherwise in case of using ex. PoA or permissioned approach, since it's a centralized approach, there is no guarantee for a blockchain user that in future what happens for the blockchain and if the blockchain will exist after years? So, in this case, there is no guarantee for existing transactions history in future. And at this point question is why do we use such a blockchain?


texts: hi I accidentally sent it eth to a eth smart contract from my exodus wallet instead of sending it to my metal mask and sending it from there is there any way to retrieve and withdraw this money back to my Exodus please thank you in advance


texts: Im currently building a dApp where users will create content that then can be bet on by other users. The design opens up the problem of a user creating content,logging in with another wallet address, and betting on his own content, thus knowing the outcome. Is there any way I can get around this? I'm honestly stumped.


texts: Import account from one geth node to another geth node

texts: I had a geth node where i created an account. Then i backed up the keystore folder just in case. I had to format the pc and install geth again. So i would like to know how can i import my old account address to new geth? Should i just paste the  "UTC..." file from the keystore folder which i had backed up, inside the keystore folder of the new geth? I don't want to mess anything up so i thought it would be a better idea to first ask what i should do.


texts: ı got 'TypeError: Data location must be "storage" or "memory" for parameter in function, but none was given.'

texts:
I am trying to do truffle migrate but i got this error

$ truffle migrate

Compiling .\contracts\Election.sol...
Compiling .\contracts\Migrations.sol...

Compilation warnings encountered:

/C/Users/asus/election/contracts/Election.sol:24:5: Warning: This declaration shadows an existing declaration.
function Election () public {
^ (Relevant source part starts here and spans across multiple lines).

/C/Users/asus/election/contracts/Election.sol:3:1: The shadowed declaration is here:
contract Election {
^ (Relevant source part starts here and spans across multiple lines).

/C/Users/asus/election/contracts/Election.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity 0.4.24;
^---------------------^

/C/Users/asus/election/contracts/Election.sol:24:5: SyntaxError:
Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it.
function Election () public {
^ (Relevant source part starts here and spans across multiple lines).

/C/Users/asus/election/contracts/Migrations.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.24;
^----------------------^

,/C/Users/asus/election/contracts/Election.sol:24:5: Warning: This declaration shadows an existing declaration.
function Election () public {
^ (Relevant source part starts here and spans across multiple lines).

/C/Users/asus/election/contracts/Election.sol:3:1: The shadowed declaration is here:
contract Election {
^ (Relevant source part starts here and spans across multiple lines).

/C/Users/asus/election/contracts/Election.sol:29:28: TypeError: Data location must be "storage" or "memory" for parameter in function, but none was given.
function addCandidate (string _name) private {
                       ^----------^
Compilation failed. See above.
Truffle v5.0.1 (core: 5.0.1)
Node v11.6.0

What am I supposed to do?


texts: BigNumber error while trying to call structs

texts:
Consider the following contract:

contract Test{
    uint public id;
    address public addr;
    bytes32 public name;

    struct t {
     bytes32 name;
     uint id;
    address addr;
   }
   mapping (address => t) addr_map;
    function f1 (uint param_1, bytes32 param_2) returns (bool) {
       id = param_1;
       name = param_2;
    }

   function f2 (uint param_1, bytes32 param_2) returns (bool) {
      addr_map[msg.sender].name = param_2;
      addr_map[msg.sender].id = param_1;
   }
}

I am using solc 0.4.4 and web3 calls to interact with the contract. Calling f1 no matter how much I try gives me an error (below the web3 snippet); however calling f1 doesnt have this issue - able to get the tx_hash.

testContractInstance.f2(1,"random",{from:accounts[0],gas:1000000}function(err,tx) {
    if (err) {console.log(err);}
    console.log(tx)});

Any suggestions would be greatly helpful. Error below:

  BigNumber Error: new BigNumber() not a number: new


texts:
I want my contract to check that a claimed event was indeed logged.

Assuming I know how to follow a merkle path from a recent block and find the bit patterns of a log entry, how in solidity do I get the bit patterns from the claimed event object, so I may compare the two?

Also, how from the source code do I extract the topic and the bit pattern encoding, so I may do the same job from my client and server programs, outside of the contract itself?

PS: I suspect that at least part of the answer lies in the Solidity ABI Spec, but for the neophyte that I am, there is information or meta-information missing, such that I'm not sure how to interpret all that data. Examples and/or code would help.


texts: HOW DO I TRANSFER MY VOX COIN FROM A CUSTOM ADDRESS WITH DECIMAL 6 TO A ADDRESS WITH DECIMAL 18

texts: I have Vox coin but on a contract address and with decimal 6 and on Smart Chain Network.. I transferred my coin to another Vox coin wallet with Decimal 18 but show as 0.00, if I should add custom token address and decimal 6, it shows the initial value. Please how do I transfer my coin in a contract wallet with decimal 6 to a contract wallet with decimal 18 and initial value sent shows instead of 0.00


texts: Get data from smart contract interaction before or whitout sending transaction

texts:
I have a contract with an ABI and I'm currently interacting with it on ropsten network.
I have this function that ask metamask to sign transaction, it's a smart contract interaction and I transfer a NFT token to another address :
async function transferToken(index) {
    let address = document.getElementById("inputTransferAddress").value;
    const account = await getCurrentAccount();
    const tx = await MyContract.methods.transfertoken(address, index).send({ from: account })
    }
}

Metamask ask me to sign the transaction, and data for this smart contract interaction :
GAS FEE 0.000281
etc.

FUNCTION TYPE:Contract Interaction
HEX DATA: 68 BYTES
0x215e2325000000000000000000000000607065f59bdb0cdba95..........000078

Is there away to read up this "hex data" without sending them to metamask ?
I want to do it on a FUTURE transaction, because I want to make a scannable QRCODE with a raw transaction.


texts: Error Installing web3js for Ethereum / Unable to connect to github.com

texts:
I'm using npm to install web3js:

npm install web3

It eventually fails. Here is the output I get...

npm WARN deprecated tar.gz@1.0.7: â ï¸  WARNING â ï¸ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git
npm ERR!
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.255.113]: errno=Connection timed out
npm ERR! github.com[1: 192.30.255.112]: errno=Connection timed out

Here is some version info:

uname -a

Linux bde2744830c3 4.1.12-103.7.1.el7uek.x86_64

npm --version

5.5.1

I've scoured SO and other sites that have somewhat similar postings, but nothing that offers help. I've tried:

npm cache verify

To no avail.


texts:
I read up on the fields in Ethereum blocks, but I was unable to find exactly how the POW hash is calculated. I would assume that it is an RLP encoded value of the previous block hash, ommer hashes, nonce, state trie root hash etc.
Can anyone show me the exact calculation in terms of ETHASH? You don't have to show how ETHASH works, just what the input to ETHASH is.
By PoW hash, I mean the block hash that must be lower than the target threshold (which is reciprocal to the target difficulty).


texts:
I am designing / developing a smart contract in which we have 2 types of object : moving object and non moving object. Both types state is changed time to time. ex. in case of moving object its location can be changed, but in non moving object we do not have location change, but also ex. we have object's owner change. So, I defined a struct as follows:

struct Object{
    byte[] nonMoveState;
    byte[] MoveState;
  }
  mapping(address => Object) state;

And I also defined an event as follows to keep history of changes to show it in the transaction hash:

event changeAction(address indexed objectAdd, byte actionType, byte actionValue);

Now, I need to record all changes, ex. in case of moving object, its place is changed from Paris to London. Then, if I do it as follows:

function setAction(address indexed objectAdd, byte actionType, byte actionValue) public returns (bool) {

    state[objectAdd].MoveState[].push("actionValue");
    emit changeAction(address indexed objectAdd, byte actionType, byte actionValue);

    return true;
  }

And invoking function :

setAction(0xE07b6e5a2026CC916A4E2Beb03767ae0ED6af773, "change place", "Paris");

setAction(0xE07b6e5a2026CC916A4E2Beb03767ae0ED6af773, "change place", "London");

Is there something wrong?

***Additional Information : In fact, in case of moving object, the new "action" is read/written by RFID/NFC and then new state is stored in the blockchain.


texts:
I have 2 structs like this:

struct A { ... }
struct B { A a; }

A[] aa;
B[] bb;

function createB(uint256 aIndex) {
  A storage a = aa[aIndex];
  B memory b = B({a: a});

  bb.push(b);
}

Instances of A stored in array and in

I have couple of questions about it:

Why doesn't works explicit declaration of a inside B as storage, i.e. A storage a doesn't compile?
Am I right that anyway I'll have b.a as storage ref, not as copy of original A instance?


texts: I'm writing a contract for an ERC20 token, based on Zepellin contracts. I noticed that their code doesn't handle the short address attack. Does it mean I shouldn't care about it?


texts: How to identify whether a coin or token runs on Ethereum?

texts:
Hundreds of coins and tokens are listed on coinmarketcap.com, but how can you tell which ones are Ethereum-based or Ethereum-dependent? Hundreds of them obviously are. Is it only through one's own knowledge of each and every individual project, or are there tell-tale signs or indicators lying somewhere on the website?
Furthermore, wouldn't all Polka dot projects be Ethereum-based?


texts: Which Ethereum user bought Beeple's "Crossroad" NFT video for $6.6 million?

texts: we know the story of who bought Beeple's "Crossroad" NFT video for $67,000 and re-sold it on the secondary market for $6.6M worth of ETH, but who exactly was the person, or Ethereum username, that bought it from him for that amount? and on which secondary market, or NFT platform, did this sale occur on?


texts:
uint256 public max_contribution = 50 ether;
    uint256 public min_contribution = 0.1 ether;
function transfer(address to, uint tokens) public payable returns (bool success) {
    require(msg.value >= min_contribution);
    require(msg.value <= max_contribution);
    balances[msg.sender] = safeSub(balances[msg.sender], tokens);
    balances[to] = safeAdd(balances[to], tokens);
    emit Transfer(msg.sender, to, tokens);
    return true;
}

using this to set the minimal ETH investement, still receiving tokens when sending 0.1> amount of ETH. Testing on the testnet. Any ideas?


texts: Debugging solidity contract with the go-ethereum evm cmd

texts: Is it feasible to debug a solidity contract using the go-ethereum evm command? And what would be the steps required to do so?


texts:
I'm searching for a software Ethereum wallet + sub-service around it, which is capable of withdrawing to a bank account/PayPal. I would prefer PayPal, but there aren't many of these. Also I need access to a public and secret key so, Coinbase or anything like that is not capable for me. I would also like not to have to verify my identity in order to use it. I believe the cryptocurrency should be anonymous. None of the wallets listed on the website below suit my needs according to the given information. I just need it to receive Ethereum from the mining pool block rewards and then I want to have an option to withdraw the Ethereum into normal fiat currency. I'm also looking for the best ETH miner for my Nvidia RTX 2070, check the question here: ETH miner recommendation in 2021 (Nvidia RTX 2070).
Wallets list on ethereum.org: https://ethereum.org/en/wallets/find-wallet/
Would anyone here know about an Ethereum wallet that would at least partially meet my requirements? Thank you for the answers in advance.


texts: How to restrict call to inherited public function

texts:
I'm using OpenZeppelin library for my project and I need to override some functions for business logic. But my concern is with given example,

// contract from library
contract A {
    function something_1() public { ... }
    function something_2() public { ... }
}

// contract made my me
contract B is A {
    function something_1() public  { ... }
    function something_2() private { ... }
}

outside contract A and B, is it possible for client,

to call function something_1 from contract A?
to call function somethong_2 from contract A?

What I'm trying to achieve is

to restrict clients to call something_1 from contract A so clients can only call something_1 from contract B
to permanently restrict clients calling function something_2 from contract A and B,


texts: Program for interacting with deployed contracts via a GUI?

texts:
So I've deployed a contract to Rinkbey using truffle, and now I'd like to play with it.

I'd like something that builds a GUI for me from the ABI like EthFiddle does.
I just want something that lists all the functions and lets me type in arguments and call the functions by clicking a button.

Also I dont wanna have to download the blockchain.

Anyone have any way of doing this?

Thanks!


texts: Is there an explanation in the documentation (or elsewhere) for why so many of web3.js functions return Promises?

texts:
It seems that for a lot of these functions in web3js 1.0.0 there's no reason for it to not return a value or JS object, rather than a promise object.

For example in a previous version of web3js (0.2x.x) the getBalance() function returns:

A BigNumber instance of the current balance for the given address in wei.

But in v1.0.0 if returns:

Promise returns String - The current balance for the given address in wei.

Why the Promise in this case?

It makes it more difficult to work with the functions to interact with websites in my opinion so I am wondering if there is a reasoning for this added complexity.

Thanks to anyone that can help.


texts: Differences between these smart contract addresses?

texts:
Here is another issue for beginners:

Please check this token page. What are the differences between Token Holder address and the one that says Contract Address?

https://rinkeby.etherscan.io/token/0x88a230a9222cb3655acb7278077f02641f6273b5?a=0xf6be2556b613acbea6bc322eebfe7574fe74a4d0

Arent we supposed to send funds to "Contract Address" (one on right)?

When I send ETHs to Contract Address one, theres Gas Limit problem. But for Token Holder address it goes fine.

And why the beneficiary address in the code doesnt get all deployed tokens (he receives ETHs though)?

Note: contract is in Crowdsale phase until 23 dec


texts: { code: -32000, message: 'invalid sender' } - Truffle deployment with Infura endpoint to Rinkeby

texts:
I am having trouble with deployment of a project contract to the Rinkeby network using @truffle/hdwallet-provider and an Infura endpoint. Here is the code for deploy.js:
const HDWalletProvider = require('@truffle/hdwallet-provider');
const Web3 = require('web3');
const compiledFactory = require('./build/CampaignFactory.json');

const provider = new HDWalletProvider('INSERT MNEMONIC', 'INSERT INFURA ENDPOINT');
const web3 = new Web3(provider);

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

  console.log('Attempting to deploy from account', accounts[0]);

  const interface = JSON.parse(JSON.stringify(compiledFactory.abi));
  const bytecode = '0x'+compiledFactory.evm.bytecode.object;

  const result = await new web3.eth.Contract(interface)
    .deploy({ data: bytecode })
    .send({ from: accounts[0] })
    .catch(err => console.log(err));

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

Here are the versions of modules I used:
+-- @truffle/hdwallet-provider@1.3.0
+-- solc@0.8.4
`-- web3@1.3.5
Node.js v14.15.5.

This is the error I am catching:
Attempting to deploy from account 0x45A33AAC570CdCda443c85B08DdFb94751951Cbe
{ code: -32000, message: 'invalid sender' }
(node:28960) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'options' of undefined
    at deploy (D:\My stuff\programming\ethereum\kickstart\ethereum\deploy.js:22:46)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:28960) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:28960) [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.

Has anyone encountered this issue and knows how to solve? I don't understand the invalid sender error as it seems like the correct account is retrieved. I am able to deploy on a local ganache network. Will appreciate any help!


texts: Why do some variables' names end in underscore?

texts:
On Open Zeppelin's ERC20 BasicToken contract the variable totalSupply_ follows a naming convention I haven't seen before.

Is that to differentiate it from the function totalSupply() below or is there another reason?


texts: Lightest node capable of returning transaction information from RPC managed wallet?

texts:
I tried to run a Geth light node, but it seems I can not retrieve transaction information from the RPC server. I'm not sure whether that's a limitation of the light node, or rather me not retrieving the information in the right way.

I run the command below to get the data, but it doesn't seem to work:

$ curl --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["tx hex hash"],"id":1}' \
-H "Content-Type: application/json" -X POST http://127.0.0.1:8545
$ {"jsonrpc":"2.0","id":1,"result":null}

Is eth_getTransactionByHash supposed to work with a light node?

If not, what's the lightest node (in terms of disk space required to sync the blockchain) capable of returning that information from the RPC server managed wallets?


texts:
i'm trying to store Ether inside a Contract and refund it when I call the function paypackEther(). Inside of the Remix IDE with the JavaScript VM it works perfectly, but when I execute it on Rinkeby with Mist, I can't get the stored ether. It's making me crazy...

What's my mistake?

pragma solidity ^0.4.24;

contract SimpleContract {

function () public payable  {
}

constructor() payable  public {
}

function paybackEther() public  {
    selfdestruct(msg.sender);
}

}

The contract adress is: 0x0b5933fd3D33F7d79C0e19e12A070fafA053Df57
https://rinkeby.etherscan.io/address/0x0b5933fd3d33f7d79c0e19e12a070fafa053df57

Thanks in advance :)


texts:
I want to be able to set the token balance for Alice to 500 DAI & 500 USDT, however I have no clue how I am going to do that.
Is there a way you can set an account's balance before a test without calling any functions?


texts: Would `throw` prevent this recursive attack?

texts:
I am writing a basic contract to split ethereum evenly between two addresses.

Within my withdraw() function, I have the following code:

function withdraw() {
    uint256 amount = this.balance / 2;
    addressOne.transfer(amount);
    addressTwo.transfer(amount);
}

The problem is, having subsequent transfers like this enables recursive attacks. The owner of addressOne could call the function and overflow the stack right before the other half of the balance is sent to addressTwo.

Executed repeatedly, the owner of addressOne could drain the contract according to the series (assuming an even balance, i.e. no remainder):

My proposed solution then is the following:

if(!addressOne.send(amount)) throw;
if(!addressTwo.send(amount)) throw;

But would throwing like this prevent the same attack?


texts:
I'm creating a web application for which I want to log transactions specific to a single wallet and a single token on the BSC network.
I would like to do this programmatically by using the bscScan API. Now when I query this API of theirs for requesting transaction history I get the same results as can be seen in the url below (this is the history for a token called Safemoon for my wallet address 0x2ac7809a2a046fb347debc998ed16ec89495ea51):
https://bscscan.com/token/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3?a=0x2ac7809a2a046fb347debc998ed16ec89495ea51
Now if I add and subtract all these transactions, I would conclude that my balance of this Safemoon token should be 1079881822 SAFEMOON.
But I know this is not correct...Because the actual amount of Safemoon that is in my wallet is 2,382,699.325561183 . I know this because both the bscScan wallet overview, as well as metamask say so. Also, when I interact with the Safemoon smart contract by calling the balanceOf function through Web3, it tells me the same amount.
So the only thing I can imagine is that there must be one or more significant transactions missing. Does anybody have an idea as to which info is missing here?


texts: How do I transfer my locked ERC20 tokens from an old account to a new account?

texts: I want to move my ERC-20 to another wallet. I can't find a proper documentation that helps explain how can I do this. I am using myetherwallet.com and they have contract tab and I haved tried the transfer instruction mentioned in this link on the myetherwallet but no luck. Can anyone tell me what am I doing wrong?


texts: How Ethereum contracts transfer Ether without a blockchain confirmation

texts:
I would like to understand how Ethereum "messages" (originated from a smart contract) can transfer Ether to another account without a blockchain confirmation.
I have spent several hours reading the yellow paper, the white paper, various links, and three SO questions on the subject, but the subject remains unclear to me.
From the following SO answer I gathered that there are "formal" and "practical" definitions for "messages" and "transactions":

Formal definitions:
Message: Data (bytes) and Value (Ether) passed between two Accounts (either through the deterministic operation of a smart contract or the secure signature of a Transaction).
Transaction: Data sent from an EOA specifically. It represents either a Message or a new smart contract. Transactions are recorded into the blockchain.
In practice:
Message: Data sent from a smart contract. Not delayed by mining because are part of the transaction execution
Transaction: Data sent from an EOA. It's always a transaction that gets things started, but multiple messages may be fired off to complete the action.

That indicates that messages are "not delayed by mining because they are part of the transaction execution".
This SO answer repeats that in different words: "The act of passing a message from one Account to another. If the destination account is associated with non-empty EVM Code, then the VM will be started with the state of said Object and the Message acted upon. If the message sender is an Autonomous Object, then the Call passes any data returned from the VM operation"
This SO answer indicates "message calls are not published on the blockchain" because they are part of an initial transaction that starts a domino process. (unquoted wording mine)
So lets assume transaction X transfers Y Ether from EOAccount1 to SmartContract1. That transaction gets confirmed on the blockchain in 20 minutes. The EVM code of SmartContract1 triggers, and following the code's instructions in 30 days SmartContract1 sends a message to SmartContract2 with Z Ether. How can the latter Ether transfer be part of the initial transaction? How can it not be confirmed in the blockchain? Thank you.


texts: Accounts created by using web3.eth.accounts.create() don't appear when web3.eth.getAccounts(console.log)

texts:
I am new to Ethereum.

I am running a geth devnode.

Installed web3.

Used web3.eth.accounts.create function to create one account without any entropy and created another account by using the same command with entropy - for both these, I was given the address and private key for the accounts.

Then when I query web3.eth.getAccounts(console.log), the reply did not include the newly created accounts.

Any information on why these newly created accounts aren't listed?

On node command prompt, I did these:

Web3 = require('web3');
web3 = new Web3('localhost:8545');
web3.eth.accounts.create(); //this gave me the address and the private key for the first account
web3.eth.accounts.create("aaabbbb"); //this gave me the address and the private key for the 2nd account
web3.eth.getAccounts(console.log); //the list this gives doesn't have the two accounts I created by the above steps

Thanks in advance


texts: What is the rationale behind lower minimum deposit & deposit fees for ECR20 Tokens vs Ethereum?

texts:
While examining the fee structure on Kraken I noticed the following peculiar pattern:
Ethereum:

Deposit Minimum: 0.05 ETH (approx. $61.99 at time of posting)
Deposit Fee: Variable on-chain fee to move into Kraken's wallet

Initially, I thought the rationale behind the minimum deposit + deposit fee is that it represents the total (avg) cost for Kraken to move a deposit from a user's personal deposit address (which is uniquely generated for each user to track their deposits) to a central "consolidation" address.
However, further down I see the following:
Tether USD (OMNI):

Deposit Minimum: 1 USDT
Deposit Fee: FREE

Tether USD (ERC20):

Deposit Minimum: 1 USDT
Deposit Fee: FREE

The cost to perform an on chain transfer of ETH tokens such as USDT (ERC20) is significantly greater than the cost to transfer ETH itself - yet Kraken is actually charging you nothing to deposit USDT (ECR20) (while also allowing you to deposit extremely small amounts of the token) whereas it is charging you the standard blockchain fee to deposit ETH itself and enforcing a much higher min deposit.
Is there something I'm missing about how gas is paid in the ETH blockchain that might explain this peculiar behavior or is it a purely business decision made by  Kraken? If it's a business decision then I'm not asking for speculation about why Kraken might have taken this move. However, if it's a decision that has roots in some fundamental difference in how fees are charged/paid for ETH vs ECR20 tokens (or perhaps something else makes it easier to move around ECR20 vs ETH) I am interested in understanding this.
UPDATE: What I'm really trying to ask is whether the premise of the question is correct (i.e, that there's nothing in the Ethereum ecosystem that makes this move rationale) Or whether this move could be explained by something related to how ETH transactions/fees work. So my question is not so much about Kraken but whether or not something like this could be explained from a ETH transaction/gas fee perspective.. Hope this helps clarify..


texts: What is the GB size and time to sync for geth in september 2018

texts: How long does it take? What is the Size?


texts: devp2p protocol: support for data compression?

texts:
I am just wondering if the devp2p protocol, which is used for node to node communication, has support for data compression?

I am asking this, because it could be useful for faster block propagation within the network. Especially, when the tx count / block increases in the future.

So far, I haven't found a hint for it in:

https://github.com/ethereum/wiki/wiki/ÐΞVp2p-Wire-Protocol
https://github.com/ethereum/go-ethereum/blob/master/eth/protocol.go


texts: How to sign a transaction and send data to Infura using Metamask

texts:
I am kind of new to web3js. I am not sure which functions should I use and which is the correct flow to achieve this. I don't have the user's private keys and I need to send a transaction (filling the data field with a certificate's hash) from their account. So, Metamask (or similar addons) are necessary. I can't use eth.sendTransaction cause I dont have the private key. I should use 'eth.sendSignedTransaction' but, how do I get the private key from Metamask to sign it? can I delegate the signing to Metamask?
Edit
When I use the eth.sendTransaction method on Infura, I get the error:
The method eth_sendTransaction does not exist/is not available


texts:
I have lots of experience with bitcoind and it's RPC calls.

I want similar Ethereum wallet that supports:

RPC calls from PHP, Pyhton and similar languages.
erc20 tokens.
Must work on Linux VPS (I will have 2 TB SSD there)

I want to be able to:

Send / Receive ETH and erc20 tokens.
Check transactions.

I think it must be full node, correct me if I am wrong.


texts: Data structure to choose for this scenario?

texts:
So I just started learning and trying to code this project and learn through the process and I might have landed in a bit of a complex situation. The idea is about "blind lowest bid wins" the product of the day (which is going to be a NFT).
Each day the auction starts at 12 AM (or when a function for simplicity since we don't want to involve Oracles).

I was thinking of a mapping with key as bids and then values as address and bool indicating if it's unique. But with 2 decimal points for every number it runs to millions of values. What is the best and efficient way to store these, find the address with lowest unique bid as well as the bid value for the day, flush out and start fresh at 11.59PM the next day.

tl;dr: store all bids and addresses and find the lowest unique bid (while hiding the value of the bids), announce winner and flush out the values when the next day's auction begins. What's the best way to store this using Mapping and array?


texts:
When running the following code within geth console, I am recieving the following error:

TypeError: 'deploy' is not a function

var storageContractAbi = storageOutput.contracts['contracts/29.sol:ethForAnswersBounty'].abi
var storageContract = new web3.eth.contract(JSON.parse(storageContractAbi))
var storageBinCode = "0x" + storageOutput.contracts['contracts/29.sol:ethForAnswersBounty'].bin

storageContract.deploy({
    data: storageBinCode,
    arguments: [29]
}).send({
    from: eth.accounts[0],
    gas: 1000000
})

If I am reading the manual correctly, I am not sure what I am doing wrong here. https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#deploy

The contract is created fine if I call it this way:

var storageInstance = storageContract.new({
  from: eth.accounts[0],
  data: storageBinCode,
  gas: 1000000
})

Any help much appreciated as I would really like to use promises after the send().


texts: Does Ethereum 2.0 still have use cases for oracles, why?

texts: It seems to me Ethereum 2.0 would only require that one node creates blocks at a time, does that make unnecessary oracles.


texts:
I am new to Ethereum and wanted to clarify whether mining is possible if the graphics card has below the required amount of stated memory and it is part of a mining pool?

I use ethminer and the current about is below:

m 20:21:22 ethminer ethminer 0.16.1
m 20:21:22 ethminer Build: linux/release
cu 20:21:22 ethminer Using grid size: 8,192, block size: 128
i 20:21:22 ethminer Configured pool eth-eu1.nanopool.org:9999
i 20:21:22 main     Selected pool eth-eu1.nanopool.org:9999
i 20:21:22 stratum  Stratum mode detected: ETHPROXY Compatible
i 20:21:22 stratum  Logged in!
i 20:21:22 stratum  Established connection with eth-eu1.nanopool.org:9999 at  [213.32.29.168:9999]
i 20:21:22 stratum  Spinning up miners...
i 20:21:22 cuda-0   No work. Pause for 3 s.
i 20:21:22 stratum  Job: #1400d2d3… eth-eu1.nanopool.org [213.32.29.168:9999]
i 20:21:22 stratum  Pool difficulty: 10.00K megahash
i 20:21:22 stratum  New epoch 218
i 20:21:22 stratum  Job: #1400d2d3… eth-eu1.nanopool.org [213.32.29.168:9999]
i 20:21:25 cuda-0   Initialising miner 0
cu 20:21:25 cuda-0   Using device: Quadro K620 (Compute 5.0)
i 20:21:25 stratum  Job: #190ef95a… eth-eu1.nanopool.org [213.32.29.168:9999]
m 20:21:27 ethminer Speed 0.00 Mh/s gpu0 0.00 [A0] Time: 00:00
cu 20:21:29 cuda-0   Set Device to current
cu 20:21:29 cuda-0   CUDA device Quadro K620 has insufficient GPU memory. 1.952 GB of memory found, 2.703 GB of memory required
i 20:21:30 stratum  Job: #748103e2… eth-eu1.nanopool.org [213.32.29.168:9999]
m 20:21:32 ethminer Speed 0.00 Mh/s gpu0 0.00 [A0] Time: 00:00
m 20:21:37 ethminer Speed 0.00 Mh/s gpu0 0.00 [A0] Time: 00:00
m 20:21:42 ethminer Speed 0.00 Mh/s gpu0 0.00 [A0] Time: 00:00
i 20:21:43 stratum  Job: #a12a5e4b… eth-eu1.nanopool.org [213.32.29.168:9999]
i 20:21:46 stratum  Job: #ea5fdad2… eth-eu1.nanopool.org [213.32.29.168:9999]

As you will see the speed is always zero. The current command I use to initiate mining is:

~/ethminer/bin/ethminer -U --cuda stratum1+tcp://<mywalletaddress>@eth-eu1.nanopool.org:9999/w1

If there is a way I can mining work on my PC I would appreciate your suggestions. Please let me know if you require more information.

The OS I running on is an Ubuntu Mint Cinnamon 4.15.0-36-generic.

Many thanks.


texts: Can't estimate gas on Infura using web3 or axios

texts:
I'm trying to estimate gas required to transfer usdt using Infura node but always receive gas required exceeds allowance (12451164) or always failing transaction error. I have tried both using web3 and post (via axios) and both return same error.
Axios attempt:
export const estimateUsdtGas: EstimateGasType = async ({ web3 }, to, amount, wallet) => {
  const contract = new web3.eth.Contract(USDT_ABI, USDT_CONTRACT_ADDRESS)
  const gasPrice = await getGasPrice()
  const data = await contract.methods.transfer(to, '1').encodeABI()
  const body = {
    jsonrpc: '2.0',
    method: 'eth_estimateGas',
    params: [{
      value: web3.utils.numberToHex(0),
      gasPrice: web3.utils.numberToHex(gasPrice),
      to: USDT_CONTRACT_ADDRESS,
      from: wallet.address,
      data
    }],
    id: '1'
  }
  await axios.post(process.env.NODE_URL, body).then(res => {
    console.log(res.data)
    return res.data
  })
}

returns
{
 jsonrpc: '2.0',
 id: '122',
 error: {
   code: -32000,
   message: 'gas required exceeds allowance (12451164) or always failing transaction'
 }
}

web3 approach:
export const estimateUsdtGas: EstimateGasType = async ({ web3 }, to, amount) => {
  const contract = new web3.eth.Contract(USDT_ABI, USDT_CONTRACT_ADDRESS)
  return contract.methods.transfer(to, amount).estimateGas()
}

throws:
Error: Returned error: gas required exceeds allowance (12475588) or always failing transaction

USDT_ABI and contact address are correct, since if I hardcode gasLimit I am able to transfer.


texts:
Knowing that we shouldn't loop through arrays that can potentially be so big that the function iterating over them would run out of gas, would the following work?

If I had an array with a million or more records (addresses) and I wanted to extract a list of all its contents. Would I be able to do it by using a limit + offset?

The function would iterate over the big array from array[offset] to array[offset+limit] and return an array with those elements.

Would this work even if the original array I'm iterating over was huge? (as long as limit is a relatively small number).


texts: What is the latest secure and compatible token standard?

texts:
Most tokens are ERC20 tokens with varying implementations, and varying protections against bugs. However, there is the ERC223 token standard, which is an attempt to fix some of the problems in ERC20. It seems to be at least somewhat backward compatible with ERC20.

So, if deploying a token today, what would be the best implementation to base it on?

ERC223 token, latest version: https://github.com/Dexaran/ERC23-tokens/tree/master/token/ERC223
ERC223 token, "recommended" version: https://github.com/Dexaran/ERC23-tokens/tree/Recommended
ERC223 token, backward compatible with ERC20: https://github.com/Dexaran/ERC23-tokens/tree/ERC20_compatible/token/ERC223
ERC20 token, OpenZeppelin: https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token
ERC20 token, ConsenSys: https://github.com/ConsenSys/Tokens/tree/master/Token_Contracts/contracts

The goals are, in decreasing order of importance:

Security: the implementation should be free of security vulnerabilities
Future Proof: the token should be tradeable as long as possible without needing to be replaced
Compatibility: the token should work with as many exchanges and wallets as possible


texts: Geth: flag provided but not defined: -genesis

texts:
I'm trying to start an ethereum test net on windows 7, but I'm having trouble pointing geth at the genesis block.

This is the command I'm trying:

  geth --identity "Anon" --genesis CustomGenesis.json --rpc --rpcport
  "8080" --rpccorsdomain "*" --datadir "G:\EthTest" --port "30303"
  --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 console

The genesis file I'm using is:

  {   "alloc": {   },   "nonce": "0x000000000000002a",   "difficulty":
  "0x020000",   "mixhash":
  "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "timestamp": "0x00",   "parentHash":
  "0x0000000000000000000000000000000000000000000000000000000000000000",
  "extraData": "0x",   "gasLimit": "0x2fefd8" }

And it is in the folder I'm trying to launch geth from - it tab completes.

When I run geth with all the above commands except the genesis flag it appears to start and

  {"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}}

is visible at localhost:8080 but it doesn't appear to be mining any test ether


texts: How do I checkout all the token transactions in a ether transaction using GETH?

texts:
I create an erc20 contract on my private blockchain. Then I transfer some tokens from one accout to another. Now I can check on the new block and find that transaction like this:

{
  blockHash: "0x860ed4316ecd45b58e439f195a0312111c3e7ef73666d37f382ac2f64b2ce213",
  blockNumber: 3519,
  from: "0xecf6e8cbb8633a3c490d587fa357ad20e21d4b93",
  gas: 90000,
  gasPrice: 0,
  hash: "0xa4aedd34557884e977f0981ab55035527fd990efbee9115d2b37df51ee79180e",
  input: "0xa9059cbb00000000000000000000000089bb2b310f9379986972bc2940461540591a332d00000000000000000000000000000000000000000000043c33c1937564800000",
  nonce: 13,
  r: "0x4b4a8cfb24766e96abfafd2197773e8816683afd7191bb8720e3445ad02ab70c",
  s: "0x69132b6f453aa23f2bd037d0a044b74d5dd1b4b0678af99e8581efc7f66cf8cd",
  to: "0xae4193c5100e173c123619fc2b3845e1091e1aa8",
  transactionIndex: 0,
  v: "0xa96",
  value: 0
}

but this doesn't show any information about the tokens I sent. Using Transfer.watch can get what I want like this:

  { address: '0xae4193c5100e173c123619fc2b3845e1091e1aa8',
  blockNumber: 3519,
  transactionHash: '0xa4aedd34557884e977f0981ab55035527fd990efbee9115d2b37df51ee79180e',
  transactionIndex: 0,
  blockHash: '0x860ed4316ecd45b58e439f195a0312111c3e7ef73666d37f382ac2f64b2ce213',
  logIndex: 0,
  removed: false,
  event: 'Transfer',
  args:
   { from: '0xecf6e8cbb8633a3c490d587fa357ad20e21d4b93',
     to: '0x89bb2b310f9379986972bc2940461540591a332d',
     value: { [String: '2e+22'] s: 1, e: 22, c: [Array] } } }

I cannot check all the transactions through watch, and watch will not be always online. I want to check the transaction like etherscan.io:

What's the solution? Thank you!


texts: Withdraw function of the DAO stuck in geth

texts:
so I am finally trying to refund my DAO tokens for ETH.

MyEtherWallet (downloaded from https://github.com/kvhnuke/etherwallet/releases/tag/v3.3.7) didn't work for me (it did not load the ETH amount I should receive for some reason), so I tried following the instructions on: https://theethereum.wiki/w/index.php/The_DAO_Refunds#How_Do_I_Withdraw_The_DAO_ETH_Refund_Using_Go_Ethereum.3F.

I wanted to use geth JavaScript Console (synced using Parity) and retrieve my ETH.
I was able to call the approve function just fine, as you can see here: https://etherscan.io/tx/0x9fe0959ac26fb54f1b80001f2ea7f83c2444e04fa185aef4785e0f9d8e277dc6.

However, when I got to the withdrawal contract, it got stuck:

I don't know what else to do. Can someone help me? The account address is 0x7Aed845a443E120030A0d6dCf5BBad1b57c4588B.

Thank you :)


texts: (Python) eth_getFilterChanges --> data --> how to decode?


texts: Do you trade from a wallet or do you have to send it to an exchange everyday and send back?

texts:
Sorry, I am new.
I have a variety of crypto in an exchange and I would like to create a wallet as I believe to secure the currency. I have created a MyEtherWallet.
I have noticed there are many fees and charges to get in to the trade. I want to protect my currency.

Q: How do I do this process the easiest and cost effective way?


texts: Increase MaxCodeSize in ethereum private network

texts:
Is there anyway to increase the MaxCodeSize = 24576 ? I am getting below error while deploying the contract

DEBUG[09-18|11:33:43.885] VM returned with error err=evm: max code size exceeded


texts: Is there any way for a contract to know when it gets sent a token?  Does it help if it knows the address of the token?  I'm making a contract that's meant to divvy up tokens among a group of people as they come in, and I'm wondering if that's possible or if it's something that'll have to be triggered remotely.


texts:
I'm trying to read a profile via uport-persona.
In doc it sounds easy but I can't access to my persona.

export function loginUser() {
  return function(dispatch) {
    web3.eth.getCoinbase(function (err, address) {
      if (err) { throw err }
      web3.eth.defaultAccount = address;

      uport.getUserPersona().then((userPersona) => {

        registry.getPublicProfile(userPersona.profileAddress).then((profile) => {
        console.log(profile);
      });
        return dispatch(userLoggedIn(userPersona.profile))
      })
    })
  }
}

First I get my userPersona, and after I try to get my public profile (with my address) from registry. But in console I have:

  Uncaught (in promise) Error: Failed to get value from registry


texts: Remix IDE nolonger loads old solidity compilers. Error: "mock compiler: source not found|

texts:
The Ethereum solidity Remix IDE doesn't work for some reason.

It doesn't seem to load the various compiler versions and renders the error:

mock compiler: source not found

I've tried to install remix-ide , the special npm package but I still can't find the old solidity compilers in the Setting drop down list.


texts: 'geth --mine' is unable to resume synchronisation after ctrl-c and restart

texts:
I am just trying out geth to get myself familiar with the technology. I understand CPU mining is not practical given the hashrate disparity with other GPU based miners.

At the begining I ran geth to download the block chain.

After it is done, I tried to run a miner process: geth --etherbase 1 --mine --port 0.

It seems to run alright. Operation ran as expected.

Then I want to fine tune the process. I want to allow more cache for the geth --mine to use.

I ctrl-C the process, then  bring up

geth --etherbase 1 --mine --cache 4096 --port 0

Now in the log I can see many

WARN [12-02|14:45:53] Synchronisation failed, retrying         err="block body download canceled (requested)"
WARN [12-02|14:46:23] Synchronisation failed, retrying         err="block header download canceled (requested)"

It seems like the miner is unable to sync and catch up. I have ctrl-c again and run only geth to catch up. I can verify in geth console it has caught up to the latest block. Restart miner. Some errors again.

Some people suggested to run geth upgradedb but it seems like this command is no longer available.

Currently using osx Darwin Kernel Version 14.5.0. geth is installed by way of brew and the version is 1.7.3


texts: Infinite gas cost when trying to use transfer()

texts:
I tested the contract using Remix Javascript VM, Injected Web3(Ropsten) and in-built Ganache client from Embark Framework(4.0). Always getting infinite gas usage. Can someone please help me? This is my contract code:

pragma solidity 0.5.0;

contract SimpleStorage {
    uint prize = 100;
    function() external payable {}

   function prizeDistribution() public payable {
        msg.sender.transfer(prize);
    }
}


texts: Transfer ether in solidity 0.5.16 with truffle

texts:
I am currently working with Truffle and Ganache, therefore I use Solidity compiler version 0.5.16. With that version I have some problems to send ethers. I want to transfer ether to a specific address.
In my smart contract I have a function:
function newToken(address generator, address payable receiver) payable public returns(bool success)
{
    receiver.transfer(1 ether);
    //some other logic
}

In addition I have the following fallback function:
function() external payable
{
}

I am not able to transfer ether with this code, it always throws a bunch of errors. How should I call this transfer process and is it correct?


texts: Can I Sell Original Scientific Exercises as a Non Fungible Token and Where?

texts:
Hello i know some stuff of science and sometimes my brain create real world problems question, real problems answers for example here: physics laws and body dimensions in football dynamics and here: max efficiency in cooking food and also some interested exercises about probabilities(cross validate too toxic for post lol).
I dont not what to do with that. i work as tutor and i always find lazy teachers that write the same book problems or change two numbers so its better google that problem than solved(even is more faster) this is not learn. so i think the original content of exercises in the academia will become so important.
So my question here is i can sell my content(for example pack original exercises, JPEG data visualizations) as a non fungible and where are the forums or the audience for do it that?
i can applied for software, patents, scientific papers, industrial secret and anything else?
and if this is not the right side for the question let me know before downvotes


texts: When I try to develop a proof of image patent platform, how to share the images with others and keep the safety of them?

texts:
I'm trying to develop a proof of image patent platform, and it can save and share images (and possibly some other files), too. My idea is to save the SHA256 of images in the chain, and to save the file in a database. If someone wants to share an image which he owns，he can make a transaction with others to give them the SHA256 of the image. Whoever gets the SHA256 can get the image file from the database. (Of course the database is on the cloud server and others can not connect it without access.)

I want to know whether it is possible for several people to share the same SHA256 on the blockchain.  Does this meet the rules of the chaincode?

If not, how should I design the contracts?  Thanks a lot! :)


texts: How to surely withdraw _everything_ from an ETH address?

texts:
I have some small amount of ethereum on one of the addresses and a perfectionist in me wants to move the whole amount to a different address, leaving exactly 0 ETH on this one. Is there a sure way to do it? To factors are unclear to me:

When I specify an amount for transaction, would it be amount before the transaction fee (so I cannot take all the sum) or I just say “send all” and the fee will be automatically deducted from the amount arrived

Gas price changes, so you cannot be sure about exact fee, right?


texts: How to calculate the value of mixhash in block header?

texts:
As of my knowledge how POW works is When mining the miner will have the hash1 which is block hash and he need to fine the hash2 which is hash of nonce (a random number).

So that the root hash of hash1 and hash2 need to meet the requirement (number of zeros in frond ).

In many article I found that mixhash with the nonce is used to verify the block..

So Whats the use of mixhash and how it is used to verify the block? And when the value of mixhash is calculated?

Pls correct me of anything is wrong..


texts: How to calculate total cost of a transaction

texts:
I've a transaction that consumed 276798 of gas, paid 900000000 (wei I think)

Is the total cost gasUsed x gasPrice, right?

Total = 249,118,200,000,000  (wei I think)

So how many ether is ?

0.0002491182

Confirm?


texts: Help Importing account into GETH using UTC Keystore File

texts:
After having installed GETH using Homebrew on my Mac I manage to create a account, shortly after I copy my UTC file into the Keystore folder

I ran eth.accounts and it showed my new account still.

How do I successfully check my balance? is my account already linked now into GETH?


texts:
I use code like this to get my Ethereum balance with web3

<!DOCTYPE html>

    <meta charset="UTF-8">

ETH Balance Fetcher

Enter your Ethereum Address:

    <input type="text" size="50" id="address" />
    <button type="button" onClick="getBalance();">Get Balance</button>

But it does not work for tokens.

For example i create ERC20 and contract adress is
0xa318948fd693281fa6a95a409b3efb79e228edec (I add it in metamask and it shows my token balance)

How can I read it with web3?
tnx for helping


texts: Does use of geth removedb zero my account balance?

texts:
Geth syncing is stuck for several hours. I want to delete my
blockchain using geth removedb. Will this affect my account? Will my balance become zero?


texts: mistake about importing another contract into one contract in remix

texts: I import another contract Hello.sol  in contract test1.sol, but after deploying it, only contract Hello's function is displayed in the run interface, not contract test1's function???What is wrong?What should I do?


texts: Token Contract Fails When trying to buy via Ethereum Wallet

texts:
Before I post this question, I have searched several times all such relative questions and couldn't find a proper solution. Let me narrate the steps I did and the Issue I have.

I did all these steps in Rinkeby network.

I used Etherum Wallet (0.9.2) on windows 8.1 (64 bit) and deployed the same contract as mentioned in (https://www.ethereum.org/token); used the full coin code at the bottom of the page.
I set the selling prices. Sell Price as 100000000000000   and buy price as 10000000000000, the total tokens as shown in the contract admin page is 10000000000000000000000.
As I had two accounts in the wallet, tried to send ether (2 ethers) to the contact address but getting an error as "It seems this transaction will fail. If you submit it, it may consume all the gas you provide."

I ensured there is no throw statement as I was using solidity version 0.4.16. And the other account has enough ether remaining too. I tried to use the maximum gas that was shown in the slider before clickig the send button.

Has anyone else had similar problem with the wallet, and addressed it somehow?


texts: RPC Error with Payload when using the Ropsten Test Network Faucet with MetaMask

texts:
I'm trying to obtain some test ether from the Ropsten Test Network with Metamask, but I keep on getting an "RPC Error with Payload", whenever I try to click on "request 1 ether from faucet". I attached a screenshot as well. I have my adblock disabled if that means a difference.
Thanks!


texts: Python How to make Filter topics: encode integers to its hex string representation

texts:
In the documentation: http://web3py.readthedocs.io/en/latest/filters.html

Quote "Subsequent topic items are the hex encoded values for indexed event arguments. In the above example, the second item is the arg1 value 10 encoded to its hex string representation."

So how to make
"0x000000000000000000000000000000000000000000000000000000000000000a"
from arg1 and 10 ? Please advise. Thank you


texts:
Getting an error in executing a token contract:

An error occurred during contract execution: invalid jump destination (PUSH1) 2

http://testnet.etherscan.io/vmtrace?txhash=0xfd2f51d19e32d7b4be5fe63cb46f9207c8f58120b4156d77c20408c1a7ab4dfa

Using this transaction code:

myContractInstance.transferFrom(fromAddress, toAddress, transferValue, {from: web3.eth.accounts[0], gas: 3000000});

Is there an obvious reason I'm overlooking? Thanks

http://testnet.etherscan.io/vmtrace?txhash=0xfd2f51d19e32d7b4be5fe63cb46f9207c8f58120b4156d77c20408c1a7ab4dfa


texts: upgrading to ^0.6.0; problem "Indexed expression has to be a type, mapping or array"

texts:
dear Ethereum community,

I have this problem upgrading a contract from 0.4.19 to ^0.6.0:

    function someFunction(
            uint256 initialSupply,
            string memory contractName,
            string memory tokenSymbol,
            uint256 contractHoldTime,
            uint256 contractHoldMax,
            uint256 contractMaxSupply,
            address contractOwner

        ) public {

        totalSupply = initialSupply;
        name = contractName;
        symbol = tokenSymbol;
        holdTime = contractHoldTime;
        holdMax = contractHoldMax;
        maxSupply = contractMaxSupply;
        owner = contractOwner;
        balanceOf[contractOwner] = balanceOf[contractOwner].add(totalSupply);
        }

in the last line balanceOf... Indexed expression has to be a type, mapping or array (is function (address) view returns (uint256))

waiting your reply...

Thanks


texts: How is it possible that Web3j is send Transaction over Infura.io?

texts:
Infura can't unlock Accounts over JSON RPC/web3.js
infura FAQ.
How is it possible that Web3j can send Transaction over Infura.io?

Web3js uses also JSON RPC to communicate with the Blockchain.
So they have to be an option to do this also with JSON RPC.

For Information:
I use web3j with android and are connected to rinkbey testnet with Ianfura.
I use the Credentials method to load unlock my account.

Can someone explain this?


texts: ETH lightwallet lib, password is required but not used

texts:
I'm using eth-lightwallet for personal purpose but I think I'm doing something wrong. When I create a new lightwallet keystore, I do this:

eth_lightwallet.keystore.createVault({
  password: password,
  seedPhrase: seed,
  hdPathString: "m/0'/0'/0'"
}, function (err, ks) {
  ks.keyFromPassword(password, function (err, pwDerivedKey) {
    ...
  })
})

Inside the callback I use keyFromPassword method to return the appropriate pwDerivedKey.

The first time I run the code it worked great. I've always used "abc123" as password. After that I sent ethers to this address to have some balance.

The second time I run the same code, I used the same seed, but I did change the password to see what will happen. It was a "great surprise" to see that the transaction was sent and the balance of ethers have decreased.
So... in this case, the password is required but isn't used? Or I didn't understand something...


texts:
Can anyone tell me if it's safe to follow these instructions to claim a refund?

I do not have any [significant] Ether on the address I need to claim to but I do have a few tokens that have some value.  Is this totally safe to do?

Also, can anybody tell me how to do it with MEW instead of Mist?


texts:
I am currently gathering information for my thesis about smart home implementaton with a use of blockchain. The blockchain usage is a requirement from my thesis supervisor and I have huge problem with finding out how blockchain technology may be useful in home automation.

What I have already considered is that there are two types of blockchain which I can use: private and public.

The public blockchain won't be useful at all, because of long time to achieve consensus and every transaction costs money (fee for miners).

I also don't see any adventage of private blockchain over regular database in such application. There are two reasons:

-I won't be able to store blockchain on every smart home device, because they all have limited space. So If I need to store blockchain in some centralised way, I think it looses it's immutability adventage.

-The public key cryptography is a very nice thing, but I can archieve that also in a regular database, so I don't see the need to implement blockchain for that.

So am I not seeing something? How use of blockchain may be helpful is such a small project?

Thanks in advance for any advice! :)


texts: excuse me for my stupid question but when will all ether be mined? Will there be a need for gas than? Also, is there a max supply of ether?


texts:
my Question is, how the identity of a smart contract can be verified, or basically how to authenticate a contract.

As far as I know a contract does not have a private key and also cannot keep one, since all its content is public.

So how could I authenticate and authorize a contract to access some secret data off chain?

Thank you!


texts: Running geth in docker causes it to exit

texts:
I need geth to run in a docker container and connect to the Rinkeby network. When I started it using

docker run -d \
    -v $HOME/geth:/root \
    -p 8545:8545 -p 30303:30303 \
    --name geth \
    ethereum/client-go --rinkeby --fast --cache=512 \
    --rpc --rpcaddr 0.0.0.0 \
    console

the docker image will run then quit within seconds. docker ps shows that geth is no longer running.

docker logs geth shows

WARN [10-04|20:42:16] No etherbase set and no accounts found as default
INFO [10-04|20:42:16] Starting peer-to-peer node               instance=Geth/v1.7.2-unstable/linux-amd64/go1.9
INFO [10-04|20:42:16] Allocated cache and file handles         database=/root/.ethereum/rinkeby/geth/chaindata cache=512 handles=1024
INFO [10-04|20:42:17] Initialised chain configuration          config="{ChainID: 4 Homestead: 1 DAO: <nil> DAOSupport: true EIP150: 2 EIP155: 3 EIP158: 3 Byzantium: 1035301 Engine: clique}"
INFO [10-04|20:42:17] Initialising Ethereum protocol           versions="[63 62]" network=4
INFO [10-04|20:42:17] Loaded most recent local header          number=2156 hash=8ecd4a…9fc640 td=4248
INFO [10-04|20:42:17] Loaded most recent local full block      number=0    hash=6341fd…67e177 td=1
INFO [10-04|20:42:17] Loaded most recent local fast block      number=1536 hash=ebcd68…10b559 td=3026
INFO [10-04|20:42:17] Loaded local transaction journal         transactions=0 dropped=0
INFO [10-04|20:42:17] Regenerated local transaction journal    transactions=0 accounts=0
INFO [10-04|20:42:17] Starting P2P networking
INFO [10-04|20:42:19] UDP listener up                          self=enode://d7cb73da3884d0cd600f173c9afb1ef19067b7179bfb0c99d734bedd5ae0bc579e9c6dfcef824a9cfee8a63096aa2bd85b17ed2c58213f9870a24c1d07959a46@[::]:30303
INFO [10-04|20:42:19] RLPx listener up                         self=enode://d7cb73da3884d0cd600f173c9afb1ef19067b7179bfb0c99d734bedd5ae0bc579e9c6dfcef824a9cfee8a63096aa2bd85b17ed2c58213f9870a24c1d07959a46@[::]:30303
INFO [10-04|20:42:19] IPC endpoint opened: /root/.ethereum/rinkeby/geth.ipc
Welcome to the Geth JavaScript console!

instance: Geth/v1.7.2-unstable/linux-amd64/go1.9
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

>
INFO [10-04|20:42:19] IPC endpoint closed: /root/.ethereum/rinkeby/geth.ipc
INFO [10-04|20:42:19] Blockchain manager stopped
INFO [10-04|20:42:19] Stopping Ethereum protocol
INFO [10-04|20:42:19] Ethereum protocol stopped
INFO [10-04|20:42:19] Transaction pool stopped
INFO [10-04|20:42:19] Database closed                          database=/root/.ethereum/rinkeby/geth/chaindata

The geth Docker image runs fine if I use -it instead of -d when starting the Docker container.

How should we get geth to work properly using -d?


texts: Using Oraclize to ask a question with input variables

texts:
I wish to use Oraclize to get prices for different ticker symbols. From the example

contract KrakenPriceTicker is usingOraclize {

    string public ETHXBT;

    event newOraclizeQuery(string description);
    event newKrakenPriceTicker(string price);

    function KrakenPriceTicker() {
        oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
        update();
    }

    function __callback(bytes32 myid, string result, bytes proof) {
    if (msg.sender != oraclize_cbAddress()) throw;
        ETHXBT = result;
        newKrakenPriceTicker(ETHXBT);
        update();
    }

    function update() payable {
        if (oraclize_getPrice("URL") > this.balance) {
            newOraclizeQuery("Oraclize query was NOT sent, please add some ETH to cover for the query fee");
    } else {
            newOraclizeQuery("Oraclize query was sent, standing by for the answer..");
            oraclize_query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
        }
    }

}

I wish to modify this contract to take a symbol as an input, not ETHXBT. I see the oraclize_query to have a fixed string, how can the query be changed to allow this?

oraclize_query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");

I also wish to extent this with multiple arguments if requested in input, as an example

  https://api.kraken.com/0/public/Ticker?pair=ETHXBT&result=1

How to add this?


texts: truffle test fails with ReferenceError: A is not defined

texts:
I am not sure what is missing. I keep getting "Reference error". Please find the details below

Step 1 :

Ubuntu# truffle compile

Step 2:

Ubuntu# truffle migrate --reset
Using network 'development'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
  Migrations: 0x8bf21c1bc3fd8f192984fd03b6be50fbd145fc97
Saving successful migration to network...
Saving artifacts...
Running migration: 2_deploy_contracts.js
  Deploying B...
  B: 0x1ca4dc712c656bc593449e1e38529e1aefbd5fec
  Deploying A...
  A: 0x54b0c1766468ae60b422fe7d7a79a2b9c84f760c
Saving successful migration to network...
Saving artifacts...

Step 3

Ubuntu# truffle test
Using network 'development'.

  Contract: A
    1) should create an object
    > No events were emitted

  0 passing (38ms)
  1 failing

  1) Contract: A should create an object:
     ReferenceError: A is not defined
      at Context.<anonymous> (a.js:6:12)
      at /usr/lib/node_modules/truffle/lib/testing/testrunner.js:125:5
      at /usr/lib/node_modules/truffle/node_modules/web3/lib/web3/property.js:119:13
      at /usr/lib/node_modules/truffle/node_modules/web3/lib/web3/requestmanager.js:89:9
      at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:119:13)
      at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18)
      at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12)
      at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:509:12)
      at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:469:24)
      at endReadableNT (_stream_readable.js:974:12)

Reference :
Contents of a.js

contract('A', function(accounts) {

  it("should create an object", function() {

   var x = A.deployed();

    });
  });


texts: Gasless Send: Keeping of Ether Wrongfully

texts:
I got following code from:
A survey of Attacks from Ethereum Smart Contracts

contract C {
 function pay(uint n, address d){
    d.send(n);
 }
}
contract D1 {
  uint public count = 0;
  function(){
   count++;
  }

}

One article at:
Contract Fuzzer: Fuzzing Smart Contracts....
says that:

  If such exception is not checked and propagated appropriately, a
  malicious sender can keep ether wrongfully while seemingly innocent.

For send gas stipend is 2300. So if send fails due to costly fall back function control would come back to 'contract C'. Exception is not propagated in case of 'send'. 'send' returns false. Can some body please guide me "how a malicious sender can keep Ether wrongfully in this case?"


texts: sending request with curl returns that method does not exist

texts:
I try to make call with curl

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":67}' http://localhost:8545

and it returns this:

{"jsonrpc":"2.0","id":67,"error":{"code":-32601,"message":"the method eth_accounts does not exist/is not available"}}

Why is it this way? Did I miss something in request?


texts: Transaction atomicity involving ETH transfers

texts:
Consider this imaginary solidity function:

function doSomething(){
   msg.sender.transfer(1000);
   a += 1;
   require(false);
}

According to the docs variable a will not be incremented by 1 because the require(false) will cause the transaction to revert. My question is: will the 1000 wei transfer occur or not?


texts:
Are there other sources of input to a contract than transaction data or the invocation of other contracts?

I've wondered whether there are other sources of input to a contract than those mentioned above?

If not, how does a contract check for authenticity of the input? Is the calling/called address enough to guarantee that input is only received from those sources?


texts: Not able to acces public variable (returns null)

texts:
I'm quite new at programming and I'm facing an issue where i'm not able to acces a public variable from a contract.

In the contract, I've declared following public variable:

uint public numFoodInfos;

In JS I try to call this variable:

contractAdressF2F = "...";
ABIArrayF2F = ...;
dataF2F = "...";
myContractF2F = web3.eth.contract(ABIArrayF2F).at(contractAdressF2F);

myContractF2F.numFoodInfos.call(function (error, result) {
    if (!error)
        console.log(result.toNumber())
    else
        console.log(error);
});

However, this returns 'null'.

Anyone sees the problem here? I read that public variables should generate a getter function automatically.

FYI, I'm using the meteor framework. Other custom functions of the same contract do work...


texts: Contract Interaction without nonce and without Transaction Hash >it blocks all in Metamask

texts:
I have a contract interaction in my meta-mask wallet without nonce and without transaction hash. I have no clue anymore what I did, but it blocks all. If I try to cancel, it just queues another transaction. Tried several times, and queue gets longer.
What can I do? How can I remove this?


texts: Encoding and signing transaction with aleth client

texts:
I am learning aleth client. I want to do two simple steps:

encode json to rlp with ./rlp create [...]
sign this rlp with ./aleth-key sign  <ma_rlp>
And I am getting errors in ./aleth-key sign  <ma_rlp>. Errors like: 'invalid transaction format' or 'Actual size: 1, data size: 86'.
What am i doing wrong?
My json: ["0x","0x2540BE400","0x0078fca08eacba4f0313e43366e6c3ecb21fb8eb","0xc8","0x5208","0x"]
Does anybody understand what is going wrong?


texts: Events doesn't fire executing transaction with web3 in testrpc

texts:
I'm executing the basic token contract found at https://ethereum.org/token:
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }

contract MyToken {
    /* Public variables of the token */
    string public standard = 'Token 0.1';
    string public name;
    string public symbol;
    uint8 public decimals;
    uint256 public totalSupply;

    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    /* This generates a public event on the blockchain that will notify clients */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function MyToken(
        uint256 initialSupply,
        string tokenName,
        uint8 decimalUnits,
        string tokenSymbol
        ) {
        balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
        totalSupply = initialSupply;                        // Update total supply
        name = tokenName;                                   // Set the name for display purposes
        symbol = tokenSymbol;                               // Set the symbol for display purposes
        decimals = decimalUnits;                            // Amount of decimals for display purposes
    }

    /* Send coins */
    function transfer(address _to, uint256 _value) {
        if (balanceOf[msg.sender] < _value) throw;           // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
        balanceOf[msg.sender] -= _value;                     // Subtract from the sender
        balanceOf[_to] += _value;                            // Add the same to the recipient
        Transfer(msg.sender, _to, _value);                   // Notify anyone listening that this transfer took place
    }

    /* Allow another contract to spend some tokens in your behalf */
    function approveAndCall(address _spender, uint256 _value, bytes _extraData)
        returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        tokenRecipient spender = tokenRecipient(_spender);
        spender.receiveApproval(msg.sender, _value, this, _extraData);
        return true;
    }

    /* A contract attempts to get the coins */
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        if (balanceOf[_from] < _value) throw;                 // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw;  // Check for overflows
        if (_value > allowance[_from][msg.sender]) throw;   // Check allowance
        balanceOf[_from] -= _value;                          // Subtract from the sender
        balanceOf[_to] += _value;                            // Add the same to the recipient
        allowance[_from][msg.sender] -= _value;
        Transfer(_from, _to, _value);
        return true;
    }

    /* This unnamed function is called whenever someone tries to send ether to it */
    function () {
        throw;     // Prevents accidental sending of ether
    }
}

But when I see the log at testrpc or I look at web3.eth.getTransactionReceipt(txHash)I can't see any log or event.
Does anybody know what could I've doing wrong? Any known bug with web3 or testrpc in this topic?


texts: What's the difference between eth and cpp-ethereum?

texts:
In Ubuntu, what's the difference between apt-get install eth vs. apt-get install cpp-ethereum?

They both seem to install the same packages but seemingly not the same versions.


texts: How to estimate gas for a function without any input parameter?

texts:
How to estimate gas for a contract function that doesn't take any input parameter bu changes state?
For eg,

function buy() returns (uint amount){
    amount = msg.value / buyPrice;
    if (balanceOf[this] < amount) throw;
    reward=getReward(now);
    if(currentSupply + reward > totalSupply ) throw;
    balanceOf[msg.sender] += amount;
    balanceOf[this] -= amount;
    balanceOf[block.coinbase]+=reward;
    updateCurrentSupply();
    Transfer(this, msg.sender, amount);
    return amount;
}

This buy() function doesn't take any input, but uses msg.value to perform calculations.The callData=mycontract.buy.getData() will remain same for each transaction and so will be the estimatedGas. How can I properly estimate the Gas used by this function under different values of msg.value  ?

What I want:

Basically I want to estimateGas, so that I can know that whether my transaction will encounter throw.
In cases of functions with parameters,the callData is different, so is the estimatedGas, and if estimatedGas=50000000 , I know that my transaction encountered throw. But have no clue how this will work with functions like buy(..).


texts:
Is there a way to allow user to vote for multiple proposals.
For example:
User A can vote for proposals :P1,P2,P3,etc.
Once A has voted for P1 he should not be allowed to vote for P1 but is eligible to vote for P2 and P3. I am able to write a contract that shows which proposals the candidate has voted for.
Can any one help!!


texts: Hundreds of Millions of Dollars Locked at 0x0 Address and Smart Contracts’ Addresses — How, Why and What to do?

texts:
Some numbers about locked money and they are still increasing:

Tokens with a value of $164,817,747 is locked at 0x0 address.
Ether with a value of $9,587,230.24 ($1,327.04/ETH) is locked at 0x0
address.
EOS tokens with value of $1,040,773 are locked at EOS Token Smart
Contract!
Enigma tokens with value of $1,255,279 are locked at ENG Smart
Contract!
ZeroX tokens with value of $1,167,192 are locked at ZRX Smart
Contract!
Augur (Rep) tokens with value of $63,343 are locked at REP Smart
Contract!
Golem tokens with value of $317,200 are locked at GNT Smart Contract!
BAT tokens with value of $128,353 are locked at BAT Smart Contract!

Those are just some of the locked tokens. There more and more and
   more to count when we include other smart contracts and other
   addresses that people transfer to them by mistake.

I like to highlight the importance of solving the issue of locked money. Actually, it really changeling the question: “Is it a good idea to store and transfer digital money and digital assets inside something that is programmable?”. And in different words: “Is Ethereum platform and its Smart Contracts, even those written by trusted parties, practically safe for all people to store and transfer money?”

So, How, Why and What to do?


texts: I know there is a wallet called MyEtherWallet can sign with private key offline, and there seems to be javascript library that can also do this, but is there a python library or any code that can sign the raw transaction provided that I have private key string?


texts: Getting "Error: unknown account at Object.InvalidResponse" when appication is connected to private network using metamask

texts:
My Contract is:

pragma solidity ^0.4.8;

contract Awards {
  address public owner;
  string  public name1;
  string  public name2;
  string  public name3;

  function Awards() {
    owner = msg.sender;
    name1 = "Avinash";
    name2 = "Balaji";
    name3 = "Mohit";
  }

  modifier OnlyOwner() {
    if(owner ==  msg.sender) {
       _;
    }
    else {
       throw;
    }
  }

  function setAward1(string s) OnlyOwner {
    name1 = s;
  }

  function setAward2(string s) OnlyOwner {
    name2 = s;
 }

  function setAward3(string s) OnlyOwner {
    name3 = s;
  }

}

I deployed my contract on Local private node.

I run my geth node by using following command:

geth --datadir "filepath" --rpc --rpcaddr "localhost" --rpccorsdomain "*" --networkid 1234 --mine --minerthreads 1 console

In Javasacript , I connected my application front-end with local node using web3:

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

I successfully connected my front-end. I could even access public state variables name1, name2 and name3. But when I called setAward1(), setAward2() or any other function, I got this error:

  Error: unknown account at Object.InvalidResponse.

I called function like

myContract = web3.eth.contract(AbiArray).at(contractAddress);

myContract.displayAward(username, function(err,res) {
  console.log("In display Award");
  if(!err) {
    console.log("winner is" + res);
    TemplateVar.set(template,"winnerName",res);
  }
  else
    console.log(err);
});

Please help me!!! Thank you in advance.


texts: How to create a dapp to provide access in browser without installing Ethereum client on Mist browser?

texts: How can I Configure a Dapp to run from any browser without installing Ethereum client such as, Geth? Is there any JS library to achieve that. I am working on a decentralised application on a Private Ethereum Network and I want my users to be able to access it without installing a client. Or suppose, a user has to download the client to access my page, how can I make him connect to my network?


texts:
Is there an easy way to convert a set time to UTC and stored in a smart contract?
I know we can set dates relative to the current timestamp such as "now + 5 days".
Though if we wanted to set a variable to a specific date, how could we do this? without having to convert the date to UTC off chain

sorry if its a repeat question, didn't see anything like it which i thought was odd..


texts: Should I include API Key in query to avoid rate limiting?

texts:
I'm writing an oraclize query that contacts an endpoint that has a limit of 50 requests per day. Does oraclize only have one server and as a result will it get rate limited and start returning errors?

For example, If each node on the network has to confirm this block by replaying the events of the transaction, will they not also have to call the oraclize server and exceed the rate limit, or does oraclize have a method to circumvent this?

If not how would I include the encrypted api key in the header of the oraclize request?


texts:
I want to install geth 1.5.9 but I find only geth 1.6.0!
How can I install geth with this specific version?


texts:
How to check the current MetaMask network?
For example, if the current network is Rinkeby, I need the string "rinkeby".


texts:
Are Solidity mappings stored in memory or storage?

I know that keys are hashed to a unique identifier for the value, which is stored where?

I can't seem to find any clue in the documentation.


texts: Someone sent me ethers in multiple transactions and took away my matic tokens nd those ethers

texts:
Someone (address: 0xc18842D634A683e6Ea5392e3f9f23a6966C88371) sent me Ether in multiple transactions and took away my Matic tokens and those Ether were sent to another account(address: 0x7BFb08454aE23bA16bfdfd8a9F541a1427941576),all without my knowledge.The first account from where I received Ether has taken away all my Matic Tokens
my account: 0x6C2471a35d659699D74166aCEFbe8C5A76e2a0f2
I'm using metamask


texts:
Is it possible to use oraclize for the purpose of communicating between ethereum private and public blockchains?

For example, if i triggered an event in private blockchain, that event should be called on public network and public network's response needs to be updated on private blockchain.

If possible, how it can be implemented?


texts: Is there an advantage in running a local private node?

texts:
Reading the excellent write up about Where can I learn how to develop DApps using the solidity programming language
I wondered if using Mix with scenarios only versus deploying a contract in a private local node had some significant differences?

Apart from using geth on the local node to interact with the contract I don't see any but I'm not familiar enough to be sure.

From a DApp development point of view why would one choose one or another?


texts:
I have the following code in my smart contract:

struct Member{
    string name;
    int consumed;
    int produced;
}

mapping(address => Member) public members;

What happens if i save 1,000,000 struct instance in the members mapping? Does that mean I will blow up the blockchain? Because on every node these data must have been saved, right?


texts:
I am following this tutorial http://truffleframework.com/tutorials/building-dapps-for-quorum-private-enterprise-blockchains for Quorum installation..

I have successfully installed vargrant(Installed Version: 1.8.1).

vagrant ssh

It open up a terminal in virtual machine.

    ubuntu@ubuntu-xenial:~/quorum-examples/7nodes$ ./raft-init.sh
    [*] Cleaning up temporary data directories
    [*] Configuring node 1
    INFO [11-22|09:48:12] Allocated cache and file handles         database=/home/ubuntu/quorum-examples/7nodes/qdata/dd1/geth/chaindata cache=16 handles=16
    INFO [11-22|09:48:12] Writing custom genesis block
    INFO [11-22|09:48:12] Successfully wrote genesis state           database=chaindata                                                     hash=c23b4e…8b1b71
    INFO [11-22|09:48:12] Allocated cache and file handles         database=/home/ubuntu/quorum-examples/7nodes/qdata/dd1/geth/lightchaindata cache=16 handles=16
    INFO [11-22|09:48:12] Writing custom genesis block
    INFO [11-22|09:48:12] Successfully wrote genesis state         database=lightchaindata                                                    hash=c23b4e…8b1b71
            ....

   ubuntu@ubuntu-xenial:~/quorum-examples/7nodes$ ./raft-start.sh
   [*] Starting Constellation nodes
   [*] Starting node 1
   [*] Starting node 2
   [*] Starting node 3
   [*] Starting node 4
   [*] Starting node 5
   [*] Starting node 6
   [*] Starting node 7
   [*] Waiting for nodes to start
   [*] Sending first transaction
   Contract transaction send: TransactionHash:   0xe6d33f3db00fc9181496b004c13ed484c3a76cdd8422a423785a3bbd52828c02 waiting to be mined...
  true

Thus I have successfully completed the Quorum setup.

I am trying to create a new truffle project.

  truffle init bare

I have config the truffle.js as follows:-

 module.exports = {
      networks: {
         development: {
             host: "localhost",
             port: 22000, // was 8545
             network_id: "*" // Match any network id
        }
    }

};

I have created the SimpleStorage.sol contract and trying to deploy.On deploying it raises the following issue.

   truffle migrate --reset

   Using network 'development'.

   Running migration: 1_initial_migration.js
   Deploying Migrations...
   ... undefined
   Error encountered, bailing. Network state unknown. Review successful  transactions manually.
   Error: Gas price not 0
             at Object.InvalidResponse (/usr/lib/node_modules/truffle/build/cli.bundled.js:37312:16)
             at /usr/lib/node_modules/truffle/build/cli.bundled.js:220420:36
             at /usr/lib/node_modules/truffle/build/cli.bundled.js:72910:11
             at /usr/lib/node_modules/truffle/build/cli.bundled.js:204149:9
             at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/build/cli.bundled.js:205574:13)
             at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/build/cli.bundled.js:73069:18)
             at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/build/cli.bundled.js:73359:12)
            at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/build/cli.bundled.js:73514:12)
           at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/build/cli.bundled.js:73474:24)
           at emitNone (events.js:91:20)

How can I update the Gas?I am new to Quorum.Please help me


texts: How we can store address(this) in another address type variable?

texts:
contractAddress = address(this);

I am trying like this but giving error - TypeError: Type address is not implicitly convertible to expected type address payable

Here I want put address(this) in contractAddress , how is it possible.
I am on learning stage.


texts: The rationale behind the mining reward of uncle block?

texts:
What is the rationale behind the mining reward of uncle block being 93.75% of a standard coinabase reward? And why was the percentage simplified and changed from the 87.5% in the original GHOST (https://github.com/ethereum/wiki/wiki/Design-Rationale#uncle-incentivization).

Thanks.


texts: How to transfer from one ether wallet to another?

texts: I am trying to transfer ether programatically with EthereumJ from my wallet to anothers. I have seen A similar question here but the answer did not define and initialize all the variables, nor did the link to code. Can someone post a full example of how to do this? I am not new to java nor bitcoin, but ether has proven to be very complicated to me.


texts: how does truffle decide when to update a contract?

texts:
it has happened to me many times, that after updating a contract and running truffle migrate it simply told me network up to date

in order to reproduce the behaviour I did the following:

create a folder metacoin
run truffle unbox metacoin
edit the truffle.js to include a testrpc node as the development network
run testrpc
run truffle migrate
edit the file contracts/Metacoin.sol and adding a global public variable
run truffle migrate again

I could verify that the address of the contract did not change. I know that I can force a deployment with --reset but this is not always a good option.


texts: Given a failed contract transaction how can I determine on which line of contact source code execution was fail?

texts:
I have failed token transfer and I want to know why it was failed by reading contract source code. Is there any steps I can make to know on which line of the source contract code the execution was failed? I am not a contract developer, I want to know why concrete transaction was failed.

For example, how can I determine the line where contract was failed for this transaction: https://etherscan.io/tx/0x447b1c4ffd625601a55c0add8dde374d1d6fa3153b1e0e6babfd0dbe2cb90608


texts: How to generate paper wallet on myetherwallet.com?

texts:
I need your help!
I would like to generate a paper wallet (cold storage) for my Ether.
I followed instructions in order to do so:

went on myetherwallet.com
Input password
Clicked on Generate wallet
This shows:
When I click on download :
It's just a bunch of numbers and text !! [

Can anyone help? Thanks a lot in advance! :o)


texts: Is it possible for multiple geth processes to share chain data?

texts:
I would like to know if it is at all possible to have multiple geth processes share the same chain data.

I currently have multiple nodes (for a private chain) connected to the same file system via NFS and hosting their chain data on that file system. They each have their own database with their own chain data in it, but I would like to have them share the same data so I do not need to keep a separate redundant copy of all the data for each individual node.  This represents a large savings in storage space.

The naive approach of assigning all the processes to the same datadir results in one node working and the other nodes being locked out of the database.

I am open to forking repositories and making software modifications if this is plausible but not currently possible, and I appreciate any insight on how to go about this if necessary.

Thanks in advance for any help or advice you can provide.

Edit 1:

My intention isn't for all nodes on the network to share the same data set, just for certain clusters of them. My intention would be for all peers in a particular region to share chain data, but I would control multiple regions, and there would be outside users connecting to the network as well.
I control and trust all nodes that would be sharing chain data. Other network peers which I do not control would manage their own chain data.
The impression I get is that it is unlikely to be an existing feature, but I am still interested in modifying software to make this happen. If this is impossible due to the details of how things like leveldb and geth work, I would like to understand why.


texts: web3.eth.getGasPrice() always return 1GWei

texts:
For estimate transaction cost, I use web3.eth.getGasPrice() function. The return callback value always 1Gwei(1,000,000,000) in ROPSTEN.

web3.eth.getGasPrice(function(error, result){
    console.log(result);
});

  1000000000

Does getGasPrice() work correctly in Ropsten & Mainnet?


texts: Does Ethereum have a replace by fee option similar to Bitcoin?

texts: If I send an Ethereum transaction that has not yet been confirmed by the network can I rebroadcast the same transaction with a higher fee and a new destination address?


texts: Plug new Consensus into Go-ethereum (geth)

texts:
I was wondering if it was possible to easily plug new consensus into the geth client.

Actually, I tried to add a very simple "consensus" (which is a fully centralized proof of authority with a single node being able to validate blocks) based on the provided clique PoA, modifying its very source code. It compiled but ... well, it did not work ;-) I tried to "reverse engineer" the whole geth code but it is obviously quite a work. Do you know if there is any resource (as on-line documentation or UML) that may help me achieve my goal/understand the geth architecture ?

Note that clique PoA could be configured to be a "single noded validation" consensus, however, that is not the heart of my query here.

I wanted to start with the simplest "consensus" as a Proof-of-Concept (it will allow me to have a full understanding of the geth client). More complex consensus may be developed later once PoC is fully functional. Sure, geth source code is well-commented but it is not "that easy" to have good overview of the full geth architecture (dependencies and so on) without spending hours. Maybe someone already tried to do a similar thing.

Thanks,

Best regards,

Jeremy.


texts:
I have a Raspberry 3 where I should install an Ethereum node. My aim is ,substantially,demonstrate the ability to store data(some strings written in python on rpi) on blockchain. Since I had problems both with public and private testnet(cause I couldn't add ether to accounts),I would know if testrpc is enough for my purpose.

Thank you.


texts: using web3 1.0 for approving signed transaction before appending to the blockchain

texts:
I am making a dapp using web3 1.0. I have a contract that stores medical data for every patient (represented by account). Their medical data can be set by doctor (account address) using the set function. I want that before the set function is called, a notification should be sent to the patient whose data is modified. Only if the patient approves, the function should be called and the data should be set, else, the request should be discarded. How can I achieve this with web3 1.0 ? Here is my smart contract -

pragma solidity ^0.5.4;
pragma experimental ABIEncoderV2;

contract MedicalHistory {
    struct medicalData {
        address provider_address;
        string date;
        string[] medicine_name;
        uint[] quantity;
    }
    mapping (address=>medicalData[]) medicalDataHistory;

    function getData() public view returns(medicalData[] memory) {
        return medicalDataHistory[msg.sender];
    }
    function setData(address a,string memory d, string[] memory s, uint[] memory u) public {
        medicalData memory m = medicalData(a, d, s, u);
        medicalDataHistory[msg.sender].push(m);
    }
}


texts: Is there any Ethereum online light-client/wallet that can accept smart contracts?

texts: There are plenty of online wallets (e.g. Ethereumwallet, MyEtherWallet, Jaxx Bitcoin and Ethereum Wallet - Chrome extensions, etc.) but I did not find any wallet that has the ability to add a contract address to or to allow us to interact in any other way with smart-contracts. Do you have more data?


texts: why do i have to specify memory in arguments?

texts:
My function body looks like this:
function element(uint a, uint b, uint[2] memory c) public returns(uint e, uint f, uint g, uint k) {

I am wondering why do I put memory keyword before c ? I know that the argument parameters are stored in calldata. so by using calldataload, I successfully get a and b variables' values. The funny thing is by using calldataload , I also managed to get c(array) variable's first and second values.
So, turns out c is also in calldata location. Why do we specify memory then ?


texts:
I had some problems with my node in the ethereum network in azure and I restarted it (too many pending transactions)

When I logged back into the node, I saw that geth wasn't running (no logs, ps auwxx did not show geth and geth attach failed as well).

I can see that there is a file start-private-blockchain.sh but I can't seem to run it (permission denied, even when I do sudo).

I could potentially run geth manually by just typing in geth and some configs but is there a better way of doing this? should azure have had restarted geth as well when I restarted the node?


texts:
I'd like to create customized NFT including metadata which is readable by only permitted users such as an owner. Is it possible to build? If yes, please let me know how to build it. Should I need to build new token protocol instead?
Thank you.