All Questions

0
votes
0answers
3 views

truffle testing enum

I am trying to test an enum value from a test. This is simplified version of the contract: pragma solidity >=0.5.0 <0.7.0; contract Foo { enum State { StateA, StateB } State ...
0
votes
0answers
4 views

Getting “Error while loading the content of <contract>.sol”

After setting up the "embark-create-react-dapp-template", I didn't see a folder for contracts. So I've created one under the root level of the project (just like in the demo). But then when I executed ...
0
votes
1answer
187 views

Trouble running node to test Web3

I'm trying to test basic web3 with node. I have testrpc running and I have the following in a javascript file: var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider("http://...
1
vote
3answers
189 views

Truffle migrate: Could Not Find .sol file from any sources

I just started onto the blockchain journey a couple of hours back trying to create an elections program on the Ethereum blockchain. While trying to migrate the smart contracts using truffle migrate, I ...
0
votes
1answer
6 views

How data is secured on ethereum network?

Blockchain is distributed decentralized database and same data is present on every node on network so now anybody on the network can see my data, so how it is secured over blockchain network?
0
votes
1answer
207 views

Sweep funds from all accounts into one account

How can i sweep funds of all ethereum accounts into one eth wallet using web3 in ubuntu server? Is there any example for the same? i found an example but that is not working for me.
2
votes
3answers
131 views

Handling decimals in somewhat complex math

I'm a bit lost on what to do with the following calculation. The problem is that decimals are being round up/down, which obviously doesn't give me the result I desire. int totalValue = 275000; int ...
0
votes
0answers
6 views

Drizzle installation end up with errors

I have followed the this tutorial from Truffle official page, First few steps goes smoothly and when i tried to install drizzle on client directory as per the tutorial says it ended up with this error ...
0
votes
0answers
15 views

Accidentally sent REN (ETH token) to my ETH contract address using my Ledger Nano S. Can someone help please?

I sent REN (ETH token) to my ETH contract address by accident while using my ledger nano s. Can someone help me understand what's happened to the tokens and if I can retrieve my REN token from my ETH ...
0
votes
0answers
18 views

Setting array.length to 0 triggers an error on solidity 0.5.0

Why setting array.length to 0 triggers an error ? I have a function that deletes an element from a dynamic array of structs within a mapping as follows: mapping(address => MyStruct[]) public ...
0
votes
1answer
250 views

Can I find constructor arguments from truffle artifact?

I'm in the process of verifying my contract on Etherscan. Etherscan asks for ABI-encoded constructor arguments during the verification process, though I was a bit silly and don't quite know what they ...
0
votes
1answer
7 views

Solidity Compatibility Configuration

I am a cyber security analyst who is new to ethereum and working on a project to study crypto security. It's a series of 22 vulnerable smart contracts that you're supposed to exploit. For anyone who ...
0
votes
0answers
4 views

Quorum 7nodes example unable to finish simplestorage migration using privateFor

I'm following this example: truffle quorum example I created a cluster using docker-compose and all the nodes are up and running but when I run the truffle migrate command the migration doesn't end ...
0
votes
1answer
242 views

How to get only past 2 days events using getPastEvents everytime?

How can the following query be modified to only fetch the past two days worth of events: const events= await MyContract.getPastEvents("eventName", { fromBlock: 0, toBlock: "latest" });
1
vote
1answer
206 views

Ethereum Wallet stuck pending transaction

NOOB here trying to get a handle on things. I've been using the Ethereum Wallet from Ethereum.org for about a year. I'm on ver 0.10.0. Around December 2017 - January 2018 I started to have very ...
1
vote
1answer
189 views

Truffle test case to unit test withdrawal pattern

How can I test the withdraw() function in a truffle javascript test case for the below contract? The problem is, If I use the msg.sender from the same contract, the before and after balance will be ...
10
votes
3answers
2k views

Invalid Solidity Type Tuple[]

I have a contract on the Ropsten test network and I am trying to return an array of structs but I am receiving the following error in my JS console. I am including the following at the top of my ...
0
votes
1answer
30 views

The method eth_sendTransaction does not exist/is not available on infura

Im trying to send transaction to simple greeter contract with web3.js on infura node.while doing soo, Im getting this error. throw errors.InvalidResponse(result); ^ Error: The method ...
16
votes
6answers
10k views

Encoding/Decoding contract ABI data

How to encode and decode ABI data? Can someone show me an example with web3js library?
0
votes
1answer
308 views

Having trouble with Geth Node 1.8.2

I have been having issues since the geth update. Mist first gave me the error that I should install the newest update manually, and when I downloaded it and tried to install it, I was unsuccessful. I ...
0
votes
2answers
202 views

Can I deploy a smartcontract with web3 1.0, without the metamask popup?

I'm using web3 1.0 to programmatically deploy smartcontracts and make transactions, and metamask to sign those transactions, since i don't want to have hardcoded fragile things. I would like metamask ...
0
votes
0answers
16 views

Create an ERC20 Stablecoin

How to create a stable coin with an ERC20 token contract ? Does it require contract to be modified ? Are there some good practices or standards ?
0
votes
0answers
12 views

How to read uint256[] array from a method in a smart contract?

I'm using this function in my smart contract. It returns an uint256[] array containing the tokens that the user owns. /** * @dev Returns all of the tokens that the user owns * @return An array ...
0
votes
1answer
15 views

Web3 - Cannot read property 'clearSubscriptions' of undefined

While creating a web3 instance, and attempting to call setProvider with a valid provider (Ganache), I get a TypeError. TypeError: Cannot read property 'clearSubscriptions' of undefined Steps to ...
2
votes
2answers
416 views

Deploying a contract that calls a contract

What is best practice on deploying a contract called within another contract with web3.js? I have previously gone under the assumption that the contracts must be mined separately, and the caller must ...
3
votes
3answers
225 views

web3.eth.Contract(abi, address) doesn't return contract instance

i'am trying to make a instance of my contract in js using web3, but when I use the function web3.eth.Contract(abi, address) the result is not the expected(I take the ABI from remix). this is the code:...
1
vote
1answer
2k views

How to get contract instance address for Web3 1.0 contract API?

With truffle-contract, all you needed to do to get the contract instance was something like this: const getContract = require('truffle-contract') const contractJSON = require('./MyContract.json') ...
22
votes
3answers
4k views

How to detect if an address is a contract?

I'm interested in knowing whether any particular address is a contract address or a standard address. There have been similar questions on the topic, but I'm not looking to detect whether an address ...
2
votes
2answers
182 views

Full node - network upload status

To support Ethereum, I would like to run a Full node. My Geth seems to be running correctly : I see it on ethernodes.org net.listening returns TRUE net.peerCount returns a positive number What's ...
27
votes
6answers
14k views

ecrecover from Geth and web3.eth.sign

I have tried to use ecrecover() to verify the signature of a message. I have looked at lots of references here and elsewhere, like: https://lab-blog.ey.com/2016/12/19/ecrecover/ How does one ...
7
votes
0answers
842 views

How to implement the ERC777 token standard?

Does anyone know how to correctly implement the new ERC777 token standard? I've been trying to create an ERC777 contract (see code below) but keep struggling with a couple of things. According to ...
1
vote
1answer
13 views

No web3 instance injected following the dApp University Tutorials

I've been following Dapp University's videos on how to make IPFS uploads with Euthereum Smart contracts, and after I manage to 'npm run start' in the command line it opens up the HTML, but it always ...
1
vote
2answers
309 views

Not able to export to csv all transfer events of a specific contract on Ethplorer.io

I'm able to use the Export to csv function, but it's only giving me the most recent 1000 events. Any suggestions on how to get ALL (2100+) of the events in a csv file? https://ethplorer.io/address/...
0
votes
0answers
7 views

stack too deep user function

I am building a dapp, the user structure is composed of multiple attribute so I divided it to 3 structures, but I still have the problem of the deep stack in the registration function struct ...
0
votes
0answers
14 views

How to prepare for blockchain interview?

I am learning blockchain and want to pursue my career on blockchain, so what will be the best way to do that? What certification I must do and what think I should cover? appreciate all your career ...
0
votes
1answer
19 views

What is difference between geth, myEtherWallet and etherscan

I am new to blockchain technology and learning it, there are many terms of blockchain which confused me like geth client, meta mask, etherscan and myEtherWaller. I used geth it's a ethereum client to ...
2
votes
1answer
242 views

transaction validation in ethereum

Can someone suggest me a tutorial or explain how to verify ethereum transactions in a non financial use case of blockchain. For example, I am using blockchain to distribute access tokens for my IoT ...
0
votes
2answers
18 views

how does this honeypot works?? 'OpenAddressLottery'

/** * Source Code first verified at https://etherscan.io on Saturday, February 10, 2018 (UTC) */ pragma solidity ^0.4.19; /* * This is a distributed lottery that chooses random addresses as lucky ...
0
votes
1answer
195 views

Ethereum Explorer without a full node

Assume a blockchain is running on a set of servers. Question 1: Can a thin client (who does not have a full node like Geth) use Ethereum explorer to see the transactions sending to the blockchain? ...
2
votes
2answers
25 views

Metamask injects one account in web3, but calls contracts using another account

Building a React app, MetaMask injects web3, I get accounts[0] from getAccounts(), then pass it to my contract functions together with other parameters. I want my modifiers to lock incoming function ...
0
votes
1answer
15 views

Parity Mnemonic or Keyfile not compatible with MEW?

I'm on a new computer and I have 2 ETH addresses I created on parity in december 2017 and february 2018. Now I thought I followed the plan on what to do to secure the addresses but when I enter the 12 ...
0
votes
1answer
25 views

How does this assembly function work?

From the Docs, how does this operation create a new "memory end"? mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f))) Context: library GetCode { function at(address _addr) public ...
0
votes
1answer
395 views

How to make API calls from a .NET Application to an Ethereum Private Network

I'm starting on blockchain development and I have a question: I was wondering if it is possible to make RPC calls to a private ethereum network (handling user private keys is not a problem in our ...
1
vote
1answer
13 views

Auction contract problem regarding highest bid display

I have an Auction contract which has a function like this: function bid() payable{ //calculate and store highest bid value } But because each transaction takes time to mine, so when a user bids ...
0
votes
1answer
16 views

How to pass a document as function argument(upload document)

I am working on a project in solidity where I want to generate a SHA256 hash value for the document. So which means when I choose a file using a function the function should return the hash value. ...
0
votes
1answer
221 views

Ganache and truffle - how to set zero deployment fees

I am running a local ganache-cli node on my machine and would like to have zero transaction fees. For this reason I am starting the node using ganache-cli -g 0 which sets the gas price to zero. ...
0
votes
2answers
508 views

How to access Truffle deployed contracts with app's javascript code?

I have some smart contracts deployed with Truffle on the local Ganache network, but I don't know how to access it with the app's javascript in order to make function calls to the contract. How would I ...
0
votes
0answers
7 views

Private chain access mode

I set up a private chain with 4 nodes.Two nodes are sealer, the others are normal ones. To send a transaction, need to attach one node and then send it. I think in this way, only one node is used to ...
0
votes
1answer
230 views

Posting data from raspberry pi on blockchain and retrieving it back

I am new to blockchain technology. I just want to know if it is possible to post the data from raspberry pi on blockchain (ethereum) and retrieve the posted data for viewing. My question is if its ...
1
vote
1answer
51 views

How to build a simple transaction?

Where is the information on the tx package build protocol? Bitcoin as an example, Bitcoin Wiki - Protocol Documentation: tx Is there an example of serialization for python like this answer to How to ...

15 30 50 per page