texts: Is Ethereum's mining algorithm vulnerable to ASICBOOST?

texts:
Bitcoin's hashing algorithm uses a multi-step hashing function. Some miners have used a technique referred to as ASICBOOST to exploit this. I'm unclear on the specifics, but it has something to do with the way headers are broken into chunks and those chunks can be re-used to speed up hashing.

Does Ethereum and its hashing algorithm have similar (obviously not exactly the same) issue?


texts: How to prevent unwanted parties pushing data to a private chain?

texts:
For example, if a private chain genesis is distributed to a group of approved peers, however a peer makes this genesis block publicly available. How can one prevent unwanted users from joining the network, mining and then creating contracts/reading data?

If this isn't possible, is there a way to invalidate false publications? Only way I can see is moving against the decentralised model by creating a unique smart contract that contains keys for credible publishers? This contract only being modifiable by the owner.Then again, what stops a peer from leaking their key.

I guess a solution would be to check that contracts are published from a particular owner address, but I don't believe there is functionality to retrieve the address without using a scanner to return the initial transaction?


texts: Is it possible to create an X.509 certificate from an Ethereum/Bitcoin private key?

texts:
We all love Ethereum/Bitcoin (i.e. EC secp256k1) private keys, because they let us sign transactions. However, browsers don't support those keys for authentication -- what they do (sort of) support is client-side SSL certs.

So the obvious question that comes to mind is: what would it be like to generate an X.509 SSL certificate from an Ethereum (or Bitcoin for that matter) private key? Would servers recognise such authenticated HTTPS connections? What support would be missing on client side?

To sum that up, the first workflow that I have in mind is SSL client auth:

I (the user) generate an SSL cert from an Ethereum private key (once) and imports it into the browser
I log into a website by providing that cert
The website trusts that I own the corresponding Ethereum address. Note that this won't let me sign any transaction, but it at least will let me prove that I own that address. Depending on the use case, that is sometimes sufficient.

Another workflow that comes to mind is CAs (Certification Authorities, think "Verisign"). The job of a CA is to sign X.509 certificates. So if I could generate a certificate from an Ethereum address, I could have that certificate signed by a CA and thus bridge Ethereum with the huge web-of-trust infrastructure that already exists. All those well-established CAs could start signing EC certs, thus anchoring Ethereum addresses to real-life entities.

So the key part is deriving a client or server X.509 cert from an EC private key. Is that at all doable? What are the obstacles or impediments?


texts: How to get a raw transaction in txpool via JSON RPC?


texts: When I hit sign transaction in deploying contract, the send button is greyed out

texts: I have 0.5 ROP but it is saying send 0. My wallet address is 0xef534b8ea9B3897a014Bf47E84c642Ad7952A120


texts: How can I install go-ethereum on CentOS?

texts:
I'd like to setup go-ethereum on centos6.5. However,this reference doesn't show how to install go-ethereum on centos.

I tried [vagrant@vagrant-centos65 ~]$ bash <(curl -L https://install-geth.ethereum.org), but it returned the following error. Could you tell me how to solve it?

==> Looking for geth
 ✘  Geth is missing

==> Checking dependencies
 ✘  apt-get is missing

==> Installation failed
==> OS not supported: geth one-liner currently support OS X, Ubuntu and Debian.
For instructions on installing ethereum on other platforms please visit http://ethereum.org/


texts: Can send ether from geth account to wallet, but not from wallet to geth (invalid sender)

texts:
geth is running as a private network. It has its own accounts, stored in its keystore. One of them is used for mining. The others are funded with ether.
MyCrypto wallet (desktop version) is connected to the private network with two accounts funded with ether.
I can send ether from the geth accounts to the wallet accounts using web3. The funds show up in the wallet accounts. I can also see the transactions, so the wallet is definitely connected to my private blockchain.
However, when I try to send funds from a wallet account to the geth accounts, or to the other wallet account, I get the error "invalid sender".
In order to send the ether, I do the following:

Go to the Send Ether & Tokens tab
Enter the recipient address
Enter the amount of ether
Click send

The blockchain rejects it with the following error message in the log file:
WARN [06-27|10:54:12.399] Served eth_sendRawTransaction            conn=127.0.0.1:51212 reqid=8bedc8b0260cb83b3388518fcb8611ba t="129.448µs" err="invalid sender"

It seems like the wallet is not signing the transaction before sending it, but I can't imagine why. I can't find anything in the MyCrypto documentation, or in the application, about this.
Has anyone seen this before and/or have any idea how to fix it?


texts: "RPC error, your account is locked" when I try to deploy the last version of parity-bridge

texts:
I have already success to deploy the last version of parity-bridge (last month), but today i have pull the last version of parity-bridge.

I have that on my terminal :

env RUST_LOG=info parity-bridge-deploy --config bridge_config.toml --database db.toml
INFO:parity_bridge_deploy: Parsing cli arguments
INFO:parity_bridge_deploy: Loading config
INFO:parity_bridge_deploy: Starting event loop
INFO:parity_bridge_deploy: Establishing HTTP connection to main "http://localhost:8542"
INFO:parity_bridge_deploy: Establishing HTTP connection to side "http://localhost:8540"
INFO:parity_bridge_deploy: Deploying MainBridge contract
INFO:bridge::deploy: sending MainBridge contract deployment transaction and waiting for 1 confirmations...
DeployMain: deployment transaction failed

Caused by:
RPC error: Error { code: ServerError(-32020), message: "Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer.", data: Some(String("SStore(InvalidAccount)")) }

Here is the config of my node :

[parity]
chain = "./spec.json"
base_path = "/tmp/parity-dev"

[ipc]
disable = false
path = "$HOME/urp/node.ipc"
apis = ["web3", "eth", "pubsub", "net", "parity", "parity_pubsub", "parity_accounts", "traces", "rpc", "shh", "shh_pubsub"]

[rpc]
port = 8542
interface = "local"
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
cors = ["all"]
hosts = ["all"]

[ui]
port = 8182

[websockets]
origins = ["all"]
port = 8452
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]

[account]
unlock = [
 "0x005eb3d86d6c987860fbc95ab97da69ee6b6118e",
]
password = ["node1.pwds"]

[mining]
engine_signer = "0x005eb3d86d6c987860fbc95ab97da69ee6b6118e"
author = "0x005eb3d86d6c987860fbc95ab97da69ee6b6118e"
reseal_min_period = 0
min_gas_price = 0

Obviously in the file node1.pwds I have the password of the node.

I think the problem comes from the connexion rpc of my node, because before the update of parity-bridge I connected to the bridge thanks to the ipc connection which is not possible anymore. And now i use the rpc connexion.

Thanks in advance.


texts: How to import an icebox encrypted wallet into Geth

texts:
I am trying to take the encrypted keyfile from icebox and import into Geth.  However I am coming up with this error when I try

geth account import icebox.txt

Fatal: Failed to load the private key: encoding/hex: invalid byte: U+007B '{'

The keystore file is a v2 keystore file.  I would import via something like myetherwallet but there is no v2 compatibility.  I was told that geth still had compatibility to import v2 keystore files and automatically import them into v3.

The reason I am trying to do this is to get my private key for this account.  So, if anyone knows another way to get a private key from a v2 keystore file (like found in icebox) that solution would work too.


texts: Push to dynamical array of structs using loop in external function

texts:
struct testR{
    bytes32 name;
    int32 count;
}

testR[] public tests;

function createTest(bytes32[] names) external returns (bool success) {
    uint256 len = names.length;
    for (uint8 i=0;i<len;i++){
        tests.push(testR({name: names[i], count: 0}));
    }
    return true;
}

Here's my code. When I deploy this contract to my private network, function createTest just doesn't work, I pass array of converted to HEX strings, then when I call public array "tests" it always returns me 0x and null.
If I try to compile and run this contract in Remix using JVM, it gives such error:

undefined errored: VM error: invalid opcode.
invalid opcode  The constructor should be payable if you send value.
The execution might have thrown.
Debug the transaction to get more information.

I guess there's something wrong with my loop but it seems so simple.


texts: Monitor and restart web3 connection if disconnected

texts:
Is there a way to listen for web3 connection to node continuously and restart if it fails. I am expecting some similar to this. It is something very common but i can't find this in documentation. If not what approach you all use to deal with disconnection and error.

Note: I am referring to web3js v1.0

var web3 = new Web3(provider);
web3
    .on('disconnect', function() {
        web3 = new Web3(provider);
    })
    .on('error', function() {
        web3 = new Web(3provider);
    });

Also should i use web3 = new Web3(provider) or web3.setProvider(provider) to reinit?


texts: This question is not specific to Solidity but in general - if i would like to randomly pick some existing ETH address, how should i do that? For example, i wanna send some token to random ETH address, but only existing one. What would be the proper way of doing that?


texts: When i run the contract i got below mentioned error

texts:
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
    at Object.callback (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:329221:46)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:39618:25
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:331159:9
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:175492:11
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:314196:9
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:315621:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70159:18)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70449:12)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70604:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70564:24)


texts: sending string parameter value to solidity method

texts:
I am trying to send string parameter value to a solidity method but i am not able to get the return value.
this is my solidity code :

contract Entity{
    event Entities(string name);
    struct Entity{
        string name;
    }
    uint32 public entityId;
    mapping(uint32 => Entity) entities;
    function insert(string name) returns (uint32 returnId){
         returnId = ++entityId;
         entities[returnId] = Entity(name);
         Entities(name);
         return returnId;
    }
}

and this is how I am trying to interact with it through JSON RPC API

curl --data '{"jsonrpc":"2.0","method": "eth_call", "params": [{"from": "0xec1466c6fa38de0506e14fe8e5b51e95d3f80b11","to":"0xbd46d45c440ae02a76938043af18cc75ac569e4b","data":"0xb1498e29456e746974792042000000000000000000000000000000000000000000000000"}], "id": 6}'

I am getting 0x as result.


texts: Do all Contracts implement some abstract base Contract?

texts:
I've deployed a very simple Contract to Testnet. It has the following function...

function transfer(address _to, uint256 _value) public
{
    /* Check if sender has balance and for overflows */
    require(balanceOf[msg.sender] >= _value && balanceOf[_to] + _value >= balanceOf[_to]);

    /* Add and subtract new balances */
    balanceOf[msg.sender] -= _value;
    balanceOf[_to] += _value;

    /* Notify anyone listening that this transfer took place */
    Transfer(msg.sender, _to, _value);
}

Question: Does the standard Ethereum wallet actually call onto this function when I use the wallet to send my token, e.g., with this code am I implementing an abstract function that is declared in some base Contract? If yes, where can I look at the base Contract declaration? If no, how does the standard Ethereum wallet know how to transfer my tokens? Thanks.


texts: Solidity 0.4.26 check if element already exists in array

texts:
How do I make it so this only adds an identifier to the dataArray if it doesn't exist already?

pragma experimental ABIEncoderV2;

contract structWithMapping{

    struct Data{
        string[] user;
        string[] catagory;
        string[]  data;
    }

    mapping(string => Data) mappedData;
    string[] public dataArray;

    function setUserData(string _user, string _catagory, string _data)public{
        var addData = mappedData[_user];

        addData.user.push(_user);
        addData.catagory.push(_catagory);
        addData.data.push(_data);

        dataArray.push(_user) -1;
    }

    function getUsers() view public returns(string[]){
        return dataArray;
    }

    function getUserData(string _user) view public returns(string[] memory, string[] memory, string[] memory){
        return(mappedData[_user].user, mappedData[_user].catagory, mappedData[_user].data);
    }
}


texts: Any quick, easy ways to convert ERC-20 tokens?

texts:
Are there any quick ways to convert my Airdrop ERC-20 tokens from various old ETH wallets to ETH/BTC...?  Looks like I've got a few hundred $ kicking around in old Airdrop tokens.

I've seen a few methods on here that are quite technical and require token specific transactions to transfer each token type to various different exchange accounts.  (a) I'm not confident I could to do that, and (b) I can't seem to find exchanges that support all my tokens.

Here's an example of one of the old wallets I'm trying to clear out:  https://etherscan.io/address/0x51855d982c8e69888a9548dbe35e38a20cebe2ea

This one contains: DATA, ELEC, OMG, XNN, AIC... I have 6 other wallets with a mix of other tokens.

Do any wallets or web-services provide a simple one hit conversion?


texts: What is the best way to store users data on smart contract? Suppose we have n number of users and we want to store each username and his other details, should we have to create a smart contract individually for every user?


texts: I looked for a while on Google/here for if there's a way to manually set the default transaction gas fees, but couldn't find anything. Anyone know if this is possible in metamask? Basically I need super fast transactions all the time for time-sensative swapping on uniswap, so I want to set it to something like 160 gwei & 60000 gas limit so that I don't need to change the gas manually for every transaction. Anyone know if this is possible in metamask? If not, is there another way to achieve this?


texts: Is fast sync the reason why my ethereum wallet doesn't show the ether I got back through the DAO withdraw?

texts:
On block-explorers like ethersan.io I can see that the DAO withdraw worked and that ether was returned to my address. However my Ethereum Wallet (0.84 - Mac OSX using geth-node) shows my old balance.

Before I made the withdraw I used fast-sync to download the blockchain. I heard that the node doesn't know about the "state". Might this be the reason the shown balance is not correct?


texts: To high power consumption 2x RX 470 8G - 575 watts - How to fix?

texts:
My miner is runnig for a few days and today i checkt the power consumption with a special device. The consumption is around 575 Watts.
I had assumed that it will be around 300 Watts.
Why is the consumption this high and how kan i fix it ?

Rig:
2x MSI Radeon RX 470 8G

Intel Core i5 4460

Gigabyte GA-Z97P-D3

4GB Corsair 1600 MHz

Corsair 60 GB SSD

Corsair RM750x Gold

EthOS 1.1

Settings:

globaldriver amdgpu

globalpowertune 4

globalminer claymore

maxgputemp 75

globalfan 85

stratumproxy enabled

proxywallet 0xE06d6425AA9bf1F609278999Fe6504f7D2A8C5E6

proxypool1 pool-eu.ethosdistro.com:5001

proxypool2 pool-usa.ethosdistro.com:5001

flags --cl-global-work 8192 --farm-recheck 200

Mining arround 42 MH/s.

How can help me?

Update:
I orderd a third card from another supplier. It's from a diffrent batch as well.
I swapped al the cards tried them single, double and with three of them.
It doesn't matter or i swap the card from different batches i get the same power consumption every time.

Minig with only 1 card: 305 Watt.
Minig with 2 cards: 570 Watt
Minig with 3 cards: 819 Watt.

This doesn't seem right


texts: How to get byte code from deployed contract in

texts: I want to get the byte code of a deployed contract. How can I get it? Is there a special function in web3.js? I haven't found any.


texts: Cannot find module 'fs-promise' Error when importing a smart contract instance

texts:
I get this error when I try to open a page in the DApp I'm developing.
Error: Cannot find module 'fs-promise'
Require stack:
- /Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/swarm-js/lib/api-node.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/web3-bzz/lib/index.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/web3/src/index.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/.next/dist/ethereum/web3.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/.next/dist/pages/registration.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/next/dist/server/require.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/next/dist/server/render.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/next/dist/server/index.js
- /Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/next/dist/bin/next-dev
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/swarm-js/lib/api-node.js:1:11)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Module._compile (/Users/eimanalwahhabi/Desktop/RecycleChain/node_modules/source-map-support/source-map-support.js:492:25)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)

This error only occurs when I use an import a smart contract instance from register.js (in ethereum folder) file to registration.js (in pages folder). I use this following import statement
import registerContract from '../ethereum/register'; // import SC instance

My File system looks like this
.
The content of register.js is this
import web3 from './web3';
import register from './build/Register.json';

const instance = new web3.eth.Contract(
    register.abi,
     '0x7126ec4f68added009015a1f5ac718c4896faa2e'
     // Address of the regist.sol contract in ropsten network
);

export default instance;

The versions of fs-extra that I'm using is "fs-extra": "^9.0.1",.
Update: The error seems to disappear when I press enter between the lines of web3.js file but then it comes back again when I refresh the page.
this is web3.js:
import Web3 from 'web3';

//current provider is the provider injected by MetaMask
let web3;

//typeof is used to check if window is defined
if (typeof window !== 'undefined' && typeof window.web3 !== 'undefined') {
  // We are in the browser and metamask is running.
  //Connect metamask to the webapp
  window.ethereum.enable();

  web3 = new Web3(window.web3.currentProvider);
} else {
  // We are on the server *OR* the user is not running metamask
  const provider = new Web3.providers.HttpProvider( 'https://ropsten.infura.io/v3/a5dc022ed8df4754b509e1f289d10b05');
  web3 = new Web3(provider);
}

export default web3;


texts:
I logged both getBlock('pending').transactions.length and txpool.status.pending while the Aragon ICO was ongoing. I'm interested in seeing transactions as they are coming to my node.

The two graphs are significantly different. The txpool pending txs counts goes up well above 2000 (which is sort of the number I remember seeing on Etherscan), yet the getBlock('pending').transactions.length never goes above 500, and seems to reset to 0 once in a while.

One explanation could be that getBlock('pending').transactions give me transactions that my node has witnessed since the start of the current pending block? Is that correct?


texts:
I find this super-confusing, but there are two consensus algorithms under the name Casper:

Casper the Friendly Finality Gadget by Vitalik;
Casper the Friendly GHOST (a.k.a. "correct-by-construction") by Vlad.

What is the relation between these two designs? What is the rationale behind designing two similar protocols in parallel? Which one is going to be actually introduced in Ethereum?


texts: How to Transfer And TransferFrom On The Tether Smart-contract from another smart-contract? It uses onlyPayloadSize?

texts:
Hi I'm trying to call transfer and transferFrom on the Tether smart-contact token located at 0xdAC17F958D2ee523a2206206994597C13D831ec7.

It is the only token I have a problem with transferring from within my smart-contract.

I'm guessing it's because of the use of the onlyPayloadSize modifier. If anyone understands whats going on, and how to fix this, that would be awesome.


texts: how to transfer from contract to another account or contract

texts:
I have a function:
function sendEther(address payable _to, uint amount) public  payable returns (bool) {
        bool success = _to.send(amount);
        return success;
    }

Now, how transferring funds work, is it first tries to grab the value from the caller's transaction and if it's not enough, then grabs the contract's funds and moves it to _to address.
Now, let's say that my contract address has 1 ether. contract has a function which moves 1 ether from it to another address. User calls this function. But user puts 0 ether while calling a function. If that's so, the function would still send 1 ether even though user put 0 ether.
Is this how it's supposed to be ? what if i don't want users to be able to lose my contract's funds ? they can call this function, but it should be their money that gets sent from my contract to another, not the actual contract's funds. I guess i'd need a require statement to check msg.value field right ?
Do you agree with me ?


texts: Can Hyperledger Fabric Blockchain Supports Partial Transaction Encryption?

texts:
My use case is that we need to protect only sensitive data in the transaction in blockchain. But we want to open other data in the same transaction to the public, Can Hyperledger Fabric supports the above mentioned transaction type? If not, can I achieve it using smart contract and user roles in my organization?

Please advise.  Thanks.

Regards,
Wilson


texts: is it possible triggering a contract on specific date?

texts: Can I trigger a smart contract on specific date? If I deploy a contract today and I want execute some function of that contract tomorrow without any exteral intervention. Is it possible?


texts: Binance smart chain wallet open using web3modal

texts:
Web3modal provides ethereum wallet connect in dapp.
I'd like to connect binance smart chain wallet extentions.
I think it would be possible to edit providerOptions for the each wallet extensions.
Anyone can give me detailed answer for my question?
Thanks


texts: Geth 6.2: miner.start() returns null and miner's hash-rate drop for all miners down due to the update

texts:
On Geth Version: 1.6.2-unstable miner.start() returns null, it used to return number of processes assigned. Is it normal? miner.start(num) num identifies the thread number?

> miner.stop()
true
> miner.start(4)
null

I have a small private net and there is only one miner. The miner used to work for almost couple of months with 503.7 KH/s (since it has been launched with geth v5.9) but now it works with 103.7 KH/s when I updated geth with 6.2 there is this sudden drop down. This drop down affected all the miner's hash rate and I observe that all's hash-rate is drop down around 5 times.

This change occur for my other nodes where hash-rate is get dramatically slower. When I check top geth consumes all the CPU power, I assume miner works with full CPU power.

[Q] What might be the reason for miner's hash rate drop down (almost 5 times slower)? Could it be related to geth's update on version 6.2? Did anyone faced with similar issue?

[Q] This is very inefficient. If the node use much smaller hash-rate why on the background does the CPU consumes all the power? or just hash-rate calculation updated.

Thank you for your valuable time and help.


texts: How do I make sure that a smart contract is production ready. Other than unit testing, what other methods or tools are currently available ?


texts: What is the max data and program complexity one smart-contract can support

texts:
I want to make a smart-contract for P2P trading. I am wandering if I have to create separate contracts for each bid and agreement between two entities, or I can simply create a single contract that contains all the bids and the agreements between users?

Having only one contract will facilitate the access to it, as I will have to mange only one address, however, if I will have multiple contract, how I can manage them? especially if I will use oracle to allow external devices to provide the contracts with some external data.

Thanks.


texts:
How can one start selling their coins on their custom website for ETH and Bitcoin?

I was checking bunnytoken.com, they have very simple payment process script, which includes referral solution.

Each time user register, they get unique ETH or bitcoin address, to sent the money.

I been looking for similar script, but cant find any. Can anyone help, if they already know which site I can use or script?


texts: Is it possible to make ethereum private by default like how monero has it?

texts: How would ethereum be made private and anonymous by default like how monero has it? Is it possible to turn an token into a fully private anonymous token by default?


texts: I am looking for testing framework which is capable of creating test scripts for smart contracts(solidity) automatically

texts:
Is there any testing tool which is capable of handling smart contracts and can generate test scripts for given contracts based on function present in that contract?

End user only need to provide contract & test scenarios/cases to the tool from which test scripts should be auto generated without any human intervention.

Is it possible to develop such a tool?If yes, How?
Did any one worked/explore on this before?


texts: How to add deployed components to puppeth configuration

texts:
Is it possible to add a bootnode (created using geth or bootnode command let's say) to an existing puppeth configuration? So that when the puppeth dashboard is created, it points to this bootnode?

Thank's in advance.


texts: why several Draw event logs when there is actually one?

texts:
I'm looking into the event logs of makerdao's CDP operation, and I'm confused why there are several event logs for 1 cdp operation, like this tx: https://etherscan.io/tx/0x0fb6a8d8f10410c544b27b848319e67a422be883e4252fea639c89a444209685#eventlog, it contains 1 cdp operation: draw dai.

there is only 1 Draw event of 95 Dai:

while in event logs, there are several event logs(totally 6) with the Topic0 (0x440f19ba00000000000000000000000000000000000000000000000000000000):

why is this?

Note: signature of draw event is:

  function draw(bytes32 cup, uint wad) public note {

here the log is made by the modifier note, which is:

event LogNote(
    bytes4   indexed  sig,
    address  indexed  guy,
    bytes32  indexed  foo,
    bytes32  indexed  bar,
    uint              wad,
    bytes             fax
) anonymous;

modifier note {
    bytes32 foo;
    bytes32 bar;

    assembly {
        foo := calldataload(4)
        bar := calldataload(36)
    }

    LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);

    _;
}

event LogNote is anonymous, so topic0 is msg.sig instead of the signature of the event. and msg.sig for func dai is: draw(bytes32,uint256), the keccak is: 0x440f19ba0


texts: Truffle test: how to get the block number of deployed contract?

texts:
In my test I would like to get the block or block number of when the contract was deployed.
const instance = await MyContract.deployed()
const contractDeploymentBlockNumber = await instance.?


texts:
Looking at the open-zeppelin  ERC721 Contract's code, I see that the very last thing that its mint function is doing is call emit on the contract's pre-defined Transfer event.
My question is: how do I capture and respond to this event in my web3 Dapp?

Here's my code:

    // Set up Event:
    MyApp.NFTtokenTransferEvent = MyApp.NFTContractInstance.Transfer();

    // Now tell my app to LISTEN/WATCH for that Event:
    MyApp.NFTtokenTransferEvent.watch(function (error, result) {
      if (!error) {
        // If a Token was Minted or TRANSFERRED, let us know who, what, where:
        console.log("TRANSFER EVENT RESULTS: " + result);
      }
      else {
        console.log("Error with EVENT and its EMISSION!!! Error is: " + error);
      }
    });
  },

The result I'm getting for is - well, nothing.

When I mint new tokens - which I know is happening successfully cause I am verifying it - I don't get any feedback from the Transfer event.
I don't get anything in the result argument - nor do I get any errors. I basically don't get anything.

Any suggestions?

(NOTE: my NFTContract obviously inherits from the ERC721Full Contract, so I'm assuming it/I can access the Transfer event without having to do anything special there, correct? )


texts: How to deploy a contract with a token contract as a parameter?

texts:
Given an interface that refers to an ERC20 token contract named XYZ, and a constructor that refers to a variable of type XYZ, how do you refer to the XYZ token contract in a contract deployment function?
Here is the interface and contract:
interface XYZ {}

contract MyContract {
    XYZ public token;

    constructor(
        XYZ _token
    ) public {
        token = _token;
    }
}

I've been trying to use the contract address of the XYZ token contract but I don't think it's working. I tried passing it as an integer and a string, but can't find anything online that talks about what to use for deployment. Here is my deployment function (using Truffle with a mainnet fork on ganache-cli):
const MyContract = artifacts.require("MyContract");
module.exports = async function (deployer) {
   await deployer.deploy(MyContract, 0x587242da6dde74aA602AF3595d271333421c7E20);
};

What should take the place of 0x587242da6dde74aA602AF3595d271333421c7E20 (the XYZ token contract address)? Thanks!


texts: How to install solc and build then build smart contract?

texts:
How to install solc on windows and then build smart contract ?

I use following command :

npm install -g solc

Is it enough to use it ?

Finally, I want to deploy my smart contract


texts: If Ethereum total supply is not capped, how is infinitely large integers prevented?

texts: If using infinite token supply, how is infinitely large integers avoided?


texts:
can someone tell me how the transaction work is it in USD OR Price of ETH / BTC ?

lets say

1 ETH = 900 $ TOKEN GIVEN 3000

when the price increased to 1000 $ then the token given to investor will be based on ethereum or usd ?


texts: How to detect multiple ETH payments and link to order

texts:
First, I read this article, but it's not my case. I'm creating crypto payments solution inside Telegram Bot for multivendor.

Here is my problem: Customer have unique wallet for payments. When he buying something, I can detect his transactions, bot how to link this transaction to his order? For example, user bought 1 item from different sellers. Each item have the same price. User sent ETH, but how detect, which order belongs to transaction? User can send 2 transactions with different gas and one transaction may stack because of low gas or network error. And how detect, who get his ETH and who not?

My opinion is to ask the user TX Hash for every transaction.


texts: Removing Brownie v1.14.6 from MacOs Terminal

texts: Please help me restore my Terminal on my MacOs and remove Brownie from it. Thanks


texts: What is the cost of storing a transaction in blockchain vs cost of storing a transaction in aws database?

texts: I am in the process of understanding Ethereum and blockchain technology. I am building a mobile app that needs to keep track of transactions between users. From what little knowledge I have of Ethereum, it seems like a good fit but on the other hand, I know that I can achieve the same result using a traditional database hosted in AWS. Does anybody have an insight into the cost involved in using AWS vs Gas? Is there always a cost involved in transferring ether from one wallet to another even if it is your own?


texts: SOLIDITY: is anywhere formalized the assignment operator behaviour in nested statements?

texts:
As a matter of fact, solidity seems to have same behaviour of C in nested assignment.

I.e. running the sample test contract below, calling nestedSum(1) results in the following: a=38, b=16, c=4

pragma solidity 0.5.1;

contract test {
    uint256 public a;
    uint256 public b;
    uint256 public c;

    function nestedSum (uint256 d) public
    {
        a = (b = (c = d + 3) + 12) + 22;
    }
}

Is this behavior described in some part of the documentation and is it guaranted to remain stable in the versioning of compilers?

Many thanks.


texts: We are creating a new ERC223 token and can't find clear info on who controls the token symbols?


texts: How to get the contract ABI in new Remix IDE?

texts:
Waked up today just to find out the remix browser interface changed to this

what happened !!? I cannot find the contract details to get the json interface anymore.


texts: Best way to watch for contracts created from a given account

texts:
I want to watch the blockchain for new contracts created from some given account. I’ve got an Ethereum node with RPC enabled.

I think, it should be something like this:

Call eth_newBlockFilter() and get a filter id.
Using this filter id, periodically check eth_getFilterChanges(filterId) to obtain new block hashes.
For each block hash do eth_getBlockByHash(blockHash, true).
Check if any transactions from the previous call are made from the given account. For the matching transactions do eth_getTransactionReceipt(txHash).
If contractAddress  is not null, it contains a contract address I’m looking for.
When I don’t need to watch for new contracts anymore, I call eth_uninstallFilter(filterId).

The question is: could I do it in an easier way, with less RPC requests and computations, or not? Any suggestions?


texts: What to do about low hash rate on EthOS with RX 580s?

texts: I just finished building my first rig, a 4 card rig using Sapphire Pulse RX 580 8GB cards, running on EthOS using claymore miner and mining to ethos pool/nano pool (Biostar TB85 MoBo, Corsair AX1200 PSU). Everything runs fine, and its been stable for almost 24 hours now, but I can't seem to get the hash rate above 20-21 MH/s per card, or 80-82 MH/s total. I've tried changing/tweaking the globalcore, globalmem, and globalpowertune settings in ethOS, but my hash rate stays pretty much in that same exact range, which was my "out of the box" hash rate also.  I was under the impression that these cards would be 24-26 MH/s out of the box, and 28-30 MH/s after changing gpu settings. Anyone else experienced a similar problem before? Any advice is much appreciated. Thanks


texts: what is a pseudorandom cache mentioned in ethereum yellow paper

texts:
in ethereum yellow paper it says:

"There exists a seed which can be computed for each
block by scanning through the block headers up until that
point. From the seed, one can compute a pseudorandom
cache, Jcacheinit bytes in initial size. Light clients store
the cache."

what does it mean by pseudorandom cache? is it because it is using a RandMemoHash for generating the cache?


texts: Testing Contract Runs Out of Gas Truffle

texts:
Trying to figure out why I get an out of gas error in my truffle tests when I have the following function:

function updateField(address someAddress, uint256 someId, bool someBool) public {
  SomeStruct storage item = myMap[someAddress];
  require(msg.sender == someAddress || msg.sender == owner);
  require(item.owner != address(0));
  item.mapInItem[someId].someVal = someBool; // when I comment out this line the error goes away
}

The thing is when I comment out the last line the error goes away! Anyone know why this might be happning and how to fix it.


texts: Optional Data Feed on the EVM, what does it mean?

texts:
I am trying to understand the idea of optional data feed for EVM in the accounting field especially. I usually read that you can use two fields with the first field being a domain to register and the second field being the IP address to register it to. Would it be possible to register anything else than a domain? to be more specific, do you know what it would look like in accounting when it comes to adding account to the blockchain, confirming transaction, etc...

thank you


texts: Why is my approve() function using incorrect token_id

texts:
I have created an ERC20 token using openzeppelin and web3. I am then trying add some of this new token to a contract (An instance of UniswapV2Router02.sol) in order to add liquidity to a liquidity pair. For some reason, when I run the approve function on my new ERC20 contract, the Ethereum explorer is confusing the amount being approved with the token id.

Here is the function I am using
await LToken1.approve(router.address, web3.utils.toWei('0.02'));
Am I calling the function incorrectly?


texts: Bootstrap node that does not rebroadcast transactions?

texts:
I have a local ethereum network where peers connect to each other based on certain conditions. Local forks and merging occur, so it is common that there are multiple blockchain versions with different lengths.
I want a node that can oversee the network -- that is, be connected to all peers and check the complete mempool, but without rebroadcasting the transactions. Basically -- an audit only node. Is this possible ?


texts:
Hi guys quick and simple question....

i have the script for airdropping tokens, all i need is to know what and how to input these value on the drop section of remix script:token,recipient,values.

Assuming i want to send to 5 addresses, please respond with a sample that we can copy and paste into the fields...

No much grammer neede thank you

see what i mean below


texts:
In this contract - Contract with Transfer event; it is using Transfer event.

But as per my understanding, events are for logging and as a means to trigger call back to front end javascript only, not to do transactions.

How does this Transfer event become equivalent to msg.sender.transfer() API?


texts: Why does solc output bytecode that is not in valid hex format?

texts:
I compile my solidity file using the following command:

solc Encoder.sol --bin --abi --optimize -o <output_dir>/

Then I try to deploy it in Geth:

Encoder = eth.contract([<abi file content>])
deployEncoder = {from:eth.coinbase, data:"0x<bin file content>", gas:2000000}>}

getPartialInstanceEncoder = Encoder.new([], deployEncoder)

The last line throws an exception. Looking closer into the bin file content, I figured out that the bin file contains several invalid characters, either '$' or '_'. What is the reason for this?

I uploaded my bin file here (since it is too large for the text here), you can search for the characters in your browser: https://file.io/OIFtZM


texts: I don't know what the problem is there, if someone can help, I'll be so happy!


texts: New account creation and deploying to node

texts:
I am developing lightwallet and trying to create new address (account) on custom node. Already tried to use eth-lightwallet and ethereumjs-accounts. I don't understand how to deploy new account to node. I created accounts, but it stored in browser only.

 $("new").onclick = function() {
                console.log($("new_passphrase").value);

                var newAccount = Accounts.new($("new_passphrase").value);
                $("new_result").innerHTML = JSON.stringify(newAccount, null, 2);
            };

Also I need to send coins from one address to another. Can you give some exaples how to add account to done and synchronise browser accounts with node accounts?


texts: How to calculate difficulty (int) based on (float)

texts:
I am trying to adapt my pool based on github.com/sammy007/open-ethereum-pool to nicehash protocol.

It works more or less and I am receiving shares already, but I ran into the problem with difficulty calculation.

hasher patched for Nicehash project returns difficulty as a float64 number.

But frontend for the pool needs integer like 4000000000 to show the hashrate.

How would I convert one to another?

I tried to use the code which I found:

var pow256 = math.BigPow(2, 256
func DiffToTarget(diff float64) (target *big.Int) {
    mantissa := 0x0000ffff / diff
     exp := 1
    tmp := mantissa
    for tmp >= 256.0 {
        tmp /= 256.0
        exp++
    }
    for i := 0; i < exp; i++ {
        mantissa *= 256.0
    }
    target = new(big.Int).Lsh(big.NewInt(int64(mantissa)), uint(26-exp)*8)
    return
}

func DiffFloatToDiffInt(diffFloat float64) (diffInt *big.Int) {
    target := DiffToTarget(diffFloat)
    return new(big.Int).Div(pow256, target)
}

But it makes my pool show ten time more hashrate than I bought on nicehash site.

Could you please point my mistakes or point me to a place where I can find this algorithm.


texts:
I've recently started looking at blockchain so have bought a small amount of bitcoin and ethereum to allow me to understand the processes. I may have some ETH but would appreciate some help as it seems to be in the wrong place!

I purchased the ETH through bittylicious after first generating a wallet using myetherwallet. I could see the transaction in the bittylicious history but not in myeytherwallet? Looking a bit more closely, I can see that while the public key of the wallet generated starts 0xf36Bxxx, the transaction shows the funds transferred to 0xf368xxx. That's an "8" where it should be a "B" for anyone else who should be wearing their glasses when using their laptop!

So, the funds are in the 0xf368xxx wallet (let's assume I gave the wrong key) and would like them in 0xf36Bxxx which is the 'real' wallet created in myetherwallet, but I'm not sure if I can move them without the private key related to 0xf368xxx? Is there any hope for me?

(yes, I'm expecting that £30 of lost ETH is the price of a very valuable lesson, but any help's appreciated!)

UPDATE:
thanks for the replies, as expected, it seems I can't get at the funds sent to an incorrect address which I gave.

Maybe someone with knowledge could help me with something which is puzzling me though?

I accidentally gave out an address for the ETH to be sent to which was identical in every way to my actual address apart from the 6th digit was given as "8" instead of "B". That's 41 out of 42 upper/lower/numeric characters being the same. So my question is whether there is any address validation in ethereum when ETH is sent to another party? My novice understanding is that hash, signature and private keys related to the ether wallet address ought to make it difficult to send to a wallet which doesn't exist, and the chances of another wallet existing with the same address as mine apart from one character being 8 instead of B ought to be infinitesimally small?

So my question is now not can I retrieve my ETH from a known address which is almost identical to mine, but can an ethereum transaction be created which posts to a wallet with any random address (which may not be a real wallet address at all?).

Apologies if this is really basic stuff I'm asking, but what are the odds of two 42-digit wallet addresses differing in only one character (and that character appearing as similar as 8 and B)?

I have looked at etherscan.io and can see both the empty wallet and the one which received the funds.

Thanks again for any assistance.


texts: I'm looking for some guide that drive me into solidity + truffle unit test (best practice, etc...). The only doc that I have found is the official doc.


texts: Offline signed Transactions not being mined on private net

texts:
I am running a geth node and tried to perform a load testing by giving multiple transactions (1000 tx) from front end.

As the application is not crypto related and need the blocks to be mined faster, the console.go file is tweaked so that the block difficulty is always set to 1. Our case is not a crypto oriented and hence we have made the minimum gas price as 1.

Please check and help me on it.

More details as below

System information
Geth
Version: 1.8.18-unstable
Git Commit: 3e1cfba
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.11.1
Operating System: linux

Expected behaviour
Expected behavior is for the tx to get mined.

Actual behaviour
I am able to push in 1000 Tx, from front end, all the transactions are only sending 1 wei from account1 to account2. I increased nonce for the tx correctly and so there is no issue and all 1000 tx are created successfully.

I see the tx are struck in pending when viewed with web3.txpool

Steps to reproduce the behaviour
Below is the Nethereum code used to create the 1000 tx. All the tx are created but waiting in pending queue.

        for (int i = 0; i < 1000; i++)
        {
            string data = "Test string";
            var gasPrice = 10+i;
            var privateKey = "XXXXXXXXXXXXXXX";
            var senderAddress = "0xa5a85c234bca3D4BF29f7Bd7AD7D458dea8Ea8E9";
            var receiveAddress = "0x1b55195c2610f7c0069cb89db1b3e973ff447a49";

            var txCount = await web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(senderAddress);
            var nonce = txCount.Value+i;
            var value = 1;
            var encoded = Web3.OfflineTransactionSigner.SignTransaction(privateKey, receiveAddress, value, nonce, gasPrice, 100000, data.ToHexUTF8());

            Debug.WriteLine(Web3.OfflineTransactionSigner.GetSenderAddress(encoded));
            Debug.WriteLine(encoded);

            var txId = await web3.Eth.Transactions.SendRawTransaction.SendRequestAsync("0x" + encoded);
            var receipt = await web3.Eth.Transactions.GetTransactionByHash.SendRequestAsync(txId);

}

PS: When I worked with 10 tx(before trying with 1000 tx) for the same above code, it worked fine and the tx are mined immediately.


texts: sload. assembly with struct - not working in solidity

texts:
struct S {
   uint128 a;
   uint128 b;
}
S test1;
function assemblyStorage() public returns (uint a, uint b, uint c, uint d, uint f, uint g){
  test1 = S(5,10);
  assembly {
     a:=sload(0)
  }
}

As we can see, test1 now will occupy the first slot. and not the second one since variables can be packed...
Now, why does sload(0) returns something like this 3402823669209384634633746074317682114565 and how can I return 5 and 10 ?


texts: Inputs to Ethereum Solidity smart contract changing between invocation and execution

texts:
In this paper on smart contract blockchain programming paradigms the authors note that it is impossible to know in advance the inputs to a function in Solidity.  This is because even if the input values are known when the function is called/invoked, these values may have changed by the time the function's invocation gets attached to the blockchain and executed.
Q. To what extent has this been a real-world issue, and how has it been addressed?


texts: How do I find how much money is stored on all deployed instances of a contract?

texts:
I am reviewing a certain contract, and would like to gauge how much money is stored on all deployed instances of this contract.

Someone told me I can deploy a new instances of the contract to mainnet, then view it on Etherscan and look for "similar or identiacal contracts" and just tally the results.

Would this work? If so, is this the easiest way to deploy a contract? Can I use remix for this deployment?


texts: How to deploy smart contract using truffle , metamask with ropsten network

texts:
This question is an extension of Deploying to testnet using Truffle and Metamask

Need to deploy smart contracts over ropsten testnet that connected through metamask . I am using truffle framework to write smart contract so what should i write in truffle.js to achieve the task.


texts: Detecting oraclize completion for front-end update using Web3.js

texts:
I am using oraclize-api to fetch and store twitter posts into a smart contract. Posts are placed into a mapping using the twitter id as the key (i.e. <username>/status/<id>), and the tweet text as the value.

I want my front end to display the tweet text once the oraclize __callback function has been called, and the tweet text has been saved to the smart contract.

The options have I entertained are:

Having a button for the user to "check the state" manually
Doing a loop to check for a tweet text value that is not ""

Neither are quite that good, especially the loop if there is a problem with the Oraclize, like an out of gas error where the state will never get updated.

Is there a recommended practice for this?


texts: Why does "truffle migrate" to Rinkeby results two transactions per contract

texts:
I ran truffle migrate -f 2 --network rinkeby. Then, I navigated to https://rinkeby.etherscan.io/address/[ADDRESS_OF_DEPLOYER]

And I got two TXs:

The second TX is clear since To equals to "Contract Creation". Now, what is the first TX? The From is the same as the second TX, however, the To is another address (0xb52078acf139....).


texts: What is the relationship between seed hash and mix hash in mining?

texts:
Miner receives seed hash and sends back mix hash. I understand that mix hash is basically a random slice of DAG, is this correct?

But more importantly, how does geth check that mix hash is correct? From studying geth I can see that it inserts it into the block template and then tries to hash it with nonce. But could not I pick any mix hash?


texts: Is it possible to set miner reward on Geth clique?

texts:
I have a private network set up with ethereum & PoA clique consensus.
Using in geth client

 miner.setEtherbase(eth.coinbase)

on miner nodes, doesn't seems to work.
Inspecting in block explorer miner is always "0x00..."
But at the same time, the "0x00.." account has balance 0.
Where are all fees?


texts: Can storage be referenced without being copied?

texts:
With for example

struct Foo {
    mapping(address => uint) b;
}

Foo[] foo;

if a function only deals with foo[4], can it reference it from storage without copying it? is that what

function c() {
    Foo memory p = foo[4];
}

does?


texts: Ethereum and intermediate state tree root

texts:
I'm reading about scaling in the whitepaper

  In the near term, Ethereum will use two additional strategies to cope
  with this problem. First, because of the blockchain-based mining
  algorithms, at least every miner will be forced to be a full node,
  creating a lower bound on the number of full nodes. Second and more
  importantly, however, we will include an intermediate state tree root
  in the blockchain after processing each transaction. Even if block
  validation is centralized, as long as one honest verifying node
  exists, the centralization problem can be circumvented via a
  verification protocol. If a miner publishes an invalid block, that
  block must either be badly formatted, or the state S[n] is incorrect.
  Since S[0] is known to be correct, there must be some first state S[i]
  that is incorrect where S[i-1] is correct. The verifying node would
  provide the index i, along with a "proof of invalidity" consisting of
  the subset of Patricia tree nodes needing to process
  APPLY(S[i-1],TX[i]) -> S[i]. Nodes would be able to use those nodes to
  run that part of the computation, and see that the S[i] generated does
  not match the S[i] provided.

Lets say there is only one honest node, and that node could provide proof of invalidity.

  Nodes would be able to use those nodes to
  run that part of the computation, and see that the S[i] generated does
  not match the S[i] provided.

If there is no other honest nodes, why would they accept that S[i] generated does not match the S[i] provided? Wouldn't they just discard that proof?

EDIT
Problem that's being addressed here in the whitepaper,

  The problem with such a large blockchain size is centralization risk.
  If the blockchain size increases to, say, 100 TB, then the likely
  scenario would be that only a very small number of large businesses
  would run full nodes, with all regular users using light SPV nodes. In
  such a situation, there arises the potential concern that the full
  nodes could band together and all agree to cheat in some profitable
  fashion (eg. change the block reward, give themselves BTC). Light
  nodes would have no way of detecting this immediately. Of course, at
  least one honest full node would likely exist, and after a few hours
  information about the fraud would trickle out through channels like
  Reddit, but at that point it would be too late: it would be up to the
  ordinary users to organize an effort to blacklist the given blocks, a
  massive and likely infeasible coordination problem on a similar scale
  as that of pulling off a successful 51% attack. In the case of
  Bitcoin, this is currently a problem, but there exists a blockchain
  modification suggested by Peter Todd which will alleviate this issue.


texts: As in truffle tests pass the check by block.timestamp?

texts:
I have 2 functions

    function startBuilding ()
        public
    {
        uint[8] memory _buildingInfo;
        _buildingInfo[1] = uint32(block.timestamp) + 2 minutes;
        addBuilding(_buildingInfo);
    }

    function finishBuilding ()
        public
    {
        uint[8] memory _buildingInfo;
        require (buildingInfo[1] <= block.timestamp);

        buildingInfo[6] = STATUS_NEW;
    }

Truffle Test

    it("Function 'Building' work", async function() {
        await buildingContract.startBuilding();

        // Here you need to rewind time ahead by 2 minutes

        await buildingContract.finishBuilding();
    });

How to rewind time ahead by 2 minutes to get tested require (buildingInfo [1] <= block.timestamp) ???

  sleep() - will not work, because the test will be done for a very
  long time, because there are a lot of smart contracts like require


texts: web3 subscribe to pendingTransactions for a given contract?

texts:
Is it possible to only subscribe to a specific contract for pendingtransactions using web3.eth.subscribe?
The docs dont show any parameters besides a callback function, so the result shows all pending transactions not just for a contract address like LINK for example.
Regards


texts:
Coursetro.setFile(fileName,"test hash",function(error, result){
  if(!error)
  {
    console.log("Transaction submitted");
  }
  else{
    console.log("Error " + error);
  }
});

I am calling the above code in my Node.js controller. The callback is executed immediately when transaction is submitted.

Is there a callback invoked when a transaction gets successfully mined and is included in a block ? (Similar to Contract.new() web3js method that fires two callbacks )


texts: VM revert on Scalar Multiplication in pre-compiled contracts

texts:
I tried to build a wrapper around the precompiled contracts as follows:
https://gist.github.com/AlexXiong97/9c24bbd4541323a61fa63100860a5f89

If you paste it into Remix and deploy it, inputting any (valid) scalar into scalarBaseMult function would result in a VM revert, which indicates a failure in parameters provided to the precompiled contract.

However, I'm pretty confident the parameters are correct as I generate them directly from Cloudflare's bn256 library which is exactly what Geth uses. Here's my script:
https://gist.github.com/AlexXiong97/217f42ee4d0dedc6182b182134caeed9

If you input (1, 2, 3) into scalarMult, the correct result will be returned which makes sense as (1,2) is indeed a point on the bn256 curve y^2 = x^3 +3

I once suspect my computed generator coordinates are wrong, but as specified here: the generator is (1, -2) mod p, where p's value is here, thus I'm quite sure there's nothing wrong with their value.

Can anyone help me understand what might cause the VM exception?


texts: Why does Solidity not use the years keyword?

texts:
Solidity has keywords like seconds, minutes, hours, days and weeks that are used to specify units of time.

Why do they not have years?


texts: Why this function doesnt need Gas for execution?

texts:
pragma solidity ^0.4.17;

contract Lottery{

    address public manager;
    address[] public players;

    function Lottery() public {
        manager = msg.sender;

    }

    function enter() public payable{
        require (msg.value > 0.01 ether);
        players.push(msg.sender);
    }

    function random() public view returns (uint){
        return uint(keccak256(block.difficulty, now, players));
    }

}

I executed random function after being deployed on Rinkeby testnet, but no ether has been deducted as GasFee. Please correct me if i am wrong, but random functions is calculating a Psudorandom function and it involves computations. Shoudnt it require gas to execute?

One guess: Any view function which doesnt change state doesnt need Gas?


texts: Using Multiple Ledger Nano's with Parity

texts:
I have several Nano's that I would like Parity to recognize. I've just updated the Nano's firmware to 1.3.1 and the ETH app to 1.0.17 on all 3 of the devices.

The first Nano popped up into Parity as soon as I disabled browser support.  When I plug in Nano#2 and #3 all with the proper settings and firmware, Parity doesn't react at all.

I deleted the Nano #1 account that Parity recognizes, and tried #2 & #3 again. Still not recognizing them. I plug #1 back in, and it is immediately recognized.


texts: Is there a way of inspecting msg.value and msg.sender in remix IDE?

texts:
I'm playing with re-entrancy business: https://medium.com/@gus_tavo_guim/reentrancy-attack-on-smart-contracts-how-to-identify-the-exploitable-and-an-example-of-an-attack-4470a2d8dfe4

Just curious if there is a way of inspecting msg.value in Remix?

Is it just me or maybe I'm missing something obvious...


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

I've tried to create an instance of a contract using:
VotingContract = web3.eth.contract(abiDefinition) but I get: TypeError: web3.eth.contract is not a function
So I've tried: VotingContract = new web3.eth.Contract(abiDefinition) as suggested here: web3.eth.contract is not a function when making contract

But then when I try to deploy the contract on my test blockchaing (launched with EthereumJS TestRPC) I get the following:

deployedContract = VotingContract.new(['Rama','Nick','Jose'],{data: byteCode, from: web3.eth.accounts[0], gas: 4700000})
TypeError: VotingContract.new is not a function
    at repl:1:38
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at REPLServer.defaultEval (repl.js:239:29)
    at bound (domain.js:301:14)
    at REPLServer.runBound [as eval] (domain.js:314:12)
    at REPLServer.onLine (repl.js:433:10)
    at emitOne (events.js:120:20)
    at REPLServer.emit (events.js:210:7)
    at REPLServer.Interface._onLine (readline.js:278:10)
    at REPLServer.Interface._line (readline.js:625:8)
    at REPLServer.Interface._ttyWrite (readline.js:905:14)
    at REPLServer.self._ttyWrite (repl.js:502:7)
    at ReadStream.onkeypress (readline.js:157:10)
    at emitTwo (events.js:125:13)
    at ReadStream.emit (events.js:213:7)
    at emitKeys (internal/readline.js:420:14)
    at emitKeys.next (<anonymous>)
    at ReadStream.onData (readline.js:1006:36)
    at emitOne (events.js:115:13)
    at ReadStream.emit (events.js:210:7)
    at addChunk (_stream_readable.js:252:12)
    at readableAddChunk (_stream_readable.js:239:11)
    at ReadStream.Readable.push (_stream_readable.js:197:10)
    at TTY.onread (net.js:589:20)

Any suggestions?


texts: You can see any vulnerability in this contract?

texts:
Its possible that this contract have some issue because i see something strange in my contract log.
Someone execute another contract function to play with this mini gamble app and in 2 plays he cleans all the money xD.

Thanks in advance :)

pragma solidity ^0.4.11;
contract MetaCoin {

  event FlipCoinEvent(
    uint value,
    address owner
  );

    event PlaySlotEvent(
      uint value,
      address owner
    );

  function() public payable {}

  function flipCoin() public payable {
    assert(msg.value < 100000000000000000);
    uint value = (block.timestamp + uint(block.blockhash(block.number-1)))%100 + 1;
    if (value > 55){
      msg.sender.transfer(msg.value * 2);
    }
    FlipCoinEvent(value, msg.sender);
  }

function playSlot() public payable {
    require(msg.value < 100000000000000000);
    uint r = (block.timestamp + uint(block.blockhash(block.number-1)))%100 + 1;
       if(r >0 && r<3){
             PlaySlotEvent(3,msg.sender);
             msg.sender.transfer(msg.value * 12);
       }else if(r >3 && r<6){
             PlaySlotEvent(2,msg.sender);
             msg.sender.transfer(msg.value * 6);
       }else if(r >6 && r<9){
             PlaySlotEvent(1,msg.sender);
             msg.sender.transfer(msg.value * 3);
       }else{
            PlaySlotEvent(0,msg.sender);
       }

  }

  function getBalance() public constant returns(uint bal) {
    bal = this.balance;
    return bal;
  }

}


texts:
Any ideas on what would cause my Mist wallet to become inordinately slow to synchronize?  When I opened Mist this evening and after the initial start up, I saw a message on the banner indicating "Incorrect date since last synch".  After about half an hour it finally synched at the contract I had started went through.  Then after initiating another contract, it denied the transfer and is now show a message:  "12 minutes since last block"

EDIT:  After reading several other related posts, discovered that the version of Mist I was running had issues with the high DAO traffic that was running.  Since I was 'watching' this contract, it was bogging down my machine and basically the wallet just stopped working.  I stopped 'watching' the contract by deleting it and now it runs fine.


texts: How to use MetaMask Web3 with Truffle promises

texts:
My project uses the react truffle box, and I use the getWeb3 method that comes with it.

After calling that method, I store the web3 object on Redux's state tree via the action creator storeWeb3.

getWeb3
  .then(results => {
    storeWeb3(results.web3);
  });

This works fine when deploying to the ganache local blockchain (localhost:8545), but breaks when I deploy to the Rinkeby testnet and turn Metamask on.

Here're the error logs:

Uncaught Error: The MetaMask Web3 object does not support synchronous methods like eth_mining without a callback parameter. See https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client for details.
    at MetamaskInpageProvider.send (inpage.js:14)
    at RequestManager../node_modules/web3/lib/web3/requestmanager.js.RequestManager.send (requestmanager.js:58)
    at Eth.get [as mining] (property.js:107)
    at derez (<anonymous>:1:66285)
    at derez (<anonymous>:1:66278)
    at derez (<anonymous>:1:66278)
    at derez (<anonymous>:1:66278)
    at derez (<anonymous>:1:66278)
    at Object.decycle (<anonymous>:1:66315)
    at Object.e.stringify (<anonymous>:1:19676)
    at tryCatchStringify (<anonymous>:1:68827)
    at stringify (<anonymous>:1:68935)
    at toContentScript (<anonymous>:1:70219)
    at relay (<anonymous>:1:23214)
    at <anonymous>:1:26299
    at invokeFunc (<anonymous>:1:29789)
    at leadingEdge (<anonymous>:1:29866)
    at debounced (<anonymous>:1:30443)
    at Object.onMessage (<anonymous>:1:24470)
    at <anonymous>:1:70941
    at Array.forEach (<anonymous>)
    at handleMessages (<anonymous>:1:70876) MetamaskInpageProvider.send @ inpage.js:14 ./node_modules/web3/lib/web3/requestmanager.js.RequestManager.send @ requestmanager.js:58 get @ property.js:107 derez @ VM26460:1 derez @ VM26460:1 derez @ VM26460:1 derez @ VM26460:1 derez @ VM26460:1 decycle @ VM26460:1 e.stringify @ VM26460:1 tryCatchStringify @ VM26460:1 stringify @ VM26460:1 toContentScript @ VM26460:1 relay @ VM26460:1 (anonymous) @ VM26460:1 invokeFunc @ VM26460:1 leadingEdge @ VM26460:1 debounced @ VM26460:1 onMessage @ VM26460:1 (anonymous) @ VM26460:1 handleMessages @ VM26460:1 postMessage (async) (anonymous) @ content.bundle.js:1 EventImpl.dispatchToListener @ VM26487 extensions::event_bindings:403 publicClassPrototype.(anonymous function) @ VM26493 extensions::utils:138 EventImpl.dispatch_ @ VM26487 extensions::event_bindings:387 EventImpl.dispatch @ VM26487 extensions::event_bindings:409 publicClassPrototype.(anonymous function) @ VM26493 extensions::utils:138 dispatchOnMessage @ VM26494 extensions::messaging:392 localhost/:1

Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension. index.js:885

GET chrome-extension://invalid/ net::ERR_FAILED


texts: Function difference from Solidity 4.4 to newer versions

texts:
I'm returning to programming today on Solidity (I was used to 4.4), and I'm now facing an issue that I don't know how to fix with the below topic:
 //name this contract whatever you’d like
contract ERC20Token is StandardToken {
function () {
 //if ether is sent to this address, send it back.
 throw;
 }

It works fine on Solidity 4.4, but when I try to do so on any newer version, I got the following error: 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. function () { ^
Done someone know how to mitigate that?
Thanks in advance!


texts: How to interconversion between privatekey and keystore with password in interactive console

texts:
When I execute geth attach attaching a active geth node into a interactive console .
I could use keystore and password to sendTransaction .  But now I only know the raw privateKey，How to execute sendTransaction ? And how to generate keystore based on the raw privateKey?

From importing-an-unencrypted-private-key,we can transform privateKey to keystore, but how to get keystore from privateKey?


texts: how to use custom web3 provider for Dapp?

texts:
I used to use metamask for Dapp development..Everything works fine, but trust wallet(Dapp mobile browser) doesn't emit events comes of from contract..My Dapp is heavily rely on events..if they don't emit, it will not worth for the Dapp.. I saw a question in github repo, someone mentioned that you should use your own custom provider for events..but whenever I search how to use your custom provider on google, it comes up with use metamask or something else..
I'm using Pure vanilla js, So I don't think I need to use truffle...However, I'm using Web3 CDN for adding it to my Dapp..now the basic code is this:
<script
 src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.3.0/web3.min.js">.

window.addEventListener('load', async() => {
if (window.ethereum) {
    const web3 = new Web3("ws://localhost:8545");
    // const web3 = new Web3(window.ethereum);
    try {
        await window.ethereum.enable();
        return web3;
    } catch (error) {
        er(error)
    }
} else if (window.web3) {
    const web3 = window.web3;
    return web3;
} else {
    er(
        "Non-Ethereum browser detected. You should consider trying MetaMask!"
    );
   }
 });

Now, my main question is how to use custom provider for Dapp so I can emit events effectively without have to relying on third party providers..however, i'll still rely on them for signing the transactions..
Now the above code gives an error:
WebSocket connection to 'ws://localhost:8545/' failed: Error in connection establishment:
net::ERR_CONNECTION_REFUSED
a @ browser.js:24
s.connect @ index.js:90.
s @ index.js:77
c.setProvider @ index.js:69
e @ index.js:40
packageInit @ index.js:45
 h @ index.js:39
(anonymous) @ auth2.js:46
35

Kindly assist me to solve this issue..
Ps: I don't mean to create my own provider from scratch..Moreover, I don't know the process either..


texts: If a smart contract automatic transfer its ether to it's benificiary accounts then who will pay gas price (transaction cost) for this transfer?

texts:
I am writing a smart contract of a charity.It pay all the money to it's subscribers in every week. I am puzzled in such point that who will pay the transaction cost of transfer?

When I am calculating splitAmount=(contractBalance/totalSubscriber) , here I am giving all my contract balance to these subscribers so I have balance remain for pay the transactional fees. What will happend here.How can I handled this situations?


texts: Document verification Smart Contract (Ethereum)

texts:
I'm new in developing of smart contracts in Ethereum. And I have a principle question:

I want to build a document verification contract. The idea would be that using smart contract(s) a document hash and additional parameters could be send to a smart contract and could be stored there forever.

Later this contract should also be used to verify the document by its hash and providing the additional parameters.

I also would like to store the document forever in a distributed store line ipfs or swarm and bind the hash-address of the store to the smart contract.

My Question to this is, I'm not really sure. If I have one smart contract where all elements (documents) are stored. Or if it would be one smart contract per document which must be deployed.

If the second is a solution how could all smart contracts which belong to this service be collected? Must there be another smart contract to hold this information?

It would be great if someone can give me some tipps how to start.

Programming language should be solidity.

Thanks for your help.


texts:
I want a function to only be able to be called after a certain specific period of time has passed from the contract's inception. Generally, I was using block.number for that. As in:

require(block.number >= 8000000);

However, if I want to use block.timestamp, could I do as below:

contract Time is owned {

    uint today;

    constructor() public {
       today = block.timestamp;
    }

Declare 'today', and then set a requirement:

require (block.timestamp >= today + 365 days);

Will that work in preventing that the function gets called before 365 days pass from the publishing of the contract?


texts: Ethereum Exchanges compatibility matrix? <- concerns due to warnings regarding "smartcontract deposits"

texts:
Is there a "exchanges compatibility" features list/matrix, so I know between which I can move Ether directly?

Context+example use case:

I've tried to move Ether between exchanges, however warnings made me concerned, examples:

Bitstamp warning when I try to withdraw: https://imgur.com/bT2UCUd
Bitfinex warning when I try to deposit: https://imgur.com/arXKeOw

Therefore, I wondered: Is there some exchanges compatibility matrix/cheatsheet so I don't need to go over support tickets for every exchanges pair?
(Yes, I know I could do transfers through a wallet, but I wondered if I could directly, at least between some pairs of exchanges - to save fees and delay)


texts:
I have this inside my function and i want to get its absolute value .
return (int(keccak256(abi.encodePacked(block.timestamp, block.difficulty)))%100000);


texts: Is it possible to initiate Geth server from a specific block instead of genesis block?

texts: I tried setting up Geth servers in full node different times, and all of them are always behind half of total max block. So, they cannot be synced easily even after weeks. I would like to know can I initiate a Geth server from a certain specific block instead of genesis block? If so, how can I do that? I did not find any option for this purpose.


texts:
I am building a mobile wallet app with React Native, Expo and synthetix.js (ethers.js for communicating with synthetix protocol) and i got utterly stuck on estimating gas limit. I wrote the following function for estimating the limit of a synth exchange:
export const estimateGasLimitForExchange = async (snxjs:SynthetixJS,baseKey:string,amount:number,quoteKey:string) => {
    try {
        const baseKeyBytes32 = snxjs.toBytes32(baseKey)
        const amountToExchange = ethers.utils.parseUnits(String(amount),18)
        const quoteKeyBytes32 = snxjs.toBytes32(quoteKey)
        const gasEstimate = await snxjs.contracts.Synthetix.estimateGas.exchange(baseKeyBytes32,amountToExchange,quoteKeyBytes32)
        return Number(gasEstimate)
    } catch (e) {
        console.error(e)
    }
}

The problem is that i tested this function in a web environemnt (React + ethers.js) and it works perfectly fine, but it throws the following error when being executed on React Native:
processing response error (body="{\"jsonrpc\": \"2.0\", \"error\": {\"code\": -32016, \"message\": \"The execution failed due to an exception.\", \"data\": \"Reverted\"}, \"id\": 50}",
requestBody="{\"method\":\"eth_estimateGas\"}

I am aware that on some networks eth_estimateGas throws an error if the wallet's balance is zero but this is clearly not the case here. I can't find anything related to error code -32016 and "The execution failed due to an exception." message doesn't help at all. If anyone here knows what's the deal with these network exceptions of ethers.js on mobile platforms, your help will be much appreciated.


texts: Is there any method to generate new public private key pair in solidity?

texts:
I want to generate a new ethereum account in solidity(if possible in online Ide remix) & sign transactions with the private key.
In other words, I want more ethereum account apart from the default 15 provided by remix Ide. I want to implement two actions one is to deposit ether to a new account & the second is to withdraw ether from the new account.

address(uint256(keccak256(abi.encodePacked(now))));//Want to deposit & withdraw ether to & from this address.

Solidity allows us to send ether to any address.Even if a private key doesn't exist for the public adderss.So we can deposit ether to any account we will.
But what about withdrawing ether from an account?
What is the simplest way to generate new public-private ket pair & use them for signing transaction?


texts: unable to list accounts in web3.py via RPC

texts:
I built a private chain on my computer using geth and I want to interact with it using web3.py. But there was something wrong.
I started the private chain(containing only one node) with the command
$ geth --datadir datadir --rpc --rpcport 8545 --port 30301 --ipcpath /tmp/geth.ipc --rpccorsdomain '*' --unlock 0

Having started the chain, I was able to use the environment in remix IDE via RPC.
Then I followed the docs of web3.py and wrote some simple code:
from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider('http://localhost:8545'))
print(w3.eth.blockNumber)
print(w3.personal.listAccounts)

What upset me was that the w3.eth.blockNumber worked just fine but the listAccounts didn't.
Here is a picture of the error message :

Some info:
OS: ubuntu16.04
geth: 1.8.2
web3.py: 3.16.5
A noobie here, please help T_T. I googled this but didn't find similar problems (maybe this is too simple?).


texts: Can Ethereum & Solidity implicitly check integer sizes to prevent truncation?

texts:
I have a contract:

pragma solidity ^0.4.18;

contract CollegeAdmin {
    uint8 public studentAge=18;
    uint16 public studentIncome=15000;
    uint8 public studentScore=4;
    uint8 public studentAttendance=96;
    event changedAge(uint age);
    function setAge(uint8 age) public {
        studentAge = age;
        changedAge(age);
    }
}

When I run:

> con.setAge(256)
"0x011189b35ac24e40f9ead0ce8062a76a0a1cad81e00b2f6fee8e43028e34cc11"

I get this:

> eth.getStorageAt(con.address,0)
"0x00000000000000000000000000000000000000000000000000000060043a9800"

The 00 at the end is the studentAge. It has apparently overflowed and then truncated 100 to 00 due to the unit8 definition.

But my question, can solidity implicitly address this problem in the setter by throwing an error for larger numbers than the storage definition allows? Or does the code need to explicitly check the size of the number and then handle an error if the number is too big?


texts: How can I read the state of some contract without creating a transaction?

texts:
Assuming I have control of the contract (meaning I haven't yet deployed it so I can still edit it), is there some way for me to make it so I can read state inside it without transacting? For example, I know I could create something like a getter function which returns the value I'm looking for, but this incurs transaction fees.

What other options do I have?  I feel like emitting events inside the contract might be what I'm looking for, but I don't fully understand whether it's free to read those events vs. having to create a transaction for that too.  It also seems like there might be some way I can create the transaction but just execute it locally so that I don't have to pay anything.

Any insights? Thank you!


texts: Which ways of distribution of Tokens are being used beside ICO/STO?

texts:
Assume, I've created my own ERC-20 Token and published it to the Ethereum Blockchain. By doing so I also got access to all of the initially created tokens.

If I'd like to distribute them, the only ways i know would be either to:

Sell them via an Initial Coin Offering (ICO) or Security Token Offering (STO)
Gift them directly / indirectly, also called Airdrops.

Which other ways of distribution are commonly used for ethereum Tokens?


texts: How to get an evm reference inside go-ethereum GetBalance function?

texts:
In order to modify GetBalance function to fork go-ethereum, I find difficulties to get a reference of the running evm. The function has a reference for self *StateDB:

func (self *StateDB) GetBalance(addr common.Address) *big.Int

but I cannot get an evm of type *vm.EVM from StateDB. I need the evm to make a contract call inside the GetBalance function for this fork. Is it possible in some way to get the evm from StateDB, or should I use any other strategy?


texts: Accessing other contract variables(address)

texts:
I'm creating a marketplace, which will have two token contracts representing currencyToken and assetToken. I've set separate owner's for both of the token contracts, in their constructor. But when I'm trying to access those two addresses from my exchangeContract, it is throwing an error:

' Error: Member "CTOwner" not found or not visible after argument-dependent lookup in type(contract CToken) '

I've tried by creating getter functions for both the contract's, still the result is same.

I'll appreciate your help.


texts: How will sharding differ from federated sidechains?

texts:
I suppose sharding will be implemented in the future, and there will be many mini-islands that hold only parts of the blockchain.

Does it mean that local nodes will mostly support local TX? If I live in Paris for example, then most of the nodes will hold records of the local transactions to speed things up? And what if I want to send money to Buenos Aires for Example? Will I need to find a node that will link me to the main chain and then another node that will store my transaction on the Buenos Aires Shard? Sending my transaction to another Shard will force all the nodes on my current Shard to download and hold the relevant blocks?

I understand it doesn't have to be a _geo-shard and that sharding can also take place between companies or other entities.

And how will it differ from the (proposed) federated sidechains?


texts: Are there any fungible, but indivisible, ERC tokens?

texts:
Are there any ETH tokens that are fungible, but also indivisible?
I'm learning about ERC-1155, and one of the common use case examples is video game items. For example, your game might have 200 swords. They're fungible with each other, but are indivisible.
Digital currencies are fungible, but they're also divisible. For example, I can buy 0.12 ETH. I'd like to find a currency that is fungible and indivisible.


texts:
Can a contract that receives a token know the origin of the tokens?

(Assuming the token follows the token standard.)


texts: Gas limit and transaction fee in clique POA chain

texts:
I set a private POA private chain using default setting of Puppeth tool.
The gaslimit in genesis.json is:

"gasLimit": "0x47b760"

The decimal number of gasLimit is  4700000

then I start node by command:

geth --networkid 123456 --rpc --rpcport "8545" --rpccorsdomain "*" --datadir ./enode1/data --syncmode 'full' --port "2001"  --rpcaddr "0.0.0.0" --rpcapi "admin,db,eth,miner,web3,net,personal,txpool" --unlock '0x3261d0a3ed09ab00f67537e1df22741217d6bf04' --password password.txt

I sent a transaction form one account to another. I found the coin.base account got block signature reward:

> eth.getBalance(eth.coinbase)
0
> eth.sendTransaction({from:'0x4fa18a0cbbdc16dbadd4ffda9adad8ec68eec87b',to:'0xf16a44cf48cca573c89de520b21f7fe00391c705',value:web3.toWei(1,"ether")})
"0xe97cee9e7aa36d3569b90c6290d363e12308ed33e0c4c73f73da56e053cc3e06"
> eth.getBalance(eth.coinbase)
21000000000000
> eth.gasPrice
1000000000

Question:
Why is transaction fee 21000000000000 Wei here,how is it calculated?
For gas price, it is set to 1000000000 by default, how to change it?

I get the gasLimit of each block as below:

> web3.eth.getBlock(0).gasLimit
4700000
> web3.eth.getBlock(1).gasLimit
4704588
> web3.eth.getBlock('latest').gasLimit
6816517
> web3.eth.getBlock('latest').gasLimit
6829834
> web3.eth.getBlock('latest').gasLimit
6836502
> web3.eth.getBlock('latest').gasLimit
6836502
> web3.eth.getBlock('latest').gasLimit
6836502
> web3.eth.getBlock('latest').gasLimit
8000000
> web3.eth.getBlock('latest').gasLimit
8000000
> web3.eth.getBlock('latest').gasLimit
8000000

Why does the gasLimit increase gradually? it keeps constant when it reaches 8000000.
I think the gasLimit value should be set 8000000 by default,where it is configured,and how to change it?

Thanks.


texts: Unknown error while installing testrpc in Ubuntu

texts:
I was trying to install testrpc using sudo npm install -g ethereumjs-testrpc.

But no ERR messages are shown. Only this is the output:

/home/***/.npm-global/bin/testrpc -> /home/***/.npm-global/lib/node_modules/ethereumjs-testrpc/bin/testrpc
/home/***/.npm-global/lib
-- ethereumjs-testrpc@3.0.5-- web3@0.16.0
`-- bignumber.js@2.0.7 (git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2)

Typing in testrpc says

  command not found.

Please help!

OS: Ubuntu 16.10


texts:
I'd like to make new account by JSON-RPC.I've checked the wiki of Ethereum, however I could not find out how to do that.

I've found call existed accounts, but it isn't what I want.

eth_accounts

Could you tell me how to do this?


texts: Signing a message with HDWalletProvider?

texts:
This works fine:

const provider = new Web3.providers.HttpProvider('http://localhost:8545');
const web3 = new Web3(provider);

await web3.eth.sign(message, address);

But when I switch to this provider:

const provider = new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/<key>", 0 )

I get this error:

TypeError: self.signMessage is not a function

Anyone know what might be the issue?

Thanks!

edit I guess it's not implemented. Anyone know an alternative way to sign something using Infura?


texts: How to remove/increase execution timeout of the geth's evm?

texts:
I am performing some benchmarking with the Ethereum Virtual Machine. I have a contract with just one function that calculates the prime numbers until 100k. However, I am not able to get my results as the execution in geth is limited to 5 seconds. When I try to perform a call, I get the following error:
{"jsonrpc":"2.0","id":68,"error":{"code":-32000,"message":"execution aborted (timeout = 5s)"}}
The gas limit is not a problem here, I increased it (in the genesis block) to a large enough value so it would not impact the execution. I initialized geth with the following command:
geth --datadir=./data/ --networkid 68 --rpc.gascap 100000000000 --http --allow-insecure-unlock  console
I thought the problem might be their VM so I tried using a different instance of the EVM called evmone using the --vm-evm option, but it didn't help with anything. Also, geth does not provide any command-line options to set the timeout. There are --metric options though, but I do not think they have any relation.
I just need to increase the timeout limit to a large enough value in order to perform my experiments. I hope this limitation is not hard-coded and there is some solution.
Can you help?


texts: Event filter of a contract doesn't filter

texts:
I'm trying to read an event only when it has a specific value, for that I declared my event like so:

event eventName(int indexed filterNumber, string messageTitle, string messageDef);

Call it like so from the solidity smart contract:

Message(filterNumber, messageTitle, messageDef);

The event works, but I want to read it only if the filterNumber is a specefic one, to acomplish this I do the following:

      var events = communicationChannelInstance.allEvents({'filterNumber': 54},
      function(error, log){
      if (!error)
        eventHandler(null, log);
    });

(Example trying to read only the messages with a filterNumber 54)

But this system still reads all the events even wen they are sent with a different filternumber.

Am I doing the filter corectly? I tried to follow the documentation but this is as far as I got.


texts: How to add JWT token in JsonRpcProvider url header when connecting to JWT enabled network?

texts:
When connecting to Besu network which enables JWT public key authentication, how to add the token to the JsonRpcProvider (ethers 5.0.8)? Here is the current code (before adding JWT token):
 let provider_url = "http://node-ip:80"
 const provider = new ethers.providers.JsonRpcProvider(provider_url);
 let wallet = new ethers.Wallet(privateKey, provider);  //<<==generate wallet for the provider above

According to the Besu document above, the JWT token can be added in header after Bearer:
curl -X POST -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJwZXJtaXNzaW9ucyI6WyIqOioiXSwidXNlcm5hbWUiOiJ1c2VyMiIsImlhdCI6MTU1MDQ2MTQxNiwiZXhwIjoxNTUwNDYxNzE2fQ.WQ1mqpqzRLHaoL8gOSEZPvnRs_qf6j__7A3Sg8vf9RKvWdNTww_vRJF1gjcVy-FFh96AchVnQyXVx0aNUz9O0txt8VN3jqABVWbGMfSk2T_CFdSw5aDjuriCsves9BQpP70Vhj-tseaudg-XU5hCokX0tChbAqd9fB2138zYm5M' -d '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":1}' http://localhost:8545


texts: Getting and setting the nonce for a transaction

texts:
I'm using a javascript library (etheremjs) to sign a transaction. When creating it, it asks for the nonce field. I researched about it and partially understood it. But my main problem is:

How do I actually get it? Is the nonce a lifetime transaction number of that wallet or just a number for a set of transactions in a period of time? Does it start at 0 or 1? Is it public? How can I know what nonce I should use for a new transaction?


texts: Blockchain sync lost after restarting geth?

texts:
I'm new to mining ethereum so this may be a very basic question.

I ran geth in attempt to sync the blockchain on my machine as follows

geth --rpc --fast --cache=2048

After letting it spin for about a day I ran get attach and saw the following

> web3.eth.syncing
{
  currentBlock: 3274586,
  highestBlock: 3275837,
  ...
}

I then restarted geth, with the intention of not passing in the fast flag and allowing geth to continue syncing the blockchain normally so that I could start to mine. However when running geth attach and checking the value of web3.eth.syncing I saw the the following

{
  currentBlock: 580,
  highestBlock: 1707213,
  ...
}

Is there some way to start geth with the blockchain from my initial sync, or do I have a misunderstanding of how geth is meant to be used?


texts:
I'm making a token with ERC777 standard.

I've got my decimals at 18, and I want whole tokens, so I set granularity to 10^18.

when I try to mint 20 tokens, I get granularity error.  So I made a function to see what the calculations are

function cal_Multiple(uint256 _amount) public pure returns(uint, uint) {
  uint cal =  (_amount.div(10^18).mul(10^18));
  return (_amount, cal);
}

I'm running tests via Truffle.
I want to make 20 tokens, with 18 decimals, and granularity of 10^18

let cal_mul = await Campaign_Deployer_inst.cal_Multiple(new web3.utils.BN('20000000000000000000'))

The result is

20000000000000000000 //value I sent in
19999999999999999992 //calculated value

This shouldn't be a JavaScript rounding error, the math is being some with the Solidity code.

Thanks for any help!!

UPDATE:
I changed it to 10**18, and the test returns the correct value thank you!


texts: I added a charity address to my contract and now I have two, can I remove one?

texts:
The token in question is listed at the following url:
https://bscscan.com/address/0x3656b9d510af37b22cc1a5c904eb90855f953fbe
I had a charity address and fee address displaying
0x0000000000000000000000000000000000000000
last night we used the function within our contract in BSCSCAN to add a charity address of
0x0000000000000000000000000000000000000001
and now the fee address shows
0x0000000000000000000000000000000000000001
and both addresses
0x0000000000000000000000000000000000000000
0x0000000000000000000000000000000000000001
return true as the charity address, since these changes have happened we no longer are getting the tax on the transactions.
There should be 6% tax with 3% going to holders and 3% being burned, but now if you purchase the token everything is going to the wallet holder with no tax.
Any help would be greatly appreciated, is this fixable?


texts:
I have my Callee contract in Callee.sol

pragma solidity ^0.5.1;

contract Callee {
  uint private val;

  constructor() public{
    val = 30;
  }
  function getValue() public view returns(uint) {
      return val;
  }
  function increment() public returns(uint) {
    val = val + 1;
    return val;
  }
}

and I have another contract Caller.sol where i have to use Callee functions.
should i use inheritance

pragma solidity ^0.5.1;
import "./Callee.sol";

contract Caller is Callee{

    // Callee public c;
    // constructor(address addr) public {
    //  c = Callee(addr);
    // }
    function someAction() public returns(uint){
      return getValue();
    }
    function inc() public returns(uint){
      return increment();
    }

}

OR should i use contract creation method by new?

pragma solidity ^0.5.1;
import "./Callee.sol";

contract Caller{

    Callee public c;
    constructor() public {
      c = new Callee();
    }
    function someAction() public view returns(uint){
      return c.getValue();
    }
    function inc() public returns(uint){
      return c.increment();
    }
}

also if I am building my ICO dapp where I have two contracts ERC20Token.sol and MYICO.sol where MYICO will be used to buy token etc.
then which one of the above methods shoild i use to ERC20Token.sol from  MYICO.sol?


texts:
Whilst going through the documentation for using JSON RPC, 1 of the parameters hasn't been explained. What is the purpose of id? Is it specific to the type of RPC curl request being made?

For e.g.

  id=67

curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}'

  id=64

curl -X POST --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c64"],"id":64}'

However it doesn't look like there is a standard id for particular call either. So I was left confused about the purpose behind it.


texts: Web3j how to get event args when parsing logs?

texts:
I'm trying to get an event args in web3j version 4.0.1.
I use the simple syntax which is explained in the docs. I'm getting the log object but there is no args property or such thing in it.
Here is my code:

EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST,
    DefaultBlockParameterName.LATEST, <contract-address>);
web3j.ethLogFlowable(filter).subscribe(log -> {
    System.out.println(log);
});

I expected to find args in the log it is not there. There is a data index and its value is some unreadable hex string.
I must mention that I'm able to see the log arguments in remix and even in truffle test transaction receipt. But no success in web3j.


texts: What is the difference between signing a document, signing a transaction and signing a message? (very basic)

texts:
As per my limited knowledge in Ethereum, user can sign the object(doc, Tx, msg) for the security purpose and with the public key other user can get that object.

But not understand the difference between them. We can use web3 to sign the object.

can anyone tell me what is these sign and what is the difference between signing document, transaction and message?

Thanks


texts: How to properly initialize nested storage array/struct?

texts:
contract Contract {

struct A {
  int a;
}

struct B {
  A[] as;
}

mapping(address => B[]) bs;

function addB(B memory b) {
  bs[msg.sender].push(...???...);
}

}

I have nested hell of arrays and structs and I can't figure out how to properly add one B into array of bs.


texts: Get addresses that have my token and the amount

texts:
How can I find out what addresses my token has and how much is solid?
I thought of creating an array with the addresses like this would go through, but this array can grow to infinity and cost me a big gas.
My idea would be to get all the wallets that have my token with the amount of it.


texts: What are the open issues with the Casper proof of stake algorithm?

texts:
Ethereum plans to move to the Casper proof of stake algorithm in a future release named Serenity.
There's a comment that Casper's "basic mechanisms are fairly firmed up now".

What are the details of the Casper algorithm that have not been specified yet?
What are the open issues and known unknowns about Casper, in rough order of importance?


texts: How does the incentive system for Swarm work?

texts: I have skimmed some of the documentation/white paper for Swarm, the decentralized storage system, but I'm having difficulty understanding how the incentive system works (i.e. motivation for people to let other store data on their nodes.) Can someone with a better understanding explain succinctly how this will work?


texts: Build blockchain application that has some off-chain functionalities

texts: I am learning about blockchain and I have a general question. Let's say that I want to build my custom blockchain based on Ethereum. My implementation has many nodes and few of them are chosen regularly to implement a functionality. Let's say that those nodes are chosen by a smart contract which once mined publishes on the blockchain the addresses of these chosen nodes. Other nodes then can connect to these node to obtain certain services for example write to a Database. This interaction would be completely offchain and done through Remote Procedure Calls. Is this a proper way to build a blockchain solution? Are there any major security risks I am not considering especially with the RPC interface?


texts: what is the equivalent of encodeFunctionSignature for web3.js version ^0.20.6

texts:
I want to check if a specific contract deployed at an address is an erc721 contract. I found out that most of the erc721 contracts should have safeTransferFrom function implemented. (except cryptokitties)

So, basically I want to check if safeTransferFrom function exists in the contract. I think that this https://ethereum.stackexchange.com/a/50091/42466 would help.

However, I am using an older version of web3.js (0.20.6) and it does not have this function w3.eth.abi.encodeFunctionSignature(signature);

TypeError: Cannot read property 'encodeFunctionSignature' of undefined

How can I use it to make it work for my current version of web3.js

PS: I found that the latest version of web3.js has different function signatures for many functions. So, I would not want to upgrade web3.js.


texts: How to query Ethereum contract to get data from it?


texts: Pass hexadecimal literal to contract using web3js


texts: testrpc spent gas amount accuracy in relation to the main network

texts: Can I trust testrpc spent gas amount as being close (or even exactly the same) to the actual gas amount that will be spent by my transactions when I deploy my Smart Contract into the main network?


texts: How to convert a string to bytes32 array?

texts: I have known how to convert a string to bytes32. But if the string length is longer than 32, the rest of the string will be truncated. So how to convert a string to bytes32[] array?


texts:
Is it possible to set the default Compiler version in Remix?

Each time I open Remix, the compiler defaults to version 0.5.0+commit.1d4f565a. However, there is currently up to version 0.5.10 available + all the "nightlys" (and the list is growing) so it takes a while to scroll to your preferred version to run the Compiler.


texts: How to map EVM trace to contract source?

texts:
In other words, how to get "classic stacktrace" of failed transaction?

E.g. we have a trace  (don't look at "Missing opcode 0xfd" - its the revert instruction) and the contract solidity source. How to find out at which line of the source the exception was thrown?

I managed to get assembly of the contract (using solc --asm), but there are no PC (program counter) hints, so I cant find a line which corresponds to PC=557. Also, I reckon that optimization performed during compilation, but despite that assembly is still readable to some degree.

I'm using solc 0.4.16+commit.d7661dd9.Linux.g++.

Thanks in advance.