texts:
https://docs.ethers.io/v5/api/contract/contract/#contract-functionsSend
In the docs, contract.METHOD_NAME( ...args [ , overrides ] ) takes overrides for gasLimit and gasPrice
Is gasLimit the result of:
var gasLimit = await MyContract.estimateGas.myMethod('my argument', {value: 0.00056*10e18 })
which in this case returns 50584. The amount of Gas (in wei?) that myMethod() would need. Or is it 50584 * current_gas_price?


texts:
I installed ethereumjs-testrpc via npm and I start it in my terminal by running testrpc.
CTRL+C does not stop it and I'm forced to suspend it with CTRL+z and then kill -9 ... it every time.
Is this behavior by design? Is there a way to stop it like any other process?

Fedora 26 user here.


texts: How to get an uncle number using uncle hash?

texts:
Let's say, we have following block: https://ropsten.etherscan.io/block/7375
It has two uncles:

0xa9e3fe7090c12fd6db3cec305d21437b0c968188becafc099f4324964015d27a
0x33eace2f6ffee2a214053c538f1fe2998a53a4bfc0a02000bc5280af7f166396

The following link shows detailed information about first uncle:
https://ropsten.etherscan.io/uncle/0xa9e3fe7090c12fd6db3cec305d21437b0c968188becafc099f4324964015d27a

I am interested how I can get a detailed information about each uncle, like in the link above. Is there some API for uncle data?

I need this in order to calculate uncle reward.


texts: What is a "raw transaction" and what is it used for?

texts: I come across a lot of posts on Ethereum Stack Exchange about "raw transactions" (more than 45 posts have this tag at the moment), but I don't really understand what it is. I have searched both Stack Exchange and the web and can't find a 101 explanation, with the exception of this one post where in answer to a question about the difference between raw transactions and other transactions, "eth" defined a raw transaction as "a transaction in raw bytes."  Being new to both computing and the blockchain world, that did not clarify all that much for me, and still left me wondering: What is a transaction "in raw bytes"? And what are they useful for?  Most posts seem to be focused on how to generate or sign a raw transaction, get a raw transaction from Hash, parse one etc.  I'd love to understand what it actually is and what it enables.


texts:
Once the Casper POS update releases, will miners still be using GPU to execute smart contracts and power the EVM?

My understanding is that this form of 'mining' will still exist, but it wont lead to the spontaneous generation of new ETH tokens - but will instead garnish gas as a reward. Is this accurate?


texts: function.call() behaves differently to function() in truffle test

texts:
I'm using Truffle 4.0.1 and Node 9.2.1

In my solidity smart contract I have a function

function finalize() public onlyOwner {
    require(!isFinalized);

    finalization(); // does some stuff
    Finalized();

    isFinalized = true;
}

In my test I have the following

await contract.finalize.call()
const isFinalized = await contract.isFinalized.call()
console.log('isFinalized', isFinalized)

which outputs

isFinalized false

If I change my code to read

const tx = await contract.finalize()
const isFinalized = await contract.isFinalized.call()
console.log('isFinalized', isFinalized)

then it outputs

isFinalized true

Why is there a difference?


texts: Cannot submit transactions due to "it seems this transaction will fail"

texts:
I am following a tutorial to write a registrant contract and when I try to submit transactions to the contract I always get error :it seems this transaction will fail. If you submit it, it may consume all the gas upi provide.
I create run a private block chain on my laptop and I deployed the contract through Mist. The source code are shown below:
pragma solidity ^0.4.18;

contract EventRegistrant {

    //basic class of registrant
    struct Registrant {
        uint amount;
        uint numTickets;
        string email;
    }

    //define variables
    address public owner;
    uint public numTicketsSold;
    uint public quota;
    uint public price;
    mapping (address => Registrant) registrantsPaid;

    event Deposit (address _from, uint _amount);
    event Refund (address _to, uint _amount);

    //Modifiers to define following functions
    //character "_" means this is a modifier
    modifier onlyOwner(){
        require(msg.sender != owner);
        _;
    }

    modifier soldOut(){
        require(numTicketsSold >= quota);
        _;
    }

    function EventRegistrant(uint _quota, uint _price) public {
        owner = msg.sender;
        numTicketsSold = 0;
        quota = _quota;
        price = _price;
    }

    function buyTicket(string email, uint numTickets) soldOut public payable {
        uint totalAmount = price * numTickets;
        require(msg.value > totalAmount);
        if (registrantsPaid[msg.sender].amount > 0) {
            registrantsPaid[msg.sender].amount += msg.value;
            registrantsPaid[msg.sender].numTickets += numTickets;
            registrantsPaid[msg.sender].email = email;
        } else {
            registrantsPaid[msg.sender].amount = totalAmount;
            registrantsPaid[msg.sender].numTickets = numTickets;
            registrantsPaid[msg.sender].email = email;
        }

        numTicketsSold += numTickets;

        if (msg.value > totalAmount) {
            uint refundAmount = msg.value - totalAmount;
            require(msg.sender.send(refundAmount));
        }

        Deposit(msg.sender, msg.value);
    }

    function refundTickets(address buyer) onlyOwner public {
        if (registrantsPaid[buyer].amount > 0) {
            if (this.balance >= registrantsPaid[buyer].amount) {
                registrantsPaid[buyer].amount = 0;
                numTicketsSold = numTicketsSold - registrantsPaid[buyer].numTickets;
                require(buyer.send(registrantsPaid[buyer].amount));
                Refund(buyer, registrantsPaid[buyer].amount);
            }
        }
    }

    function withdrawFunds() onlyOwner public {
        require(owner.send(this.balance));
    }

    function getRegistrantsAmountPaid(address buyer) public view returns (uint) {
        return registrantsPaid[buyer].amount;
    }

    //destructor, to delete the contract when there is no need
    function kill() onlyOwner public {
        selfdestruct(owner);
    }
}

This is how my contract looks like in the Mist.

This is error when I submit the transaction.

Anyone can help me? thank you in advance.


texts: Run code on an open geth command line, but initiated from OS command line

texts:
Say I have testrpc set up:

testrpc -a 10

and have attached a geth console:

geth attach rpc:http://localhost:8545

If I want to run a contract call from the open geth console, but call it from the OS (windows in my case) command line, how might I do it?

e.g this command (contract from this question).

> UnitCounter.submitUnits(72,{from:eth.coinbase,gas:3000000})


texts:
I have installed Ethereum Wallet and switch it to the Ropsten Testnet after first start, it synced all blocks.

After restart I am trying to run it, but it stuck on loading splash.

I am on Windows 7, how can I fix this problem and run this application?


texts: debug.getModifiedAccountsByNumber always returns an Error: missing trie node

texts:
I am trying to run the new debug.getModifiedAccountsByNumber() function directly on my geth node console but getting an error every time:

  Error: missing trie node: xxx

I assume that I setup the node incorrectly somehow and that the state is missing. Here is my config.toml file for the node:

[Eth]
NetworkId = 1
SyncMode = "full"
NoPruning = false
LightPeers = 100
DatabaseCache = 768
TrieCache = 256
TrieTimeout = 3600000000000
MinerGasPrice = 18000000000
MinerRecommit = 3000000000
EnablePreimageRecording = false

[Eth.Ethash]
CacheDir = "ethash"
CachesInMem = 2
CachesOnDisk = 3
DatasetDir = "/home/ubuntu/.ethash"
DatasetsInMem = 1
DatasetsOnDisk = 2
PowMode = 0

[Eth.TxPool]
Locals = []
NoLocals = false
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1
PriceBump = 10
AccountSlots = 16
GlobalSlots = 4096
AccountQueue = 64
GlobalQueue = 1024
Lifetime = 10800000000000

[Eth.GPO]
Blocks = 20
Percentile = 60

[Shh]
MaxMessageSize = 1048576
MinimumAcceptedPOW = 2e-01

[Node]
DataDir = "/home/ubuntu/.ethereum"
IPCPath = "geth.ipc"
HTTPHost = "127.0.0.1"
HTTPPort = 8545
HTTPVirtualHosts = ["localhost"]
HTTPModules = ["db", "eth", "net", "web3", "debug.admin"]
WSPort = 8546
WSModules = ["net", "web3", "eth", "shh"]

[Node.P2P]
MaxPeers = 25
NoDiscovery = false
BootstrapNodes = ["enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303", "enode://3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99@13.93.211.84:30303", "enode://78de8a0916848093c73790ead81d1928bec737d565119932b98c6b100d944b7a95e94f847f689fc723399d2e31129d182f7ef3863f2b4c820abbf3ab2722344d@191.235.84.50:30303", "enode://158f8aab45f6d19c6cbf4a089c2670541a8da11978a2f90dbf6a502a4a3bab80d288afdbeb7ec0ef6d92de563767f3b1ea9e8e334ca711e9f8e2df5a0385e8e6@13.75.154.138:30303", "enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303", "enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303"]
BootstrapNodesV5 = ["enode://06051a5573c81934c9554ef2898eb13b33a34b94cf36b202b69fde139ca17a85051979867720d4bdae4323d4943ddf9aeeb6643633aa656e0be843659795007a@35.177.226.168:30303", "enode://0cc5f5ffb5d9098c8b8c62325f3797f56509bff942704687b6530992ac706e2cb946b90a34f1f19548cd3c7baccbcaea354531e5983c7d1bc0dee16ce4b6440b@40.118.3.223:30304", "enode://1c7a64d76c0334b0418c004af2f67c50e36a3be60b5e4790bdac0439d21603469a85fad36f2473c9a80eb043ae60936df905fa28f1ff614c3e5dc34f15dcd2dc@40.118.3.223:30306", "enode://85c85d7143ae8bb96924f2b54f1b3e70d8c4d367af305325d30a61385a432f247d2c75c45c6b4a60335060d072d7f5b35dd1d4c45f76941f62a4f83b6e75daaf@40.118.3.223:30307"]
StaticNodes = []
TrustedNodes = []
ListenAddr = ":30303"
EnableMsgEvents = false

[Node.HTTPTimeouts]
ReadTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000

[Dashboard]
Host = "localhost"
Port = 8080
Refresh = 5000000000

In fact, I suppose I should throw in my ideal result. My ideal resulting node would retain the chain state for the last month (so that I could run debug.getModifiedAccountsByNumber() on any block in the last month) but no longer (i.e. it would delete and free up space for data older than that).

Thanks in advance


texts: "The constructor should be payable if you send value" although my address and constructor are already payable

texts:
I tried to write a simple contract (deployed on Virtual VM java script on Remix) that send a certain amount of money from an account to the other. I construct my receiver and sender address, and my send function as payable already as the error suggesting me to do, but it still throws me this error. Even omitting the require does not help as well.
I do not understand what else is wrong. Any hints?

Thank you in advance!

Contract code :

pragma solidity >=0.4.0 <0.6.0; // Tested and compiled using 0.5.2

contract Workload {

    address payable public receiver;

    constructor(address payable _receiver) public payable {
        receiver = _receiver;
    }

    event Sent();

    // Get balance of a specified address
    function getBalance(address _from) public view returns (uint256) {
        return address(_from).balance;
    }

    // Get sender address
    function getSender() public view returns (address) {
        return address(msg.sender);
    }

    // Send money to receiver address
    function send(uint amount) public payable {
        address payable sender = msg.sender;
        require(amount <= sender.balance, "Insufficient balance.");
        sender.transfer(amount);;
        emit Sent();
    }
}


texts: Not able to read Array of Addresses in Function

texts:
function approveUsers(address[] users) onlyOwner {
   for(uint i=0; i<users.length; i++) {
       approvedUsers[users[i]] = true; //Mapping {address: bool}
       ApproveUserForPreSale(users[i], approvedUsers[users[i]]); //Event
   }
 }

I'm getting a zero length array with this snippet. And if I take users as static array( address[10] users), I get the correct length but the contents are 0(0x0..).

edit This is working on Remix Studio as Expected, but not on Ethereum Wallet.


texts: I do mining on testnet, but cannot get ether

texts:
I'm doing mining on testnet as following, but I could not get any ether. Did I make any fault? Could you tell me how can I get ether on testnet?

$ build/bin/geth --testnet console
>miner.start()
>> I0305 05:12:06.326181    7460 backend.go:591] checking DAG (ethash dir: /home/vagrant/.ethash)
I0305 05:12:06.482523    7460 blockchain.go:1243] imported 256 block(s) (0 queued 0 ignored) including 81 txs in 2.911192064s. #42701 [ac4ed672 / 19059a7c]
I0305 05:12:08.438405    7460 blockchain.go:1243] imported 256 block(s) (0 queued 0 ignored) including 6 txs in 1.955358033s. #42957 [bf3c0c62 / eba3cbc2]
0.720423    7460 blockchain.go:1243] imported 256 block(s) (0 queued 0 ignored)
...

> eth.getBalance(eth.accounts[0])
0


texts:
I’ve successfully deployed this contract to BSC-Testnet and I’ve arranged the PancakeSwap testnet router. As you see in line 780, It’s my friend’s testnet wallet address but when I bought my token on PancakeSwap (test), the fee of charity which is 3% didn’t go to his address. (Also when I bought 1 token, it gives me 0.93) How can I fix this issue? Thank you so much!
https://www.paste.tc/basliksiz-578


texts: Is there waste of resources in mining as a result of concurrency?

texts:
Suppose there are 10 nodes in network. New block detected. What happen next?
All 10 nodes begin to search for hash for that block simultaneously. One of them found the hash first? What happened with other 9 nodes? Did they just waste resources?


texts: Error when deploying with infura ropsten, rinkeby and kovan

texts:
when deploying to infura ropsten i get error

Running migration: 1_initial_migration.js
Deploying Migrations...
... 0x0ed88dd40f380a805ed0ba1b5b0a9d8178321ab6da9e5c0cb247f5700337b173
Migrations: 0xcfc4ba0488f20c7a2bb24e735f43e240bf249bc8
Saving successful migration to network...
  ... 0x471a1036236241c302cfa7b8dfcd011e106e221202b7c8c2586c3bf2d28c5546
Saving artifacts...
Running migration: 2_deploy_contracts.js

`/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38
        return new Error(message);
^
Error: Invalid JSON RPC response: undefined
    at Object.InvalidResponse (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
    at RequestManager.send (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:61:1)
    at Eth.get [as accounts] (/usr/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/property.js:107:1)
    at module.exports (/home/josue/Desktop/projectX/ebay-on-ethereum-ipfs-starter-project/migrations/2_deploy_contracts.js:6:44)
    at /usr/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:82:1
    at /usr/lib/node_modules/truffle/build/webpack:/packages/truffle-require/require.js:101:1
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)`

this my truffle.js content

require('dotenv').config();

var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = process.env["NEMONIC"];
var tokenkey = process.env["ENDPOINT_KEY"];
require('babel-register')

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*"
    },
    ropsten: {
      host: "localhost",
      provider: function() {
        return new HDWalletProvider(mnemonic, "https://ropsten.infura.io/v3/" + tokenkey)
      },
      network_id: 3,     //make sure this gas allocation isn't over 4M, which is the max
      gas: 400000,
      gasPrice: 1000,
    },
    rinkeby: {
      host: "localhost",
      provider: function() {
        return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/" + tokenkey)
      },
      network_id: 4,
      gas: 67500000,
    }

  }
};

and my 2_deploy_contract.js

var EcommerceStore = artifacts.require("./EcommerceStore.sol");

module.exports = function(deployer) {
  deployer.deploy(EcommerceStore, web3.eth.accounts[9]);
};


texts:
I'm trying to install a bsc fullnode, i'm following the bsc tutorial (https://docs.binance.org/smart-chain/developer/fullnode.html). But i ran into a problem.
At the last step when i launch the node it says :

INFO [05-27|09:59:45.452] Starting Geth on Ethereum mainnet...
Fatal: ./config.toml, line 35: field 'OracleThreshold' is not defined in gasprice.Config, see \https://godoc.org/github.com/ethereum/go-ethereum/eth/gasprice#Config for available fields

I saw this guy add similar problem... https://githubmemory.com/repo/binance-chain/bsc/issues/255
Hope you can help me, thanks in advance.


texts: Why doesn't my Ethereum node have any peers?

texts: I'm running an Ethereum node using geth and it can't find any peers. I've already tried the time sync command suggested on the wiki. My bandwidth is good.


texts: Where to find the private key for my contract in blockapps?

texts:
I am trying to use blockapps-js to invoke functions on my smart contract deployed in blockapps. Since I need the private key for it, I am looking at the app/users/admin/.json file. Problem is I cannot figure out which of these fields to use. Is it encPrivKeys.key? My code is not working yet, and am trying to figure out whether that is the cause.

{
  "encSeed": {
    "encStr": "...",
    "iv": "...",
    "salt": "..."
  },
  "encHdRootPriv": {
    "encStr": "...",
    "iv": "",
    "salt": ""
  },
  "hdIndex": 1,
  "encPrivKeys": {
    "": {
    "key": "...",
    "iv": "",
    "salt": ""
  }
},
  "addresses": ["..."],
  "keyHash": "...",
  "salt": {
    "words": [, -,,],
    "sigBytes": 16
  }
}


texts: How to get the transaction cost in a Truffle unit test?

texts:
How can I get the actual gas consumed by a sendTransaction inside a truffle test?

In the following test, buyer sends an amount of 50 ETH to a contract:

const EmptyContract = artifacts.require("EmptyContract");
const BigNumber = web3.BigNumber;

contract('Test', function(accounts) {
    it("should work", async () => {
        let contract = await EmptyContract.new({ from: accounts[1] });
        let amount = web3.toWei(50, 'ether');
        let buyer = accounts[2];

        // BALANCE BEFORE TX
        let balanceBefore = web3.eth.getBalance(buyer);

        // SEND TX
        let hash = await contract.buy.sendTransaction({from: buyer, value: amount});

        // BALANCE AFTER TX
        const balanceAfter = web3.eth.getBalance(buyer);

        let tx = await web3.eth.getTransaction(hash);
        const gasUsed = tx.gas;
        const gasCost = tx.gasPrice.mul(gasUsed);
        console.log("BEFORE", balanceBefore.toNumber());
        console.log("amount sent", amount);
        console.log("gas price", tx.gasPrice.toNumber());
        console.log("gas used", gasUsed);
        console.log("gas cost", gasCost.toNumber());
        console.log("AFTER", balanceAfter.toNumber());
        console.log("CHECKSUM", balanceAfter.add(gasCost).add(amount).toNumber());

        assert.equal(balanceBefore.toNumber(), balanceAfter.add(gasCost).add(amount).toNumber());
    });
});

Then buyer's balance is checked. It should be

[balance before tx] = [balance after tx] + [amount sent] + [gas cost]

But it fails, printing:

BEFORE 100000000000000000000
amount sent 50000000000000000000
gas price 100000000000
gas used 6721975
gas cost 672197500000000000
AFTER 49997862200000000000
CHECKSUM 100670059700000000000
   :
AssertionError: expected 100000000000000000000 to equal 100670059700000000000

The contract is very basic:

pragma solidity ^0.4.18;

contract EmptyContract {
    function buy() public payable  { }
}

It seems that the transaction cost 0.6700597 ETH less than the value returned by tx.

I followed Transaction gas cost in truffle test case but it didn't help.

Any idea?


texts: Could we know if an address contains a specific token via Etherscan API?

texts:
I tried this, http://api.etherscan.io/api?module=account&action=txlistinternal&address=0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3&startblock=0&endblock=2702578&sort=asc&apikey=KEYHERE

but it doesn't seem to help much.


texts: How contract data is stored in blockchain

texts:
Is the contract data stored as a whole or it is spreaded out in the history of blockchain? I notice the input of a transaction issued to a contract contains only the Method ID follow by the method's parameters. After miner executes a transaction and accepted into the blockchain, how is the contract data being updated?
Without using a contract method is it possible to retrieve the whole contract data by scanning the blockchain?


texts: What does affect Mining Rig performance?

texts:
I'm planning to set up a computer to mine Ether, with up to 3 way CrossFire cards. here are my questions

would the choice of OS affect mining performance (i.e. Linux vs
Windows)?
can I add a non-crossfire card (basic graphic) to boot off of?
if I did boot off one of the CrossFire cards, would that affect the mining performance?
if I ran some virtual machines off this computer, would it affect mining performance?


texts:
I have a pretty dummy contract:

pragma solidity ^0.4.16;

contract Ballot {
    struct Voter {
        uint weight; // weight is accumulated by delegation
    }
}

Compiled with remix I receive the following bytecode:

{
    "linkReferences": {},
    "object": "60606040523415600e57600080fd5b5b603680601c6000396000f30060606040525b600080fd00a165627a7a72305820c9e69aabe54411b89c6b2223932d7349334d3e75c12657355b7ba52c47e4db250029",
    "opcodes": "PUSH1 0x60 PUSH1 0x40 MSTORE CALLVALUE ISZERO PUSH1 0xE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST JUMPDEST PUSH1 0x36 DUP1 PUSH1 0x1C PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x60 PUSH1 0x40 MSTORE JUMPDEST PUSH1 0x0 DUP1 REVERT STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 0xc9 0xe6 SWAP11 0xab 0xe5 DIFFICULTY GT 0xb8 SWAP13 PUSH12 0x2223932D7349334D3E75C126 JUMPI CALLDATALOAD JUMPDEST PUSH28 0xA52C47E4DB2500290000000000000000000000000000000000000000 ",
    "sourceMap": "26:104:0:-;;;;;;;;;;;;;;;;;;"
}

I am trying to deploy it in a spurious dragon py-evm using the following code:

SENDER_PRIVATE_KEY = keys.PrivateKey(
   decode_hex('0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8')
)

SENDER = Address(SENDER_PRIVATE_KEY.public_key.to_canonical_address())

state = chain_without_block_validation.get_vm().state
state.set_balance(SENDER, 1000)

vm = chain_without_block_validation.get_vm()
nonce = vm.state.get_nonce(SENDER)

vm_tx = vm.create_unsigned_transaction(
   nonce=nonce,
   gas_price=0,
   gas=3138525,
   to=CREATE_CONTRACT_ADDRESS,
   value=0,
   data=b'60606040523415600e57600080fd5b5b603680601c6000396000f30060606040525b600080fd00a165627a7a72305820c9e69aabe54411b89c6b2223932d7349334d3e75c12657355b7ba52c47e4db250029',
)
signed_tx = vm_tx.as_signed_transaction(SENDER_PRIVATE_KEY)
new_block, receipt, c = chain_without_block_validation.apply_transaction(signed_tx)

The problem is that I always receive the following outputs:

Computation is error: True
Computation error: Out of gas: Needed 1782022989126083463177950425152579434543167263616556917372498944687405603136755656096088332 - Remaining 3073463 - Reason: Expanding memory 0 -> 966588469268559010541288244128370517706469799232
code len: 24576
computation output: b''
computation output len: 0

Following the code I have observed that error happens in the opcode 55 (CALLDATACOPY) when evm tries to extend memory. it tries to extend from:

before_size = 0
after_size = 966588469268559010541288244128370517706469799232

with a gas cost:

after_cost = 1782022989126083463177950425152579434543167263616556917372498944687405603136755656096088332

Anyone that has successfully deployed a smart contract can provide me any help?

Thanks for advance. :-)


texts: how to run a private blockchain network with geth on other machines, such as server and client?

texts:
i want to run private blockchain network , on the server I'm running:

geth --networkid 4224 --mine --minerthreads 2 --datadir "D:\mydirectory\private-network" --nodiscover --rpc --rpcport "8545" --port "30303" --lightkdf --cache 16 --rpccorsdomain "*" --nat "any" --rpcapi eth,web3,personal,net --unlock 0 --password ./password.sec --allow-insecure-unlock

then on another machine I want to run the client, then my question is how to run the client on another machine and connect to the server?


texts: Ownership isn't allocated in the contract?

texts:
I've taken the below contract as an example from a tutorial and changed items highlighted in bold, as per IDE errors.

What the contract should do is allocate ownership of the item to the account that deploys the contract, then when 2 ether is paid, change the ownership to the account that made the payment. When I deploy the contract, the ownership isnt allocated to the account, instead it has the address 0x000..., and when i use the buy function, ownership does not transfer and ether is not deducted from the buyers account. Any help would be appreciated.

pragma solidity ^0.4.0;

contract SalesContract {

    address **public** owner;
    bool public isSold = false;
    string public salesDescription = "Honda Civic";
    uint public price = 2 ether;

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

    function Buy() **public** payable {
        if(msg.value >= price) {
            **owner.transfer(address(this).balance)**;
            owner = msg.sender;
            isSold = true;
        } else {
            revert();
        }
    }

}

Original code from tutorial:

pragma solidity ^0.4.0;

contract SalesContract {
    address public owner;
    bool public sold = false;
    string public salesDescription = 'Volvo V40 HF 56 32';
    uint price = 2 ether;

    function SalesContract() payable {
        owner = msg.sender;
    }

    function buy() payable {
        if(msg.value >= price) {
            owner.transfer(this.balance);
            owner = msg.sender;
            sold = true;
        } else {
            revert();
        }
    }
}


texts: How to call another contract via create and call in EVM?

texts:
I am reading the source code of EVM. And want to imitate a contract remote call.

I made two contracts as below:

callee:

contract Called{
    uint public myuint;

    function set(uint _var) {
        myuint = _var;
    }

    function get() view returns (uint){
        return myuint;
    }
}

caller:

interface Called{
    function set(uint);
    function get() view returns (uint);
}

contract Caller {

    Called public called_address;

    function set_address(address _addy) {
        called_address = Called(_addy);
    }

    function set(uint256 _var) {
        called_address.set(_var);
    }

    function set_call(address _called, uint256 _var) {
        require(_called.call(bytes4(sha3("set(uint256)")), _var));
    }
}

Then,  my test code is as below :

...
contractCode, contractAddr, gasLeftover, vmerr := evm.Create(contractRef, data, total, big.NewInt(0))
...
// metaContractAddr is the contract address of callee. I got it after I called evm.Create(callee.bytecode).
input, err := abiObj.Pack("set_address", metaContractAddr)
must(err)
outputs, gasLeftover, vmerr := evm.Call(contractRef, contractAddr, input, statedb.GetBalance(fromAddress).Uint64(), big.NewInt(0))
must(vmerr)
fmt.Printf("output = %x\n", outputs)

input, err = abiObj.Pack("set", big.NewInt(100000))
must(err)
outputs, gasLeftover, vmerr = evm.Call(contractRef, contractAddr, input, statedb.GetBalance(fromAddress).Uint64(), big.NewInt(0))
must(vmerr)
fmt.Printf("output = %x\n", outputs)

The first call set_address went well, cause I can get it by calling called_address's getter method. But when calling input, err = abiObj.Pack("set", big.NewInt(100000)),  error occured as below:

op = GAS, operation=vm.operation{execute:(vm.executionFunc)(0x4229840), gasCost:(vm.gasFunc)(0x4234140), validateStack:(vm.stackValidationFunc)(0x4234f20), memorySize:(vm.memorySizeFunc)(nil), halts:false, jumps:false, writes:false, valid:true, reverts:false, returns:false}
op = CALL, operation=vm.operation{execute:(vm.executionFunc)(0x422a220), gasCost:(vm.gasFunc)(0x4220e10), validateStack:(vm.stackValidationFunc)(0x4234f20), memorySize:(vm.memorySizeFunc)(0x4233310), halts:false, jumps:false, writes:false, valid:true, reverts:false, returns:true}
panic: out of gas

goroutine 1 [running]:
main.must(0x434ec20, 0xc420086ca0)
    main_icc.go:46 +0x4a
main.main()
    main_icc.go:132 +0x1581
exit status 2

From this error, I am sure that the caller's balance is definitely enough, which be assigned to 1e18.

Anyone helps?  thanks in advance!


texts: Unhandled promise rejection (rejection id: 100): TypeError: Invalid hex string

texts:
Getting this error when calling a write function in the smart contract. Please find the code below.

getListedAsValidator: function(address,sender, callback) {
    var self = this;
    var config = require('../config/config');
    var Web3 = require('web3');
    var web3 = new Web3(config.clientEndPoint);
    var sender = config.address;
    var contractAddr = config.contractAddress;

var tokenInstance = new web3.eth.Contract(zecash_artifact.abi, contractAddr, {
  from: sender
});

var txnNonce;
var txnObject;

web3.eth.getTransactionCount(sender)
  .then(function(data){
   // txnnonce = txnnonce + 1;
    txnNonce = data;
    console.log(txnNonce);
    txnObject = {
      from : sender,
      to : contractAddr,
      value : "0x0",
      gasPrice: web3.utils.toHex(web3.utils.toWei('30', 'Gwei')),
      gas: web3.utils.toHex('3000000'),
      nonce: txnNonce,
      data: tokenInstance.methods.setValidators(address).encodeABI()
    };
    console.log(txnObject);

    var Tx = require('ethereumjs-tx');
    var privateKey = new Buffer(config.privkey, 'hex');

    var tx = new Tx(txnObject);
    tx.sign(privateKey);

    var serializedTx = tx.serialize();
    console.log(serializedTx);

    web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'))
    .on('receipt', function(receipt){
        console.log("Receipt Called");
        callback(receipt.valueOf());

      })
      .on('error', function(err){
        console.log("Error Called: "+ err);

        var minedPending = "Be aware that it might still be mined";
        var sourceErr = " " + err + " ";
        if(sourceErr.indexOf(minedPending) !== -1)
        {
          var rtnObj = {
            "status" : "pending",
            "data" : err,
            "errmsg" : "Your transaction is on the Blockchain. Depending on data traffic, it may take anywhere between 5-30 minutes to execute. Kindly check your wallet again in some time to be sure that the transaction was successfully executed."
            };

          callback(rtnObj.valueOf());
        }
        else
        {

          callback("ERROR 404");

        }
      });
 });

}


texts:
From my understanding QuickBlocks is an api in C++ that provides similar services as etherscan API for the ethereum blockchain. Is there a link or tutorial to use quickkblocks because the example in the documentation is kind of hard to understand.

It seems like the name was changed to true blocks since the github repo is this.  I am looking for a comprehensive one and c++ beginner friendly.


texts: Difference between require and assert and the difference between revert and throw

texts:
I was looking at the docs and Im looking for clarification on the difference between require and assert and throw and revert.

assert(bool condition): abort execution and revert state changes if
condition is false (use for internal error)
require(bool condition):
abort execution and revert state changes if condition is false (use
for malformed input)

Specifically with respect to assert and require, how do you draw the line between malformed input and internal error?


texts: Does ethereum or blockchain blocks in general use any specific format to store data on local instant?

texts: For example if I store a text file locally it will have .txt extension similarly .jpg in case of images or .mp4 in case of video, so what it would be in case of block record. Can files be located on particular path on local file system.


texts: Adding a modifier to an auto-generated variable getter

texts:
Is it possible to add a modifier to the auto-generated getter for a given variable?  My use case is I am marking a contract as being in-process for updating and setting a modifier flag; I'd like to prevent reading the contract state while it's updating, restricted by this modifier.

I understand I could create my own getter, but then I am returning a tuple with no keys.  When I access one of the structs via the auto-generated getter via web3 for a mapping at a specific mapping key (of the form mapping(uint => SomeStruct), I get the SomeStruct instance along with the struct keys, which is nice but unexpected, since I'm not using the ABIEncoderV2 experimental encoder.  I'd like to keep the ability to return this object, which as I've stated I don't think is possible if I define  my own getter, without the experimental encoder.


texts:
I am currently playing around with IPFS in a docker container. I am able to send HTTP requests to the API using curl. I created a small text file with some text. I would like to add the file with the content to the node and retrieve it afterwards.

So I did:

curl -F file=test.txt http://localhost:5001/api/v0/add

and received the response

{"Name":"QmYregh1mU7otV4s37hXLKnJ2fk2e8yFbJmU9L9cM6yrQM",
 "Hash":"QmYregh1mU7otV4s37hXLKnJ2fk2e8yFbJmU9L9cM6yrQM",
"Size":"16"}

Now I would like to read the file with and save it on my local machine. I used

 curl http://localhost:5001/api/v0/cat?arg=QmYregh1mU7otV4s37hXLKnJ2fk2e8yFbJmU9L9cM6yrQM

to retrieve the file. The response is

test.txt

My question is now: How do I get the content of the file?


texts: Is transaction written into block even if it failed?

texts:
According to economic incentive, gasPrice and gasLimit is required for every transaction and total transaction fee is gasPrice * gasLimit. If the transaction failed to be validated or out of gas, the transaction will not be written into block and gasPrice * gasLimit is wasted.

Here are my questions:
1. If the the transaction failed, is the error information or something saved in the chain? If not, where the transfer that gas to miners recorded? If yes, how can I get the kind of error information?
2. If the transaction is signed with incorrect private key, it should be found in the first place when node processes the transaction. Will total or part of transaction fee(gasLimit * gasPrice) costed in this scenario?


texts: web3: getPastEvents works in Truffle on instance, not in web3 script on page

texts:
I am looking to collect the previously logged events of a certain type using getPastEvents. It does not seem to work in my web3 script on my site but it does work in truffle console on a deployed instance. I am using this code:

myContract.getPastEvents('depositTx', {
      fromBlock: 0,
      toBlock: 'latest'
    }, function(error, result) {
      if (!error) {
        console.log(result);
      } else {
        console.log(error);
      }
});

When I create a myContract instance in truffle console it works (e.g. let myContract = await contractName.deployed()) but when I try to run this on my web3 script where I have set the contract using address and ABI it does not (other method calls work fine).

Any thoughts?


texts: Solving forwarding issue in smart-contract deployment

texts:
I've tried to create a smart-contract that automatically forwards incoming transaction to parent address. The issue there is gas amount since I've failed to create a function that pays for gas from the incoming transaction ether. Received ether are sent straight to parenr address, gas is paid from received ether.
My code now:

  pragma solidity ^0.4.21;

   contract Forward {
       address public receiver;

// Constructor, pass the address of the account you want this contract
// to forward any incoming ether to.
function Forward(address _receiver) {
    receiver = _receiver;
}

function() public payable {
    // Forward the received ether to receiver, as well as some gas,
    // which the receiver can use to run code
    // If something goes wrong, the ether is sent back
    require(receiver.call.gas(gasleft() - 2000).value(msg.value)());
}
}


texts: Question: Mining Rewards and Uncle Rates

texts: Looking at https://etherscan.io/chart/uncles we can see that uncle rates are on the rise lately. Recently every day more than 3000 ETH is awarded in uncle rewards. How does this situation affect mining rewards? Lets assume that miner gets all the rewards i.e transactions + 3 ETH block reward + uncle rewards. As I understand high uncle rates should increase miner rewards (more ETH is granted to miner from the network, hence larger average block reward), however, http://whattomine.com/coins/151-eth-ethash states that current reward is 2.91 ETH, on which they comment "Reduced due to uncles lowered reward". Where is the truth? Are miners getting more or less than 3 ETH block reward due to uncles? When uncles percentage rises do mining rewards rise or fall with it?


texts: Is there a way to deploy a contract using bytecode only (to Ropsten ...)?

texts:
One solution on medium.com describes how to do that via myetherwallet but it's the old verion of myetherwallet where you can switch between ropsten/mainnet - right now I can't find how to switch to ropsten...

I've deployed on ropsten with both remix and truffle but both required .sol solidity sourcecode and not bytecode? Thanx!


texts: How to find out how many blocks left to sync?

texts: When syncing with geth, how do you know how many blocks are left to be fully in sync?


texts: Is it possible send from multiaddress using single transaction without contract?

texts:
Is it possible send from multiaddress using single transaction without Smart contract?

I have read somewhere, using https://wiki.parity.io/JSONRPC-eth-module#eth_signtransaction (signTransaction) you can create multiple address to send single transaction. But I m not aware about it. Can you help me on it?


texts: get statistics by event filters or normal blockchain traversal

texts: I want to ask what's the better approach among the following two: Filter events using address.eventFilter function or traversing the local blockchain block by block and getting events statistics. I suppose in the former approach we need the contract abi, so what if we can't find the contract's abi? Are all contracts' abis available?


texts: How do miners choose which transactions to include in a block?

texts: If I'm running a private chain with a block gasLimit: 100 and if I initiate 60 transactions, all with an equal gas value of 2, I assume only 50 transactions will be placed in the current block. If all the transactions reach the miner at the same time, which 50 of these 60 transactions will be added to the current block? Is there any guarantee that the remaining 10 transactions in the queue will be added to the immediate next block? How are queues managed?


texts:
I'm learning solidity right now and making a dApp where users get paid to perform actions. Actions are paid based on certain criteria.

Since I can't schedule a cron job on ethereum, I can only pay users when the user trigger some function.

Therefore when the user triggers this 'claimPayment' function, he might have say an array of 10 unpaid actions, of which any number between 0-10 are payable. For our purposes let's say 4 are payable.

I'm wondering what is the most efficient way to replace the old array of 10 unpaid actions with the new array of 6 unpaid actions.

Is it more efficient to create 6 unpaid actions in memory and replace the prior variable? Or is it better to delete at specific indices and then move everything left?

Note by efficient i mean the way that will cost the least gas

Example of option 1:

mapping(address => UnpaidAction[]) unpaidActions;

function claimPayment() public returns (bool){
        uint arrayLength = unpaidActions[msg.sender].length;
        if (arrayLength != 0) {

            UnpaidAction[] memory stillUnpaid;
            uint offset = 0;
            for (uint i = 0; i < arrayLength; i++) {

                if (/*some criteria is met then we pay user*/) {
                    ...
                } else {
                    // criteria not met add it to our temporary array
                    stillUnpaid[offset] = unpaidActions[msg.sender][i];
                    offset += 1;
                }
            }

            // done everything let's replace our storage variable
            unpaidActions[msg.sender] = stillUnpaid
        }

        return true;
    }

Example of option 2

function claimPayment() public returns (bool){
        uint arrayLength = unpaidActions[msg.sender].length;
        if (arrayLength != 0) {

            for (uint i = 0; i < arrayLength; i++) {

                if (/*some criteria is met we pay user and delete index*/) {

                    balances[msg.sender] += 100

                    // delete
                    delete unpaidActions[msg.sender][i]

                }
            }

            // now run a second for loop and move everything left

            uint offset = 0;
            for (uint i = 0; i < arrayLength; i++) {
                if (offset > 0) {
                    unpaidActions[msg.sender][i - offset] = unpaidActions[msg.sender][i]
                }

                // check if this element has been deleted
                if (unpaidActions[msg.sender][i].someIntVar == 0) {
                    offset +=1;
                }
            }
            unpaidActions[msg.sender][i].length -= offset
        }

        return true;
    }

Edit

enum ActionType { /* many action types here*/ }
struct UnpaidAction {
    ActionType actionType;
    string description;
    uint createdAt;
}


texts:
I just started mining and everything seems fine but I don't know how to link my current geth account to a wallet. I've tried this:

How to import a plain private key into geth or Mist? and it looked like it worked but there isn't any ether on it.


texts:
I can keccak strings to construct the leaves of a Merkle tree, for example, ['a', 'b', 'c']. But what's the recommended approach to constructing objects instead of merely 'a'? Let's say:
{
    address: "0x123",
    token: "0x456",
    amount: "15000000000000000000"
}

In Solidity, to verify that the object exists in the tree, a leaf would be constructed via bytes32 leaf = keccak256(abi.encodePacked(address, token, amount)) and that leaf would be verified along with the proof and root. How would you recommend constructing the above object as a leaf?
Can a leaf be constructed simply with web3.utils.soliditySha3(param1 [, param2, ...])? So if...
const hash0 = web3.utils.soliditySha3(address0, token0, amount0);
const hash1 = web3.utils.soliditySha3(address1, token1, amount1);
const leaves = [hash0, hash1]
const tree = new MerkleTree(leaves, keccak)
const proof = tree.getProof(hash0)

...would leaves[0] (hash0) in JS match keccak256(abi.encodePacked(address0, token0, amount0)) in Solidity?
Also, is this the right approach to adding objects to a Merkle tree, and what Merkle library would you recommend?


texts: How many accounts can a geth node hold/have? Any upper bound limits

texts: How many accounts can a geth node hold/have? Are there any upper bound limits?


texts: How to store small database, editable data on blockchain accessible by smart contract?

texts:
New to blockchain and smart contracts. Been doing research and I realize I can't update my transaction smart contract. Is it possible to store database data  as an entry to the ledger or in another smart contract that only I update that the transaction smart contract can access to pull the data?

For example

User wants to make a donation payment to an organization.  His wallet needs to pull in all possible organizations for him to choose from a database which I would like to be decentralized.

Where can I store the organizations and their wallet address as well as update them or remove them?  Also I want to add subsections of an organization and its address.

For example

User wallet pulls in:

Hospital, address
Hospital, lab, address,
Hospital, ER, address
Fire department, address
Fire department, equipment fund, address
Fire department, supplies fund, address
Etc.

I would read the only one  adding organizations and removing them . Is there a way to do this all decentralized inside the blockchain?

Chris


texts: Unable to call event using web3.js and infura

texts:
My event call is

event AmountChanged(address indexed purchaser,  uint256 value);

My function in solidity

function () external payable {
    uint256  amountinwei = msg.value;
    AmountChanged(msg.sender, msg.value);
}

When i am calling it through web3

contractinstance.AmountChanged({}, {fromBlock: 0, toBlock: 'latest'}).watch(function(err, result){
    console.log(result);
    console.log(err);
});

I am getting error ----

Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/Volumes/Macintosh HD 2 2/MorpheusApiGit/WebServices/Node-API-Morpho/node_modules/web3/lib/web3/errors.js:38:16)
    at XMLHttpRequest.request.onreadystatechange (/Volumes/Macintosh HD 2 2/MorpheusApiGit/WebServices/Node-API-Morpho/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/Volumes/Macintosh HD 2 2/MorpheusApiGit/WebServices/Node-API-Morpho/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/Volumes/Macintosh HD 2 2/MorpheusApiGit/WebServices/Node-API-Morpho/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (/Volumes/Macintosh HD 2 2/MorpheusApiGit/WebServices/Node-API-Morpho/node_modules/xhr2/lib/xhr2.js:509:12)
    at IncomingMessage.<anonymous> (/Volumes/Macintosh HD2 2/MorpheusApiGit/WebServices/Node-API-Morpho/node_modules/xhr2/lib/xhr2.js:469:24)
    at IncomingMessage.emit (events.js:164:20)
    at endReadableNT (_stream_readable.js:1054:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

using web3@0.19.1
web3.providers.HttpProvider("https://rinkeby.infura.io/")

Thanks in advanced


texts: HELP to set up a private net with 3 nodes on the same machine or 3 different VM linux

texts:
i'm looking for a way to set up 3 node on a private net with Ethereum. I'm using Go as a Client .

I Hope you can help me


texts: What client does MetaMask use on the back-end?

texts: How does MetaMask itself connect to the network? Do they use geth or parity?


texts: How do I use the proof of work function given in here: https://www.ethereum.org/token#proof-of-work?

texts:
I am creating a cryptocurrency contract, which rewards the miner a proof of work generated. To get the reward you will need to call proofOfWork(uint nonce). If the nonce is correct, the miner is awarded.

I am calling this function at the end of each function, and planning to generate a random nonce which is passed as an argument for the function call. If the nonce is correct transaction is carried out and miner awarded. Else the execution is thrown.

How do I generate this random nonce? And is it the way you carry out proof of work? If not then, how do I use this function?

I am following the guide https://www.ethereum.org/token#proof-of-work .


texts: Why processed block greater than current block height for rinkeby network for running a full node?

texts:
I am trying to run a full node on rinkeby network
using command

  geth --rinkeby

but , I cannot figure out why the processed block size [2382419] is greater than the current block height which was [1624447]  while writing this post on https://rinkeby.etherscan.io/blocks

I have attached a screen shot


texts:
I'm trying to initialize web3j with following code:

Web3j web3 = Web3j.build(new HttpService());  // defaults to http://localhost:8545/
Web3ClientVersion web3ClientVersion = null;
try {
    web3ClientVersion = web3.web3ClientVersion().sendAsync().get();
} catch (InterruptedException e) {
    e.printStackTrace();
} catch (ExecutionException e) {
    e.printStackTrace();
}
String clientVersion = web3ClientVersion.getWeb3ClientVersion();

Also I've added as per manual dependency

compile ('org.web3j:core-android:2.2.1')

But android studio refuses to compile that.It says cannot resolve method


texts: Is it possible to work with stable coin currency in Ethereum smart contracts using solidity?

texts:
I know in solidity you can use identifiers like ether and wei. For example, I can do something like
if (msg.value == 1 ether) {
   //do something
}

Is it possible for me to use stable coins as a type definition? I'm asking this because I want all of the escrow to be in terms of a stable currency.
I'm specifically trying to work with ethereum smart contracts, but I'm new to smart contracts, though I coded some in only ethereum.


texts:
I always having issue with sending token. when I send token even transaction get confirm, the token remain in my wallet and I lost only ether on fees!
what wrong with ethereum!


texts: Smart contract to buy/sell ETH/ERCToken for backed token and fee on each transaction

texts:
I did quite a lot of research to find something like this with no success.
I would like to create a smart contract that allows any token to be backed by ETH. The user can buy the token directly by sending ETH and a 1% fee goes to a third address. Anytime, he can send back the token and receive the ETH, again the fee is involved in this transaction too.
It should be possible to modify the list of tokens accepted.
The exchange rate ETH/Token for each accepted token can be modified too.


texts: calling a payable function sending a custom amount

texts:
Lets supose i got a contract named Contract (already an instance).
And this contract got a method/function named function with the payable clause.

This method gets the address of the caller and the amount paid to do some stuff.

I've tried calling it by: Contract.function.value(x)(arguments) but it throws me TypeError: 'value' is not a function.

How can i call this contract and send (as example) 5 ether to this function?

Thank you.


texts:
How do I get all my wallet balance？
I already have a very large number of wallet addresses, and I need to know the balance.and I want to know the number of addresses


texts: Using debug_traceTransaction with geth in light sync mode

texts:
Is it possible to use debug_traceTransaction with geth in light sync mode?

I'm doing this:

docker run -it -p 8545:8545 -p 30303:30303 ethereum/client-go --rpcapi debug,eth,web3,net --rpc --rpcaddr "0.0.0.0" --syncmode light

and then using truffle debug with a transaction in the mainnet. I get this error:

WARN [03-06|19:13:00.036] Served debug_traceTransaction            conn=172.17.0.1:59382 reqid=1583521980033 t=14.206µs err="the method debug_traceTransaction does not exist/is not available"

Notice that other debug_* methods do work, for example debug_gcStats.


texts: EOS transaction using MetaMask went wrong. Is it possible to verify transaction within blockchain?

texts:
Yesterday I traded 2 ETH on eos.io using MetaMask. I got most of the way through the transaction and was offered the EOS tokens I bought.  I got to the point of the transaction where I had to generate a public/private key and register.  Complications and my unfamiliarity with the micropayment on the blockchain (within the MetaMask app) caused the transaction to fail and I lost the ability to see the EOS I was given.  Basically, in two attempts I was able to generate two sets of public/private keys, but was not successful in registering.  I am afraid that the EOS I purchased are no longer available to me.

I took a number of documenting screen shots of the transaction so I would have as much record as possible, including the exact time and date of the transaction and various addresses and numbers.

Is there any blockchain process by which I can still prove I purchased these EOS tokens and get them back?

I would gladly pay for someone to assist me in this and with a future EOS transaction I want to do without error.
Can someone please help?

Thanks

DS Ramirez


texts: ERC20 transfer - caller expects return but none provided - what happens?

texts:
If someone implements the ERC20 transfer() function without the return value as follows:

function transfer(address to, uint256 value) public {
    require( ... usual checks ... );
    balances_[msg.sender] -= value;
    balances_[to] += value;

    emit Transfer(to, value);
}

But a calling contract expects the return value:

  function transfer(address to, uint256 value) public returns (bool)

and calls the function somehow like:

ERC20 token = (ERC20)someaddress;
if (!token.transfer(to,amt)) { ... }

Assuming someaddress is correct, what happens?

I imagine that the transfer function would run ok but return nothing, causing the caller to receive a false. The balances would be updated and an event would be emitted.

Am I correct? Would the call fail? Some exception?

Thanks!


texts: Pending transactions removed from txpool in geth

texts:
We have been working on load-testing our private blockchain network using geth and Web3j. The transactions are sent using Web3j.

We send 100 transactions, where every block has space for about 25 of them (Because of gas limit). When transactions are received on our local node, this is printed:

TRACE[07-26|10:15:53] Pooled new future transaction            hash=20453e…f2ec96 from=0x992a03b1bb4cc56929f2d21eaf34779d0562c9a7 to=0x32f1e2e74122efd01bd666750c5afc18c4ce3f91
TRACE[07-26|10:15:53] Promoting queued transaction             hash=20453e…f2ec96
INFO [07-26|10:15:53] Submitted transaction                    fullhash=0x20453ef67cba4d3549603f7a0bc0505d170a8fc2adeac849dc1a8c2fa3f2ec96 recipient=0x32f1e2e74122efd01bd666750c5afc18c4ce3f91
TRACE[07-26|10:15:53] Broadcast transaction                    hash=20453e…f2ec96 recipients=2
DEBUG[07-26|10:15:54] Transaction pool status report           executable=43 queued=0 stales=9

When all transactions are sent, our local nodes transactionpool is txpool.status:

{
  pending: 100,
  queued: 0
}

We then start to mine on out local node.

INFO [07-26|10:20:41] Starting mining operation
TRACE[07-26|10:20:41] Gas limit exceeded for current block     sender=0x992a03b1bb4cc56929f2d21eaf34779d0562c9a7
INFO [07-26|10:20:41] Commit new mining work                   number=8383 txs=25 uncles=0 elapsed=18.063ms
TRACE[07-26|10:20:41] Started ethash search for new nonces     miner=0 seed=4567440808604611913
DEBUG[07-26|10:20:42] Transaction pool status report           executable=100 queued=0 stales=8
TRACE[07-26|10:20:48] Ethash nonce found and reported          miner=0 attempts=313611  nonce=4567440808604925524
INFO [07-26|10:20:48] Successfully sealed new block            number=8383 hash=774d72…ba62fc
DEBUG[07-26|10:20:48] Trie cache stats after commit            misses=11 unloads=2
INFO [07-26|10:20:48]  block reached canonical chain          number=8378 hash=81b120…f0867f
INFO [07-26|10:20:48]  mined potential block                  number=8383 hash=774d72…ba62fc
TRACE[07-26|10:20:48] Transaction failed, will be removed      hash=05c537…979f0b err="invalid nonce: have 731, expected 756"
INFO [07-26|10:20:48] Commit new mining work                   number=8384 txs=0  uncles=0 elapsed=957.166µs
TRACE[07-26|10:20:48] Propagated block                         hash=774d72…ba62fc recipients=1 duration=2562047h47m16.854s
TRACE[07-26|10:20:48] Announced block                          hash=774d72…ba62fc recipients=2 duration=2562047h47m16.8

After mining one block with 25 transactions, our txpool is now empty

{
  pending: 0,
  queued: 0
}

Only 25 of the total 100 transactions were mined, and the rest were deleted (they seem to be declared as old pending transactions). My question is then. Is this the intended behavior, or are we missing something? If it is intentional, does anyone have tips for how to solve sending multiple transactions from the same address and node?

EDIT:

We created a supervisor to check for confirmed transaction, and attempt to resend the transactions if they were lost. When resending the transactions, we receive the error:

-32000 know transaction: transaction_hash

However, when manually sending eth.getTransactionReciept(transaction_hash), null is returned.

Where is known transactions stored, and why are they not mined? (They are not in txpool)


texts:
If I write a Ethereum contract something like this (taken from https://solidity.readthedocs.io/en/develop/introduction-to-smart-contracts.html)

pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function set(uint x) {
    storedData = x;
}

function get() constant returns (uint) {
    return storedData;
} }

if someone called the "set" operation, would it be executed 30 time ( assuming 30 nodes are supporting blockchain, at that point in time). Appreciate confirmation one way or other.
( I know similary question is already been asked, though that is not very clear for me atleast, neither I am able to add comment to that question, hence creating new one)


texts: Is it legal to trade between markets when there are market inefficiencies?

texts:
Are there regulations or rules that prevent me from writing a program that profits from arbitrage?

For example: Coinbase may be selling ETH for $99 and Kraken $90 which provides an outstanding opportunity for arbitrage profits of around 10% by buying on Kraken and immediately selling on Coinbase.


texts:
I am trying to connect geth to a private blockchain running parity nodes and I don't know how.  Some of my research leads me to this page:
how to connect "Kovan" or "Rinkeby" from geth

They mention the "--chain" option.  But I don't see that option here:
https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options

Can anyone tell me what --chain is?  Can anyone tell me if that is the same as the genesis file?

Thank you.


texts: Implementing validator contract on existing PoA chain

texts:
I'm running a private PoA chain with a height of around 700,000 blocks.

I initialised the chain with two signer addresses included in the genesis file to get things started. Since then we've added further validator nodes through clique.propose(<address>, true) but as the chain scales up I'd like to move to having a validator contract similar to those found here so we can control signer approval from a central admin point.

Rather than starting a new chain with the validator contract approved to sign from block 0, how can I implement the new contract into the current chain and avoid losing the data we've generated to date?


texts:
browser/myadvancetoken.sol:191:7: TypeError: Referenced declaration is
  neither modifier nor base class.
      ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
        ^-----------------------------------------------^

/* Initializes contract with initial supply tokens to the creator of the contract */
    function constructor(
        uint256 initialSupply,
        string tokenName,
        string tokenSymbol
    ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}


texts: What is the proposed ETH 2.0 staking reward and minimum / maximum stake one can put on a node?

texts:
There are 80+ million ethereum. A staking node requires only 32 eth to stake. If even just 25% of the 80 million started to stake, that would create 625,000 staking nodes. If the reward is 1 eth per minute and split among even just 100,000 nodes. Its not worth it to stake anymore. What is the proposed staking reward per block?

And is there a min and max of how much a user can put in a ethereum staking node?


texts: Difference between contract.new and contract.deployed functions

texts:
I have create a basic truffle project and i am writing automated tests.
There is 2 ways to instantiate the smartcontract to test and i want to understand the difference between this 2 ways:
const SimpleStorage = artifacts.require("./SimpleStorage.sol");
contract("SimpleStorage", accounts => {

  beforeEach( async () => {
     // Way 1:
     this.instance = await SimpleStorage.new({ from: accounts[0] });

     // Way 2:
     this.instance = await SimpleStorage.deployed();
  });

It works in both cases but i want to understand the differences between new and deployed
Thanks


texts: Function does not return value on ropsten

texts:
This code returns the address perfectly when i run it on ganache local chain but when i run this on ropsten it just returns a "-"

Any idea on what the problem is?

function newMatch(uint _matchId,uint _noOfGames,uint _oddsOfA, uint _oddsOfB) public returns(address newContract)
      {
        Match c = new Match(_matchId,_noOfGames,_oddsOfA,_oddsOfB);
        matchTracker[_matchId] = addr;
        count++;
        return address(c);
      }


texts: Which function of this contract makes it impossible to sell the tokens?

texts:
this is the contract:
https://bscscan.com/address/0xa05d9b4f558a96efd5d976007e03d6a705c3da73#code
I thought it was
function () external payable {
revert();
But i saw another token with this same function and it could be sold normally. So, on this contract above, which function does it ?


texts: Will contract selfdestruct also return tokens?

texts: If I have tokens assigned to a smart contract, will "killing" the contract send leftover tokens to the owner of the contract? I know that remaining Ether stored in the contract is sent to owner in selfdestruct(owner), but what about tokens that are stored in the contract? It looks like I would have to manually right a function to disperse remaining tokens before self destruct, correct??


texts: Disable block mining reward in private testnet

texts: Is there a way I can disable the generation of block reward in a private network during creation? Any parameter in genesis.json can do so?


texts: How do i know if an account is unlocked in geth

texts:
Is there any API available to check whether an account is locked/unlocked in geth ? If i try to unlock an account that is already in unlocked state, does geth look out for the cached decrypted key , instead of decrypting  each time ?

Also what if there are concurrent requests for unlocking of the same account (which is initially locked) ? Can this result in out of Memory error ?


texts: Is there a way to test already deployed solidity contracts with truffle?

texts: Lets say I have many contracts that are already deployed and I don't want to re-deploy them (using testrpc), can I still test them with truffle?


texts: How to change block generation period？in POA private ethereum blockchain


texts: How can import one contract functions in solidity

texts:
Looking at the solidity documentation i don´t find a date type. Searching in the web I find a GitHub repo that appear one contract that give the posibility to work with date.

https://github.com/pipermerriam/ethereum-datetime/blob/master/contracts/DateTime.sol

My problem is that I don´t know how can import one contract inside other contract. Any help??


texts: Two ERC721 tokens that refer to the same metadata

texts:
This is a question about the ERC721 interface. I understand that the tokens are non-fungible and guaranteed to be unique to a specific account (owner).

One possible way to use ERC721 tokens would be to uniquely represent real-world assets.

I understand that there is also an ERC721Metadata contract that implements a token URI function which could point you to an image for example or some metadata that uniquely identifies the underlying asset, or it could be an IPFS address where some information is stored.

/**
  * @dev Returns an URI for a given token ID
  * Throws if the token ID does not exist. May return an empty string.
  * @param tokenId uint256 ID of the token to query
 */
 function tokenURI(uint256 tokenId) public view returns (string) {
    require(_exists(tokenId));
    return _tokenURIs[tokenId];
 }

What would happen if two ERC721 tokens were minted and referenced the same token URI or metadata about the same asset? Couldn't this be a problem and is there a solution?

I suppose there could be some mechanism that relies on consensus (maybe an oracle?) to resolve any disputes that arise from duplication like this, at least for certain use cases, just wondering if this is formalized at all.

EDIT -

A better way to phrase this question might be: if it was necessary to prevent a many-to-one relationship between different ERC721 tokens and the same physical thing, how could this be achieved, or are there existing real world examples where this is a problem that has been solved?

I'm taking for granted that the requirement is necessary for someone as part of the thought experiment or question. If you needed to be able to reason about the cardinality of physical things or metadata about things, relative to ERC721 tokens when using the ERC721 standard, you might need to solve this problem.


texts: Can you use biconomy or GSN to pay for gas when deploying a contract?

texts:
I'm building a small dapp to allow users to deploy smart contracts without needed gas, where I'll use GSN or biconomy.
I'm not sure you can use meta-transaction services like these for transactions like this, since what I'm gathering on their website is you have to have a smart contract in play.
I'd just like to know 1. if this is possible to use gasless for gassless txns, and 2. an overview of what the structure I'd need in place to be / what the flow would be.


texts: Newbie question: how to add block, add transaction and search transaction in blockchain

texts:
I am new to this. I wanted to know, how i can add block, add transaction and search for transaction in blockchain?
Thanks.


texts: Why is this random algorithm not good enough?

texts:
Many lotteries on Ethereum use random algorithms to determine a 'winner'. For instance, this function is bad because has some vulnerabilities (read here about some):

function random() private view returns (uint){
/// players is an array of lottery participants
        return uint(keccak256(abi.encodePacked(block.difficulty, now, players)));
    }

I have three possible solutions to this issue and I would like to know if they are vulnerable.

Solution 1)

Instead of using the array of participants, could we use a SecretKey?

Basically the lottery entry function would be put in pause and a SecretKey would be determined by a server-side random algorithm which will be passed to smart contract and call the random function. Our function becomes:

function random() private view returns (uint){
        return uint(keccak256(abi.encodePacked(block.difficulty, now, SecretKey)));
    }

Solution 2)

Could we use now or block.difficulty and two secret keys instead? Would that improve it further?

Solution 3)

I can use an Oraclize API and generate random numbers using a centralized service.


texts: not able to mine transactions generated on remote node

texts:
i have connected two nodes locally on my private testnet using admin.addPeer()

I0829 16:33:25.280649 eth/downloader/downloader.go:320] Block synchronisation started
I0829 16:33:27.187839 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ig
nored) including 1 txs in 5.0005ms. #1 [5992ca33 / 5992ca33]
I0829 16:33:27.194840 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ig
nored) including 0 txs in 4.0004ms. #2 [a7d03425 / a7d03425]
I0829 16:33:27.201841 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ig
nored) including 0 txs in 4.0004ms. #3 [c830dc48 / c830dc48]
I0829 16:38:10.295147 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ig
nored) including 1 txs in 7.0007ms. #4 [0b5dda9b / 0b5dda9b]

I0829 16:41:26.715787 eth/api.go:1193] Tx(0x8dc736b5ad28770506e917d0edba187fa0cb
e2e62c1e71129f061e2789731f82) to: 0xfb02474300b1dc625a6cc19cc10e7ac963183695
"0x8dc736b5ad28770506e917d0edba187fa0cbe2e62c1e71129f061e2789731f82"

> I0829 16:41:56.317747 core/blockchain.go:964] imported 1 block(s) (0 queued 0
ignored) including 0 txs in 5.0005ms. #7 [9744d1d6 / 9744d1d6]
I0829 16:41:58.201936 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ig
nored) including 0 txs in 5.0005ms. #8 [81d0a6a4 / 81d0a6a4]
I0829 16:42:01.574273 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ig
nored) including 0 txs in 5.0005ms. #9 [19fd5783 / 19fd5783]

> eth.pendingTransactions
[{
blockHash: null,
blockNumber: null,
from: "0x076dba93600dbbc8928b02af47b14465a4274b62",
gas: 90000,
gasPrice: 20465684346,
hash: "0x8dc736b5ad28770506e917d0edba187fa0cbe2e62c1e71129f061e2789731f82",
input: "0xd7bb99ba",
nonce: 0,
to: "0xfb02474300b1dc625a6cc19cc10e7ac963183695",
transactionIndex: null,
value: 300
}]

the two have synchronised well. yet when i try to mine on first node the transaction generated on node 2 then the transaction is always in the pending mode. the transaction does not get mined. what should be done to avoid this?


texts: How safe are online private key and seed generators?

texts:
Recent news from IOTA wallets:

  Just two days ago, many users reported having their funds (an estimated $4 million) in their IOTA wallets stolen from an unknown source. The cause? Online seed generators.

Please, explain me, how to understand that there is enough randomness in online private key/seed generator? Is it safe to use MyEtherWallet or Ian Coleman's Mnemonic Code Converter for this purpose?


texts: Trying to find my address on iancoleman.io

texts: I didn't log my private key for my metamask wallet but have my secret phrase. After some searching I found online that I can visit iancoleman.io enter my phrase and when i locate my address, the private key will be listed. But I can't locate my address. I identified the right coin and am using bip 44 but i've looked through 10k addresses and haven't found mine. Is there a way to search by address?


texts: Limit the amount of times a smart contract can receive ether

texts:
How would I set a limit to the amount of people who could send ether to a contract?
I can't find anything on google or youtube.
Ideally the contract would stop taking inputs after 2(or however many) different people have sent an amount.

Below is simple code from https://solidity-by-example.org/sending-ether/ for sending ether to an address, but i'm not sure what I would do. I'm using remix and running it with ganache on my machine.
Is it possible to make it read-only after X transactions?

https://github.com/CrazybutSolid/ethereum-lottery/blob/master/contracts/lottery.sol has a kind of similar example but it seems too complicated and I'm still a noob.

pragma solidity ^0.5.16;

contract Receive {

    function () external payable {}

    function getBalance() public view returns (uint) {
        return address(this).balance;
    }
}

contract Send {

    function sendViaCall(address payable _to) public payable {

        (bool sent, bytes memory data) = _to.call.value(msg.value)("");
        require(sent, "Failed to send Ether");
    }
}

Thank you


texts:
I'm looking for a detailed explanation (video would be the best) how and when transaction is being mined on Ethereum network (in theory), since the moment it's created with web3.eth.sendTransaction().

To be more specific:
Assumptions: time to mine Ethereum block = 16s.
If block no. 99 was started to be mined at t=0, and finished mined at t=16, block 100 started at t=16 and is still being mined and I'm creating the transaction (t=17) and it's in pendingTransactions pool.

When transaction is being chosen to be included in the block? (I know that gas and gasPrice are being key factors and I'm aware that gas block limit exist), but I'm looking for graphical explanation (let's assume that gasPrice is quite high 700 Gwei).
What are possible scenarios?

Will transaction be included in block 101?
Can it be still included in block 100 if one of the miners didn't start to mine block 100?
If it's mined in blocked 101, will the rest of the network know about transaction in block 102, once it's at least confirmed one time?

I've being looking for answers to my questions and found many related topics, read about gas, gasPrice, GHOTS protocol, but this still seems not entirely clear to me.

Thanks!


texts: How to sign a smart contract deployment transaction?

texts:
I have a question related to smart contract deployment and wallets. Since I am new to the Ethereum blockchain world, I want to get an insight on how it actually works and write down what a developer needs to do in order to deploy a smart contract on the ethereum blockchain.
So, I have written a simple smart contract on Remix IDE, then it was compiled, and now I want to deploy this to the Ethereum blockchain. Since I have MetaMask running on my browser, I can select on Remix IDE "Injected Web3" and this will automatically read my account and then I can deploy it.
So, I understand that once I have MetaMask running, my account will be autopopulated in the account field, and then I can sign the transaction.

What I don't understand though, is in case of a desktop or mobile wallet, how should the developer sign the transaction of smart contract creation on the blockchain? (since there is no an automatically pop-up in the browser like MetaMask)


texts: Usage of Float Numbers in Smart contract

texts: I am not able to store and retrieve some values of Float types from smart contract. I am about to store the values of IP Address, Geo-location, Mac address etc.. which all are of float types. I know float types are not currently supported in solidity, is there any work around for the same !


texts: Ubuntu Mining RX570 4GB Claymore amd-gpu pro low hashrate

texts:
I've been able to get a much higher hashrate on other systems. These are the steps I've taken so far, getting ~ 17Mh/s.

Description:    Ubuntu 17.10
Kernel: 4.13.0-36-generic

Install amdgpu-pro-17.40-492261 (used the --compute flag. This is the only way my machine will boot)
Flashed the BIOS (BIOS was found online)
atiflash -p -f 0 Anoraks_Sapphire RX 570 Pulse 4GB Hynix Elpida_memshift-1500.rom
Ran this for OC
sudo bash -c 'echo 5 > /sys/class/drm/card1/device/pp_sclk_od'
sudo bash -c 'echo 15 > /sys/class/drm/card1/device/pp_mclk_od'
Claymore flags: -epsw x -mode 1 -ftime 10 -asm 1 -etha 0

I've also tried a kernel 'pre spectre meltdown' with no effect. Any help or advice would be much appreciated :) will send some ETH for a solution!

Update: I have noticed the SCLK & VDDC fluctuating while mining. Power goes from 95W to 105W and SCLK goes from 988Mhz to 1070Mhz...

Changing to Ubuntu 16.04 and Kernel 4.10 does not do anything.


texts: Where is storaged the publickey for any account?

texts:
I have been reading the Ethereum Yellow paperthat for any account there are four parameters:

nonce
balance
storageRoot
codeHash

A transaction is signed using three parameters: r,s,v

According to the ECDSA paper of The Elliptic Curve Digital Signature Algorithm (ECDSA)(https://web.archive.org/web/20170921160141/http://cs.ucsb.edu/~koc/ccs130h/notes/ecdsa-cert.pdf) for a sign verification

Domain parameters:
      - p,q curve generator
      - g generator of the finite field
Public key: y
Signature: r,s
Message: m

I know that v is used for checking the parity and finitness of the point r[Appendix F from yellow paper), but for ECRECOVER I think that at least, g needs to be provided.

I can't find any information about this.

If you have some documentation about this, please let me know!


texts: Truffle migration script does not make transaction

texts:
Please look at my simple example below. Is migration script 3 being executed, such that it sets the value on the blockchain -- I think not, because there is no speak about a txHash or cost...

How to make truffle do a transaction for migration script 3.

contracts/Test.sol

pragma solidity 0.5.8;

contract Test {

    uint256 c;

    function read() public view returns ( uint256 ) {
      return c;
    }

    function write( uint256 _c ) public {
      c = _c;
    }
}

Migrations scripts

$ cat migrations/1_initial_migration.js
const Migrations = artifacts.require("Migrations");

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

$ cat migrations/2_deploy_contracts.js
var Test = artifacts.require("Test");

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

$ cat migrations/3_set.js
var Test = artifacts.require("Test");

module.exports = function(deployer) {

  Test.deployed().then( t => {
    t.write(1)
  })

};

Truffle output

truffle migrate --network goerli

Compiling your contracts...
===========================
> Compiling ./contracts/Test.sol
> Artifacts written to test_sc/build/contracts
> Compiled successfully using:
   - solc: 0.5.8+commit.23d335f2.Emscripten.clang

Starting migrations...
======================
> Network name:    'goerli'
> Network id:      5
> Block gas limit: 0x7a1200

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
   > transaction hash:    0x778fd1772305c7425141ed0bd871e59c5c95ea07ac3e608dd40c7bdb30d8b3e1
   > Blocks: 0            Seconds: 12
   > contract address:    0x44f40AAFF065A1bAf4d9Dd204e22B5C419F1DC8f
   > block number:        1210809
   > block timestamp:     1567180517
   > account:             0x1ae222dCbEEC5c581F44d8bCC87e74fcfAB083Cb
   > balance:             0.063013755
   > gas used:            261393
   > gas price:           5 gwei
   > value sent:          0 ETH
   > total cost:          0.001306965 ETH

   Pausing for 2 confirmations...
   ------------------------------
   > confirmation number: 1 (block: 1210810)
   > confirmation number: 2 (block: 1210811)

   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:         0.001306965 ETH

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

   Deploying 'Test'
   ----------------
   > transaction hash:    0x2a1cd709be9eaf1fefba8382a3e6c0a825fca72555beca76b4acdf868556996d
   > Blocks: 0            Seconds: 12
   > contract address:    0x74BdaE85cC50E3554Ae16cC7d09a83dAe503Ca41
   > block number:        1210813
   > block timestamp:     1567180577
   > account:             0x1ae222dCbEEC5c581F44d8bCC87e74fcfAB083Cb
   > balance:             0.062278565
   > gas used:            105015
   > gas price:           5 gwei
   > value sent:          0 ETH
   > total cost:          0.000525075 ETH

   Pausing for 2 confirmations...
   ------------------------------
   > confirmation number: 1 (block: 1210814)
   > confirmation number: 2 (block: 1210815)

   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:         0.000525075 ETH

3_set.js
========

   > Saving migration to chain.
   -------------------------------------
   > Total cost:                   0 ETH

Look at that last line, didn't do it.


texts: How to mint coins on a private PoA network?

texts:
I have a PoA network and the balance went to zero after testing. How can I mint new coins?

I know the genesis file can define a balance, and also under PoW the miner rewards the account. But under PoA how are coins generated (actual command in geth)?


texts:
I am developing Tic-tac-toe game where players can play for ETH.
I created a smart contract where a player sends ETH and balances is updates, the player receives some life.

Then I thought when the player plays and win/lose I send a request to a server, and that server sends a transaction to smart contract.

Is that correct way of the implementation or usually developers use another approach?


texts: Best way to reclaim the disk space consumed by chaindata downloaded mist/geth?

texts:
When I tried out the wallet mist and geth, I wasn't aware of the --light option. Therefore the applications have downloaded the full chain to my local MacbookPro (macos).

It is now sitting at 45.5Gb.

I would like to be able to reclaim the space.

Here is my plan:

1) Shutdown the applications mist and geth

2) Remove all files under ~/Library/Ethereum/geth/chaindata/

3) Start geth with geth --light --rpc

4) Start mist with mist --rpc http://localhost:8545

Is this plan reasonable? Is there any potential pitfall?


texts: Location specifiers in solidity function parameters

texts:
I understand that I need to tell solidity where a parameter is located, for example a string:

function f(string memory abc) {...

Because a string could be calldata (passed in original method call) or it could be memory or it could be storage.

But this does not seem to be required for other types such as uint.

Why only string needs to be specified?


texts: Do you release an official Token on Ropsten Test Network or the Ethereum Main Network?

texts:
So I know this question might be really obvious but I seriously cannot find a single answer anywhere else. Let's say I finished making my token using Solidity in Remix and I want to put it out on the Ethereum network so that people can actually buy and sell my tokens. How do I go about this? Yes, I know that you have to go to wallet.ethereum.org and create a custom token, etc. But, do I create that custom token on a Ropsten Test Network or the Main Ethereum Network?

Or am I completely wrong and is there another "official" way of releasing a token that I made onto the network.

Thanks.


texts: migrating from one node private network to real-like multi node using Ganache-cli

texts:
I made a Dapp on a local node using ganache-cli as my eth blockcahin and i want to simulate a real main-net.

A real main-net  where i can connect with multiple nodes and these nodes share the mining process and get rewarded gas for doing so.
I admit maybe i am missing something, but i really need to get this.

Is there any way of doing so,


texts:
I have a smart contract for selling Painting in crowdsale, Once the Painting is sold in crowdsale the owner of the painting can trade it to other user once the crowdsale is over. I have to implement  a buy function where the buyer can buy the painting only if the seller has interest to sell it.The problem I am facing is that How can a buyer  know whether the seller  is  interested and at what cost is he comfortable to sell? Once solution I have thought is that to make the function multisig where both buyer and seller need to sign to transfer the painting and accept the Payment.

Ps :- How to implement multisig feature to a function to sign


texts: Transfer ethers from smart contract to an account in metamask

texts:
I want to transfer 10 ether from smart contract to an account in metamask.
I used the following script inside my smart contract :
 function transferBalance(address payable Add) public{

       Add.transfer(10 ether);

       }

It is not working and I got the following message on metamsak.

and I got the following error on the console:

I would appreciate your help.


texts: How would an nft marketplace structure their smart contracts to pay out "creator shares"?

texts:
This may be a noob question, but does any know how a market like Nifty or any similar nft marketplace actually implement paying a "creator share" or royalty back to the original creator after any secondary market sales? Would this be included somewhere in the actual ERC-721 smart contract itself or are they tracking/disbursing these creator shares another way, some sort of logic layer that's tracking the transactions?
To be clear, I'm talking about a secondary sale within the same marketplace, not referring to any implementations of EIP-2981.


texts:
I dowloaded the Ethereum Wallet, version 0.7.3 for Mac.

I used the address on the main account, and the ethers that I sent
to the wallet from shapeships, are not there. I can' text the Test-Net
I did a new installation, but again and again the test- net is present
can you please help me with this. thank you,
Frank


texts: How are the confirmation times distributed in Homestead?

texts: Now that we know about the empirical distribution of block times, what would the confirmation times look like?


texts: Source for a reliable number of active mining nodes?

texts: I am a researcher looking for an accurate number of active mining nodes in the Ethereum network. Do any of you know where I can find this information? I have valid sources for hashrate and the number of nodes running each client. What I cannot find is a reliable number for the active mining nodes within the network. Please help.


texts: Smart Contract for accepting multiple ERC20 Tokens

texts:
If I wanted a smart contract to send tokens based on the exchange price of the ERC20 token received, or any agreed upon value in US dollars how would I do so?

For example, If i wanted my tokens to have a value of $.01 and I wanted to accept Patientory (PTOY) tokens which currently trade at $.13, (or the equivalent exchange rate in PTOY/ETHER) is there a way to have the contract automatically send 13 tokens for each PTOY received and to determine that value at the time it is sent?

Essentially, I want to import the GDAX, coinmarketcap, Poloniex price, etc into the smart contract.  The ultimate goal would be to be able to accept almost any ERC20 token at its current exchange value when sent.  Or is the only option to manually change the contract in a given interval (daily, hourly etc).


texts: How to use web3.filter to check if the transaction is processed

texts:
i am trying to send ether to an account and then deploying a contract with that account. So i need to setup a watcher which triggers when the transaction is completed or mined, so that i can deploy the contract.
watcher using 'pending' and 'latest' does not trigger on the transaction getting mined. So i tried for putting a watcher for the address, but it does not trigger.

Code:
"Setting up watcher for that account"

web3.eth.filter({address: "0x7480e208a68aae46d96cad5341ae111a2a86dcf6"}, function(error, result){
  if (error){
    return console.log(error)
    }
    console.log("----filter-----")
    console.log(JSON.stringify(web3.eth.getBalance("0x7480e208a68bae46d06cad5341ae111a2a86dcf6")))
    console.log(result);
    console.log("----filter-----")
});

Now doing the transaction.

web3.eth.sendTransaction({ from: web3.eth.coinbase, to: "0x7480e208a68bae46d06cad5341ae111a2a86dcf6", value: 10000000000*4 })

Very new to this, please let me know what would be the correct way to do this.


texts:
When parsing through the levelDB or RocksDB (Depending on the client you are using) there are string values representing the key and the value. These are both stored as Byte arrays as well.

My question is: When analyzing each entry, what does the key represent in the relation to the data stored? Is the key just a unique identifier for the data or is it part of the data itself? I am trying to decode the RLP of an entry and need to know what the significance of the key is to the data.


texts: How secure is this Rock Paper Scissors smart contract?

texts:
This contract has been out for a while (it's not mine). I wonder how secure it is. I understand encrypting & revealing process there, but what strikes me more is: When player1 calls method play with arguments string choice, string randStr, the fact that he called this method with those arguments is visible to all nodes on network, isn't it? Therefore player2 can search in blockchain transactions player1's call of play method and see choice?
As far as I know transaction data isn't private.

Contract URL: https://github.com/SCBuergel/ethereum-rps/blob/master/rps-advanced.sol


texts: How to deal with smart contract Versioning

texts:
I just got hit by a problem regarding the changes in a smart contract in case of a business use case. Changing the smart contract in general means, " in business terms", loosing the data and starting a new database with a new smart contract.

Having to deal with this, what should I do ? do I create a "dump and upload again" script or do I just reference the old data somehow in the new smart contract?

Thanks.


texts:
What are currently the best architectural and deployment options for building and deploying a Dapp built with Meteor/Web3?

For building the Dapp, a few Meteor packages are currently available :

"Dapp Using Meteor" contains key Meteor packages
Meteor Build Client : https://github.com/frozeman/meteor-build-client

In practice, Meteor apps are hosted on a server.  How can a Meteor Dapp be deployed so that all users who access it on the web can interact with the blockchain?


texts: How to access the event log by knowing the contract address (web3)?

texts:
How can I access a log stored in one of the tx of the contract via web3?

Code example:

event newtest(string indexed name, uint indexed idlevel,string indexed multib, string objmulti, uint objnm);

and

newtest('test',5,'testj','obj2',30);

Let's say contract address is 0x00. How do I get all the logs that are stored in this contract address with web3?

P.s. I don't need to listen on events in real time. I just need to get all the logs of a contract, based on filters when I need it.


texts: How to connect web3.js 1.3.4 to MetaMask?

texts:
I am trying to connect to MetaMask and I have read their docs about the breaking changes and everything. From what I understand, they are not injecting web3 into window.web3 but instead are using window.ethereum. However, I am using this but when I try to run web3.eth.getAccounts my code returns an error saying that eth is not defined, and furthermore that "metamask no longer injects web3". But I thought that I changed this correctly to use window.ethereum?
Here is my code, first I call this function and then set window.web3 to the web3 provider.
  async loadWeb3() {
    window.addEventListener('load', async () => {
      // Modern dapp browsers
      if (window.ethereum) {
        window.web3 = new Web3(window.ethereum);
        await window.ethereum.enable();
        // legacy dapp browsers
      } else if (window.web3) {
        window.web3 = new Web3(window.web3.currentProvider);
      } else {
        window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!');
      }
    });
  }

After that, I use the provider object and call eth.getAccounts():
  async loadBlockchainData() {
    const web3 = window.web3;
    const accounts = await web3.eth.getAccounts();
  }

But I get an error saying that "cannot read property getAccounts of undefined".


texts: how to loop call token transfer function in a single transaction

texts: I find a transaction here which contains multiple inner transfers. It seems that it saves a lot gas. May I do this with web3j?


texts: What is this syntax? Only function expressions are arguments wrapped in parentheses

texts:
function tokenFallback(address _from, uint _value, bytes _data) {
    (_from);
    (_value);
    (_data);
 }

From https://etherscan.io/address/0xd1dd82d1ded8f40c200b89455050e9c18d918504#code.


texts: Call ethereum smart contract function using web3js 1.2.6

texts:
I am trying to call a smart contract but i am getting error : The function eth_sendTransaction does not exist. I think it is because of transaction not signed , but how can i sign the transaction when i am calling .send() method. Please tell me what am i doing wrong here?

My smart contract function does not accept any argument but when executed it changes a bool value so i am assuming it is changing the state of contract. So can anyone please guide me how to call functions to alter contract data and also transaction to get data.

    const sourceCode = fs.readFileSync('contract_path', 'utf8').toString();
    const compiledCode = compiler.compile(sourceCode, 1).contracts[':Contract_Name']
    const abi = JSON.parse(compiledCode.interface);
    const bin = compiledCode.bytecode;
    var contractInstance = new web3.eth.Contract(abi, data.contractAddr);
    // build the transaction
    web3.eth.getTransactionCount(data.signerPubKey, (err, txCount) => {
        if (txCount) {
            // using the callback
            contractInstance.methods.signAgreement().send({ nonce: web3.utils.toHex(txCount), from: 'my_public_key', gasLimit: web3.utils.toHex('2100000'), gasPrice: web3.utils.toHex(web3.utils.toWei('10', 'gwei')) }, function (error, transactionHash) {
                if (error) {
                    next(error, null)
                } else if (transactionHash){
                    next(null, transactionHash)
                }
            });
        } else if (err && err.message) {
            next(err.message, null);
        }
    })


texts:
2000 tenx tokens were stolen from MyEtherWallet after i transferred it. Luckily i didn't transfer everything, i wanted to test it first. I was looking for a safe wallet and decided to go ahead with MyEtherWallet. I generated my private key over the website (web-wallet) and use it.

At first i thought it was a phishing website that i got into, but then i checked my web browser history over and over again... and couldn't find any suspicious website address. I did go to the correct website www.myetherwallet.com

Secondly I tried to scan my PC for malware / virus using Norton anti-virus and found nothing.

So did the website got hacked when i used it? Any suggestion to this? Can you suggest anything to get my tokens back? Thanks for your help.


texts: What is the Intent of smart contract and decentralization

texts:
I have just started on blockchain and found that there are two key benefits with Ethereum: smart contract and decentralization. I tried to understand the benefits they provide and why they could have not been achieved by available tools. Could not realy get a convincing answer. Can somebody provide more light on it.

Smart Contract.

I think this is to make the code (logic) public and fixed. But, is it not similar to open sorce code (may be sequence of transactions could have been added to it).

Decentralization

Is it to provide more control with owner and to avoid spof? But how? Though the code and some data may be distributed but in most of the cases there are many other resources which may not be distributed such as private key to sign some data, some licences, apis to other modules. How can an application which uses its private key be decentralized? Even if somehow replicatef to few failover nodes, the private key can always be removed making the control still with vendor! How decentralization can work and be helpful here?


texts: Remix Compiler Errors - Transferred GitHub .SOL Codes to Remix

texts:
I transferred all 23 Sol extension files (smart contracts for Syscoin and Ether) from GitHub to Remix but only 3 of them can be compiled and deployed. The rest of them show errors.
[Here is the link for the .Sol codes: https://github.com/syscoin/sysethereum-contracts/tree/master/contracts]
What am I doing wrong?
Here are 4 error message examples (displayed on Remix compiler):
Error message from SyscoinBattleManager.sol is: "not found browser/SyscoinParser/SyscoinMessageLibrary.sol"
Error message from SyscoinClaimManager.sol is: "Unable to import "@openzeppelin/upgrades/contracts/Initializable.sol": File not found"
Error message from SyscoinDepositsManager.sol is: "Unable to import "openzeppelin-solidity/contracts/math/SafeMath.sol": File not found"
Error message from SycoinSuperblocks.sol is: "not found browser/SyscoinParser/SyscoinMessageLibrary.sol"


texts: Will gas from a failed ERC 20 token creation be returned?

texts:
I recently attempted  to create a new ERC 20 through MyEtherWallet and the creation failed due to Warning! Error encountered during contract execution [Out of gas].

Below is some information about the gas from the transaction and the full transaction can be found at:
https://etherscan.io/tx/0x0f2e83db40bfd43c38360dc5507b5d7cb5751093f9a88b456eea1b5627e87601

Gas Limit: 750022
Gas Used By Txn: 750022
Gas Price: 0.000000099 Ether (99 Gwei)
Actual Tx Cost/Fee: 0.074252178 Ether ($50.57)

It has been over 24 hours already from this failed transaction. My question is whether or not the gas from the transaction will be returned to my wallet or is it lost?


texts: Why can't I view my token on https://rinkeby.etherscan.io/token-search?

texts:
I have created a token contract on the Rinkeby Testnet:
https://rinkeby.etherscan.io/address/0x89b901df4f818bb848a6fb64892253fc01f7f559

The contract address is viewable on Etherscan, but when I search https://rinkeby.etherscan.io/token-search for the token, I get the result:
"Sorry! We were unable to locate any valid Token Transfer Events for Contract..."

I have successfully transferred tokens between wallets and the token shows up on https://www.myetherwallet.com/#contracts.

Why am I not able to view the token on Etherscan?


texts: How to withdraw from multiple contracts?

texts:
Thank you for watching this topic.
I'm not sure how I can withdraw my balance from multiple contracts.

The situation is like this.
1)People have rights to withdraw each fund.
2)funds are stored at multiple accounts. (e,g A~Z)
3)There is no priority for each account (Withdrawing from any order is ok)