All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
37 views

Is the following scenario doable by a smart contract?

I have 2 persons ( say A or B). They want to have the following agreement. Person ‘A’ specify a deposit (x coins ) for user ‘B’ under a certain condition with a future time lock ‘t’. If user ‘B’ ...
0
votes
1answer
61 views

In node.js event is not fired

I am using web socket to get event. sending transaction works fine. but event is not fired. also I referred Web3 events not working but it does not work, too. I used eventemitter also. but it did ...
0
votes
2answers
1k views

Error: Invalid JSON RPC response: “” using infura

My code: const contract = require('truffle-contract'); const fs = require('fs'); const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const fileContents = fs....
0
votes
1answer
395 views

Tracking transaction status using ethereum private chain

I am implementing an order management system using ethereum private block chain. Each order is a smart contract. Each order will be acted upon by multiple actors. The status of the order will also be ...
0
votes
2answers
66 views

My question is about forks in general. If I have a portion of a coin do I get the exact portion of that new coin?

my question is about forks in general. If I have a portion of coins and it gets forked do I get the exact amount of the new forked coin?
0
votes
1answer
553 views

Cannot connect to testrpc

I have a testrpc running on a virtual machine (Ubuntu 16.04) and it works properly when I interact with it using the truffle console. My only goal is to call a smart contract that simply sends ether ...
0
votes
1answer
173 views

Best way to do USD math in Solidity?

Pardon the n00b question! I am trying to do some simple math in solidity using USD values. For example, say the start price of a token offering is $0.50 USD and the contribution is $10.00 USD, then ...
0
votes
1answer
404 views

Truffle Exec Gets Stuck [closed]

I want to exec a script in the truffle console. script const artifacts = require('./build/contracts/Message.json') const contract = require('truffle-contract') const Message = contract(artifacts); ...
0
votes
1answer
163 views

Why I do not get returned value of function of my smart contract using testRPC and a Graphical User Interface?

I have a smart contract that is tested with remix and it works well. Its code is as follows : contract Weechain: pragma solidity ^0.4.15; // --------------------------------------------------------...
0
votes
2answers
307 views

Why aren't block hashes a reliable source of randomness?

I just saw this answer that informed me that block hashes were not a reliable source of randomness. In what situation are block hashes not a reliable way to obtain randomness?
0
votes
1answer
294 views

How to call a function from deployed contract to another contract? [duplicate]

I created a basic ERC20 token contract and deployed in rinkeby testnet and I got the contract address now I want to call transfer() function from this deployed contract to another contract without ...
0
votes
1answer
61 views

How Do You Parse Web3 Retuned JSON Objects of Events?

I am using Web3 1.0 to listen to events from a contract like this: tokenContract.events.AddressList({ fromBlock: 6020474, toBlock: 'latest' }, (error, events) => { ...
0
votes
0answers
815 views

Ropsten Network down?

According to Etherscan the last mined block was block 2933931. However, my node is stuck at block 2933993. On their website they are announcing the following: "Node Resynch in progress. Indexing ...
0
votes
1answer
563 views

R,S,V ECDSA packet signatures

I am using BouncyCastle to generate .NET core packet signatures. I want to be able to get the v value for the Ethereum signature. To these ends, and with my understanding of the meaning of the v ...
0
votes
1answer
194 views

how to deal with bytes32 to string in javascript?

I am going to set a email address from users and going to save it to ethereum network. I kept email as bytes32 in smart contract and when I am sending the value to javascript i am getting always a ...
0
votes
2answers
608 views

How to send transaction/call function from server-side?

After an event emits from my smart contract and I hear it server-side, I want to call a certain function in the smart contract and pass it some information to use. I'm wondering how you place a ...
0
votes
1answer
1k views

Hash of the transaction VS Transaction Hash or Transaction ID

I just want to be sure I understood well how each of them are generated. I'm a bit confused because of the similarity of the names and because I couldn't find in the yellow paper how the transaction ...
0
votes
1answer
45 views

create ERC-20 token from a contract function

I would like to do a function create contract with ERC-20 interface. But I have a few problems. If anyone help me I’ll be appreciated. Here’s the code : pragma solidity ^0.5.0; import 'https://...
0
votes
1answer
290 views

eth.getBalance(eth.coinbase) = 0, node/client not fully synced yet

I just started to get my fingertips wet with Ethereum and Dapps. After receiving some ether on Ropsten to test with: https://ropsten.etherscan.io/address/0x05c86fc0ec0b80715f1cbc2fa96e86ba18e2eb90 I ...
0
votes
1answer
37 views

Ethereum fork that implements transaction ordering

Hyperledger fabric has its consensus that contains Transactions endorsement Transactions ordering Transactions committed to a block I wonder if there is an Ethereum consensus or fork that would have ...
0
votes
1answer
2k views

How to decrypt private key form keystore file, without using third party applications? [duplicate]

I would like to write a piece of code that takes input as UTC key store file and password, and returns decrypted Private Key. I am aware of options like "MyEtherWallet" but I would like to do using my ...
0
votes
1answer
103 views

identifier problem with “require”

function transfer(address to, uint tokens) public returns (bool success) ; uint256 public max_contribution = 50 ether; uint256 public min_contribution = 0.1 ether; require (msg.value &...
0
votes
1answer
103 views

Getting error in the contract code “please check your gas amount”

I am getting this error: Error: The contract code couldn't be stored, please check your gas amount. This is when I am importing one extra contract with the name of TimedCrowdsale from ...
0
votes
1answer
702 views

Unlock remote account

I have smart contract deployed that accepts funds (via fallback function function() payable { ... }). Also I have frontend using web3 to send funds. When I tested it with local node (and JSON wallets ...
0
votes
1answer
131 views

Am I paying gas in ETH for sending tokens to a specific miner?

Am I paying gas in ETH for sending tokens to a specific miner? If so is it possible to find out how that miner is and to make a deal with that miner to pay less gas for many transactions or maybe pay ...
0
votes
1answer
360 views

“instance.at(addr) is not a function” in truffle console (access to non-migrated contracts)

I have a setup with one contract that is a singleton and is migrated to e.g. a testnet through the truffle console. This contract "creates" new contracts, which I want to access in the truffle console....
0
votes
2answers
418 views

web3 detect/listen to events if someone send ether to addresses

I need to constantly keep running some code to detect if someone has in the past minute sent some ether/token to a lot of addresses, is there better way to do than https://ethereum.stackexchange.com/a/...
0
votes
2answers
973 views

Cancel a transaction that has not been pushed via Mist

I submitted a transaction via Mist with the fee slider at the leftmost position. Nothing happened for a day now, so I suspect that the displayed gas price has been to small, although Mist told me that ...
0
votes
1answer
59 views

How to return the change to the sender?

In this answer, @pabloruiz55 provides the following code for sending ether. SmartContract.sol function transferToOwner() payable returns (bool) { //Sender should forward at least 1 ether. ...
0
votes
1answer
260 views

Export a JS package from Truffle?

Truffle has this whole build process for deploying fronted code that is kinda mediocre. Does anyone know if I can just have Truffle output a single javascript file that will work in a web3 enabled ...
0
votes
1answer
195 views

Solidity smart contract inherited function output failed

I'm trying to inherit a function from the parent contract into child contract and its working fine in remix JavaScript VM. I did the following steps: Deployed the parent contract in remix JavaScript ...
0
votes
0answers
22 views

Truffle test including mainnet contract - Error: Cannot create instance of Whitelist; no code at address

Problem with the error Error: Cannot create instance of Whitelist; no code at address 0x6198149b79AFE8114dc07b46A01d94a6af304ED9 How do I have to setup truffle so that I can run a test which includes ...
0
votes
1answer
221 views

Solidity test file reaches gas limit due to imports

I have a sol contract X.sol and a sol test file TestX.sol. X.sol is large: ~4m Gas after optimisation TextX.sol compiles, migrates and executes tests fine when just executing a single test - testY, ...
0
votes
1answer
90 views

What is the change in smart contract when the 'chain reorganizations'?

Recently I learned about 'chain reorganization'. What is the change in smart contract when the 'chain reorganizations'? for example, contract Contract{ event LOG_Increase(); uint sum = 0; ...
0
votes
1answer
131 views

Is there any way to return multiple structs (or the fields from them) in Solidity when one of the struct fields is of type `bytes`?

I would like to return structs keys from my contract to display on the frontend, ideally 10 at a time. I understand that if I make keyByOwner public I can return a single key at a time with the getter ...
0
votes
1answer
274 views

Comparison of Metamask vs Ganache [closed]

I watched some videos about Metamask but I am so confused by it Metamask: To use the final application like the end user would. Based on that, what is the purpose of React then? What are the ...
0
votes
1answer
401 views

Transaction signing fails Invalid RLP.“,”data“:”RlpExpectedToBeList"

I'm trying to sign and push a transaction using ethereumjs and Infura. It seems to be working and I'm getting a transaction hash back, but the transaction is not visible on Etherscan, and when I'm ...
0
votes
2answers
245 views

Calculate integer input length

I need to get the length of input which is an integer in bytes function mine(string s , uint i ) public view returns () { return (length of i); }
0
votes
1answer
460 views

I don't see “Start Mining” option?

I just installed Ethereum wallet, but I do not see the Start Mining option in the menu. What am I missing?
0
votes
2answers
535 views

using abi generated by truffle in DApp

I use truffle to deploy contract to ganache network. I like to use the json file generated by the truffle in the DApp rather writing messy ABI into it. I tried the below piece of code and it gives ...
0
votes
1answer
127 views

How to deploy Smart Contracts With Web3 Using Async/Await?

This is my Javascript code. I keep getting an error that states Error: No privateKey given to the TransactionSigner. at TransactionSigner._callee$ (/Users/payton/WebstormProjects/Esgro_DAPP/...
0
votes
1answer
481 views

Solidity Debugging in Remix

I am working Remix Browser for the following simple Contract. I had a couple of questions. I could not find the right answers. During Contract Creation: It gives the following error. What is ...
0
votes
1answer
1k views

Can transfer ether from a contract to an account, but not to another contract [duplicate]

Here are two contract functions. The first works fine, the second displays the following error: "Warning! Error encountered during contract execution [Bad instruction]" function DoTransferToAccount()...
0
votes
2answers
67 views

Suggestion on my asset contract

I created asset transaction smart contract. Functions are Create Assets (asset id, asset details, with owner) and pushing into array list. Get Assets by owner address: Looping assets array and get ...
0
votes
1answer
232 views

How can I upload a smart contract to the Ethereum blockchain directly from a Raspbian Terminal without Parity, Geth, etc installed?

How can I upload a smart contract to the Ethereum blockchain directly from a Raspbian Terminal without Parity, Geth, etc installed? Hello, I primarily use a Raspberry Pi 3B with Raspbian OS ...
0
votes
2answers
506 views

Division/Percentages in Solidity (a workaround)

Division/percentages is a required part of many applications but is difficult to implement since fixed and ufixed are not supported yet in Solidity. I've come up with this workaround: pragma ...
0
votes
1answer
429 views

Ethereum light node: Light vs Cache vs fastsync

There are many different options when running a Ethereum node. I want to make sure I pick the right options before I start downloading the blockchain... can someone explain the advantages of using: —...
0
votes
0answers
57 views

Web3 & Solidity - Automatically read ABI and Create Contract

Is there a way to automatically create a new Solidity Contract - from within a web3 JS file using the .json file created in a project's build folder after each compile? I have already figured out how ...
0
votes
2answers
43 views

I'm trying to create an app that allows people to exchange ether between themselves but I have the error: “web3.eth.transact is not a function”

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <center> <title>dEnergy</title> </head> <body> <label for="name" ...
0
votes
1answer
223 views

Ropsten Network - geth console does'nt give updated blocknumber

I have used the command : geth --testnet --syncmode "fast" --rpc --rpcapi db,eth,net,web3,personal --cache=1024 --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*" --bootnodes "enode://...

15 30 50 per page