texts: Need Help With Setting Up Multisig Wallet Contract

texts:
I need help with setting up ETH multisig wallet contract. I used Mist and I think it's very newbie-friendly. However, there are 3 issues that I encountered:

I cannot set up more than 7 owners of the same multisig wallet contract. How/where to edit this?
I can edit the smart contract and under 'Select function' I can 'Remove Owner'. This is not something that I want. I want not to be able to touch the smart contract again after I deploy it. How to do that?
How do I access the same multisig wallet contract from other platform? For example, I can easily access my private key from myetherwallet and access the same personal wallet from metamask. If I want to 'export' this same multisig wallet contract to be used in another platform (outside Mist), how to do that?

**If there's no satisfying answer to the 3 points above, can you guys recommend me another newbie-friendly platform to set up multisig wallet contract? Thank you


texts: Lets say that Ethereum is running at 95-100% of max tps, wich means gas price will rise. And then lets say we update the blockhain and dobble the tps. Would that lead to a halving of gas price?


texts: How to listen to Metamask Ethereum events

texts:
I am trying to listen to the 'chainChanged' event for Metamask, but the event never fires. When running the following snippet, the I get a console.log of the chainId once, but the chainChanged event never runs. What could be the issue? Thanks!

if (window.ethereum) {
    window.ethereum.send('eth_chainId')
        .then(handleChainChanged)
        .catch((err: any) => console.error(err));

    window.ethereum.on('chainChanged', handleChainChanged);

    window.ethereum.autoRefreshOnNetworkChange = false;
   ...
}

function handleChainChanged(chainId: number) {
    console.log(chainId);
}


texts:
I try install full node Binance Smart Chain (https://docs.binance.org/smart-chain/developer/fullnode.html). I follow all the instructions on the site.
After the command
geth --config ./config.toml --datadir ./node -pprof.addr 0.0.0.0 --metrics --pprof

I get messages
ERROR[04-08|14:47:00.953] Unavailable modules in HTTP API list     unavailable=[parlia] available="[admin debug web3 eth txpool personal ethash miner net]"
WARN [04-08|14:47:33.190] Invalid header encountered               number=1       hash="040553…2ad0f6" parent="0d2184…d57b5b" err="extra-data too long: 97 > 32"
INFO [04-08|14:47:33.190] Downloader queue stats                   receiptTasks=0 blockTasks=0 itemSize=0.00B throttle=8192
WARN [04-08|14:47:33.190] Synchronisation failed, dropping peer    peer=6c7bc767b533972a12b605c1f086c6503df257cb91296bed6faaae3dcc2ef5a8 err="retrieved hash chain is invalid: extra-data too long: 97 > 32"

I don't understand how i can fix it. I saved and unziped this snapshot (https://docs.binance.org/smart-chain/validator/snapshot.html) but it not work.
I install get from /bsc folder (1.10.1-stable-c2d2f4ed).
Please, help me.


texts:
I'm not very technical, but I have a question.

Supposing that a Smart Contract is being upgraded to a new one, would it be possible in the new contract to not send new tokens to certain wallets?

So for example, if wallet XXXXX was a known storer of hacked funds, could wallet XXXXX not be sent tokens from the new contract?


texts:
I want to model the following scenario - a small market place
I have 2 nodes in my network - the seller and the buyer.
I want to model the market place in that why  - that the buyer node asks every seller node for their offer - the buyer node decided (based on some rules) which offer he will accept.

My questions is regarding the "asking each buyer node" for their offer. How does the smart contract of the buyer knows whom he should contact in the network? I want to avoid to hard code the adresses in the Smart Contract :-)

Thx


texts: How do I overcome the problem of gas limit?

texts:
Here is my genesis.json file

{
   "config": {
      "chainId": 1994,
      "homesteadBlock": 0,
      "eip155Block": 0,
      "eip158Block": 0,
      "byzantiumBlock": 0
   },
   "difficulty": "400",
   "gasLimit": "2100000",
   "alloc": {
      "7b684d27167d208c66584ece7f09d8bc8f86ffff": {
          "balance": "100000000000000000000000"
      },
      "ae13d41d66af28380c7af6d825ab557eb271ffff": {
          "balance": "120000000000000000000000"
      }
   }
}

Here is the truffle-config.js

networks
{
development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
      from: "0x0000000000000000000000000000000000000001",
      gas: 200000,
     },
};

Here is the 1_initial_migration.js

const Migrations = artifacts.require("Migrations");

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

I have kept the gas in the 1_initial_migration.js file lower than the gasLimit. But still, I find this error on using "truffle migrate":

Compiling your contracts...

===========================

  Everything is up to date, there is nothing to compile.

Migrations dry-run (simulation)

===============================

  Network name:    'development-fork'
  Network id:      1
  Block gas limit: 0x1388

1_initial_migration.js

======================

Deploying 'Migrations'

Error: Error: Error:  * Deployment Failed *

"Migrations" exceeded the block limit (with a gas value you set).
   * Block limit:  0x50e7c
   * Gas sent:     20000
   * Try:
      + Sending less gas.
      + Setting a higher network block limit if you are on a
        private network or test client (like ganache).

at Object.run
 (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:84:1)
    at
    at process._tickCallback (internal/process/next_tick.js:188:7)
Truffle v5.0.18 (core: 5.0.18)
Node v8.10.0

Please give some solutions.

Thank you


texts:
When I run delve as below, it errors about internal packages. How to overcome it?

$ dlv debug cmd/geth/main.go
cmd/geth/main.go:35:2: use of internal package not allowed
exit status 1


texts: Problem while generating DAG for Epoch 1 with geth

texts:
I am running geth on private ethereum network.
I have changed the CalcDifficulty() in block_validator.go to always return return big.NewInt(0x100)... to have a constant difficulty.

The mining starts fine ... problem starts to happens when mining starts for epoch 1, i.e after 30000 blocks are generated, I am receiving below runtime exception:

I1228 05:42:57.026535 miner/worker.go:362]   Mined stale block (#29998 / 4356a658).
I1228 05:42:57.029435 miner/worker.go:362]   Mined block (#29999 / 95be9c6e). Wait 5 blocks for confirmation
I1228 05:42:57.029678 miner/worker.go:362]   Mined stale block (#29999 / 5f6a0b48).
I1228 05:42:57.029823 miner/worker.go:570] commit new work on block 30000 with 0 txs & 0 uncles. Took 335.912µs
I1228 05:42:57.029868 vendor/github.com/ethereum/ethash/ethash.go:259] Generating DAG for epoch 1 (size 1082130304) (290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563)
I1228 05:42:57.029885 vendor/github.com/ethereum/ethash/ethash.go:259] Generating DAG for epoch 0 (size 1073739904) (0000000000000000000000000000000000000000000000000000000000000000)
I1228 05:42:57.029908 vendor/github.com/ethereum/ethash/ethash.go:259] Generating DAG for epoch 1 (size 1082130304) (290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563)
I1228 05:42:58.112724 vendor/github.com/ethereum/ethash/ethash.go:291] Generating DAG: 0%
I1228 05:42:58.415948 vendor/github.com/ethereum/ethash/ethash.go:276] Done generating DAG for epoch 0, it took 1.386053157s
fatal error: unexpected signal during runtime execution
[signal 0x7 code=0x2 addr=0x7f210f9af9c8 pc=0xd21c3a]
runtime stack:
runtime.throw(0x12b9d80, 0x2a)
        /usr/lib/go-1.6/src/runtime/panic.go:547 +0x90
runtime.sigpanic()
        /usr/lib/go-1.6/src/runtime/sigpanic_unix.go:12 +0x5a

and following are  the file which gets created in .ethash directory

 ubuntu@ip-172-31-29-183:~/.ethash$ ls -hlrt
 total 1.1G
 -rw-rw-r-- 1 ubuntu ubuntu 1.0G Dec 27 21:14 full-R23-0000000000000000
 -rw-rw-r-- 1 ubuntu ubuntu 1.1G Dec 28 07:47 full-R23-290decd9548b62a8

 ubuntu@ip-172-31-29-183:~/.ethash$

What is wrong ? Kindly advise


texts:
the code

pragma solidity ^0.4.13;

contract TicTacToe {

    uint[3][]   arr ;

    function isSolved(int[3][] board) returns (int) {
        arr = board;
        //检查每个数组是不是横向的存在

        int check  = 0;
        int h1 =  checkH(arr[1]);

        if(h1 == -1){
            int h2 =  checkH(arr[2]);
            if(h2 == -1){
                int h3 =  checkH(arr[3]);
                 check = h3;

            }else{
                check = h2;
            }
        }else{
          check = h1;
        }

        if(check == -1){
            check = checkS(arr);
            if(check == -1){
                check = checkX(arr);
            }

        }

        if(check == -1){
            check = 0;

        }

        if(check == 0){
            check = -1;

        }

        return check;

    }

    //检查横向数值是不是相等
    function checkH(int[] h) private   returns (int)  {
        if(h[0] == h[1] && h[1] == h[2]){
            return h[0];
        }
        return -1;//平局
    }

    //检查竖向的
    function checkS(int[3][] board) private   returns (int)  {
        if(board[0][0] == board[1][0] && board[1][0] == board[2][0]){
            return board[1][0];
        }
        if(board[0][1] == board[1][1] && board[1][1] == board[2][1]){
            return board[1][0];
        }
        if(board[0][2] == board[1][2] && board[1][2] == board[2][2]){
            return board[1][0];
        }
        return -1;//平局
    }

    //检查斜向的
    function checkX(int[3][] board) private   returns (int)  {
        if(board[0][0] == board[1][1] && board[1][1] == board[2][2]){
            return board[0][0];
        }
        if(board[0][2] == board[1][1] && board[1][1] == board[2][0]){
            return board[0][2];
        }
        return -1;//平局
    }

}

Error

/home/codewarrior/solidity/contracts/solution.sol:18:15: TypeError: Type int256[3] memory[] memory is not implicitly convertible to expected type uint256[3] storage ref[] storage ref.
        arr = board;
              ^---^
,/home/codewarrior/solidity/contracts/solution.sol:22:26: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref to int256[] memory requested.
        int h1 =  checkH(arr[1]);
                         ^----^
,/home/codewarrior/solidity/contracts/solution.sol:25:30: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref to int256[] memory requested.
            int h2 =  checkH(arr[2]);
                             ^----^
,/home/codewarrior/solidity/contracts/solution.sol:27:34: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref to int256[] memory requested.
                int h3 =  checkH(arr[3]);
                                 ^----^
,/home/codewarrior/solidity/contracts/solution.sol:39:28: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref[] storage ref to int256[3] memory[] memory requested.
            check = checkS(arr);
                           ^-^
,/home/codewarrior/solidity/contracts/solution.sol:41:32: TypeError: Invalid type for argument in function call. Invalid implicit conversion from uint256[3] storage ref[] storage ref to int256[3] memory[] memory requested.
                check = checkX(arr);
                               ^-^

Compiliation failed. See above.

help me please!


texts: Does the number of geth's maxpeers option include it's own node?

texts:
In geth's parameters there is a --maxpeers option. Does this option number includes it's own node?

  --maxpeers "25" Maximum number of network peers (network disabled if set to 0)

Does --maxpeers "1" means 2 peers in the network including the node which execute the geth command with --maxpeers "1"?


texts: What are function signatures in ABIv2 and how do they enhance Ethereum?

texts:
EIP-712 talks about function signatures being bytes4. I understand that the new version of the ABI format will contain a pre-defined set of keccak256 hashes of function names, as per the work done on clef, but it's not clear to me what their role is, in details.

What if there's a function not defined in that list? Will developers need to retrofit it for their apps?


texts: How to connect with different node if main node get down in private ethereum blockchain?

texts:
I have created private ethreum blockchain,It is hosted in LAN network and connected with 3 nodes,
i am using one main Node IP (e.g 192.168.1.27:8546) to connect my application(created using web3.js truffle) with blockchain
 but if that main Node is get down then how to connect with Other node using application??


texts: Can miners "lie" about how much gas a computation cost them?

texts: I've noticed that I'm hardly refunded gas fees. Why is this? Are miners somehow lying about how much gas a computation cost? Can they lie? How is this prevented?


texts:
As far as i know solidity doesn't support passing an array of strings into a function ?

My issue is that i just added an array of strings (hashs from ipfs) into my struct and i am used to use the constructor to either create or update my data
like this User storage x = User(_id,_someting); and now i can not pass the array into User. any simple way to go over this or how can kepp the files outside the struct but somehow link it with the id to the struct?

struct User{
unit256 id,
unit256 someting,
string [] files,

}


texts: Not able to receive ether onto MetaMask account

texts:
I've installed MetaMask, connected to Ethereum Main Net and created an account. Then I copied the address of the account (did "Copy address to clipboard") and sent it to the person who was going to send me some ether. However he failed to transfer it, he was told that the address that I gave him doesn't exist or something.

I'm new to the crypto world and just need to get that Ethereum thing. What am I doing wrong? I've followed MetaMask tutorial step by step. Do I need to register that account, or activate it somewhere else, after I create it in MetaMask?


texts: Are mutable data structures expensive (gas, Solidity)?

texts:
I was planning on implementing a heap data structure for efficient popping of the highest valued node. I am wondering if it is expensive gas-wise to constantly move values around ("bubble up") to maintain O(log n) running time?

CTRL+F "shape invariant"
http://www.cs.cornell.edu/courses/cs2112/2015fa/lectures/lecture.html?id=heaps

Also, are there any plans to make a data structures library for Solidity?


texts:
I've read this question and answer thread about representing decimal values in solidity, and I understand that math is entirely done using fixed-point.
However, I'm curious as to why this is the case. Is it because who numbers allow us to never loose any value? Couldn't we just not allow transactions to be processed that would have too many decimal places? (ie, give it an "always failing transaction" warning before processing?)


texts: Where Do I Download the "geth removedb" tool & how do I use it, Step by Step?

texts: I am reading that many people who are having problems with Mist gobbling up hard drive space (in my case 135 GB - I'm serious - there should be a 5 inch read warning when you download MIST about this - and of course it nearly killed my 251 GB hard drive) that they should use "geth removedb" to fix this. Unfortunately no one ever explains where or how to download this tool OR how to use it. Is there a support site?


texts: Is there a reason why Ethereum DAPPS would benefit from their own blockchains?

texts: For example even if all of their useful functions will occur on the ETH blockchain, would a separate blockchain simplify the creation of DAPP tokens to trade on centralized exchanges?


texts: Running test with multiple contract address on a local Ganache blockchain

texts:
I'm developing with Truffle and Ganache
I have an standard ERC20 ABI that I import in my test file. it only has 3 optionals functions name, symbol and decimals.
const Token = artifacts.require('./Token')

And I instantiate it
token = await Token.new()

After this I can call it's functions directly like this
token.name()

How would I proceed to use the same functions on another ERC20 standard contract? Can I use my contract ABI that is pretty much standard or do I need another contract that will take a contract address as an argument to make the call to the right contract?


texts: Does the Bytecode and ABI generated for each contract also include it's imports?

texts:
If not, how does a contract such as an ERC20 get deployed if each output has its own ABI and Binary file?
When compiling with truffle, and looking at A.json (where A imports B and C) it seems that it also includes the ABI and Bytecode for B and C. Is this some magic that truffle is doing? Or is this inherently built into Solc.


texts: Contract is deployable on Remix Ethereum only with "Enable optimization"

texts: my contract is only deployable to a blockchain via remix Ethereum as soon as I enable optimization. Otherwise it runs out of gas before deployment. Is there anyway to include this optimization in my code? Because I would like to use truffle building a DAPP with this code.


texts:
Does anyone have a script that can be used to transfer all ether found in an address to another address?

The script will constantly check for any incoming ether and make an automatic transaction, use half of the ether for gas.


texts: Why do null topics affect the output of filter logs in geth?

texts:
I'm connected to a private chain with geth and this is the output I get when trying to retreive logs (first topic is function signature):

> eth.filter({'fromBlock': 0, 'toBlock': 'latest', address: '0xe25b529f5b2475694eeb29dced46dde986488b03', topics: ["0x8a314ef48dbd2506be5878ac08beae6e006dc0e15052df82217252ba71026059", null, null]}).get().length
6125
> eth.filter({'fromBlock': 0, 'toBlock': 'latest', address: '0xe25b529f5b2475694eeb29dced46dde986488b03', topics: ["0x8a314ef48dbd2506be5878ac08beae6e006dc0e15052df82217252ba71026059"]}).get().length
14286

I remember reading that null topics had no effect on log filter output, eg. they only existed in order to enable filtering by specific topics, while leaving others out. But it seems this isn't the case.

This is especially concerning for scenarios in which I need to access logs by the second argument, leaving the first one blank. This seems to only work for recent logs. Anyone has an idea why?


texts: ERC20 Token Total Supply, When to Mint, When to Burn?

texts:
What formula should be used to determine the initial amount of tokens you want to be in your total supply?
When does it make sense to mint tokens?
When does it make sense to burn tokens

For question one, would it be simply based on how you would want your token used? For example, I rather have people commonly send 100 myCoins rather than .0001 myCoins and therefore I would need a bigger supply. I guess we would also have to consider the amount of coins that would potentially be used on a daily basis to interact with your dApp.

As for questions two and three, would those be just for simple control over supply / demand? What scenarios would you use mint/burn for?


texts:
Hi I was searching on upgradeable/upgradable contracts, then I found this Rocket Pool by David Rugendyke
https://gist.github.com/darcius/6e8fa4faa6d9139f3950b6f1d9e96038

/// @dev Only allow access from the latest version of a contract in the Rocket Pool network after deployment

modifier onlyLatestRocketNetworkContract() {

    /* The owner is only allowed to set the storage upon deployment
    to register the initial contracts, afterwards their direct access is disabled
    only allow the owner of the storage contract to access these methods directly to set
    some initial contract addresses during deployment,
    after deployment their access is removed to ensure only visible contract methods
    can write to storage. From then on, only registered contracts within the Rocket Pool network
    can write to storage.
     */

    if (msg.sender == owner) {
        require(boolStorage[keccak256("contract.storage.initialised")] == false);
    } else {
        // Make sure the access is permitted to only contracts in our Dapp
        require(addressStorage[keccak256("contract.address", msg.sender)] != 0x0);
    }
    _;
}

Could someone help me understand these two lines:
keccak256("contract.storage.initialised")
keccak256("contract.address", msg.sender)

http://solidity.readthedocs.io/en/develop/units-and-global-variables.html#mathematical-and-cryptographic-functions
I know keccak256(...) or sha3(...) computes the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments, then returns (bytes32)

but I could not find any reference regarding to ".initialised"
Thank you


texts: How to securely Interact with a contract on user's behalf from centralized server?

texts:
To explain myself, what I need is to be able to have a way so that the central server can only interact with the contract only with valid identification from a user? This identification provided by the user may be a password or anything else that isn't too inconvenient for the user. However, most importantly, there should be no way for someone to hack the system into authenticating an invalid authentification. So ideally the contract would have to verify that the user has provided identification that allows the server to perform a certain task such as changing the user's balance value in the contract.

The goal is that a user can interact with the decentralized contract through the server which can then send additional information to the contract, if and only if a certain authentification that can not be forged and can be verified by the contract is provided.

To give a concrete example for my use case: I have a web app that users can access from their browser. However, I want users to be able to easily interact with a smart contract without having to set up anything on the client side. Therefore I want to be able to have a user which has an account on the web app to be able to click a simple button that sends a post request to the server. This post request will for instance transfer a user's balance into another user's balance in the contract. However, the server has to know to only call the smart contract if this is a legitimate and verified call. And the smart contract needs to be able to distingue between a legitimate call and a forged call. As to not have someone send a user's funds to his account on the smart contract without authorization. Which would be undesirable since what happens on the contract is out of my control.

Is there any smart way to do this?


texts:
i have 5 mining rigs.
In one of them i have 5x GTX1060
 Iam using latest claymore miner v10.0

When i start mining everything is ok and cpu load is about 5-20%, but after probably 50 minutes the CPU load go in to the sky :(, about 95-98% and degrade my hashrate from 123mhs to 49-70 mhs.

In task manager, here is a ethdcr64miner.exe using  big piece of CPU...
I dont know how is it possible i have other rigs where clymore is using about 25% CPU MAX.... and no problems

Any ideas where is a problem?

*NOTE: Windows 7 64-bit, 8GB RAM, latest drivers for everything from manufacturer, claymore miner v10.0, asus gpu tweak2, and other software things which i have installed on other rigs, other rigs have some software and hardware....


texts: Web3.py error: Unsupported type: the primitive argument must be one of: bytes,bytearray

texts:
I am trying to deploy a contract to a private Ethereum chain following instructions from here and using following code. I have used this same code several times with Ropsten and it worked perfectly but now it is giving following error.
Unsupported type: The primitive argument must be one of: bytes,bytearray, int or bool and not str
Please help me, where I am making mistake.
 import web3,time from datetime import datetime from solc import compile_source from web3 import Web3,HTTPProvider from web3.contract import ConciseContract from eth_account import Account import csv,random,sys from web3.auto import w3 import binascii number_of_files=0;

def deploy_contract(compiled_sol):

    print('Deploying contract ..')
    contract_id, contract_interface = compiled_sol.popitem()
    w3 = Web3(Web3.HTTPProvider('http://192.168.122.31:8543'))
    if(w3.isConnected()):
        print('we are connected!')
    else:
       print('Sorry not connnected!')
    # w3.eth.enable_unaudited_features()
    account = Account()
    acct = account.privateKeyToAccount(private_key)

    contract_ = w3.eth.contract(abi = contract_interface['abi'], bytecode = contract_interface['bin'])
    print('We have done this  ',contract_)
    print(acct.address)
    unlocked = w3.geth.personal.unlock_account(acct.address,"xx")

    contract_data = contract_.constructor().buildTransaction({
            'from': acct.address,
            'gas': 1728712,
            'gasPrice':w3.toWei('21','gwei'),
            'chainId': 5333
        })

    print('Transaction built ....')
    contract_data['to']=""

    trans_hash = w3.eth.sendTransaction(contract_data)
    time_transaction_sent = datetime.now()
    receipt = w3.eth.waitForTransactionReceipt(trans_hash.hex())

    time_receipt_recieved = datetime.now()
    block_n = receipt['blockNumber']
    gas_used = receipt['gasUsed']
    contract_address = receipt['contractAddress'] contract_code =

pragma solidity ^0.4.25;

contract SimpleStorage {
    string source_address;
    string dest_address;
    uint protocol;
    constructor() public {
        field_one = '';
        field_two = '';
        field_three = 0;
    }
    function set_params (string field_one, string field_two, uint field_three) public {
        field_one=field_one;
        field_two=field_two;
        field_three=field_three;
    }

    function get_field_one() public returns (string) {
        return field_one;
    }
    function get_field_two() public returns (string) {
        return field_two;
    }
    function get_field_three() public returns (uint) {
        return field_three;
    }
    function get_time_stamp() public returns (uint256){
        return now;
    } }

try:
    compiled_sol = compile_source(contract_code)
    time_compilation_ended = datetime.now()
    print('compiled source ..')
    deploy_contract(compiled_sol) except Exception as e:
    print(e, 'Error in contract code') ``


texts: How can I find out what the highest block is?

texts: I'm syncing up a new node. How can I find out what the latest block is so that I know how far I've got to go?


texts: If a contract is to send a given amount of tokens or ether to lets say, 10,000 different addresses, will it run out of gas? If so, what will happen?


texts: How transactions are selected by the miners?

texts:
The deployment of transaction executions is bounded by the block gas limit that changes dynamically. If a block fits only one transaction, then the gas limit per transaction is, in theory, the same as block gas limit. As of 2020, this limit is around 10 million. There is also a minimum base cost for each transaction of 21,000 gas.

From answer for this question How are transactions stored in a block? @Richard Horrocks:

  However, miners can order transactions however they like, as long as
  the order equates to a set of valid state transitions.

[Q] Hence, transaction order is decided based on the miners, but how the transactions to be included into blocks are decided?

As I know miners select the most profitable transactions based on gasPrice * gasLimit.
Does using a very high gas limit somehow get your transactions executed slower? @iamdefinitelyahuman:

  The reasoning: miners seek to maximize their profit within each block.
  Calls to eth_estimateGas can be computationally heavy, so miners
  typically do not determine the actual gas each tx will consume.
  Instead they calculate gasPrice * gasLimit for each given transaction
  and from that determine the most cost-effective set of transactions to
  mine.

=> For example, I submit a transaction with a very high gasPrice which has 10,000,000 gasLimit. It is selected and added into a block. Since it consumes all the gasLimit of a block no other transaction is included.

Afterwards, during execution, my transaction only consumed 21,000 of gas and remaining part is refunded back to me. There is still remaining 9,979,000 of gas to be consumed on the block. Can the miner dynamically add more transactions after selected transactions' executions are completed?

or all the transactions are decided statically and cannot be updated after their executions are completed. If it is the case, miners tend to prioritize a lot of smaller tx's over one large one and larger ones never be deployed.

=> Is there are common algorithm for miners to decide the transactions to be included into a block? Let's say, does all the combinations of pending transactions is generated in order to select the most profitable one using brute force or greedy algorithm? Since time is very important to solve the puzzle first, deciding the transactions to be included into block might consume additional time.


texts: Deploying and interacting contract with Azure consortium blockchain with their transaction receipt not returning from blockchain

texts:
I am using Web3j to deploy and interact with a contract on Azure consortium blockchain.

Connecting to Azure consortium blockchain RPC endpoint

Web3j web3 = Web3j.build(new HttpService("http://***.cloudapp.azure.com:8545"));

Unlocking my account from my wallet file

Credentials credentials = WalletUtils.loadCredentials("mypassword", "path/to/mywallet");

Deploying contract from web3j smart contract wrapper

 Future<MySmartContract> contract = MySmartContract.deploy(
   web3,
   credentials,
   BigInteger.valueOf(700000),
   BigInteger.valueOf(700000),
   BigInteger.valueOf(0),
   new Uint256(10000L));

Printing the contract address

System.out.println(contract.get().getContractAddress());

Under the hood, Web3j would call

 "{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xa8b688bc982252bf514adf9ff0cf6eef73d6b5212fb69a7b2f80b281faefecc8"],"id":1}"

but the result would always be "{"jsonrpc":"2.0","id":1,"result":null}[\n]"

Essentially, I am guessing the transaction is submitted to the blockchain, but the blockchain does not mine this transaction. I have tried this on Ethereum testnet and it works. I am wondering whether there are debugging tools or ways to monitor the azure consortium blockchain, and possible solutions to this issue.


texts: Adding Application Security for Cakeshop (Quorum) on Azure?

texts: Is there a way to set a password to the cakeshop UI when using Azure for Quorum deployment? In order to prevent Ethereum accounts being generated or smart contracts being deployed via the publicly accessible websites!


texts:
I have a Python program using stack operations and string concatenations. It runs in less than a minute on a particular input, doing about 100 million string operations. Doing this number of operations in Ethereum will today cost about $2 million in gas.

Why is execution in Ethereum so expensive?

Let's say there are 35000 nodes today and each node needs to execute the Ethereum port of the Python program. If we assume roughly the same speed,these are 35000 CPU-minutes = ca. 600 CPU hours = ca. $60 on Amazon. That is a lot less than $2 million.

Why such a big difference? Or is there a flaw in the estimates?


texts: How can you approve a token through an interface?

texts:
I have an interface to Dai from my contract and want to allow a user to approve the contract to transfer their Dai. Dai uses DSToken code which has an approve function that relies on msg.sender:

function approve(address guy, uint wad) public returns (bool) {
    _approvals[msg.sender][guy] = wad;

    Approval(msg.sender, guy, wad);

    return true;
}

I have an interface my contract inherits which calls the interface contract like

contract DaiInterface {

    function approve(address guy, uint wad) public returns (bool);
}

contract DaiTransferrer is Ownable {

    DaiInterface daiContract;

    function approveDai(address guy, uint wad) public {
        daiContract.approve(guy, wad);
    }
}

So the problem is that msg.sender changes by the time it gets to the token contract so I think the interface code gets approved rather than main contract which needs to transfer the Dai. What's the best way to solve this?


texts: What DSAuthority(0) and eos.owner() means and does?

texts:
In ERC20 EOS crowdsale contract, what these three lines(469-471) does?

    function initialize(DSToken eos) auth {
    assert(address(EOS) == address(0)); //[Someone explained this line here][2]
    assert(eos.owner() == address(this));
    assert(eos.authority() == DSAuthority(0));

When I compile and push the contract on Remix, it works fine. But, no token minted. On debugging, I figured that the initialize() must be called to mint tokens. But, when I execute initialize() with the same contract address as parameter as the crowdsale contract it shows 'Error: Invalid upcode" on second line(line 470). What am I doing wrong here?
I also noticed there is no method called owner() and authority() inside DSToken contract which is passed as argument to EOSSale contract. Then how the contract compiles and run without any error until initialize.


texts: I'm mining to my address and I can see the accumulation of my ether when I go to my mining pool's website but I'm still unsure of how the wallet works. I don't remember if I got my wallet address through https://www.myetherwallet.com/#generate-wallet or through geth on my Linux terminal or through the Ethereum Wallet GUI on my Linux desktop. When I check my address at https://eth.nanopool.org/account/0xADDRESS I click the 'View with address only' bubble but it doesn't ask for a password. It shows that I have 0.00 ETH but I think that's just because I haven't mined enough for a payout on my pool's website yet. How does the wallet work, where is the password stored. If I create a wallet address on geth through my command line how would a site like MyEtherWallt even be able to verify that the password is correct? And vise versa. If I create a wallet at the MyEtherWall website how would either my geth terminal or my GUI Ether Wallet be able to verify or authenticate my password. Thanks.


texts: Are there any good ways to express conditional ownership on ERC20 or ERC721 tokens?

texts:
I'm currently looking for any good ways to express conditional ownership on tokens.
I look into approve function of both ERC20/ERC721 but, it seems that function may be disapproved by the owner and people approved don't have any right to prevent the owner to transfer tokens.

the needs for spec are below.

one account (account A) can be seen as an owner of a token so that they can use them in other services(e.g. using its right to receive dividends)
other accounts (lets say secondary owners) can prevent A to transfer token to others on Dex or any other services alike.


texts: How can I split my ETH and ETC if I have an account that made a transaction with the WithdrawDAO contract?

texts:
Let's say:

I own account A, which had a 100 ETH pre-DAO balance.
Pre-fork I sent 50 ETH from A -> DAO.
Post-fork I had 50 ETHF and 50 ETHC in A.
Post-fork I made a transaction with the WithdrawDAO contract, so now account A has 100 ETHF and 50 ETHC (minus gas of course).

How do I split out the ETHF and ETHC in account A?

My thought is that rather than using a splitter contract I could simply make a transaction to deposit the 100 ETHF into a new account B. If my understanding is correct, then if the transaction was replayed on the classic chain it would simply fail due to insufficient funds, and would therefore be immune to a replay attack.

If so, then at this point:

Account A has 0 ETHF, 50 ETHC.
Account B has 100 ETHF, 0 ETHC.

And my ether would be cleanly split. Is this correct? My assumption is that ethereum transactions fail completely if the balance is insufficient, rather than partially fulfilling the transaction. Just want to make double sure I'm not missing anything.


texts: Request user to sign state changing transaction with metamask using Infura and web3js

texts:
Can't seem to find the right function to ask the user to sign a transaction via metamask, this is my code so far:

  const bet = '102500000000000010'
  const account = '0xc8133b744147078a551b8d9c547414d427d8f579'

  web3.eth.getTransactionCount(account, function (err, nonce) {
    const data = Contract.methods.payBet(1553399554260556, bet).encodeABI();
    const tx = new Tx({
      nonce,
      gasPrice: 165335,
      gasLimit: 100000,
      to: "0x232b....",
      value: bet,
      data,
    })

    //THIS tx.sign SHOULD BE THE METAMASK PART, since I dont have the user PK
    tx.sign(ethereumjs.Buffer.Buffer.from(privateKey, 'hex'));

    var raw = '0x' + tx.serialize().toString('hex');
    web3.eth.sendSignedTransaction(raw, function (err, transactionHash) {
      console.log(transactionHash);
    });
  });

What should I do to ask the user to sign the tx? I also tried to use web3.eth.sendTransaction but it is not supported by infura.

I'm abit lost here


texts: Parity Ethereum on Windows : Corruption block checksum mismatch - fails to launch

texts:
I have installed Parity Ethereum on my Windows 7 (64 bits) laptop. It has worked fine for some weeks. Today, I was forced to hard-reboot my laptop for some reason, while Parity wallet was running. Due to the hard-boot, there was an auto-run of ChkDsk at restart that did some clean-up. I'm trying to relaunch Parity Ethereum, it attempts to launch & I see Parity icon in my system-tray. But after a few seconds, the icon disappears & Parity also doesn't show up as a new tab in Chrome browser. On launching Parity via command line, I receive the following error:

thread 'main' panicked at 'failed to update version: "Corruption: block checksum mismatch"', C:\bot\slave\stable-dist-rustc-win-msvc-64\build\src\libcore\result.rs:868

Can anyone please guide me about how to resolve this? Thanks in advance !


texts: What is the most cost effective way to compare to arrays eg. uint arrays  in solidity. Running a for loop takes too much gas.


texts: What is the name of pool which keeps transactions in memory such as Bitcoin's mempool?

texts:
Do Ethereum clients have a memory pool which keeps transactions like Bitcoin's mempool?
If so, what is the name for it in Ethereum?


texts: How do we access a contract that was deployed by another contract in Truffle?

texts:
I am trying to figure out how do we access Contract2's instance in Truffle's test if it was deployed by Contract1 in Truffle Develop? Can't seem to find a question that described my issue exactly so sorry in advance if there is one already!

I have a BallotFactory contract that generates a new Ballot contract as below.

contract BallotFactory {
address[] public deployedBallotsAddress;

function createBallot(
    string memory _title,
    string memory _description,
    string memory _option1,
    string memory _option2
) public {
    address newBallotAddress = address(
        new Ballot(_title, _description, _option1, _option2, msg.sender)
    );
    deployedBallotsAddress.push(newBallotAddress);
}

function getDeployedBallots() public view returns (address[] memory) {
    return deployedBallotsAddress;
}

I migrated the BallotFactory contract.

const BallotFactory = artifacts.require("BallotFactory");
module.exports = function (deployer) {
  deployer.deploy(BallotFactory);
};

In my Truffle test's beforeEach:

beforeEach(async () => {
factoryInstance = await BallotFactory.new({ from: accounts[0] });

await factoryInstance.createBallot(
  "President",
  "Vote for Alice or Bob",
  "Alice",
  "Bob",
  {
    from: accounts[0],
  }
);

[ballotAddress] = await factoryInstance.getDeployedBallots();

console.log(ballotAddress);

ballotInstance = await Ballot.deployed(ballotAddress); });

console.log(ballotAddress) returns as address which I guess means that BallotFactory successfully deployed a new Ballot contract. But when I try to access the deployed ballot instance in the last line, I get the error: "Ballot has not been deployed to detected network (network/artifact mismatch)". There are functions like voting on the Ballot contract that needs testing later in the 'it' hence the need to access it.

Testing is done on Truffle Develop without ganache.

Thanks!


texts: Solidity function with multisig functionality

texts:
I have a smart contract for pallet exchange. There I have a function for exchange pallets between two partners. The point is, I want that you can only run the function when both partners confirm the transaction.

Is there a possibility to write a function with multisig functionality?


texts:
I had 3 accounts under my MetaMask Chrome extension. One of them had some small deposit. I have reinstalled the extension and used seed phrase to get access again. However, I can see only one account (with zero funds).

Does it mean I lost access forever? I've read that a seed phrase gets access to a whole list of addresses. I still know the public key of the needed lost account. Is it possible to recover, still?


texts: What stops an unwanted smart contract from being executed by the receiver

texts:
I have searched online about this, but I can't seem to find a real answer.

Say someone sends a smart contract to some address. What if the receiver does not want to accept that contract? How do they "deny" the contract or prevent it from executing?

For example, in financial derivatives, a trade for a call option is agreed upon between two parties. If the buyer initiates the contract with the wrong strike price, what stops the counterparty from being forced to accept that price?


texts: Does reentrancy attack happens as soon as the balance in storage is modified after the withdrawal?

texts:
I just saw something like this:

function sub(
    uint a,
    uint b
    )
    internal
    pure
    returns (uint)
{
    require(b <= a, "SUB_UNDERFLOW");
    return a - b;
}

function withdraw(uint amount) public {
    msg.sender.call.value(amount).gas(gasleft())("");
    balance[msg.sender]=balance[msg.sender].sub(amount);
}

Is there a possible reentrancy attack here, or does balance[msg.sender] is reloaded after the call making the subtraction based on the value after the call?
Can compiler optimizations affect the behavior through caching on the stack in order to have a single SLOAD operation in terms of gas cost?


texts:
I don't understand how deployment and hosting of a DApp works.
My quesitons are:

1.Is DApp's code stored on Ethereum servers or do I have to get my own server and store it there?
2.Do I have to run my own Ethereum daemon on my server 24/7 where the contract's code will be executed ? In other words, what services exactly does Ethereum provide (external services) that my DApp will use?

3.Do I have to create my own currency to run a DApp ?

Or in other words, I don't understand what resources are provided by Ethereum and what resources should be provided by me to run a DApp.


texts: How can I find out the sender's gas limit?

texts:
Is there a way to check Sender's Gas Limit?

If the sender sets too low, I will just accept whatever gas amount that he had set and return immediately without hitting the limit.

I am trying to mitigate Fomo3D type of attack.


texts: How to hash multiple values including array keccak256 Solidity v5.0.x and web3 'Autodetection of array types is not supported.'

texts:
How can I receive the same hash in solidity and web3?
Multiple values where one is a multi dimensional array.

Solidity v0.5.x:

pragma solidity 0.5.6;
pragma experimental ABIEncoderV2;

contract Hash{

    uint256[][] public data;

    function append(uint _a, uint _b) public {
        data.push([_a, _b]);
    }

    function hash(uint256 _idx, string memory _b) public view returns(bytes32) {
        return keccak256(abi.encodePacked(data[_idx], _b));
    }
}

Solidity output:

decoded input
{
     "uint256 _idx": "0",
     "string _b": "a"
}

 decoded output
{
"0": "bytes32: 0x8385585c10cea4e82d9662964b0a952bc1ad925ded1aff4ab359eb38b6d23d11"
}

Web3:

truffle(development)> var arr = new Array(2);
truffle(development)> arr.push([1, 2]);
truffle(development)> web3.utils.soliditySha3(arr,"a")

Web3 output:

/Users/xxx/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/cli.bundled.js:345535
        throw new Error('Autodetection of array types is not supported.');

I also tried

web3.utils.keccak256(
   web3.eth.abi.encodeParameters(["uint256[][]", "string"], [arr, "a"])
);

which provides a different hash.


texts:
my solidity code is below:

pragma solidity ^0.4.24;

contract Test {

    event Event(address);
    event TestEvent(uint256);
    event Data(bytes);
    event Data1(bytes);
    function show() public returns(uint256){
        emit Event(msg.sender);
        return 100;
    }

    function test(uint256 a)external returns(bytes){

        emit Data(msg.data);
        emit TestEvent(a);
        return msg.data;

    }
    function caller1(address _addr) {
        emit Data1(abi.encodeWithSelector(bytes4(keccak256("test(uint256)")),100));
        _addr.call(abi.encodeWithSelector(bytes4(keccak256("test(uint256)")),100));
    }
}

contract Call {

    function caller1(address _addr) {
        _addr.call(abi.encodeWithSelector(bytes4(keccak256("test(uint256)")),100));
    }
}

I have been deployed contract Test and Call。when I call function test(100) directly, this event Data show the msg.data is "0x29e99f070000000000000000000000000000000000000000000000000000000000000064",ok.

But, when I call the contract Test's function caller1 or contract Call's function caller1 to call the function test by solidity lib function .call,the event Data show the msg.data is "0x29e99f07000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000".

yes,you can see this msg.data is longer than that one ,this msg.data is much more an  hexString "00000000000000000000000000000000000000000000000000000000".the length of the hexString is 56,of course,the length is 26 byte.
Why,somebody could you help me .

My English is poorly,understand what I say ?


texts: What's the advantage of interacting with a smart contract from another smart contract (instead of just calling it using something like Web3.js)?

texts:
I've noticed there are lots of tutorials online that talk about deploying a smart contract that allows them to interact with other smart contracts e.g. deploying a smart contract to interact with Uniswap's contracts here: https://soliditydeveloper.com/uniswap2
Is there any advantage of deploying a smart contract to call Uniswap's contract functions vs. calling those functions directly using something like ethersjs or Web3js?
Seems like a lot of extra hassle having to deploy a smart contract first.


texts: Understanding front running. Why did my transaction fail? (PancakeSwap V2)

texts:
I am doing some research on front running transactions. My goal is to purchase a token in PancakeSwap in the same block that liquidity is added.
Lets take this token as an example: https://bscscan.com/token/0x195d3576bbf6504d8eac5b614dcb756e32b911d5
It was launched on block https://bscscan.com/block/7699663, which a single transaction adding 20 BNB LP on the PancakeSwap V2 Router (https://bscscan.com/tx/0x48b3b3b9dafcaff0f77e4c40abd80afcc47a20b19db23d9dc96a9ff326446a8c).
I used that transaction as a trigger for my swap order (only 0.01 BNB, 10 gwei) https://bscscan.com/tx/0xa66fbba13749cbd3005957d257da22e5afb07cfc007fe790976cda284a64c1f0 which failed. I want to understand why.
Maybe I placed my order too soon, but that is the goal, right? How should I estimate when to place then order then?
I can also think the problem was the gas price. My gas price was 10 gwei and the tx that added the liquidity had a price of 5 gwei. Does this mean that my tx will get processed first, and therefor will fail because there is not enough liquidity yet?
If this explanation is correct, would doing this transaction with the same gas price as the liquidity (or perhaps 1 less gwei?) guarantee that it will get processed? What would be the best way to achieve a good compromise between speed and success rate?
From this little experiment I can imagine that detecting a pending transaction (with a low or average gas price) and then submitting an equivalent swap with x2-3 gas price will likely result in my transaction being processed first, right?
Isn't this a very important flaw of DEX? how can one solve this problem?
Thanks!


texts: Events with string argument not working (not indexed)

texts:
I am trying to listen to an event on rinkeby test which I run locally. Every thing works fine when my argument is int such as  event EventTester(int values); When I change the event argument to string (it is not indexed) it does not work and I do not see the log. event EventTester(string values); . Any idea why? I do not see the Events Log tab when I check the transaction on https://rinkeby.etherscan.io.

Thanks

var fs = require('fs');
var Web3 = require('web3');
var util = require('ethereumjs-util');
var tx = require('ethereumjs-tx');
var lightwallet = require('eth-lightwallet');
var txutils = lightwallet.txutils;
var web3 = new Web3(
    new Web3.providers.HttpProvider('http://localhost:8545')
);
var address = '0x.....';
var key = '';
var bytecode = '6060...90029';
var interface = [{"constant":false,"inputs":[{"name":"input","type":"string"}],"name":"getOut","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"values","type":"string"}],"name":"EventTester","type":"event"}]

function sendRaw(rawTx) {
    var privateKey = new Buffer(key, 'hex');
    var transaction = new tx(rawTx);
    transaction.sign(privateKey);
    var serializedTx = transaction.serialize().toString('hex');
    web3.eth.sendRawTransaction(
    '0x' + serializedTx, function(err, result) {
        if(err) {
            console.log("ERROR HAPPENED:" +err);
        }
    });
}

var contractAddress = '0x...';

strInterface='[{"constant":false,"inputs":[{"name":"input","type":"string"}],"name":"getOut","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"values","type":"string"}],"name":"EventTester","type":"event"}]'
abiDefinition = JSON.parse(strInterface)
myContract = web3.eth.contract(abiDefinition)
var contractInstance = myContract.at(contractAddress)

var txOptions = {
    nonce: web3.toHex(web3.eth.getTransactionCount(address)),
    gasLimit: web3.toHex(700000),
    gasPrice: web3.toHex(10000000000),
    to: contractAddress
};
var rawTx = txutils.functionTx(interface, 'getOut', ["hi"], txOptions);
sendRaw(rawTx);


texts: Is there any way to only encrypt the api key in a GET oraclize query

texts:
I am building a contract that uses oraclize to query an API. The API only accepts GET requests (no POST) and also has authentication that requires an API key to be sent as an argument(query_token) in the query string.

Is there any way to use oraclize_query and encrypt only the API key leaving the base part of the url (such as https://testingfire.com/transaction/15) exposed?


texts: How do I recover the disk space space after uninstalling Ethereum Wallet on OS/X?

texts:
Just to preface, I am somewhat new to Ethereum, and I'm trying to learn my way around.

So I recently downloaded the Ethereum Wallet from the Ethereum website, and I subsequently uninstalled it once I realized that it was downloading the entire blockchain, which I just don't have space for on my machine (on a mac).

However, I noticed that I am missing about 9 gigs of space on my machine even after deleting the app and the data. Any idea why I'm missing space? Any files I should delete?


texts: What is the equivalent of "buildTransaction" of web3Py in web3JS?

texts:
I'm using Node to interact with my smart contract. I understand that I need to first sign my transaction before sending it.
In one of the StackExchange answers I see that it can be done using buildTransaction method.
How can I do the same implementation in web3JS?


texts: How Ethereum dev team/ENS team is anticipating to solve the rise in price for ENS domains and gas prices

texts:
I am just looking for the prices for the ENS.
Can anyone help me understand the economics of ENS domain, their price depends on the fluctuations of Ethereum and if we assume that it'll always go up then the very simple thing like domain registering would be impossible to purchase in ENS(Currently it is 348$ to register a domain).
How onboarding of new users which is really important for the adoption of any technology will become with this pricing? How ethereum developers/team is thinking of tackling this problem?
Also, are there any solutions ongoing for the high gas issue too?
I am really intrigued by this whole decentralized technology that is why I am trying to learn as much as I can.
Any literature directions to read are also welcome.


texts: Get ERC-20 token transfer transaction for some address with JSON-RPC node

texts:
How can I get ERC-20 token transfer transactions for some address with JSON-RPC node?

Input:

Token Contract address
Token Contract ABI
Address
Start block
End block

Output:

JSON with list of token transfer transactions

Thanks!


texts: How to configure Truffle to use the Ganache GUI instead of ganache-cli (TestRPC)?

texts: I'm using Truffle v4.0.1 (core: 4.0.1) with the default configuration (ganache-cli aka TestRPC) on Ubuntu and it works fine, but I'd like to use the Ganache GUI.  However, I can't find any instructions on how to configure them to work together.  The Truffle documentation has a nice page explaining what it is and how it install and configure it, but not how to configure Truffle to take advantage of it. Thanks!


texts: Relaying a contract call from contract A to contract C via contract B

texts:
Let's say contract A does not know the address of contract C but it knows what function of C it wants to call. Contract B stores contracts's C address. Therefore contract A wants to request a call to C's function but at the address of contract B.
Furthermore, the function returns a value about which contract A cares. Essentially, contract C is a library that contract A wants to use for his own computations but does not know the libraries' address.

Now, I have looked into various ways of doing this with call, delegatecall and fallback function but I think it might not be possible to do it exactly like that.

For example, there was once suggested solution here which I hope is fine to copy here for convenience:

contract Relay {
address public currentVersion;
address public owner;

function Relay(address initAddr){
    currentVersion = initAddr;
    owner = msg.sender;
}

function(){
    if(!currentVersion.delegatecall(msg.data)) throw;
}

Solution 1:
I have tried something like the above code, making my contract B to have a fallback function. However, when A executed a call to C through it then it returned me some strange result back to A which made me believe that it will just not work this way for some reason; the result of C will not return through fallback back to A.

Solution 2:
The closest I got it to work is when I had A execute a delegatecall to B which in turn executes the delegatecall to C. This meant that C was executing in the context of A and so when I set a storage variable in C, I am actually setting a storage variable in A. Then I had the result of the computation stored in a state variable in A which is not bad. However, this solution also means that B needs to have hardcoded all the variables/logic in the fallback function and cannot access its storage variables because it executes in the context of A. It cannot have the address of C stored in a state variable like the currentVersion in the example above.

I am not sure if everything what I wrote is correct but this is my take on it. I am hoping that maybe solution 1 should still be possible but I did something wrong? Am I missing something?


texts: Transfer tokens after smart contract is deployed

texts:
When the smart contact will be deployed, I want to send some tokens to another wallet, by smart contract.
Is there some way to do that?


texts: What is the unit used when using the SetBalance() function of the state package?

texts:
Maybe I missed it, but can't seem to find it anywhere. Is the unit used in Gwei or in Eth?

For example when writing :

stateDb, err := state.New(rootHash, db)
if err!=nil{
   return err
}
addressA := common.HexToAddress("0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B")

stateDb.SetBalance(addressA, big.NewInt(1000))

do we get 1000 eth or 1000 wei?

Any help appreciated


texts: Someone can help to verify smart contract on Etherscan?

texts:
Here is source code of this smart contract !
http://dweb.link/ipfs/QmNxz54r9DfNqqgm9h7oJp52QgTPesbnGQ4PpppkSBjwH8
Complier version : 0.5.16
What I tried: Deployed successfully but can not verify on Etherscan with Ropsten test net


texts: What does it mean to serialize a transaction?

texts:
In tx library there is a function: serialize() that "serializes" your transaction object. You can then convert that serialization into hexa decimal string, and use it to send the transaction with the sendSignedTransaction() method.

My question is: what does serializing a transaction object mean? and why is it necessary to do this?


texts:
I accidentally sent some ETC to an ETH wallet. The transaction was completed, Poloniex told me that they can't do anything. The coins never got to my wallet but went to the ETC blockchain, understandably
Is there a way to point them to a proper ETC wallet from where they are now?


texts: Quorum vs Private network Ethereum blockchain

texts:
I want to know what are the main features of a private Ethereum blockchain: the used consensus algorithm, the transaction fees, the time needed to produce a new block, the throughput, etc.
Does it enable to define private transaction and smart contract?
I want also to know the difference between a private Ethereum blockchain and a Quorum network.


texts:
I want to create a signed transaction using C#, which will later be used by Nethereum via JSON-RPC to call eth_sendRawTransaction.

I have the raw transaction and the private key, now how do I sign the data with the key?


texts:
I have a function which accepts one bytes16 argument.

  function start(
    bytes16 reference
  )

I have some events which I use to track behaviour, using reference as the index. Everything works well enough except when a user submits a reference with 17-32 chars. Between web3 and the SC, reference is being truncated, keeping only the 16 bytes to the left and the rest as zero.

I added validations for this on the client-side but I still wanted to setup the SC to handle this more gracefully. I was expecting it to revert transaction with a type error but that only happens if the argument has over 32 bytes.

I would imagine I should be adding a modifier to require the right length but I'm having a hard time finding similar cases to understand how it should be done. What's the best practice in a situation like this?


texts: I want to examine behavior of some EVM instructions in live mode, but can't find any tools like debuggers/emulators which give nice look of stack and memory and ability to execute contract by steps.


texts: How to use older version of Solidity in Truffle suite

texts:
I've tried to migrate contract on an older version of solidity, I have modified the config.js to be as in the following

and the smart contract solidity code I'm trying to deploy as follows

The problem is that whenever I try to migrate the contract it displays the following error.

any recommendations?


texts: assign decimal to a variable in solidity

texts:
I'm trying to calculate commission, but having a hard time doing a very easy math in Solidity.

Ex:

Commission = 5%

Sales = 100 ETH

100 x 5% (0.05) = 5 ETH

and in Solidity:

uint sales = 100;
uint afterCommission = sales * 0.05;

When I do this, I get

    TypeError: Operator * not compatible with types uint256 and rational_const 1/2

Solidity can't assign a decimal points to a variable? How can I make this work?


texts: the blockchain now has 6,170,500 blocks. To speed up the download I'm using the method at https://mudra.cloud/ethereum/blockchain.html   Is this the fastest method? Does anyone know another faster method? Thanks


texts: How do contracts interact, and how is the network secured?

texts:
I don't understand what it means when people saying things such as "(Ethereum) applications can interact with each other on the blockchain, so a library of useful functionality will gradually build up". The second part is fine, but how will applications interact with each other. Does that just mean features from created applications can be integrated into new applications?

Also, it is my understanding that the code behind a dapp is open source? So anyone can see and copy what I've spent my time producing?

Is there a way to conceal code, while not interfering with the other functions of Ethereum?

I understand that all apps created on Ethereum are connected to its blockchain, how will it manage thousands of connections?

Does the degree of security of the Ethereum blockchain increase with connections?

That is, is the blockchain reliant on connections to be secure?

I thought it's security was based on some sort of cryptographic innovation (inspired by Satoshi's bitcoin whitepaper).

If this is correct, then why would I even need to build the dapp on ethereum's blockchain.

If a customizable blockchain code was released for free online in a pre-existing language which can be run, then if I could just copy it and modify it according to my interests, would that not have the same effect as creating and running an app on ethereum's blockchain.

Are the details of contracts on the blockchain public? Or just the creation of the contract.

If so, is it possible to conceal the details of contracts?

Also is it possible to have a private blockchain, where a central entity controls a party's connection to the blockchain?


texts:
When I am running npm run test (mocha), I am getting this message.
 Using following: npm install --save mocha ganache-cli web3@1.0.0-beta.26
 Please advice.

> smart@1.0.0 test C:\Smart
> mocha

Error: Cannot find module 'web3'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Smart\test\inbox.test.js:3:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at C:\Smart\node_modules\mocha\lib\mocha.js:253:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (C:\Smart\node_modules\mocha\lib\mocha.js:250:14)
    at Mocha.run (C:\Smart\node_modules\mocha\lib\mocha.js:577:10)
    at Object.<anonymous> (C:\Smart\node_modules\mocha\bin\_mocha:591:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! smart@1.0.0 test: `mocha`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the smart@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:


texts: How can I get notification from geth when I receive ether?

texts:
I'd like to get notification from geth when my account receives ether. I'm thinking to type api command eth_getBalance in every minute, in order to check if my account receive ether or not. However, I don't think it's a good way.

Could you tell me better way in order to get notification from geth?


texts:
I'm indexing transactions as they are confirmed. I poll the web3.eth.getBlock with the next number and I put them in a database.
But, I've realized that some transactions have an incorrect block number. I suppose that the problem is that I've got the incorrect block branch and finally another branch was the one kept in the blockchain.
How I can prevent this situation? web3.eth.getTransactionReceipt can prevent this situation?


texts: How to introduce new consensus protocol for the Ethereum based application?

texts:
I am developing a Blockchain based application using Ethereum. Can I introduce my own consensus protocol for the application.

Any suggestions would be appreciated.

EDIT : Or will it be possible to use POA or BFT protocol in my application?


texts: Why write an EVM in bytecode, and not in something like Python or Go?

texts:
I know that Ethereum runs in virtual byte code and there's a javascript-like wrapper language called Solidity. This question is about why the developers chose this approach?

What makes it infeasible to write a smart contract blockchain in pure Python or Javascript? What are the advantages of doing it Ethereum's way?

Why did Ethereum choose to write its blockchain on EVM? Why is the EVM so limited, and how does it look under the hood?


texts: Argument encoding: list of uints (uint[48])

texts:
Using python web3 module, attempting to call a contract function that takes one argument, a list of 48 uints:

function checkOrderBatch(uint[48] input) external view returns(uint16[16] status, uint[16] amount) { ...

Calling the function like so:

res = contract.functions.checkOrderBatch(o).call()

Where o is my input.

I've been able to successfully interact with this contract already with the python web3 module, but everything I try for this function returns an error about my input values.

Here are the things I've tried, and the errors I've recieved:

Input: List of 48, with each element being a string of the following form

'0x0160e8043c35120bde2b0788f918bdd57160a127d2d56cea9c24a1342b45320c'

Error:

  Could not identify the intended function with name checkOrderBatch, positional argument(s) of type (<class 'list'>,) and keyword argument(s) of type {}.
  Found 1 function(s) with the name checkOrderBatch: ['checkOrderBatch(uint256[48])']
  Function invocation failed due to improper argument encoding.

Input: List of 48, with each element being bytes of the following form

b'0160e8043c35120bde2b0788f918bdd57160a127d2d56cea9c24a1342b45320c'

Error: Same as #1
Input: List of 48, with each element being a string of the following form

'0160e8043c35120bde2b0788f918bdd57160a127d2d56cea9c24a1342b45320c'

Error: Same as #1
Input: List of 48, with each element being bytes of the follow form

b'0x0160e8043c35120bde2b0788f918bdd57160a127d2d56cea9c24a1342b45320'

Error: Same as #1
Input: 48 separate arguments.
Error: As expected, incorrect number of arguments.

Clearly I'm not an expert in the data types intended here, so I'm likely doing something stupid. But I can't seem to figure it out. Any help would be greatly appreciated!

If you would like something to test, here is the specific contract:

https://etherscan.io/address/0x37304b0ab297f13f5520c523102797121182fb5b#code

The function is checkOrderBatch. It is a view function, so you can mess with it without wasting gas. If you can submit anything to it and get past the point I got, that's all I need! It's ok if the function returns an error. I just need to get the encoding right.

Thank you!


texts:
Issue:
When I initiate "start.bat", I am noticing that the Miner only recognizes that I have (1) GPU being recognized. Although, I do have 6 of these cards all properly connected, powered on and updated with the most recent drivers.

Am I missing something here?

Software:
Windows 7 Ultimate x64
Claymore Eth/SIA Dual Miner V11.0

Hardware:
6 NVidia GTX-1070 Cards
1 MSI Z270-A PRO Motherboard
1 4GB RAM
1 1500w Power Supply

Config:

EthDcrMiner64.exe -epool us1.ethpool.org:3333 -ewal 0xc566e10De2d070F2F7aB0455eE1f8C2AAF269347 -epsw x -dpool stratum+tcp://us-east.siamining.com:7777 -dwal 5852e111dfe4c90946457f956c5822a9e5834d7b6c197ed246f42e138bf968b5293bedba3574 -mode 0 -dcoin sia


texts: I have been mining to the address I created on my mining Linux box with geth. I can list my accounts with geth account list but how do I check my balance. My mining pool has made one payout to my address since I've started mining so I should have .02 eth there but I'd like to see it to be sure. Secondly I'm not sure if I even remember my password or not and I don't know where or how to enter my password to verify if I remember it or not. How can I check my password with geth? Thanks.


texts: Calling private function from external - where are referenced type parameters stored in the end?

texts:
Let's assume we have something like:

contract C {
   function externalFunction(uint256[] calldata data) external {
      privateFunction(data);
   }

   function privateFunction(uint256[] memory data) private {
   }
}

If I access data from within externalFuction it will read it from calldata, since it is referenced type, thus saving gas. But what will happen when it gets to internalFunction? Will it create a memory copy of array or will it read it from the same location since it will JUMP there from externalFunction?

Referenced documentation would be highly appreciated.


texts: problem connecting web3 v 1.2.1 with metamask : 'currentProvider' of undefined

texts:
I am using Web3 v1.2.1 with nodejs v10 and following this link. I am having issue connecting with metamask,below is my code snippet:

const Web3 =  require('web3')
const window = require('window');
const web3 = new Web3(window.Web3.currentProvider);

The error says
TypeError: Cannot read property 'currentProvider' of undefined

I want to access the address from metamask, can someone help me with it


texts:
I have a 2 node Ethereum system already setup. I am trying to have a web3 client talking to it. I installed web3 on a client machine and it gave no errors.

However, I try to setup index.js and do node web3. It gives me an error.

This is the error I see:
Web3.providers.HttpProvider("http://172.17.0.5:8545") = web3;
               ^

TypeError: Cannot read property 'HttpProvider' of undefined

Basically, this means it is unable to pick up any of the web3 providers. I tried with WebSocketProvider and IPCProvider, but still see this issue.

any inputs on what the issue could be.

thx - Anand


texts: Where are the opcode 0xfe and 0xfd documented?

texts:
The Solidity documentation has the following:

  Internally, Solidity performs a revert operation (instruction 0xfd)
  for a require-style exception and executes an invalid operation
  (instruction 0xfe) to throw an assert-style exception.

When looking in the yellow paper, I cannot see the opcodes 0xfd and 0xfe documented. (The largest non-suicide opcode is 0xf4 for DELEGATECALL.) Where are 0xfd and 0xfe formally documented?


texts: How to interact with a ERC20 / ERC677 token through a smart contract

texts:
I'm trying to write a smart contract that can send ERC20 / ERC677 tokens from one user to another. For example send LINK from one address to another. I deployed my contract on the kovan network but it is not working.
Im using these addresses:
1)0xC2BD595E642889Fd8130A2eA57Cb820Eb7F66D60
2)0x6BbD26ae05Ac2C69532D2c679CB693F01FD6F49f
Address: 0xC2BD595E642889Fd8130A2eA57Cb820Eb7F66D60 has 100 test LINK.
When I call transferToken(0xC2BD595E642889Fd8130A2eA57Cb820Eb7F66D60,0x6BbD26ae05Ac2C69532D2c679CB693F01FD6F49f,1) I get an error "false Transaction mined but execution" and the tokens are not transferred.
The transaction can be found at ( https://kovan.etherscan.io/tx/0x36752d523894e395feabee55c0f13cb02ef92684c5ec4383d77c94a41f1709e7p ).
I'm using remix btw.
What am i doing wrong?
This is my contract:
pragma solidity >=0.4.22 <0.7.0;

import "LinkInterfacee.sol";
contract Test{

  //kovan contract of chainlink token
   address linkAdr = 0xa36085F69e2889c224210F603D836748e7dC0088;

    IERC20 link = IERC20(linkAdr);

    function transferToken(address sender, address recipient, uint256 amount) external payable returns(string memory){
        link.approve(address(this),amount);
        link.transferFrom(sender, recipient, amount);
    }

    function getBalanceOf(address _address)public view returns(uint256){
        return link.balanceOf(_address);
    }

}


texts:
When I tried to send ether to my contract, I get this error. Even if try to change the value of Gas Limit and Gas Price the transaction still fails. What could be the possible reason?

What I speculate is that the fallback payable method is a little complex and that it requires huge gas to fuel that transaction.


texts:
I have written a basic contract like this to store certificates:

    pragma solidity ^0.4.2;

    /// @title Sending and storing certifications to the blockchain
    contract CertificationStore {

        struct Certification {
            string firstName;
            string lastName;
            string certName;
            string institution;
            string description;
            uint year;
            uint month;
            uint day;
        }

        mapping (address => Certification) public certifications;

        Certification[] public certArray;
        address[] public addressIdx;

        uint numCerts;

        Certification public aCert;

        event Send(address indexed _from);

        function CertificationStore() {
        }

        function getCertArrayLength() returns(uint) {
            return certArray.length;
        }

        function getAddressIdxLength() returns(uint) {
            return addressIdx.length;
        }

        function sendCert(address acct, string fn, string ln, string cn,
            string ins, string desc, uint yy, uint mm, uint dd) returns(uint certId) {

            certifications[acct] = Certification({
                    firstName: fn,
                    lastName: ln,
                    institution: ins,
                    description: desc,
                    certName: cn,
                    year: yy,
                    month: mm,
                    day: dd
                });

            certId = numCerts++;

            addressIdx[certId] = acct;
            certArray[certId] = Certification({
                    firstName: fn,
                    lastName: ln,
                    institution: ins,
                    description: desc,
                    certName: cn,
                    year: yy,
                    month: mm,
                    day: dd
                });
            Send(acct);

        }

        function getFirstName(address _from) public returns(string) {
            for (uint i = 0; i < certArray.length; i++) {
                Certification cert = certArray[i];
                string name = cert.firstName;
                address acct = addressIdx[i];
                if(acct == _from) {
                    return name;
                }
            }

            return ("no name found");
        }

    }

I am using web3 and truffle to create a frontend to interact with this contract.

On the frontend, when I call sendCert with all the values, it seems to add them to the map but NOT to the array. I tried adding to the array the way shown above and with the .push() method and when I call the two functions to check the certArray length and the addressIdx array length, it ALWAYS returns 0.

The method sendCert, which is supposed to add the certifications to the array and the mapping also returns 0 for that certId no matter how many times I add certifications.

Am I doing something wrong here? In the frontend, I have a call back which logs "success" when the certification is sent successfully and executed by this method successfully.

Lastly, is there any way I can send the contents of the two arrays to the frontend to work on them in javascript instead of solidity?

Thank you for your help and patience!


texts: How to modify the algorithm of transaction selection in Ethereum private net?

texts:
By default, miners select transactions with high fees from the mempool. So, transactions which are dependent and have a specific order can be selected randomly without respecting this order.
Will I be able to insert my own algorithm of pending transaction selection in the Ethereum private net? and how to do this insertion?
Thank you.


texts: How to send PAXOS token which has not transfer method?

texts:
I'm new in Ethereum contracts. I could implement sending USDT tokens through web3.php, and everything work well. Now, I want to add PAXOS and send such tokens through my system. But I found there is not any transfer() method for PAXOS like what is in USDT contract.
May you help me please and say what is the way to send PAXOS?


texts: Function selector computed differently for libraries?

texts:
As documented in various places, the function selector is computed as the first four bytes of the keccak256 hash of the function header, which consists of the function name followed by the list of canonical argument types.

Is this function selector computed differently if the function is defined in a library instead of in a contract? The following example seems to indicate that (even though I haven't found any specification of this behaviour).

Function with struct parameter in contract

The selector of function F is computed as the first four bytes of the hash of F((address)), which is 0xa0b61132, as expected.

# cat c.sol
pragma solidity 0.5.12;
pragma experimental ABIEncoderV2;
contract C {
  struct S {address a;}
  function F(S calldata) external pure returns (uint256) {return 0;}
}
# solc --asm c.sol
...
    tag_1:
        /* "c.sol":58:173  contract C {... */
      pop
      jumpi(tag_2, lt(calldatasize, 0x04))
      shr(0xe0, calldataload(0x00))
      dup1
      0xa0b61132 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      eq
      tag_3
      jumpi
...

Function with struct parameter in library

The selector of function F is computed as 0xe2a2daa1, which is unexpected.

# cat l.sol
pragma solidity 0.5.12;
pragma experimental ABIEncoderV2;
library L {
  struct S {address a;}
  function F(S calldata) external pure returns (uint256) {return 0;}
}
# solc --asm l.sol
...
sub_0: assembly {
        /* "l.sol":58:172  library L {... */
      eq(address, deployTimeAddress())
      mstore(0x40, 0x80)
      jumpi(tag_1, lt(calldatasize, 0x04))
      shr(0xe0, calldataload(0x00))
      dup1
      0xe2a2daa1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      eq
      tag_2
      jumpi
...

Which method is used to compute the selector for functions in libraries? What is the rationale for doing it differently from contracts?


texts:
I'm trying to use jscon-rpc but I dont get any response. After installing geth and loading the rinkeby test net does the ethereum node start ? I used "localhost" as the IP and "8545" as the port number. Have I missed out on anything? Please help

String callGeth(String inputJSON)

{

HTTPClient http;
    http.begin("http://IP address of my PC(have geth running) :8545/");
    http.addHeader("Content-Type", "application/json");
    int httpCode = http.POST(inputJSON);
    String JSONResult = http.getString();
    Serial.println(JSONResult);
    http.end();
    return JSONResult;

}

StaticJsonBuffer<1000> JSONbuffer;
JsonObject& gethQueryJSON = JSONbuffer.createObject();
gethQueryJSON["jsonrpc"] = "2.0";
gethQueryJSON["method"] = "eth_call";
JsonArray&  gethQueryParams = gethQueryJSON.createNestedArray("params");
JsonObject& gethCallParams = JSONbuffer.createObject();
gethCallParams["to"] = "0xC2eafE628dB80634Fdd657965B38136Ec6F3338A";
gethCallParams["data"] = "0x9de4d683";
gethQueryParams.add(gethCallParams);
gethQueryParams.add("account3");
gethQueryJSON["id"] = 1;
String gethStringJSON;
gethQueryJSON.printTo(gethStringJSON);
Serial.println("First Geth query JSON message isLightTurnedOn function: ");
Serial.println(gethStringJSON);
String gethResult = callGeth(gethStringJSON);
Serial.println(gethResult);


texts: Truffle Drizzle-box fails with TypeError: (0 , _drizzle.generateContractsInitialState) is not a function

texts:
Right after unboxing Drizzle-box I'm getting a
TypeError: (0 , _drizzle.generateContractsInitialState) is not a function.

Ganache is running on localhost:8545, contracts are deployed, Metamask connected to localhost:8545, as it should. What I did wrong? Please help!


texts: MyEtherWallet interact with contract : generate input from ABI

texts: Do you know some code to generate a contract interaction from ABI like there is on MyEtherWallet ?


texts: I looks like JAXX is only for Android. Is there really no option for iPhone yet?


texts: Why some contract addresses show 0 supply and 0 holders on Etherscan

texts: I have a an old list from December 2019 which showed the holders, supply and transfers in last 24h from Etherscan like here . Howvever while I was revisiting the addresses on Etherscan, there were a few address like this which now don't show any holders, supply or transfers. Any idea why this might be so?


texts: After mining (incomplete synchronized blockchain) and get 15 ether I loose everything

texts:
I'm pretty sure that what happened to me was an exception or a bug or certainly innexperience over Ethereum. I will establish all the facts in order to find what happened or at least an explanation.

Rigth now I know that was impossible to mine 15 ethers in less than 48hs with CPU. But I also know that I saw (I even have screenshots) with my own eyes those 15 ethers in my wallet, until I get an error with Eth Wallet and everything goes bad :)

At first my wallet started with 0 ethers and geth started from scracth to synchronize blockchain.

My question is very simple. What happened? I know that was impossible to get that amount of ether in so few hours, but how is possible that I saw those ethers?


texts: Help will be greatly appreciated: I'm trying to find the JSON or ABI for one of my contract wallets:

texts:
i have lost the keystore to my wallet which i am trying to retrive. As i understand that if i have a Contract associated with that wallet(which i do) i could import the contract and then save the wallet files. If this is true i can get hold of my lost wallet again. But i do not understand the method of retrieving the jason interface if someone can help me actually generate that. My Contract Address is: 0x5246E70a8839987FC4A752746755673382a6c9F1 and the wallet i am trying to retrive is: 0xC137c13da76a1E2E85C66d75599802e887E655DB

Please Help
Thank you


texts: trying to send some tokens from unlocked account

texts:
So I'm trying to send some tokens from an, with ganache-cli unlocked, address to mine to try something out, however for my code to work I need some starting amount of the initial token. Is there some way to act as the owner of the unlocked account or can I 'take' some of the accounts token?
Any help is much appreciated


texts: How to generate sign to pass to transferPreSigned(), contract is not asking for sign while transfer()

texts:
I'm creating ERC865 token so that users can send tokens without having ether. I followed 1 and 2.

As per 1, sender will sign transaction object while calling transfer() but I'm unable to see any "Sign"! What parameters should be passed to transferPreSigned()? I'm using Metamask and Solidity.


texts: Truffle Mainnet - "No contracts deployed."

texts:
I really need help! I created an ERC721 smart contract and deployed into the rinkeby test network. All was nice, after that I deployed into mainnet.
I set the gas price to 65 Gwei. Now the contract is created. I found the contract address into etherscan and all looks nice. When I'm typing into Truffle truffle networks I am seeing this:

Network: mainnet (id: 1)   No contracts deployed. Network: rinkeby
(id: 4)   FakinSurreal: 0x03D24C886741B49bebcdf93538162E881b1Db9BD
Migrations: 0x8909907E804E326Db3a230ccd603560A4D77e32d

I have an external script to mint tokens using the command truffle exec. When i did that it told me that:

Error: FakinSurreal has not been deployed to detected network
(network/artifact mismatch)
at Object.checkNetworkArtifactMatch (C:\Users\user\AppData\Roaming\nvm\v9.10.0\node_modules\tru
fle\build\webpack:\packages\contract\lib\utils\index.js:249:1)
at Function.deployed (C:\Users\user\AppData\Roaming\nvm\v9.10.0\node_modules\truffle\build\webp
ck:\packages\contract\lib\contract\constructorMethods.js:84:1)
at
at process._tickCallback (internal/process/next_tick.js:118:7)

Please help me! Can I configure my smart contract address somewhere into Truffle to interact with it?
Thank you!


texts: crowdsale deployed on testnet cannot receive ether from another test account

texts:
I deployed a smart contract for crowdsale that has a function of receiveETH():

function receiveETH(address beneficiary) internal {
    uint coinToSend = bonus(msg.value.mul(COIN_PER_ETHER).div(1 ether)); // Compute the number to send
    Backer backer = backers[beneficiary];
    coin.transfer(beneficiary, coinToSend); // Transfer right now
    backer.coinSent = backer.coinSent.add(coinToSend);
    backer.weiReceived = backer.weiReceived.add(msg.value); // Update the total wei collected during the crowdfunding for this backer
    etherReceived = etherReceived.add(msg.value); // Update the total wei collected during the crowdfunding
    coinSentToEther = coinSentToEther.add(coinToSend);
    // Send events
    LogCoinsEmited(msg.sender ,coinToSend);
    LogReceivedETH(beneficiary, etherReceived);
}

this contract I have deployed on testnet, but it could not receive ether. For example, I use some test accounts to send ether to that deployed smart contract address, everytime it says success on etherscan and the Tx cost is deducted, while the ether is not successfully transferred and smart contract ether amount remains 0. link

I wonder what's wrong here?  Does crowdsale contract has a function that's triggered everytime a new transfer comes in?

P.S. just noticed I have the fallback function defined:

function() stopInEmergency respectTimeFrame payable {
    receiveETH(msg.sender);
}

it looks perfect for me, but still my contract does not receive ether when I try to send to it. What else is wrong here?


texts: How can we get the current spot price for a BEP20 token used web3?

texts:
I'm using web3 to get the token balances (quantity) for a number of BEP20 tokens (eg safemoon 0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3)
What I'm trying to get now is the latest token price in bnb or usd so that I can then work out my current balance
The balance is displayed on bscscan (as below) and that is effectively what I'm trying to get to

How would we get the price data points from web3?


texts: Error "Trying to create an instance of an abstract contract." for standard token

texts:
When I try to create a new instance of the standard token, compiler throws an error:
Error: Trying to create an instance of an abstract contract.

I suppose it is due to abstract receiveApproval function specified in standard token:
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }

If I'm right, then how to deploy standard token contract from within another contract?

Update:
Code, compiler and error in the browser-solidity:
https://ethereum.github.io/browser-solidity/#version=soljson-latest.js&gist=d033d42efe4975df632dff74e889dd05


texts:
In this answer, @pabloruiz55 provides the following code for sending ether.

SmartContract.sol

function transferToOwner() payable returns (bool) {
    //Sender should forward at least 1 ether.
    require(msg.value > 1 ether);
    uint amountToSend = 1 ether;
    uint change = msg.value - amountToSend; // Do something with the change. Return it to sender, maybe?
    // If you don't do anything with the change, it will be stuck on this contract
    owner.transfer(1 ether);
    return true;
}

What would be the code for?

// Do something with the change. Return it to sender, maybe?


texts: Smart Contract that can transfer ETH to other ETH Wallet (Owner of the Smart Contract)

texts:
I actually my partner created a Smart Contract which is able to create a new smart contract and send the proceeds. I'm quite new to Solidity unable to figure out a way to modify the smart contract to accept ETH from the sender, store it or send it directly to the Owner of the Smart Contract. Here's the code, help will be appreciated!

    pragma solidity ^0.4.0;

    contract EtherTransferTo {
    function () public payable {
    }

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

    contract EtherTransferFrom {

    EtherTransferTo private _instance;

    function EtherTransferFrom() public {
    // _instance = EtherTransferTo(address(this));
    _instance = new EtherTransferTo();
   }

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

    function getBalanceOfInstance() public returns (uint) {
    //return address(_instance).balance;
    return _instance.getBalance();
    }

    function () public payable {
    //msg.sender.send(msg.value);
    address(_instance).send(msg.value);
    }
}


texts:
I've sent a mistake ETC from ETH address from poloniex.
How do i do now.
This is my transaction (this is a fresh address)
http://gastracker.io/tx/0x13ae860aa07336c3343cc408bc9360a89c64703c690e64380a34ceaa4bc71e02

PS: let me explain more.
I want withdraw 7.5ETH from Poloniex to MyEtherWallet.com address. But I sent 7.5ETC from Poloniex to an ETC address "0x407e1bb8b5c114e40469eedb5632518b68f9be38". My ETH address has same address like this.

Thanks.


texts: What is parity bootnode role in a private network an how should I setup it?

texts:
NOTE: I've found a bunch of answers concerning geth client, but I'm interested specifically in parity. I have the following private network spec:

clients: Parity v1.9.2-beta
consensus: aura

I've split the main question into the smaller chunks:

I treat bootnode as a node which should always be online to provide your node with a list of other peers. Your node has either a hardcoded bootnodes list (for public networks such as mainnet, kovan, ropsten, etc)
or the list is provided to a parity executable using startup params or via *.toml config file. Is this definition correct?
Could bootnode be an aura validator at the same time?
Are any config options to explicitly tell parity to run this node as a bootnode or any node could be run as a bootnode?
Does bootnode share blocks with other peers?


texts: Issue deploying a contract successfully with Truffle and ganache

texts:
Long story short my contract is not passing the deployment test using truffle, mocha, and chai.
I ran the code individually in the truffle console and it was returning an address just fine but it won't pass the test I wrote. I'm positive I wrote the mocha test well but I can't figure it out.
side note: running truffle test  from the truffle console causes node.js to throw an error. However, running truffle test from the CLI works fine and just returns 0 passing.
Here is the code
const { expect } = require('chai')
.use(require('chai-as-promised'))
.should()

const Auction = artificats.require('./implementor.sol');

contract('Go',(accounts) => {
    let contract

    describe('deployment',async() =>{
        it('deploys successfully',async ()=>{
            contract = await Go.deployed()
            const address = contract.address
            console.log(address)
            console.log('ran')
            assert.NotEqual(address,'')
        })
    } )
})

So I tried it this way because I thought maybe the contract wasn't being created at all.
const { expect } = require('chai')
.use(require('chai-as-promised'))
.should()

const Auction = artificats.require('./implementor.sol');

contract('Go',(accounts) => {
    beforeEach(async () => {
        this.Go = await Go.new()
    });

    describe('deployment',async() =>{
        let contract
        it('deploys successfully',async ()=>{
            contract = await Go.deployed();
            const address = contract.address;
            assert.NotEqual(address,'');
            return(address);
        });
    } );
});


texts: How to enhance list of accounts for the Truffle tests to run against Ropsten testnet

texts: I am working on the my contracts testing scripts. But I want to run tests not on the local TestRPC or Ganache but in the Ropsten testnet. How can I predefine a list of accounts (private keys and addresses)?


texts:
how to get transactions per hour for given ERC20 tokens on blockchain? (preferably with python)

Lets say i want to get number of transaction per hour for EOS token.


texts: How to exchange two different ERC20 compliant tokens directly?

texts:
In my Dapp, I have two different ERC20 tokens: say, ABCToken and XYZToken.  A user could give 10 ABCTokens to an account and in return should get 5 XYZTokens.

Is it possible to do this directly without converting to ethers in between? If so, what is the best way to do it (i.e. at a high level, what kind of contracts and operations required to achieve this)?


texts: Safety of Using DELEGATECALL with Mappings

texts:
To make my contract upgradable, I have a proxy contract that stores all of my data.

As I understand it, when using delegatecall the storage layout needs to match for both the caller and callee. Due to the nature of my contract, I have many mappings that are subject to change on upgrades. Do these need to be defined in both contracts? Am I at risk of corrupting storage if not?

My thought is no, since mappings are not stored the same way and do not have fixed sizes. I want to be sure though.


texts: When mining on uncle, how storage serialization is handled?

texts:
This might be a question which carries misunderstanding, but as I understand it, an uncle is a temporary valid block not part of the main chain. Ethereum introduce the possibility to mine on an uncle and merge transactions mined inside an Uncle.
The problem as I understand is an Uncle use a differrent state of state database. So when 2 competiting transactions are mined (1 in a regular block and the other inside an Uncle block). How does serialization works?


texts: Geth syncing - Jan 18, how much time should wait before I call it quits. (First time miner)

texts:
After 3 days; current status:

> eth.syncing
{
  currentBlock: 4829460,
  highestBlock: 4829665,
  knownStates: 19675738,
  pulledStates: 19646971,
  startingBlock: 4828906
}

Getting ti


texts: Can you Pass a Variable to a smart contact?

texts:
For Example:

I have a website and on the website there is an input box that allows the user to input a number.

Say he inputs 10, can that number then be passed to an empty variable in the smart contract?


texts:
Im trying to setup puppeth Ethstats on a Ubuntu machine to connect to my geth private chain and I'm getting the error
'err="docker configured incorrectly: bash: docker: command not found\n"'
I followed the tip from this thread setting PermitUserEnvironment yes then creating file ~/.ssh/environment with text PATH=/puppeth/bin:/bin:/puppeth/sbin:/sbin:/puppeth/local/bin and the username is puppeth as it seems to indicate would work but the error doesn't change.  Are there further steps I need to take?


texts:
I want to sort next Struct by amount. Any idea how to get it? Thnks
pragma solidity 0.5.1;

contract AllWalletsContract{

    struct AllWallets{
        address wallet;
        uint amount;
    }

    AllWallets[] allWallets;

    function add(address _wallet, uint _amount) public {
        allWallets.push( AllWallets( _wallet, _amount) );
    }

    function getBiggestWallet() public view returns (address) {
        /* Return the biggest wallet */
    }

}


texts: Are addresses between different networks (testnet) interchangeable?

texts:
I am designing user interface having both Ethereum mainnet and testnet addresses. Is it possible for the user to accidentally give testnet address when withdrawing in mainnet and vice versa?

How can I verify an address belongs to a particular Ethereum network?


texts: Constructor error on multiple pieces of code - Remix

texts:
I've been getting this error when I try and deploy a contract with a constructor on multiple pieces of code. I use the correct complier version too
creation of MyContract errored: Error encoding arguments: Error: invalid address (argument="address", value="", code=INVALID_ARGUMENT, version=address/5.1.0) (argument=null, value="", code=INVALID_ARGUMENT, version=abi/5.1.2)
can anyone help?
pragma solidity 0.5.1;

contract MyContract {
    mapping(address => uint256) public balances;
    address payable wallet;

    constructor(address payable _wallet) public {
        wallet = _wallet;
    }

    function buyToken() public payable{
        //buy token
        balances[msg.sender] += 1;
        wallet.transfer(msg.value);
        //send eth to wallet
    }
}

edit: this is happening when I pass in address payable _wallet into my constructor. If I take out address payable I can deploy. This happens on my other computer too. So I know this isnt a machine related error


texts:
I was reading this article about Crowdsale.

Simply, 100 Tokens are to be minted. The author set 60% of tokens are distributed as public sale. To be more specific, 20 out of 60 tokens will be sold during PreICO and 40 out of 60 will be sold during ICO.

As per rate,

in PreICO, 1 ETH can buy 5 tokens, and

in ICO, 1 ETH can buy 2 tokens.

To summarize,

PreICO has limit up to 4 ETH (4 ETH * 5 tokens = 20 tokens), and

ICO has limit up to 20 ETH (20 ETH * 2 tokens = 40 tokens).

So in total public sale will be capped at 24 ETH, which means investors should not be able to purchase more tokens when the weiRaised reached 24 ETH.

However, the author set its hard cap at 500 ETH, but isn't it supposed to be capped at 24 ETH instead?


texts: Where should we actually need to set the token price?

texts:
I have seen a video which sets the "token price" in a contract using that token (erc20), If the same token is used in another contact for transferring in another contract with a different value of "token price" then is the token acceptable in the exchanges?

And is it the correct way of setting the token price ?