texts: Is there a Dapp for an Escrow(like) Smart Contract?

texts: I have been searching and can't tell if I'm just confused or what. But I am trying to find out if there is a Dapp or if i need to make a smart contract that allows me to make an escrow smart contract or something of the likes. I am looking for this because I am trying to make a large purchase from a seller I have not necessarily gained a lot of trust yet and want the payment to go through on delivery of the goods.


texts: Dockerized Ganache-cli + HdWallet Provider?

texts:
Does anyone have any experience connecting an instance of HdWalletProvider to a dockerized Ganache-Cli? Having trouble connecting with http://0.0.0.0:8545, or ganache-cli:8545, or anything other form of host I can think of. I'm new to Docker as well (snippet attached)
var provider = new HDWalletProvider({mnemonic: teamsMnemonic, providerOrUrl: "http://0.0.0.0:8545", addressIndex: 0, numberOfAddresses:10, shareNone:false});

version: "3"
services:
mongo:
image: mongo
ports:
 - 27017:27017

executor:
build:
context: https://github.com/zach-is-my-name/Aion.git#docker
depends\_on:

  - mongo
  - ganache-cli
labels:
  purpose: "run the Aion system executor"
  platform: "node.js"

truffle-test-suite:
build: .
depends\_on:

  - ganache-cli
labels:
  purpose: "run the GoalZapp test suite"
  platform: "node.js"
  framework: "truffle"

ganache-cli:
image: trufflesuite/ganache-cli:latest
command: bash "ganache-cli -h http://0.0.0.0:8545 -f https://sandbox.truffleteams.com/de77b065-c9a7-4c8b-9fe9-0e507a623f9a"
ports:
- 8545:8545
labels:
  purpose: "run the virtual ethereum network for testing, hosting Aion contract"
  platform: "node.js"

Update Gist with formatted docker-compose.yml


texts: How to distinguish token from a liquidity pool?

texts:
Let's take two addresses:

Pancake LPs
ElonGate

The first one is a liquidity pool that implements IPancakePair interface and the second one is a IERC20 token.
Short of inspecting the name, how can I differentiate the two programmatically?
I have abi for IPancakePair and IERC20.


texts: Sending to ETH2 deposit address manually?

texts: Does anybody knows how to send the required amount to the ETH2 deposit contract manually? Ethereum Launchpad supports only 3 wallets. Metamask is the only one which supports hardware wallets, but currently have a problem with Ledger to sign the transaction. I did generate eth2 keys and depost_data.json file and I want to use my Ledger to sign the transaction with MEW for example.


texts: need help with erro code in smart contract

texts: ParserError: Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead. --> contracts/Mhetoken.sol:88:17: | 88 | function () { | ^


texts:
Can anybody show me how to add a code for burning %1 of each transaction?
https://github.com/strainzeh/MADToken/blob/main/MADToken.sol


texts: How can I create public-private key for a ERC20 wallet that using user's email address?

texts:
I am working on a side project that provides a wallet (Think Coinbase, Binance, etc) like interface to users where they will sign in using username and password.

To be able to provide a clearer interface and ease of use, I would like to abstract them from all the complexities of public-private key.

How can I use their username/email or some unique id to generate a pair of keys to be used as wallet address and the corresponding private key to hold the ERC20 token?

I have explored the has functions within Solidity but now I am not even sure if this needs to be a smart contract?


texts: filter blocks by time range on https://etherscan.io/

texts:
Could you please tell me how I can filter the blocks by its created time on https://etherscan.io/? For example, if I want to find all blocks that were created between May-22-2019 04:50:00 AM +UTC and May-22-2019 04:51:00 AM +UTC, how can I do?

Really thanks a lot!


texts: Is it ok geth need any delay untill it start to listen RPC-port?

texts:
My app launches Geth process like this: geth --cache=512 --rpc
Next it immediately starts to process incoming requests and sends some needed data to http://localhost:8545 (i.e. to geth for the interaction by RPC protocol).
However at the first time after launch (about 5 seconds) geth returns:

  Failed to connect to localhost port 8545: Connection refused

Afterwards it works great.

Is such behavior standard?


texts: Uniswap core requires solidity 5 while periphery requires 6

texts:
Working through the examples of uniswap v2 (https://uniswap.org/docs/v2/smart-contract-integration/quick-start/) I got stuck with the following problem:

As we can see, v2-core requires solidity 5 while v2-peryphery requires solidity 6.
The issue is opened on the github: https://github.com/Uniswap/uniswap-v2-core/issues/105 from 2020.
Does anyone have a solution to that? How should i import both core and periphery contracts into my contract to make their examples work?


texts: Zero Knowledge v Multi Party Computation (MPC)

texts:
I am struggling with understanding the difference between the two. From what I am putting together, they have different adversarial models, MPC adds the condition of collusion between parties i.e. election voting.

OR

Is Zero Knowledge a prerequisite for MPC?

I would appreciate if it anyone could provide both a simple and expanded explanation for this.


texts: Howto transfer BTC/ETH from coinbase to Mist / ethereum wallet

texts:
recently I bought some BTC on CoinBase. I've transfered the whole amount from the CoinBase BTC wallet into the CoinBase ethereum wallet. But how can I send that ETH into my Mist/Ethereum Wallet (e.g. using my wallet contract as receipient) ?

kind regards
Dominik


texts: What's the root cause "contract error - Gas estimation failed Gas estimation errored with the following message (see below)"?

texts:
Rest of the error:

  The transaction execution will likely fail. Do you want to force
  sending?  Internal JSON-RPC error.

I got that message on several cases, usually on different mistakes.

What's the cause for that error and is there a way which can get me towards understanding the problem faster.

In most cases I'm trying to rewrite everything chunk by chunk and check when I don't get that error.


texts: Initialising structs to storage variables

texts:
The following code fails to compile with error: Type struct SomeStruct memory is not implicitly convertible to expected type struct SomeStruct storage pointer.

contract StructExample {

    struct SomeStruct {
        int someNumber;
        string someString;
    }

    SomeStruct[] someStructs;

    function addSomeStruct() {
        SomeStruct storage someStruct = SomeStruct(123, "test");
        someStructs.push(someStruct);
    }
}

while the following code does compile

contract StructExample {

    struct SomeStruct {
        int someNumber;
        string someString;
    }

    SomeStruct someStruct;
    SomeStruct[] someStructs;

    function addSomeStruct() {
        someStruct = SomeStruct(123, "test");
        someStructs.push(someStruct);
    }
}

Is there a way of initialising a struct to a storage variable rather than a memory variable?

Or is the first method outlined above the correct way to do it and there's just a bug in the Solidity compiler?
The second method that does work is not ideal as you have to scope the storage variables at the contract level rather than within a function.


texts: Can someone explain me the syntax of this solidity line?

texts:
Is this (syntax 1):

feed.info.value(10).gas(800)();

equivalent to (syntax 2):

feed.sendTransaction({value: 10, gas: 800, from: address(this)})

?

In which case, how will the Consumer contract have the 10 eth in the first place since it has no payable function?

I saw the first of these lines in the infofeed example here:

contract InfoFeed {
  function info() payable returns (uint ret) { return 42; }
}
contract Consumer {
  InfoFeed feed;
  function setFeed(address addr) { feed = InfoFeed(addr); }
  function callFeed() { feed.info.value(10).gas(800)(); }
}

If there are equivalent, suppose InfoFeed.info() were to take some arguments. How could we send the value of these argument using the first syntax please?

Thanks


texts: implement solidity library with no overhead of external function calls

texts:
When reading the doc of Solidity.I found out that the following is hard to understand or maybe I misunderstood something, any help is much appreciated.The document says:

  The following example shows how to use memory types and internal functions in libraries in order to implement custom types without the overhead of external function calls:

pragma solidity ^0.4.0;

library BigInt {
    struct bigint {
        uint[] limbs;
    }

    function fromUint(uint x) internal returns (bigint r) {
        r.limbs = new uint[](1);
        r.limbs[0] = x;
    }

    function add(bigint _a, bigint _b) internal returns (bigint r) {
        r.limbs = new uint[](max(_a.limbs.length, _b.limbs.length));
        uint carry = 0;
        for (uint i = 0; i < r.limbs.length; ++i) {
            uint a = limb(_a, i);
            uint b = limb(_b, i);
            r.limbs[i] = a + b + carry;
            if (a + b < a || (a + b == uint(-1) && carry > 0))
                carry = 1;
            else
                carry = 0;
        }
        if (carry > 0) {
            // too bad, we have to add a limb
            uint[] memory newLimbs = new uint[](r.limbs.length + 1);
            for (i = 0; i < r.limbs.length; ++i)
                newLimbs[i] = r.limbs[i];
            newLimbs[i] = carry;
            r.limbs = newLimbs;
        }
    }

    function limb(bigint _a, uint _limb) internal returns (uint) {
        return _limb < _a.limbs.length ? _a.limbs[_limb] : 0;
    }

    function max(uint a, uint b) private returns (uint) {
        return a > b ? a : b;
    }
}

contract C {
    using BigInt for BigInt.bigint;

    function f() {
        var x = BigInt.fromUint(7);
        var y = BigInt.fromUint(uint(-1));
        var z = x.add(y);
    }
}

My Question is that, is using A for B a good practice ? for here it says when using this ,there is no overhead of external function call.But in the document it also says:

  The calls to Set.contains, Set.insert and Set.remove are all compiled as calls (DELEGATECALL) to an external contract/library.

but code comment in the document also says both ways are just identical:

// Here, all variables of type Set.Data have
// corresponding member functions.
// The following function call is **identical** to
// Set.insert(knownValues, value)
require(knownValues.insert(value));


texts:
Created a Contact and got it verified on Etherscan.com with name, symbol etc.
Now again I create another ERC20 contact with the same Name and same symbol but with another contact address will it not cause a confusion to people who will use my previous Token.


texts: Provided Host header is not whitelisted on curl call

texts:
I wanted check if I can connect to a remote server to get some information and send a transaction.

First I checked the connection with this :

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1} http://xxx.xxxx.xxx.xxx:8545

But I've this error :

curl: (3) [globbing] nested brace in column 50
curl: (3) [globbing] nested brace in column 50
curl: (3) [globbing] nested brace in column 50
Provided Host header is not whitelisted.

What doest it mean? What can I do to resolve it?


texts:
I tried signing a Message using the SHA256withECDSA algorithm . It gives a different signed(r,s) output everytime. When i try to recover the address using the ecrevover method .it gives me a different address everytime.

Does it mean Ethereum requires a constant r,s value for message everytime?


texts:
I am using the prebuilt function now in my contract and returning it as an uint. but when i read it using web3 1.0 i get bigger numbers than usual :

Example :
This what the number should look like from number of digits pov: 1522342012
this is what i get : 1522339819405493950

I tried getting this as a solidity string or bytes32 but i still get the same number of digits.


texts: Cannot transfer ownership of ERC20 contract

texts:
My contract source code likes below:

contract StandardToken
{
  uint256 totalSupply;
  ...
}
contract Ownable {
  address public owner;
  function Ownable() public {
    owner = msg.sender;
  }
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }
}
contract MyToken is StandardToken, Ownable {
     string public name ;
     string public symbol ;
     uint8  public decimals ;
     function MyToken(
            uint256 tokenInitialSupply,
            string tokenName,
            string tokenSymbol,
            uint8 tokenDecimals,
         ) public {
         totalSupply = tokenInitialSupply.mul( 10**uint256(tokenDecimals));
         name = tokenName;
         symbol = tokenSymbol;
         decimals = tokenDecimals;
         balances[msg.sender] = totalSupply;
     }
     ...
     function getowner() public view returns (address) {
            return owner;
       }
}

I use the js code below to transfer ownership:

var tokenAddress = "0xc11b5692d92c5a5f72c5286caaaf27281ff23cc4";
var ownerAddr = "0xf05b0e099cbbb7805cef0c3a822ae2d3b49040ce";
var targetOwnerAddr = "0x700fac5cb73979f0d64b9b410b14a214146f1df1";

var async = require('asyncawait/async');
var await = require('asyncawait/await');
const Web3 = require('web3');
const web3 = new Web3('http://localhost:8545');
const main = async () => {
    var abi = JSON.parse(fs.readFileSync('/root/abi/mytoken.json', 'utf-8'));
    const contract = new web3.eth.Contract(abi, tokenAddress );
    await web3.eth.personal.unlockAccount(ownerAddr, "********", 600);

    //current owner address
    var currOwnerAddr = await contract.methods.getowner().call();
    console.log(`current owner address: ${currOwnerAddr}`);

    //transfer owner
    await contract.methods.transferOwnership(targetOwnerAddr).call({from: ownerAddr});

    //new owner address
    var newOwnerAddr = await contract.methods.getowner().call();
    console.log(`new owner address: ${newOwnerAddr}`);
}
main();

However, the log below shows owner is unchanged:

current owner address: 0xF05B0e099CbBB7805CEF0C3A822aE2D3B49040ce
new owner address: 0xF05B0e099CbBB7805CEF0C3A822aE2D3B49040ce

So would you help point out where the problem is?Many THANKS.


texts: Relationship between Transaction Trie and Receipts Trie

texts:
Reading through the Yellow paper, I can see that each block header includes the Keccak 256 hash of the root of the trie for transactions and transaction receipts. I am struggling to understand how and where they are created.

How are the  Transactions Trie and the Transaction Receipts Trie related for a given block?

Is it the case that, as the world state is updated by going through the transactions, the transactions and transaction receipts are stored in their respective tries?


texts: geth install in kali linux throws a error

texts:
sudo add-apt-repository -y ppa:ethereum/ethereum

PPA name not found
Utility to add PPA repositories in your debian machine
/usr/sbin/add-apt-repository ppa:user/ppa-name


texts: Implement tokenfallback on an existing ERC20 Token

texts: I have an ERC20 token which is already deployed on the mainnet. I want to make a contract which accepts this token from users and pays dividends in Ethereum stored already inside the contract. In my knowledge, ERC20 doesn't have a default tokenfallback function. So how will I detect the incoming token transaction to my contract?


texts: Storing 100 million transactions in private ethereum blockchain

texts:
I want to store 100 million transactions in a private ethrereum blockchain where each transaction may be 100 kilobytes of data for verification purpose. I am considering proof of authority (POA)  of ethereum blockchain.

Will ethereum be the right choice? If yes then which client I should consider.
What kind of complexities may arise later in terms of the query, CPU usage, storage?
What server configuration should I consider?
Any precautionary suggestions are much appreciated.

thanks in advance


texts: How to fork current eth mainnet chain in new private blockchain from block #####

texts: I want to run my own eth fork from mainnet (keeping history of transactions, balances & etc). How can I start my new geth instance that will start working after ###### block of mainnet chain? I found ganache-cli but it`s only for testing. Are there any solutions / manuals for forking eth mainnet in production?


texts:
I´ve bought GAME (GTC) and transferred it to My Ether Wallet. It shows me the amount of GTC, but the value shown in USD is not correct. How is that possible?

Thank You


texts: I have bought MSI motherboard with ethOS SSD. I have Nvidea GPU but it's not starting up the mining process. Is there any particular brand GPU I have to use with ethOS?


texts: How do i connect geth to web3.py using IPC on Windows?

texts:
I'll briefly explain my setup before describing the problem in detail.

I am on Windows 10 and using the geth client in Light Sync Mode, along with web3.py on Jupyter Notebook and Metamask as a wallet.

I have already succeeded in connecting to Rinkeby network through an Infura Node, but now i want to do the same using geth.

So, basically i want something along the lines of web3.py being able to communicate with the geth client. both of these are running on the same machine, hence i see no reason to use the HTTP provider in web3.py.

I want to use the IPCProvider of web3.py and i have tried to do so, but with no success so far.

After starting geth in light mode, i tried this in Jupyter,;

from web3 import Web3
w3 = Web3(Web3.IPCProvider(''))

I left the IPCProvider brackets empty since it auto-detects the path of the geth pipe in windows, which is ( i have tried manually inputting the path as string, but it has given me errors, so i went with the auto-detect )

  \\\.\pipe\geth.ipc

and examning 'w3' variable in jupyter results in;

  web3.main.Web3 object at 0x00000266CBEDB080

meaning that it is indeed a web3 instance.

however;

w3.isConnected()

results in False. Even though geth is running in the background successfully.

Also, using any arbitrary web3 functions results in an OS error

e.g if i want to get a list of accounts;

w3.eth.accounts

will give;

  OSError: (5, 'CreateFile', 'Access is denied.')

From the very little documentation available on windows IPC, i have gathered that windows uses named pipes for interprocess communication, where one process writes to the pipe and the other process reads from it. But that is pretty much it and there are no helpful guides or tutorials to properly tell about how to use
windows Pipes practically.

I just want to connected web3.py to geth, using IPC. So that i can send commands to the geth client from the web3.py interface

since there's very little information about geth IPC with windows, i am completely lost.

please help me out


texts: Ethereum transaction 'Exceeds block gas limit'

texts:
Title says it all!

More info:

Geth 1.3.5 Windows:

  eth.getBalance(MY_ADDRESS)
  70000000000000000000

  eth.sendTransaction({from:"MY_ADDRESS", to:"TARGET_ADDRESS", value: web3.toWei(1, "ether"), gas:40000});

Exceeds block gas limit
    at InvalidResponse (<anonymous>:-81662:-170)
    at send (<anonymous>:-156322:-170)
    at sendTransaction (<anonymous>:-133322:-170)
    at <anonymous>:1:1

I'm pretty new at this, so any suggestions or tips that may help me to resolve this problem will be greatly appreciated.

Thanks!


texts: Issue with "Generating Transaction" with MEW offline

texts:
I would like to try to send offline with MEW.
I'm using a pc with Window 7, no sp1, never been connected.
I have tried with Firefox and Chrome.
Been cleaning cache, rebooting.

Nothing happens when I click on "Generate Transaction".


texts:
I'm new to ethereum/parity and trying to follow this PoA setup demo as part of a larger project.

I've done it locally on my laptop, accessing resources via localhost. Now I'm trying to set up two separate nodes on two azure virtual machines and make them interact via internet.

Now my first question is - is this a sensible thing to do in the first place? Maybe I didn't grasp the architecture and these nodes shouldn't be exposed to the internet?

If this should work, I have the following problem - even a single node doesn't start properly.
I use docker container ethcore/parity:stable, this is my node0.toml file

[parity]
chain = "demo-spec.json"
base_path = "/tmp/parity0"
[network]
port = 30300
[rpc]
interface = "172.17.0.2"
hosts = ["172.17.0.2", "azure-vm-public-ip", "10.0.0.4"]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[ui]
interface = "172.17.0.2"
port = 8180
[dapps]
cors = "all"
hosts = ["azure-vm-public-ip", "10.0.0.4", "172.17.0.2"]
interface = "172.17.0.2"
port = 8080

I've added hosts and interfaces to the original file from demo (link above). Here azure-vm-public-ip is the IP I use to connect to the vm from my laptop.
10.0.0.4 is vm's local IP from $ ifconfig and 172.17.0.2 is IP that's seen from inside the docker container if you run $ifconfig.

demo-spec.json is exactly the same as in demo.

I run docker via this command, exposing all ports:

sudo docker run -ti --rm -p 30300:30300 -p 8080:8080 -p 8180:8180 -p 8540:8540 -v ~/demo-spec.json:/build/demo-spec.json -v ~/node0.toml:/build/node0.toml 65de5e38cf4b --config node0.toml

after startup public node URL is returned: enode://...@172.17.0.2:30300
which has docker's IP in it, not machine's IP and if I try to connect to http://azure-public-ip:8180/ from laptop I get

URL BLOCKED
YOU ARE NOT ALLOWED TO ACCESS TRUSTED SIGNER USING THIS URL.
Use: http://172.17.0.2:8180

and Blocked connection to Signer API from untrusted origin is written in parity log.

If I make a second connection to the vm and run $ curl http://172.17.0.2:8180 a proper html is returned, but $ curl http://localhost:8180 gives the same error.

If I change interface to 10.0.0.4 or azure-public-ip, parity doesn't start with the following error: RPC io error: Cannot assign requested address (os error 99)

So there seems to be a network setup misconfiguration, but I can't figure out where it is. Please advise.


texts: Trouble accessing an array inside a struct inside a mapping via web3

texts:
Here are a few relevant code snippets from my smart contract

  struct Constituency{
    uint16 id;
    string name;
    uint64[] cans;
  }

  mapping(uint => Constituency) public constituencies;

  function newConstituency(string memory _name) private{
    uint64[] memory tmp;
    constituencies[concount] = Constituency(concount, _name, tmp);
    concount++;
  }

  constructor() public{
    newConstituency("Bikini Bottom");
    constituencies[0].cans = [1,2,3];
  }

And here's the web3 snippet I'm using to access elements from the constituencies mapping:

election.methods.constituencies(0).call({from : defaultAccount},function(e,r){ console.log(r) })

Here is the response it gives out:

Result { '0': '0', '1': 'Bikini Bottom', id: '0', name: 'Bikini Bottom' }

As you can see, it simply does not mention the array. What can I do to fix this?


texts: How can I specify an external harddrive as the download target for the Mist blockchain in Ubuntu?

texts:
How can I specify an external harddrive as the download target for the Mist blockchain?

Hi there,

I am using Linux Ubuntu 15.10

My harddrive is quite full and I need to download the whole Mist blockchain.

Is it possible to specify an external harddrive as the target for the blockchain and if so, how do I do it?

Even if the blockchain data gets corrupted somehow, it won't affect my wallets, right? I can keep them in a folder on my computer instead of the external harddrive, yes or no?

I. e. I would prefer having the blockchain data on an external drive and the wallet files on my laptop harddrive. Possible or not?

Vesa


texts: What node(s) does Ethereum broadcast a transaction first? How is it determined?

texts:
When I as a user make a transaction, where or what node(s) does it get sent to first? How does  an Ethereum node, in terms of implementation details, determine that? Does it send a new transaction to, say, 1 random or multiple random node? Or to a certain one(s) that meet a certain criteria?
Or to the all nodes in the world?
Also, does an Ethereum node keep a list of all the nodes in the world, dynamically, in RAM, and periodically refreshe it? Or does it do it at startup and then simply works with that, never refreshing a list?


texts:
In that example you can see, how to deploy a new contract having just ABI and ByteCode

(uses for copy and deploy contracts from mainnet to your testnet for example).

/****** Deploying new contract to ethereum network via Geth console             *****/
/****** Using only ABI and BYTEcode of a new contract                           *****/
/****** Example created by Vladimir S. Udartsev (https://github.com/udartsev)   *****/

/*
 * (1) Connect to your ethereum network via Geth console:
 *
 * @note http://127.0.0.1:8545 - is a default ganache-cli host address, be free to change it
 * USE CLI COMMAND:
 */
$ geth attach 'http://127.0.0.1:8545'

/*
 * (2) Set you new contract variables inside Geth:
 *
 * @note contract abi object must be in array [], like: '[{"constant": false}]'
 * @note contract byteCode must start from 0x606060
 */
var abi = '[{"constant": false,"inputs": [{"name": "_winnings","type": "uint256"}],"name": "nothingIsImpossible","outputs": [],"payable": false,  "stateMutability": "nonpayable",  "type": "function"},{  "payable": true,  "stateMutability": "payable",  "type": "fallback"}]';
var byteCode = '0x6060604052341561000f57600080fd5b60db8061001d6000396000f300606060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063241f673d146041575b005b3415604b57600080fd5b605f60048080359060200190919050506061565b005b600081111560ac573373ffffffffffffffffffffffffffffffffffffffff166108fc600283029081150290604051600060405180830381858888f19350505050151560ab57600080fd5b5b505600a165627a7a723058209dccf8f370dde2ae64186418da896aafb9d45bf83b13aeaf0f8710f0a68bb2470029';

/*
 * (3) Unlock your account for deployment:
 *
 * USE COMMAND IN GETH:
 */
var accountAddr = web3.eth.accounts[0];
var gas = 5000000;
personal.unlockAccount(accountAddr)

/*
 * (4) Prepare contract data for deployment
 */
var newContractAbi = web3.eth.contract(JSON.parse(abi));
var newContractObject = {from: accountAddr,data: byteCode, gas: gas};

/*
 * (5) Deploy contract
 */
var deployedContract = newContractAbi.new(newContractObject);

/*
 * (6) Check deployment and get delpoyed contract address
 */
var deployedContract = web3.eth.getTransactionReceipt(deployedContract.transactionHash);
var contractAddr = deployedContract.contractAddress;
contractAddr;

I did it and it works well. But what if I have only ByteCode without ABI... How can I deploy contract WITHOUT abi only with ByteCode? Does it real?


texts: Web3 estimateGas error: gas required exceeds allowance?

texts:
I would like to estimate the amount of gas required for a transaction before actually sending it with web3. For some reason I always get a gas exceeded error. I've double-checked my solidity code and there are no errors failing during this function call. Does anyone know why estimateGas() does not work for my use case?
My Code:
from web3 import Web3, HTTPProvider

web3 = Web3(HTTPProvider('https://mainnet.infura.io/v3/{LONG_INFURA_PROJECT_ID}'))

abi = [ ... long abi ...]
MyContract = web3.eth.contract(address="[contract_address]", abi=abi)

# this line fails...
# note: contractMethod is the name of the contract function I'm trying to call
estimated_gas = MyContract.functions.contractMethod("some_param").estimateGas()

Once I try to execute the line where estimateGas() is called, I get the following error:
{'code': -32000, 'message': 'gas required exceeds allowance (124572510) or always failing transaction'}


texts: How do you monitor Geth with Prometheus or InfluxDB?

texts: I've read the v1.9.0 and v1.10.0 blog posts: https://blog.ethereum.org/2019/07/10/geth-v1-9-0/ https://blog.ethereum.org/2021/03/03/geth-v1-10-0/ I didn't read that any of the monitoring features mentioned in the 1.9 post where removed, yet when I try to view http://127.0.0.1:6060/debug/metrics or http://127.0.0.1:6060/debug/metrics/prometheus. So, I assume that these metrics were removed and the documentation wasn't updated. However, when I try these steps for InfluxDB, https://ethereum.org/en/developers/tutorials/monitoring-geth-with-influxdb-and-grafana/ , I do not get any measurements when I type show measurements


texts: EcRecover signed message does not match PublicAddress

texts:
I am trying to create a C# webservice back end API that handles the code logic found in Step #5 here:
https://www.toptal.com/ethereum/one-click-login-flows-a-metamask-tutorial
Their code looks like this:
User.findOne({ where: { publicAddress } })
  // --snip--
  .then(user => {
    const msg = `I am signing my one-time nonce: ${user.nonce}`;

    // We now are in possession of msg, publicAddress and signature. We
    // can perform an elliptic curve signature verification with ecrecover
    const msgBuffer = ethUtil.toBuffer(msg);
    const msgHash = ethUtil.hashPersonalMessage(msgBuffer);
    const signatureBuffer = ethUtil.toBuffer(signature);
    const signatureParams = ethUtil.fromRpcSig(signatureBuffer);
    const publicKey = ethUtil.ecrecover(
      msgHash,
      signatureParams.v,
      signatureParams.r,
      signatureParams.s
    );
    const addressBuffer = ethUtil.publicToAddress(publicKey);
    const address = ethUtil.bufferToHex(addressBuffer);

    // The signature verification is successful if the address found with
    // ecrecover matches the initial publicAddress
    if (address.toLowerCase() === publicAddress.toLowerCase()) {
      return user;
    } else {
      return res
        .status(401)
        .send({ error: 'Signature verification failed' });
    }
  })

My code looks like this, below. But it always returns false. My first guess is that the "message" format is incorrect somehow. I've seen other examples not include the "\x19" portion, but removing it and including it both returns false.
public static bool AccountSignerIsValid(string signature, string publicAddress)
{
    var nonce = "12345678";
    var terms = "Please sign to log in: " + nonce;
    var message = Encoding.UTF8.GetBytes("\x19Ethereum Signed Message:\n" + terms.Length + terms);
    var hash = (new Sha3Keccack()).CalculateHash(message.ToArray());

    var signer = new Nethereum.Signer.MessageSigner();
    var account = signer.EcRecover(hash, signature);

    return (account.ToLower().Equals(publicAddress.ToLower()));
}

What would I need to do to change the C# code to make it return true?


texts: Truffle project encounters "Error: Cannot find deployed address"

texts:
I am a beginner and was trying to run a truffle project but encountered an error which I am unfamiliar with. I based it off Testing contracts with truffle

To explain this is my folder structure.

In my app folder I have the contract C.sol and migrations.sol

In my test, I have this c.js file

In my truffle.js, this is what I have written

I ran testrpc and then tried to compile truffle and then truffle test but I got this error below saying it can't find the deployed address. What is the issue?


texts: Pull payment for automatic payment transfer.

texts: How can I program my wallet such that all Ether sent to it is immediately and automatically transferred to my other wallet within a minute.


texts: Having trouble storing multiple values in a uint256

texts:
In one uint256 I want to store the entire sender's address of 20 bytes and then 12 bytes of a second address.  In this case the example addresses will be the following:

0x9E1C3a90c6EB03F914dF819CA9b3c891DE003301  sender address

0xdFd6b3Fd6E13C3E6AE53d510bFAb5217b5b39FeC  secondary / other address

I send a tx with the setCharacter function below.

setCharacter(0xdFd6b3Fd6E13C3E6AE53d510bFAb5217b5b39FeC, 25)

Now when I use the getter to retrieve the data I get the following.

getCharacter(25)
owner_address -> 0x9E1C3a90c6EB03F914dF819CA9b3c891DE003301
secondpart -> 0

The secondpart = 0 is not what I am shooting for.  I want secondpart to be equal to the equiv of 0xAE53d510bFAb5217b5b39FeC (last 12 bytes of 2nd address)  or 0xdFd6b3Fd6E13C3E6AE53d510 (first 12 bytes of the 2nd address).  Any pointers on where I went wrong?  Thank you for any help.

contract storagetest8 {

    mapping(uint256 => uint256) inventories;

    function setCharacter(address other_address, uint256 index1)
        external
    {
        uint256 _id = uint256(msg.sender);
        _id |= uint96(other_address)<<160;
        inventories[index1] = _id;
    }

    function getCharacter(uint256 index1)
        external view
    returns(address owner_address, uint256 secondpart) {
        uint256 _id = inventories[index1];
        owner_address = address(_id);
        secondpart = uint256(uint96(_id>>160));
    }

}


texts: Why does my JSON-RPC request never complete?

texts:
I've set up geth to run in a Docker container with the following command (yes, I realize it's wide open to the world):

docker run -it -p 127.0.0.1:8545:8545 -p 30303:30303 -v /data/ethereum:/root/.ethereum ethereum/client-go:alpine --syncmode "fast" --cache=512 --rpc --rpcaddr "0.0.0.0"

Then, from a different machine, I run:
curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' -H "Content-Type: application/json" http://IPADDRESS:8545

Nothing happens. geth appears to be running fine, but the http request times out.

Any idea what I'm doing wrong?

UPDATE: After several restarts, permissions configs, and other foolings-around, I am now receiving "Connection Refused" from curl. No idea what's going on here...

UPDATE 2: It absolutely has to do with Docker. Running geth on the machine itself (and not with Docker) results in everything working fine. So... ?


texts:
I am new to smart contract, I have to make NFTs so I am following ERC721 standard, but I have to make two types of NFT
NFT1  = {prop1, prop2}
NFT2 =  {prop3, prop4}
so can I have two type of createNFT function in my contract or it will violate the standard?


texts: How does an end user pay for his transactions in a Dapp?

texts:
I'm only getting started with my knowledge of Blockchains, but one thing has me confused.

If I were to build a Dapp offering a service for users, such that users don't have to pay to use the service, how can the transaction fees from executing the computation be paid for?

If a way around this was to only show data (i.e. so nothing is being written to the Blockchain, only read), would that have a computation cost? Does reading data count as a transaction?

Thank you in advance for your help. Please don't hesitate to correct any of the above.


texts: VS Code and Solidity files have a lot of warnings

texts:
Every time I use VS Code to develop Solidity, files I have a lot of this weird warnings saying:

  no-trailing-whitespace: Line contains trailing whitespace

I googled a bit and I understand why they are here. Although I would like to make my VS Code ignore them. Any help?


texts: `Error: authentication needed: password or unlock` in solidity chrome plugin. Couldn't deploy smart contract to local node

texts:
I run local private ethereum network using the below commands.

./geth --datadir=./data/test init genesis/genesis.json

./geth  --datadir=./data/test --rpc --rpccorsdomain "http://localhost:8000" --rpcapi "db,eth,net,web3,personal,miner"  --rpcaddr "localhost" --rpcport "8545"

I have installed chrome plugin for solidity Solidity realtime ethereum compiler and runtime.

I have below contract.

contract CalculatorV2 {

  uint result;

  event NumberAdded(uint n);
  event NumberSubtracted(uint n);
  event NumberMultiplied(uint n);
  event NumberDivided(uint n);

  function CalculatorV2(uint num) {
    // constructor
    result=num;
 }

  // returns the result
  function getResult() constant returns (uint){
   return result;
 }

  // result = result + num
  function addToNumber(uint num) returns (uint) {
   result += num;
    NumberAdded(num);
   return result;
 }

 // result = result - num
 function substractNumber(uint num) returns (uint) {
   result -= num;
   NumberSubtracted(num);
   return result;
 }

 // result = result * num
  function multiplyWithNumber(uint num) returns (uint) {
    result *= num;
    NumberMultiplied(num);
    return result;
  }

  // result = result / num
  function divideByNumber(uint num) returns (uint) {
    result /= num;
    NumberDivided(num);
    return result;
  }

}

Then I clicked the node icon on the right side and choose web3 provider with value 'http://localhost:8545'.

When I click create button, this gives to error Error: authentication needed: password or unlock.

I'm not sure where I've to save the authorize or login to compile and deploy the smart contract.


texts: What is a geth account and how does it relate with ethereum wallets?

texts: I've created an account within geth, where I've entered a password and been given an address. However, I've also created an Ethereum wallet within JAXX. How would I be able to import the JAXX wallet to geth, or have the two wallets communicate, if they are indeed both wallets? That said, once I begin mining, how will the mined ether enter the wallet such that I can transact with it?


texts:
I have built go-ethereum from source and I'm running on Ubuntu in a Docker container. I can run geth commands from the command line just fine, but I'm having trouble attaching to it or curling RPCalls to it.

For example:

nohup geth --verbosity 0 --rpc import /home/myvbo/cloudwallets/serverbinaries/blockchainTo1463224 &
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' localhost:8545
geth attach http://localhost:8545

The error message for the curl is curl: (7) Failed to connect to localhost port 8545: Connection refused

The error message for the attach is Fatal: Unable to attach to geth node - Invalid endpoint

What am I missing?  Have I not completely configured geth for RPC?


texts: How to view latest block number of a geth node in the console?

texts:
How to get information about the state of the blockchain on a geth node?

There are mentions of admin.chainSyncStatus in the documentation, but it is undefined on my 1.4.0 node. The admin.nodeInfo shows a hash for the head block, but not the number.

This information is sort-of available in the log, but that is not an answer.


texts: Is there a way to deploy contracts with circular reference in 2 steps using create2?

texts:
Circular reference meaning contracts know each other addresses. So instead of
deploy foo
deploy bar(foo.address)
foo.init(bar.address)

Use some clever tricks to have only 2 deploy steps without an additional call to init


texts: How does Mist know that I'm using Ethereum Classic?

texts:
I went to the guide on Ethereum Classic website, and the instructions there are exactly the same as with installing a regular Ethereum account.
There is no difference, so it looks like I can send both ETH and ETC to the same address in Mist wallet, how will Mist be able to separate them? I don't see any option there


texts: Solidity unsigned integer less than zero

texts:
I was trying to figure out the overflow in solidity, and I noticed that when I subtract one to a uint which was assigned by zero.

The value will become 115792089237316195423570985008687907853269984665640564039457584007913129639935

What does this monster mean?

For example

contract test{
    uint public a = 1;

    function subone(){
        a--;
    }
}

After I execute twice subone, the value of a becomes that long number. The same thing happened when I have an array and I subtract its length to less than zero.

For example

pragma solidity ^0.4.17;

contract X{
    uint256[] public array = [1];

    function X(){}

    function popLength() public{
        array.length--;
    }

    function getLength() constant returns(uint256){
        return array.length;
    }
}


texts: Balance updation problem of ethereum process due to block number updation took more time

texts: We are integrated the ethereum on new server, then we send the balance to my ethereum wallet address. The balance is updated on the ethereum.io site with current ethereum block number but in our server the balance is not updated because of the block number started from 1 so it took more time to reach the current ethereum block number. we are waiting upto 20 days but till now the block not reached to the block number shown in ethereum.io(upto the 2000000 block number it updated within one day but after that it took this much of time). Is there any solution for this problem recommend to us. if we do wrong anything please correct us. Thanks in advance


texts: web3.js-1.0.0 General Availability (GA) Date ?

texts: When will web3js 1.0.0 be General Available? i.e., web3 GA date


texts: In windows, what do I type in powershell to connect my dApp to a liteserver?

texts: In windows powershell, what do I type to connect metamask to a liteserver?  >


texts: Solidity: How to enter a value in a dynamic array inside a struct?

texts:
I'm working on the following code in Remix IDE. What I'm trying to do is create an object of a structure that is mapped to an address. Inside the struct, there is a dynamic array. How can I put a value in this case? I checked other answers on stack exchange but I can't find anything that works for my case. Help please.
pragma solidity ^0.5.0;

contract Register{

    //state variables - stored permanently in contract storage

    // goverment entity - municipality
    address public govermentEntity;

    //seller - sorting facility
    struct Seller {
        address sellerAddress;
        string sellerLocation;
        address [] sortingMachineAddress; // dynamic array
        bool isExist;
    }

    //constructor - initilize state variables
    constructor() public{
     govermentEntity = msg.sender;
    }

    // Mappings

    mapping (address => Seller) registeredSellers;

    modifier onlyGovermentEntity{
        require(msg.sender == govermentEntity, "Entity not authorized to register stakeholders.");
        _;
    }

    // register seller if it doesn't exist
    function registerSeller (address addr, string memory sellerLocation, address sortingMachineAddress) public onlyGovermentEntity {
        require(registeredSellers[addr].isExist == false , "Seller is registered already.");

        registeredSellers[addr] = Seller(addr, sellerLocation, sortingMachineAddress, true);  // WHAT IS A SORTING MACHINE ADDRESS AND HOW TO SAVE IT DYNAMICALLY???
    }

}


texts: how can we get all transaction according date(timestamp) filter

texts:
What I have
1. I have setup my own private blockchain.
2. mining started on my node

What I want
1. I want to know all transaction object which executed last one or 24 hour and their total ether value.


texts: How to prevent signature input double spending

texts:
Let's say I have implemented a contract that allows you to transfer a token to a recipient for whom you do not have the address.

Let's say I have 5 of token x and I want to give 1 to my friend and I do not know her address, as a result I send her a message (e.g. give one token from my account to anyone who claims this) and a corresponding signature.

My friend can then broadcast the function call claimToken(message, signature) and get the token from me in the smart contract.

My question is: how do I prevent a node from seeing this transaction in the mempool and taking the inputs (message, signature) and sending the transaction with a higher fee, essentially getting confirmed before my friend and taking the token for themselves?

I understand that this is solved if you sign the message with the recipients address, but this cannot happen when you do not know the address of the recipient.


texts: Is it possible to connect to public Ethereum like blockchain with Remix to deploy and view contracts?

texts:
I've tried to do so by specifying the web3 provider and the 8584 port but it gets stuck on every try.

Is this possible? if so, is there another solution for that need?


texts: Get transaction data by its hash (Solidity)

texts: I need a method in my contract that receives a transaction (its hash) as a parameter and checks its data in the blockchain (sender, etc).Is there an object for transaction in Solidity? (Like one for address)


texts:
I'm trying to deploy a contract to the Ropsten testnet using Truffle. Already tested on testrpc, worked smoothly. I keep getting the error "Exceeds block gas limit" when I try to deploy to testnet. Even when I am not specifying any gas amounts anywhere, I always get the same error.

I noticed the following warning in the geth client, which might be affecting my network, since it seems like I'm unable to mine blocks and get ether like before.

WARN [07-27|12:26:21] System clock seems off by 20.321575601s, which can prevent network connectivity
WARN [07-27|12:26:21] Please enable network time synchronisation in system settings.

I'm running macOS 10.12.5 and followed the instructions here a while ago, but it clearly didn't resolve my issue. Other people who get time synchronization errors seem to be on Windows. How do I fix this on a mac?


texts: The network id specified in the truffle config (4447) does not match the one returned by the network (4777)

texts:
Please, the error messsage is in this imgur link, how's that even possible? They are the same network, but I still cannot test my smart contract via Truffle.
https://i.stack.imgur.com/vykIa.jpg
Code of the truffle-config.js file:
const path = require("path");
module.exports = {contracts_build_directory: path.join(_dirname, "client/src/contracts"),
networks: {
 develop: {
     port: 7545,
     host: "127.0.0.1",
     network_id: 4777
 }
},

compilers: {
    solc: {
        version: "^0.6.0"
    }
 }
}


texts: Ethereum opcode: meaning of first few instructions?

texts:
Looking at the opcode level, the first few instructions of any smart contracts start with this:

push1 80
push1 40
mstore

I understand that this saves 0x80 to address 0x40, but what is this all for?
I looked into the Ethereum Yellow paper, but it never mentioned this anywhere.

Thanks.


texts: blockchain oracles to communicate with external api via smart contracts?

texts: Is there is any other oracles other than provable or oraclize to communicate with external api via smart contract.


texts: Getting error insufficient funds for gas * price + value in flutter app

texts:
DeployedContract contract = await loadContract();
final ethFunction = contract.function(functionName);
final result = await etherClient.sendTransaction(
    credentials,
    Transaction.callContract(
      contract: contract,
      function: ethFunction,
      parameters: args,
      maxGas: 10000000,
      gasPrice: EtherAmount.fromUnitAndValue(EtherUnit.gwei, 100),
    ),
    fetchChainIdFromNetworkId: true);

return result; }


texts:
I'm trying to make a function in my Dapps front end that requests Ether from the user, I know I have to use web3.eth.sendTransaction() but am unsure of how to correctly implement and call this function on the front end of my Dapp, thanks!

current code is:

   $("#button").click(function() {
    Raffle.main(function (err, result) {
      web3.eth.sendTransaction({from:0x627306090abaB3A6e1400e9345bC60c78a8BEf57 ,to:0x086912faa7f6598d28d80c448c8d1e9dae5a4dee, value:web3.toWei(1, "ether")});
      console.log(result);
      });


texts:
Question 1:
So, let's look at exchanges. Let's say I want to buy the token - OmiseGO (it's an ERC20) token.
I know that on the exchange, I can directly buy ERC20 token from someone like a trading option.
But what about the following - does exchanges have the feature so that I can buy OmiseGO directly from the smart contract (without trading) ? This would work like that - I have some ether on the exchange. I type that I want to buy 2 OmiseGo and it just sends the ether from my account (with its gas limit and all that) to the contract and gives me 2 OmiseGo ?
Question 2:
After The above question, here is what comes to my interest. I read the following:

This fee is repaid in MKR. Each time someone pays off their debt the
Maker tokens are purchased at market price and are burnt immediately
resulting in less MKR tokens in circulation.

I hope you know how MakerDao works.
I am not sure the above sentence is always correct. If I buy Maker from the trading option, like someone is selling it and I buy it, in this case, the count of Maker tokens will decrease overally, but what If I buy the Maker from smart contract and that's how I pay the debt ? in that case,  we won't have less MKR tokens in circulation, because what got destroyed was bought(born) by me.


texts: How to store strings in an array in solidity?

texts:
I am trying to build a simple application on ethereum where strings can be added/deleted from an array and the contents of this array can be shown in a frontend UI.

The basic structure of the smart contract is:

pragma solidity ^0.4.18;

contract ExampleApp {
  <string array over here>

  function add(string x) public {

  }

  function delete(string x) public{

  }
}

I have 2 questions: How can I initialise a string array and secondly how to delete a specific item from the string array? Do I have to iterate through the array to find the string or is there some simpler way?


texts:
I tried to send locked EOS to Etherdelta, and the transaction been pending for almost 4 days now.

MEW can't find the transaction so I'm unable to cancel it nor do anything else even with higher gas price.

sometimes the transaction disappears from etherscan but then start again after few minutes.

here is that bad boy

If there's anyone that can assist, I will be forever grateful


texts:
I have been working on error handling recently using the event emitter. If I call a function directly from a contract (using contract.methods.myMethod().send{from: Ganache supplied account}) with an input that violates a require statement, then the .error part of the event emitter is invoked. That works as I would expect.
However, if I call a function through a proxy contract with an input that violates a require statement, the .error part of the event emitter is not invoked. I would note that the ‘transactionHash’, 'receipt, and ‘confirmation’ events of the event emitter work when going through proxy contracts. However, I do receive a notification of an error through the console even though I do not have any console.log() statements in my code. See below:
web3.min.js:20 Uncaught (in promise) Error: Returned error: VM Exception while processing transaction: revert Number of offices can't be less than one
    at Object.ErrorResponse (web3.min.js:20)
    at Object.callback (web3.min.js:20)
    at web3.min.js:30
    at Array.forEach (<anonymous>)
    at s._onMessage (web3.min.js:30)
ErrorResponse @ web3.min.js:20
(anonymous) @ web3.min.js:20
(anonymous) @ web3.min.js:30
s._onMessage @ web3.min.js:30
async function (async)
initializeElectionProxy @ playing.js:743
dispatch @ jquery.min.js:3
r.handle @ jquery.min.js:3

OR
Uncaught (in promise) Error: Returned error: VM Exception while processing transaction: revert Number of offices can't be less than one
    at Object.ErrorResponse (errors.js:28)
    at Object.callback (index.js:303)
    at index.js:114
    at Array.forEach (<anonymous>)
    at s._onMessage (index.js:102)

I tried to encapsulate my function call in try catch blocks, but that didn’t do anything.
I believe that this issue is related to the differences between the Truffle contract instance and the web3.js contract object. I’ve put together some files that illustrate the issue on github. There are instructions in the readme file on how to get it running, how to run the functions, and what to look for. Hopefully, that’s enough to show you the problem I’m experiencing. If not, please let me know and I’ll clarify. If someone wouldn’t mind taking a look and letting me know what you think, that would be excellent.
The link to the github repository is https://github.com/cjd9s/ProxyErrorWeb3jsDemo.
I should mention that I found a post on here that might have been addressing the same issue. The link and quotes that caught my attention are below:
Handling require/assert failure errors correctly from a Node.JS app?

"The challenge is accessing this message further up the stack in Web3 and Node.
In the meantime, you can use try and .catch() in promisified code such as a truffle contract abstraction."

In my case, .catch does work with the Truffle contract abstraction, but not with the web3.js object. Does this shed light on the problem?
Again, thanks so much for your time; I’ve very grateful. Cheers.
Sincerely,
Craig


texts: How can I transfer usdt if I do not have eth on account?

texts:
Is there any way I can transfer the usdt if I do not have any eth on my account?
Actually I want to develop a payment gateway and give each customer an address to pay usdt, Once the payment done, the usdt will be transferred to my main eth account.


texts:
When using Metamask, the user can see transaction data before approve a transaction, like origin and destination.
Users can define alias to their accounts, so the origin is in general easy.

So, in general we can say the user see something like that

Origin       -> Destination
MyAccount1   -> 0xABCD1234567889...

Supposing a DAPP that always send transaction to the same contract, that is deployed at 0xABCD1234567889...
Is there a way to give a hint of what the destination address means? For example, if we create an alias to 0xABCD1234567889... using ENS (Ethereum Naming Service), does it reflect on how metamask presents the address?

Thank you!


texts: Eth 2.0 node software on Apple Silicon (M1 Mac Mini)

texts:
Is there any support for Apple Silicon (M1 Mac Mini) for running a Eth 2.0 beacon chain validator?
None of Lighthouse, Nimbus, Teku or Prysm seems to have M1 support? Geth has M1 support, but seems to only be an Eth 1.0 client?


texts: What does "_" mean before a variable name?

texts:
I'm a beginner, just recently started reading the docs for Solidity.
I can't seem to find this anywhere on google. What does the underscore mean when placed with the indexed keyword?
Examples:
_from
_id
_amount
_account
How are these different from other variables, and how are they used in events?


texts: Does it cost gas to access data stored on the IPFS with a smart contract?

texts:
I want to store about 4MB of data on the IPFS.

I then want to create a smart contract that can access the data or a subset of the data on the IPFS.

I know that data already stored on the Ethereum blockchain casts no gas to access.

But what if my data is stored immutably on the IPFS and then accessed via a smart contract call; will it cost any gas?

If so, how much gas will it cost (a ratio like USD/MB-Retrieved would be nice).


texts:
I run one simple voting application in ethereum....

i want to know where they store the data(no of votes)..

what is the mechanism for storing data..

or where data persist in ethereum

i am referring

https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2

can anyone explain..?


texts: Pros & cons of enterprise volatile/stable ERC20 usage and likelihood

texts: What are the pros and cons for a business to accept a stable/volatile erc20 token as means of payment? and what is the likelihood of such? I assume a business would always prefer a stablecoin over a volatile coin. I'd love to hear people's individual view on this subject.


texts: web3JS filter.get() result data Structure

texts:
Im trying to get all the past event log based on filter criteria using filter.get() and then transform data to show in a table. However, I'm not able to figure out how to retrieve the data from the resulted data. In the below, if I log the result var inside the get function call, I'm able to see the data. However, I'm not able to make meaning out of dataset3. Any inputs will be helpful here as I'm a newbie to both Javascript and ethereum.

var filter = AutoClaims.approveClaimEvent({ClaimStatus:web3.sha3("VERIFIED",  {encoding:"hex"})}, { fromBlock: 0, toBlock: 'latest' });
var dataset3 = filter.get(function(error,result){
              if (!error)
                {
                    $("#loader").hide();
                    console.log(timestamp);
                    console.log("Result Length:"+ result.length);
                    if(result.length>0){
                     for (var i = 0; i < result.length; i++) {
                      if(web3.sha3(AutoClaims.claimResult(result[i].args._policyNo.toNumber())[0],{encoding:"hex"}) == web3.sha3("VERIFIED",  {encoding:"hex"}))
                      {
                          dataset2= "["+AutoClaims.claims(i+1)[1]+","+result[i].args._policyNo.toNumber()+","+AutoClaims.claims(i+1)[3]+","+AutoClaims.claims(i+1)[6]+","+ AutoClaims.claims(i+1)[5]+","+ AutoClaims.claims(i+1)[7]+"],";
                      }
                    }
                  }
                }
              else {
                    $("#loader").hide();
                    console.log(error);
                   }
});
filter.stopWatching();
console.log(dataset2);
console.log(dataset3);


texts: Who is transferFrom function sending tokens from?

texts:
I'm new to Solidity and see:

function transferFrom(address from, address to, uint256 value)
    onlyOwner
    returns (bool)
{
  return super.transferFrom(from, to, value);
}

I mean is "from" here the contract address? Or can this be called by the owner to transfer from some address (given password) to any other address? Thank you!


texts: Stop a smart contract to be created in Ethereum

texts:
I have a smart contract with some constructor code that has a throw statement in there, if certain conditions are satisfied.

But even with that, seems like contract is deployed and I get a transaction receipt and a contract address back, though when I look at the generated contract, it does not have all the properties and data.

Is there a way to stop the "Contract Deploy" transaction to be committed if the constructor code throws?

Here is the sample smart contract code I got:

pragma solidity ^0.4.8;

contract MyCoin {

    function MyCoin(address _finalDestination, uint _contractGracePeriod, address _parentContract)
    {
        if(_parentContract == address(0))
        {
            hupCount = 0;
        }
        else
        {
            throw;
        }
    }
}


texts:
We have a private network with 10 nodes actually. It's been working for a couple months now.

When we did it, we set up some parameters in the chain specification that are now too small for the growth we've been having.

So we need to update the chain specification, to increase gasLimit and, essentially, to allow a lot more transactions per block.

I know that to change the chain genesis file implies a hard fork, but, is there a way to do a this AND keep the data already in the chain?

How is it done when a hard fork is made in the mainnet?

Even if this is not possible, what parameters do I have to increase to allow more transactions per block?

Our values are, right now:

"gasLimitBoundDivisor": "0x400",
"maximumExtraDataSize": "0xF4240",
"minGasLimit": "0x1388",
"difficulty": "0x20000",
"gasLimit": "0x5B8D80"

Thanks!


texts: How to delete MetaMask accounts - if I recover an account from the seed phrase, can I access also the old related accounts?

texts:
Premiss
I'm really new to this, I would like to share my art throught KnownOrigin and other ETH based art websites in order to make them unique. Now that I started to understand the blockchain and basic wallets, I found MetaMask as an option to log-in into KnownOrigin.
I was firstly using FortMatic but it seemed a bit odd so I dropped it. MetaMask really seem to be cutting edge with web3 stuff.
Questions
I linked KnownOrigin with MetaMask but with the wrong address, so I created a new account solely for that purpose.
Now I have an unused account.
Online, the only solution to "delete" an account from MetaMask seems to be to simply disconnect/reinstall the plug-in and recover the account from the seed phrase. Problem is, what happens to other accounts created inside MetaMask? (to be clear, I don't have external accounts linked)
It seems like this will recover only the first account, what happens to the others?
What should I do? Is there another way to delete accounts from MetaMask?
Conclusion
In general, I find this "account system" a bit confusing, I don't really know what is recoverable, where the wallets are and how they work fully.
Software wallets seems easier to understand, I would really like to continue using MetaMask because it really seems like the future, and also seems to be the best way at the moment (imho).
Setup
I have Firefox and the MetaMask app installed in my iPhone. Have access to Linux, Mac and Windows in case this is necessary.


texts: Is it gas efficient to store the msg.sender in a local var?

texts:
Suppose I have a function that refers to msg.sender many times:
function foo() external {
  doSomething(msg.sender);

  // ...

  doSomethingElse(msg.sender)

  // ...

  emit LogSomething(msg.sender);
}

Would it be more efficient if I stored msg.sender in a local variable, like so?
function foo() external {
  address msgSender = msg.sender;

  // ...
}


texts: Is there a way to check the balance of another contract from a contract without the use of a public variable? (ie. this.balance)


texts: How to assign an event output to a variable in SO?

texts:
So I got this function that gets latest eth price and I want it to put in a var like output = price.
Thanks in advance.
 // For ETH-USD on ropsten, input the address:
 // 0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507
 address _aggregator = 0x8468b2bDCE073A157E560AA4D9CcF6dB1DB98507;
 constructor() public {
   ref = AggregatorInterface(_aggregator);
 }

 function getLatestAnswer() public view returns (int256) {
   return ref.latestAnswer();
 }
   ```


texts: solc compiler; ParserError: Token incompatible with Solidity parser

texts:
I am trying to compile this contract (part of an online tutorial, not my contract).
I'm running ethereumjs-testrpc (ganace precursor) on one terminal, then on another instantiate web3 object;

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

From there I get confirmation Im running on test network, I can call the dummy accounts, etc.

Then from there I believe I need to cast my .sol contract to a string object;

code = fs.readFileSync('voting.sol').toString()

And I get this:

I'm assuming there's an error in my contract, can't figure out where..


texts: What does ganache mean by eth_getTransactionReceipt?

texts:
I'm transitioning our testing suite from using the parity client to using (a fork of) testrpc/ganache (so we can run code coverage). Our parity client has a lot of configuration, and I don't know how much of it needs to be equivalently configured in ganache. So far, when I run the testing suite, I see the following output from ganache;

<stuff about accounts>

net_version
eth_getTransactionCount
eth_sendRawTransaction
eth_getTransactionReceipt
eth_getTransactionReceipt
eth_getTransactionReceipt
...
<continues to print eth_getTransactionReceipt forever>

The testing command hangs here.

My question is; what does this mean? What are the possible states that the blockchain could be in, given that it gets to this point but no further?

Thus far, from reading through the source, my hypothesis is that the first transaction is sent, but it is not being mined into a block, and so no receipt is generated. But that leaves me with questions about why; is the transaction invalid? Or does the fact that it was sent mean that the client validated it? Is there a miner running by default? The docs make it sound like there is, but I don't know how to check.


texts: go-ethereum event subscriptions doesn't work?

texts:
I'm new to go-ethereum and even Golang in general so my terminology might be wrong, I'm guessing event handling is also referred to as "subscription"? Anyways, my actual issue is that I want to test out an event on a contract, but I can't seem to get any callbacks.

Here's my code:

func main() {
client, err := ethclient.Dial("wss://ropsten.infura.io/ws")

if err != nil{
    log.Fatal(err)
}

fmt.Println("We have a connection!")

privateKey, err := crypto.HexToECDSA("blablabla")
if(err != nil){
    log.Fatal(err)
}

publicKey := privateKey.Public()

publicECDSA := publicKey.(*ecdsa.PublicKey)

fromAddress := crypto.PubkeyToAddress(*publicECDSA)

nonce, err := client.PendingNonceAt(context.Background(), fromAddress)
gasPrice, err := client.SuggestGasPrice(context.Background())

auth := bind.NewKeyedTransactor(privateKey)
auth.Nonce = big.NewInt(int64(nonce))
auth.GasLimit = uint64(300000)
auth.GasPrice = gasPrice
auth.Value = big.NewInt(int64(0))

testAddr := common.HexToAddress("blablablabla")
testEvent, err := TestEvent.NewTestEvent(testAddr, client)
if(err != nil){
    log.Fatal(err)
}

resChan := make(chan *TestEvent.TestEventHandleEvent)

if(err != nil){
    log.Fatal(err)
}

start := uint64(0)
testEvent.WatchHandleEvent(&bind.WatchOpts{
    Context: context.Background(),
    Start: &start}, resChan)

if(err != nil){
    log.Fatal(err)
}

timer := time.NewTimer(5 * time.Second)
go func(){
    <- timer.C
    _, err := testEvent.Gotcha(auth)
    if(err != nil){
        log.Fatal(err)
    }
}()

code := <-resChan
fmt.Println(code)

close(resChan)

}

Here's my contract:

pragma solidity 0.4.25;

contract TestCon
{
    event HandleEvent(uint64 code);
    address public owner;

constructor() public{
    owner = msg.sender;
}

function Gotcha() public payable {
    if(msg.sender == owner)
    {
        emit HandleEvent(10);  // I've deployed the contract from the same address. So this should match.
        return;
    }
    revert();
}

}

what am I doing wrong? Or is that a problem with my contract?


texts: Calculating annual percentage yield (apy) value for Uniswap pairs

texts: I wants to calculate annual percentage yield for a token pair listed on uniswap like this. Is there any API which I can use to retrieve the value? How can it be directly calculated?


texts: Lost my passphrase but have the Json (or keystore file) and know the wallet adress

texts:
I made an account on Ether blockchain client long time ago and I lost my passphrase (actually it consists of two words which I probably know (not sure) and some additional numbers among this words that I forgot). But I have a keystore-file (UTC) and I know the external wallet adress (etherscan shows that ballance doesn't changed for 1200 days, which is good). How can I to recover my account? Maybe to brute force combinations offline, how can I do it?
I have some light knowledge in cryptography and can write a program in C/C++, maybe Python. But I don't know how to use data from UTC file and don't understand it's structure. It would be acceptable to make a program, and run it on the processor for a weeks.


texts:
plateforms to develop private blockchain

Hello !

I want to develop a private blockchain , and i wanna know what's the best plateforms / logiciel to work with
thank you


texts: can you send ethereum to the same address you sent from?

texts: I was doing some financial investigation and I found transactions which had same account for source and target. Is this possible?


texts: scatter confirmation for sign a transaction?

texts:
I have built an dapp. It's almost like twitter where the user can tweet and also use as a microblogging site in blockchain.I have used scatter as transaction signer for using my dapp.
The real problem arises when I write something in my twitter a press post button it will ask the scatter permission to sign the transaction. My question is whether is it possible to avoid the scatter confirmation to make it user-friendly.
my dapp : www.tweetblocks.com


texts:
I am trying to console.log the blockNumber that my transaction was confirmed in with the following code:

web3.eth.sendTransaction(
    {from:account3, to: account2, value: web3.utils.toWei('1','ether')}
).then(function(receipt) {console.log(receipt.blockNumber)}

Node.js then sends me the following UnhandledPromiseRejectionWarning

  (node:11957) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9)

  { error:
     Error: Timeout exceeded during the transaction confirmation process. Be aware the transaction could still get confirmed!
         at _callee2$ (/Users/julianmartinez/node_modules/web3-core-method/dist/web3-core-method.cjs.js:434:36)
         at tryCatch (/Users/julianmartinez/node_modules/regenerator-runtime/runtime.js:45:40)
         at Generator.invoke [as _invoke] (/Users/julianmartinez/node_modules/regenerator-runtime/runtime.js:271:22)
         at Generator.prototype.(anonymous function) [as next] (/Users/julianmartinez/node_modules/regenerator-runtime/runtime.js:97:21)
         at asyncGeneratorStep (/Users/julianmartinez/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
         at _next (/Users/julianmartinez/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
         at processTicksAndRejections (internal/process/task_queues.js:86:5),

At the same time that I receive the previous error, I also receive the transaction receipt, but it does not console.log the block number.

Any idea about what is going on?


texts: If you're a node, why would you accept other node's solution instead of copying and broadcasting that solution?

texts: Let's say someone broadcasted a solution to the recent block. Why, as a node, would I accept it? I can just copy and broadcast it myself instead. Yes, most of the times the first node would win, but in rare occasions I would get ahead of that node (mine would propagate faster) and get the reward, no?


texts: How to create unique contribution addresses for a referral system by smartcontract

texts: I ran into some trouble with my smartcontract. I want to be able to allocate referral tokens to each person who participated in the ICO referral program. In order to do this, the smart contract must be able to distinguish contributions made and link them to a certain participant. I am looking for a way to let the smart contract create unique contribution addresses for each participant that registers for the ICO. These addresses will receive contributions and immediately transfer them to the "main" contract address, this way knowing each contribution made by each contributor seperately, even if he contributes from multiple wallets. How can i do this?


texts: What is the return of array.push() in Solidity?

texts:
I saw these code lines in cryptozombies.io:

uint id = zombies.push(Zombie(_name, _dna)) - 1;
zombieToOwner[id] = msg.sender;

I wouldn't have had a problem had there not been "- 1" after the push() function. I believe the return value of the push function has something to do with the index of the inserted object. Why is there a "-1"?
Is the return value index of the next free spot available to insert the next object in the array?


texts: Can ZKSnarks be implemented on the Ethereum ecosystem?

texts:
Since Zcash seems to have it's ZKSnarks implementation finished (or almost at least).

And versions of JPMorgan's Quorum had appeared with ZKsnarks implementations included see: https://www.coindesk.com/jpmorgan-integrates-zcash-privacy-tech-enterprise-blockchain/

We all know that the verification time of the Snarks its independent from the circuit (not of the number of gates, it's true) but anyway, the verifications of the nodes will be so much faster than they are now because the computations wouldn't be executed anymore.

  The possibilities of zkSNARKs are impressive, you can verify the correctness of computations without having to execute them and you will not even learn what was executed – just that it was done correctly.

As it is said on the Ethereum Blog (maybe with a lower "mathematical/theoretical level"

I know about the LibSnark.cpp implementation and other ones, but I'm not talking to put all of this on a SmartContract, I'm talking about the whole blockchain mechanisms adopting the Snarks structures in order to work with full encrypted blocks and transactions, and a verification process of the nodes implemented also with ZkSnarks verifying.

Will be possible to implement those SNARKS at the protocol level to verify the entire Ethereum Blockchain? If it isn't, why?

Thanks.


texts: If Ethereum gas charges based on the individual CPU instructions

texts:
I'm trying to understand exactly how gas works. Wondering if it charges based on actual individual CPU instructions (like Assembly-level x86 instruction set architecture level of detail), or if it charges at a higher level such as individual functions or something like that.

The reason I ask is because if it tracked individual instructions to charge for gas, then that tracking is itself an instruction, so it would lead to an infinite recursion of charging. To prevent that, some level of "meta" instructions would need to be ignored. So I'm wondering what level of stuff is ignored, and what is charged, and how it gets charged.


texts:
What average block time does the Etheruem network try to achieve?

The average block time has varied from ~30 seconds to ~14 seconds according to https://etherscan.io/chart/blocktime.

Does the yellowpaper define a "canonical" average block time that the network try to achieve?


texts: How can I write a test that fails a "requires(...)" in Solidity?

texts:
If calling a function in a contract would result in a failed require the whole test passes, even if the asserts are incorrect. This is extremely confusing. Look at the simple example below, which actually passes when it should obviously fail.

function testSomeFuncThatRequires() public {
    Assert.equal(uint(1), uint(2), "What the hell");
    require(1 > 2);
  }

If you remove the require(1 > 2), then the test fails as expected.
I am using truffle test to run my tests.

What am I doing wrong? Do most people just test their contracts with JavaScript? Seems like the problem is avoidable with JS.


texts: Should genesis.json be copied to each node for private testnet?

texts:
I am referring to the main page of go-ethereum here.

  With the genesis state defined in the above JSON file, you'll need to initialize every Geth node with it prior to starting it up to ensure all blockchain parameters are correctly set:

     $ geth init path/to/genesis.json

If I have a bootnode in my local LAN, should my nodes be able to download the genesis.json on their own? Or do I have to manually copy the genesis.json and execute the init command above on each of the nodes?

If it indeed requires this genesis.json to be copied to each of my nodes, how does it work with the main ethereum blockchain? Does ethminer/geth(any mining client) acually have a copy of the original genesis.json hard-coded?

Also, do I have to specify --networkid 1234 in case I have defined the chainId as 1234 in the genesis.json already?


texts:
I have my primary DOMAIN through the Ethereum Name Service.  I see documentation that shows you can set subdomains as I would like to do this for security for an up-coming ICO.

So I would like to register ICO.DOMAIN.eth to point to the contract for the ICO that way the address can't get changed on my site like has happened in the past.  Plus it seems easier for ICO participants to enter the ICO.DOMAIN.eth.

Is there a way to do this?  On the ENS site I see a mysterious section "CONTENT HASH FOR APPS (IPFS/SWARM)", is this where I register the ICO subdomain and if so how?


texts: DApp storage for data other than tranactions?

texts:
For the purpose of illustration, say I would like to create a decentralized version of Yelp.

A centralized approach would be to have a restaurants table and a reviews table in an Mysql database. In the case of a DApp, what is the best practice for storing non-transactional data?

My current thinking to have a Restaurant.sol contract and a Review.sol contract, each having a mapping from the record ID as key, to the record object as value. Every time a restaurant is added, we invoke a addRecord() method in Restaurant, which adds the new restaurant data to its current mapping. (Similar flow for Review)

Is this approach of treating a contract like a RDBMS table robust? Or am I missing something?

What's the limit to the amount of data that can be stored in the mapping of a contract?

EDIT: from my understanding changing the mapping of the Restaurant contract would cost ether. So that means every new record that is added to the "database" costs money? What's an economically viable way to run an app without requiring users to pay?

Please advise.


texts: How can DApps interact with solidity smart contracts?

texts:
What framework is used to send tokens between accounts by accessing solidity smart contract functions?

Say I made a Solidity smart contract called foocoin with the default transfer function. Assuming the function works correctly:

function transfer(address recipient, uint amount);

What sort of framework/API is capable of calling this function externally within a game for example?


texts: Failed to verify contract source code due to timeout/memory limit

texts:
Failed to verify contract deployed through remix on Ropsten network both using optimization and without it.

Error is:

Exception #1 Occured: ERROR|The Contract solidity compilation has exceeded the maximum timeout/memory limit that we can safely process. Automated source code verification is unavailable for this source code.

Gas estimation of creating contract with optimization:

gas  2592372 gas
 transaction cost   2592372 gas

Without optimization:

gas     4570491 gas
 transaction cost   4570491 gas

Tried both of Verify Contract Code (version 2.0) and Standart Version.


texts: ganache-cli: how to persist new created accounts

texts:
I start my service by:

ganache-cli -d --gasPrice 0 -q --db=./db

This persists my 10 defaults created accounts, but when I create new accounts using Web3:

web3.eth.personal.newAccount('password')

All the created accounts desapears after I restart the Ganache CLI command. So I cannot unlock this accounts.
But all my erc20 token balance are there.

How can I persist the new created accounts?


texts:
From the wiki of private chains in parity

  Parity also includes Proof of Authority Chains which do not require
  mining.

Is it possible to raise more ether in an existing POA chain?

Use case

Lets suppose I started a private chain with one account. Now that account used up its ether. Now there is no way to mine ether, since mining POA does not require mining. How do I raise more ether?


texts: Which mining pool has been heavily shorting Ether?

texts: This video shows that f2pool miners are guilty for suppressing Bitcoin's recent upwards momentum in price since f2pool is selling around 14,000 bitcoins per day. Can a certain Ether miner be similarly singled out for suppressing the ETH price?


texts: Is there any way to know whether blockchain is downloaded normally or using --fast option

texts:
This question is related to Mist started resyncing and ethers are gone.
I was downloading blockchain using --fast --cache=1024. I am surprised, inspite of using fast sync , my blockchain data is around 11GB. How is that possible?
I am downloading blockchain on another machine too with same --fast option and around 1715969 blocks are downloaded and it consumed only 4.4GB of memory which is reasonable.
But why my previous machine has downloaded full blockchainn with 11GB data and it's resyncing and the data has reached around 15GB.
I am pretty sure I used fast syncing in both my machines. But to be sure, is there any method by which I can know that whether my blockchain was downloaded using fast or normal sync?

Edit:
I have been through How do I tell whether the Mist/Wallet is “fast” or “full” syncing? , but it suggests to check via ps ux | grep geth , but what if you have stopped syncing? This command shows details of geth only if it's running.That question is about knowing whether syncing is through fast or normal mode while syncing.My question is about of I have finished syncing and I want to know whether the blockchain data was download by normal or fast mode.


texts: Abstract contracts cannot be initialised, can they?

texts:
As of v0.6, solidity introduced abstract contracts.

Do they behave just like in all other languages - that is, they can't be initialised, can they?


texts:
I am trying to wrap my head around magic values in solidity code, but cant seem to find any resources on this.

Here is an example of a contract I am looking at:

/// @dev Magic value to be returned upon successful reception of an NFT
bytes4 constant ERC721_RECEIVED_NEW = 0x150b7a02;
bytes4 constant ERC721_RECEIVED_OLD = 0xf0b9e5ba;
bytes32 constant ERC998_MAGIC_VALUE = 0xcd740db5;

The full contract can be found here:https://etherscan.io/address/0xaaf401585b72c678afc09036510d3ef759bdaf7e#code
Would appreciate it if some could provide an explanation or point me to resources .


texts: What is the main use of approveAndCall() function and _extraData?

texts:
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);

    if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; }
    return true;
}

  What does if condition do? What is the use of bytes4, byte32 and _spender.call?


texts: Deploy dapp on private blockchain network

texts:
i have create a private network with 2 nodes. I have connect an account with metamask from my private network and i have created a full dapp ( contract,front-end). Now i want to deploy the whole dapp on my private network without truffle.
Can you help me pls!~?


texts: What do the ethminer logs look like when you have successfully mined something as part of a pool. Say on ethermine.org?


texts: Pending tx with parity through geth console

texts: I am having issues with the current version of geth 1.8. Thus, I tried using parity and got a node synced. I want to use web3 and because of familiarly, I want to use parity with the geth console which I did so successfully. However, much to my dismay it appears that familiar objects and functions I had been using with geth liketxpool.content no longer works. Is there a way to get pending tx on the geth console with a parity node?


texts: Is a function prone to re-entrancy attack even if I set balance to zero within the same function (example included)

texts:
Such as in this scenario, is the hackable via re-entrancy? thanks...

function withdraw(uint256 money) public {
    if(money <= balance[msg.sender]) {
        (bool success, ) = msg.sender.call.value(money)("");
        if(success) {
            balance[msg.sender] -= money;
        }
    }


texts: Truffle + Infura Mainnet deploy. Transactions never get mined, timing out after 750 seconds

texts:
The contract deploys on Rinkeby without a hitch, but when it comes to mainnet it is erroring out strangely. Infura's HTTP endpoint was giving me Invalid JSON RPC RESPONSE "", so I decided to switch to WebSocket endpoints, provided by Infura.
       const webSocketProvider = new Web3.providers.WebsocketProvider('wss://mainnet.infura.io/ws/v3/eeb0ee32c0364281afb37982fbbe26fb');

//network
  live: {
      network_id: 1,
      provider: function() {
        return new HDWalletProvider(
          'mnemonic',
          webSocketProvider
        );
      },

      gasPrice: 27000000000,
      confirmations: 2,
      skipDryRun: true
    }

Enclosing my code snippet with WS provider and mainnet configuration in Truffle, as well as package.json:
"dependencies": {
    "@0x/subproviders": "^2.1.11",
    "@truffle/hdwallet-provider": "^1.0.35",
    "opensea-js": "latest",
    "openzeppelin-solidity": "^2.5.1",
    "truffle": "^5.1.31",
    "truffle-flattener": "^1.4.4",
    "web3": "1.0.0-beta.34"
  },

Have been messing with this deployment for 3 days now. Please, provide as much intel as you possibly can.


texts: Mist recently launched its Beta (0.8.0), you can call any website for getting the HTML and JS files. What happens if inside my Dapp I make a XMLHttpRequest?


texts: Is it possible to derive public key from ETH address?

texts:
Goal (not asking XY question):

send ETH to an address
web3.js script monitoring it and acting upon transaction
if msg.value > 0.1 ether then...
...encrypt a file with the public key of the msg.sender and publish to IPFS
only the original ETH sender (they have private key) can decrypt the file

Looking at the question: How are ethereum addresses generated?

Start with the public key (128 characters / 64 bytes)

Take the Keccak-256 hash of the public key. You should now have a string that is 64 characters / 32 bytes. (note: SHA3-256 eventually became the standard, but Ethereum uses Keccak)

Take the last 40 characters / 20 bytes of this public key (Keccak-256). Or, in other words, drop the first 24 characters / 12 bytes. These 40 characters / 20 bytes are the address. When prefixed with 0x it becomes 42 characters long.

Public key to address is a one-way function, so how can we design the system to accomplish the goal?


texts:
I'd like to store a unique mapping from NFT's to some state data in my contract.

NFT's are globally unique based on:  the NFT contract address, and the uint ID within the NFT contract.

I would therefore like to do a mapping that equates to:

mapping ((address, uint) => myStateData)

How can this be accomplished?

Thank you!


texts: How convert signed int256 into a string?

texts:
I've found how to convert an unsigned int256 in oraclizeAPI.sol and Ethereum String Utils but I haven't had any luck finding how to convert a signed int256 into a string.

    function uint2str(uint i) internal pure returns (string){
    if (i == 0) return "0";
    uint j = i;
    uint len;
    while (j != 0){
        len++;
        j /= 10;
    }
    bytes memory bstr = new bytes(len);
    uint k = len - 1;
    while (i != 0){
        bstr[k--] = byte(48 + i % 10);
        i /= 10;
    }
    return string(bstr);
}


texts:
Before the question, I want to show my development environment configuration:

I am using Remix online solidity IDE for coding

My contract is running on local PC with RPC (web3 provider option in Remix)
I set up MEW to run on my http:127.0.0.1:8545 node

The code:

pragma solidity ^0.4.0;
contract MyCoin {

    string name;
    string symbol;
    uint decimals;
    uint256 totalSupply;
    uint balance;

    mapping (address => uint) blanceOf;

    function MyCoin(uint256 coinAmount) {
        name = "MyCoin";
        symbol = "MC";
        decimals = 18;
        totalSupply = coinAmount;
        balanceOf[msg.sender] = coinAmount;
    }

    function getBalance(address addr) constant returns(uint256) {
        return balanceOf[addr];
    }
}

All seems to work well, in fact, all of the 10 accounts generated with the command 'testrpc' are accessible through MEW, and tx from each other works as well. The issue is that my custom token, that, of course, is not an ERC20 token,
can't be sent between those wallets, or better, from the getBalance function I see that a specific account has a certain amount of tokens, but within MEW I can't see this information; all I get from MEW is 'Not a valid ERC-20 token'.

The error:

So the question is: is there a way to show the amount of a custom token inside MEW running on local RPC node? Or an ERC20 token Standard Interface is a must have?


texts: The transferFrom function of ERC721 conract has no Tokens Transferred

texts:
I build up a contract on the rinkeby network, and mintted a token successed.
Now I want to transferFrom this token to another address with the contract
this is my code
    const transactionParameters = {
   to: to, // Required except during contract publications.
   from: from, // must match user's active address.
  'gas': web3.utils.toHex("30000"),
   //gasLimit: web3.utils.toHex(30000),
   'gasPrice': web3.utils.toWei('1','Gwei'),
   'value':web3.utils.toWei('1','Gwei'),
   'data': window.contract.methods.safeTransferFrom(from, to, tokenId ).encodeABI()
   };

and I call this by the
      await window.ethereum
   .request({
    method: 'eth_sendTransaction',
    params: [transactionParameters
        ],
    }).then((result)=>{
      console.log("transActionResults:",result);
    }).catch((error)=>{
      console.log(error);
    });

the metamask send this transaction, but there no any token transferred.
is there any issues of my contract of code ?
the link is the tx page.
https://rinkeby.etherscan.io/tx/0x48c98d62757cd7a450625626c9c491952ae940e4b21b4cb7a1f344bf44fbddee
but I want the tx should like this:
https://rinkeby.etherscan.io/tx/0x21e7582292af759dd83aca494b0bce3df6dec17067736c3c66b73dc927850862


texts: Function withdrawReward "The transaction has been reverted to the initial state"

texts:
Dear colleagues of the Ethereum environment,

I'm learning to code Solidity in a intermediate level. Trying to adapt existing old 0.4.19 contract for a experiment of crypto-investment fund.
I have a problem when calling the withdrawReward function. Solidity 0.6.8 compiling in Remix.

The contract hast a first function "requestWithdraw" that puts the token-shares in hold:

    function requestWithdraw(uint value) public {
      require(value <= balances[msg.sender]);
      delete holded[msg.sender];
      hold(msg.sender, value);
      requestWithdraws[msg.sender]=value;
      emit requestedWithdrawal(msg.sender, value);
    }

Made a transaction calling 100000000 tokens (8 decimals). And tested lower amounts too.

And later on, after the hold time, another function can be call for the withdrawal of the corresponding reward in ether:

    function withdrawReward() external {
        uint i = 0;
        uint256 ethAmount = 0;
        uint256 len = holded[msg.sender].length;
        while (i <= len - 1){
            if (block.number -  holded[msg.sender].time[i] > holdTime && block.number -  holded[msg.sender].time[i] < holdMax){
                ethAmount += tokenPrice * holded[msg.sender].amount[i];
            }
            i++;
        }
        require(ethAmount > 0);
        require(ethAmount>=(tokenPrice*requestWithdraws[msg.sender]));
        emit LogWithdrawal(msg.sender, ethAmount);
        totalSupply = totalSupply.sub(requestWithdraws[msg.sender]);
        balances[msg.sender] = balances[msg.sender].sub(requestWithdraws[msg.sender]);
        contractBalance = address(this).balance.sub(ethAmount);
        emit Transfer(msg.sender, address(this), requestWithdraws[msg.sender]);
        delete holded[msg.sender];
        hold(msg.sender,balances[msg.sender]);
        msg.sender.transfer(tokenPrice*requestWithdraws[msg.sender]/tokenUnit);
    }

It already have the enough amount of tokens in hold; ether in the contract and seems to be all in its position. But I get this revert error:

transact to DynamicCryptoFund.withdrawReward errored: VM error: revert.
revert  The transaction has been reverted to the initial state.
Note: The called function should be payable if you send value and the value you send should be less than your current balance.  Debug the transaction to get more information

 status     0x0 Transaction mined but execution failed

You can review the full contract's code in my github:
https://github.com/ecofintech/dynamic-diverse-cryptofund/blob/master/DynamicCryptoFund-beta.sol

Any feedback is very welcome too.

Thanks


texts: When I attempt to add V2 liquidity to Uniswap ETH/Token, the button stays grayed out and is titled "Insufficient Input Amount" (no matter what I set for the token values). When I attempt to do so on V3, I click the "Add" button and then nothing happens. The processing modal pops up where Metamask is supposed to take over, but then quickly goes away. What am I doing wrong?


texts: How to get the current block number using Golang?

texts:
It's a seemingly simple operation but I can't find an obvious way to do this using the go-ethereum library.

Given a blockchain client like so:

client, err := ethclient.Dial("http://localhost:8545")

The only available methods are:

BalanceAt
BlockByHash
BlockByNumber
CallContract
Close
CodeAt
EstimateGas
FilterLogs
HeaderByHash
HeaderByNumber
NetworkID
NonceAt
PendingBalanceAt
PendingCallContract
PendingCodeAt
PendingNonceAt
PendingStorageAt
PendingTransactionCount
SendTransaction
StorageAt
SubscribeFilterLogs
SubscribeNewHead
SuggestGasPrice
SyncProgress
TransactionByHash
TransactionCount
TransactionInBlock
TransactionReceipt
TransactionSender

Which does not include GetBlockNumber like it does in web3.js for example.


texts: How to filter transactions in PoA/Clique chain

texts:
(ETH noob here)

I am thinking of running PoA/Clique based network for a potential dApp project.

Is it possible for the sealer to apply filters on transactions before sealing a block?

The scenario is this.

Trusted parties run sealers.
Users issue transactions against smart contracts.
Users should not be able to spam the network with useless stuff inflating the blockchain.

Some solutions that come to mind.

Run chain on isolated network

Not really viable since I would like users to transact directly. Also having more (non-sealer) nodes should help the network propagate transactions quicker.

Set high gas price

Only accounts with (fake) ETH can issue transactions. But I need to vet each account and issue them ETH to make transactions. This doesn't give me any way to validate transactions.

Sealer only includes legit transactions

In this approach, the sealer would run some custom logic, like who is allowed to deploy new contracts, who can transact on particular contract, size limits, and so forth.

The question: Is there any way to set up the geth miner to apply custom logic to transactions before they get included into a block? If not then are there third party miners that allow me to do this and support Clique?

Just to be clear, my question is not regarding security, it's simply about reducing spam on the chain.


texts: Is it possible to call a public array from another contract?

texts:
Let's say there is a uint[] public MyArray declared in contract_A.
Is there a possiblility to create an interface contract_A that would allow to read the values in  MyArray from another contract, or is it absolutely necessary to build a getter for MyArray in contract_A?
Asking this because of the code size limit, if there are a lot of arrays in contract_A, would be convenient to not build a getter for all of them (they need to be read by another contract).


texts:
Trying to install Genoil on ubuntu16 as following with GPU
https://github.com/Genoil/cpp-ethereum

Since cuda and ethminer have successfully installed  before, I just start from:

sudo apt-get install git cmake libcryptopp-dev libleveldb-dev libjsoncpp-dev libjsonrpccpp-dev libboost-all-dev libgmp-dev libreadline-dev libcurl4-gnutls-dev ocl-icd-libopencl1 opencl-headers mesa-common-dev libmicrohttpd-dev build-essential cuda -y

But it said 'E: Unable to locate package cuda'

Any suggestion, thanks.