Categories
Cryptocurrency Development Ethereum

Storing code in contracts

I’m considering different designs to implement “configuration options” with Ethereum. The design should allow me to define arbitrary (= number and type) options, quick access to a list of options, their values, and validated change of options values. A naive design would be one contract per config option. That would be a lot of contracts. […]

Categories
Cryptocurrency Development Ethereum JSON

NodeJS + Web3 + Infura Ropsten – Error: Invalid JSON RPC response: “”

I have problem with invalid response to ethereum from BE NodeJS app. I got error like: Error: Invalid JSON RPC response: “” Below I’d attached my simple code for testing connection. const Web3 = require(“web3”); const web3 = new Web3(new Web3.providers.HttpProvider(providerUrl)); const contract_web3 = new web3.eth.Contract(abi, contractAddress); console.log(“Config Data: \n”, providerUrl, “\n”, config.privateKey, “\n”, contractAddress); […]

Could not deploy contract with valid data

I have downloaded contracts with their abi and json. I have to deploy them. when i extract bytecode from downloaded files and then assign it to my data variable to deploy contract whic gives following error; Same error related question asked earlier here, but no answer is given. UnhandledPromiseRejectionWarning: Error: The data field must be […]

Categories
Cryptocurrency Development Ethereum

What do you think awaits Ethereum in the future?

What do you think awaits Ethereum in the future? What changes will be in your opinion? What will happen to crypto services, wallets, exchanges? (This question is of particular concern to me, especially after the recent news about the theft of $50 million from Upbit) I mainly use bittrex.com and freewallet.org. What services do you […]

Categories
Cryptocurrency Development Ethereum GitHub

transactions in rpc block response sometimes have chain null and sometimes correct chain

when doing e.g. a blockByNumber rpc request I am getting a result like this from parity: https://gist.github.com/ligi/fbc7061d93f087cf0eb0f4db83d1fced what is puzzling me that some transactions have: chainId”:null and some have “chainId”:”0x1″ I do not see the pattern when either variant is returned. geth does not contain the chainId there at all. Can someone enlighten me what […]

Categories
Cryptocurrency Development Ethereum

Is it possible to have multiple private keys for a single public address?

Since the ratio of all possible digits (please correct my math if I am wrong) of a public key versus private is: 1/79228162514264337593543950336 for public (40^16): 1 461 501 637 330 902 918 203 684 832 716 283 019 655 932 542 976 for private (64^16): 115 792 089 237 316 195 423 570 985 […]

Categories
Cryptocurrency Development Ethereum

Bad randomness exploitation

There is a contract with a betting function that calculates a random number and send you back a reward if winning. The betting function looks like: function bet() public payable { if ((random()%2==1) && (msg.value == 1 ether)) { if (!msg.sender.call.value(2 ether)()) throw; } } function random() view returns (uint8) { return uint8(uint256(keccak256(block.timestamp, block.difficulty))%256); } […]

Categories
Cryptocurrency Development Ethereum

How to test chain reorganization with testrpc?

I am working on blockchain synchronization script. I need a way to make reorganization programmatically for testing purposes. Is there such functionality in some testrpc?

Categories
Cryptocurrency Development Ethereum

Hourly data for Ethereum?

Is there any reliable source for hourly data for Ethereum dating back to 2017? The poloniex API only provides me with daily data – https://poloniex.com/public?command=returnChartData&currencyPair=USDT_ETH&start=1480360203&end=9999999999&period=14400

Categories
Cryptocurrency Development Ethereum GitHub

What big number library does ethers.js use?

Logging a value from a contract with ethers.js, gets me this: tokenBalance: v _hex: “0x033b2b2062ddfc98de7fffff” _ethersType: “BigNumber Is this an instance of bn.js, bignumber.js or a custom implementation?