All Questions

1
vote
1answer
8 views

ERC721Token super._mint calls addTokenTo from the top level implementation

Based on Shawn's answer, super._mint calls addTokenTo from the top level implementation (ERC721Token). How does this work? super._mint calls _mint from ERC721BasicToken reads line addTokenTo ...
1
vote
1answer
10 views

ERC721 how does tokenOfOwnerByIndex() list tokens owned by a user?

Per eip-721, there's an optional "enumeration extension". So what I did was I called balanceOf to get the number of tokens owned by the account and called tokenOfOwnerByIndex in a loop to get each ...
0
votes
0answers
9 views

How to add smart contract functionality to my blockchain?

I am currently developing my own Blockchain in C++ to just more understand the technology. I am using the Ethereum Blockchain as an example. One of the things I already copied from Ethereum blockchain ...
2
votes
0answers
8 views

String Input of three numbers (comma seperated) doesn't work in Remix

So when I try to put in three numbers as a String in a usual setter-method, it doesn't work. Does anybody know why? function test(string memory x) public view returns(string memory){ return x; }...
0
votes
1answer
10 views

Error: Data location must be “memory” for return parameter in function, but none was given

I am unable to solve the error mentioned below. Error: Data location must be "memory" for return parameter in function, but none was given. function fromHex(string memory s) public pure returns(...
0
votes
0answers
14 views

How to handle estimate gas cost error?

I am programming a button for a transaction which shall only appear if the transaction is possible. Therefore, I am using the following code contract.methods.function(parameters) .estimateGas({...},...
0
votes
0answers
17 views

I can not make a transaction in the system Blockchain

I am studying blockchain, found a project on github. Make all the necessary settings, the project launched, but I can not make a transaction when adding data to the system. The project is under the ...
0
votes
2answers
14 views

How to handle JSON in a smart contract?

I want to store JSON input in my Smart Contract. Like { "name":"John" } First I thought i could just handle it like a String, but it is not working because of the double quotes. Remix says, that ...
0
votes
1answer
7 views

Why Could not find artifacts for contract from any sources

I am using windows 10 with truffle and ganache-cli. I have 2 contracts file to be deployed contain interfaces of other contracts defined within the contract: Contracts: ERC721Mintable.sol Ownable ...
0
votes
1answer
8 views

Can I have a listener to cryptocurrencies / tokens reaching a specific address?

Let's say that there is an address called 0x1 There is another address called 0x2 which just released a new token called ABA. Is there a way to constantly listen for 0x1 to see if it receives ABA ...
1
vote
1answer
16 views

Where can I find public and known ERC20-Contracts from existing ICOs

In order to list real live example code for ERC20-Token and Crowdsales at a talk about Smart Contracts I'm looking for such projects? Who can recommend me the real GOOD examples out there (and not ...
0
votes
1answer
13 views

How merkle tree is used to verify transaction in blockchain

May any one give example how merkle tree is used in blockchain to verify the transaction? I confused because validation of data in ethereum is done through the proof of work where you find the nonce(...
0
votes
1answer
10 views

Geth expose eth.call only via --rpcapi

Need a way to open Geth publicly, but don't want to expose all eth methods. Need only eth.call. Using --rpcapi eth will expose all eth methods. How to expose only particular one?
0
votes
1answer
19 views

Generate wallet public and private key using web3 PHP

I am using this to get public key: https://github.com/sc0Vu/web3.php#assign-value-to-outside-scopefrom-callback-scope-to-outside-scope I am in need of to get the public and private key using PHP ...
0
votes
0answers
25 views

Web3 Cannot read property 'apply' of undefined

I'm new to dapp and trying to follow iwaldman to build an ipfs-image-dapp. Here is the repo: https://github.com/iwaldman/ipfs-image-dapp. But running yarn start gives the error Cannot read property '...
0
votes
0answers
16 views

Change params from another contract

Is it possible to change params of one contract from another? I mean: contract One { address public addr; } contract Two { function test(address oneAdd) public { One one = One(oneAdd); ...
0
votes
2answers
22 views

Compare bytes32 and string using solidity

I need to compare a bytes32 value with a string. In the below example I need to check if QRVal==QRScanVal. Eg: bytes32 QRVal="0xc59aa6848d32d073bdcaa041b2735d3e4546d0836498e30de7c4c64c50933a33"; ...
0
votes
1answer
15 views

Miner address is all zero in block

I sent a transaction in clique POA private chain and get the block via transaction hash. Why is the miner address for this transaction all zero? step 1: send a transaction > eth.sendTransaction({...
0
votes
1answer
10 views

Parse Error, Expected Pragma on remix

I am new to remix and can't figure out what is wrong with this basic function. pragma solidity ^0.5.1; contract Pie { uint256 public p; } function pie () public returns (uint256) { ...
0
votes
1answer
12 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
3answers
25 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 ...
1
vote
3answers
29 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
0answers
14 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
7 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
3answers
23 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
24 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
24 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
0answers
18 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 ?
3
votes
3answers
179 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 ...
1
vote
1answer
16 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 ...
0
votes
0answers
16 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
0answers
10 views

stack too deep user function [duplicate]

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
1answer
23 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 ...
0
votes
1answer
20 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 ...
0
votes
2answers
19 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 ...
1
vote
1answer
14 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
19 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
0answers
8 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
9 views

How much gas does looking up block.timestamp consume?

Trying to get some insight as to whether or not it's more optimal to call block.timestamp repeatedly for comparisons or to set a (memory) variable to hold the value and use it instead. I've looked at ...
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
0answers
10 views

Parity synced at not existing block 4839212

I have problem with parity, cant get synchronization in archive mode to end, anything, changing arguments, max-, min-, snapshot-peers, parity verisions do not help. I have blockchain in archive mode ...
0
votes
0answers
9 views

Java class generated with web3j has a “deploy” method wherein initialWeiValue, initialSupply have to be both specified. Isn't it the same amount?

Method in the java class generated by web3j is like this: public static RemoteCall<Crowdfunding> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, ...
0
votes
1answer
18 views

What happen when I format my blockchain setup PC? [on hold]

Suppose I have ethereum blockchain network setup in my PC and when I format my PC how I will recover my data? Normal in client server architecture my data doesn't depend on my PC whether I format or ...
0
votes
1answer
11 views

VM error transaction has been revert to initial state [on hold]

pragma solidity ^0.5.8; contract PharmaChain { address public superAdmin; //address of the super admin uint quotlist; enum Status { NotExist, Pending, Aproved, Rejected, ...
1
vote
0answers
14 views

truffle unbox react - front end is unable to read / set state of the contract

I am experiencing problems with the Truffle React boilerplate code that the front end is unable to read / set state of the contract. Here are the details: I unboxed the React boilerplate using ...
1
vote
0answers
5 views

Access to XMLHttpRequest at 'https://ropsten.infura.io/' from origin 'null' has been blocked by CORS policy

I want to interact with a simple contract on the ropsten network this is my Js code : Web3 = require('web3'); if (typeof web3 != 'undefined') { web3 = new Web3(web3.currentProvider); console....
0
votes
1answer
15 views

How do I deposit Ether to Smart Contract using Web3.js

So I am creating a web application that interacts with a smart contract that I deployed on the Ropsten TestNet. I am able to withdraw ether from the contract to my Metamask account using a withdraw ...
0
votes
0answers
15 views

How use vscode to debug geth with breakpoints interactively?

I set up vscode enviroment and launch a node with launch.json: { "name": "Launch geth main", "type": "go", "request": "launch", "mode": "debug", ...
0
votes
1answer
40 views

Unable to deploy the smart contract using solc compiler in mac

I am trying to deploy the Lottery contract using solc compiler of verison 0.4.17 but it's showing me nothing. But the same contract is working good in the remix ide. I providing you the the Solidiy ...
0
votes
1answer
37 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 ...

15 30 50 per page