All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

I can't see smart contract's value in my web browser

I have compiled myself smart contract in Truffle. But when i use its js app (that there is in src file from pet-shop box downloaded) to interaction with my smart contract, i can't understand how i can ...
0
votes
0answers
8 views

Multiple callbacks with provable random oracle

I'm making a simple lottery game where there are hourly, daily and weekly prizes. My contract has functions to pick winners for each of these game types. Each game types will have different number of ...
0
votes
0answers
13 views

How i can exchange the erc20 with ether

i want to make crypto to crypto smart contract where i need to sell erc20 token and on buyer side i need to calculate the price which i have to send to seller and i have a price of token can you ...
0
votes
1answer
13 views

What is nodekey of bootnode command?

My understanding is that bootnode --genkey commands generate private key of node, and bootnode --writeaddress commands generate public key of node. However, why node needs private key and public key?...
0
votes
0answers
11 views

How to assign event output to variable when testing?

I'm using Truffle test(chai/mocha) and openzeppelin-test-helpers. Can anyone help me about how to assign values from event to variables in the above testing environment?
0
votes
0answers
13 views

Is there a graph data structure in solidity?

I am trying to achieve a file lineage information Dapp and I need a graph kind of data structure for that. I know I can always write one but is there a ready to use data structure that is efficient ...
0
votes
1answer
12 views

How to Open console In geth 1.9.10

I am currently using geth in windows and 1.9.10LTS version of geth. I have to Open geth console, but when i try to implement geth console or geth attach or geth attach ipc:\\ .\pipe\geth.ipc it doesn'...
0
votes
1answer
12 views

Always raising “Gas required exceeds allowance or always failing transaction” when the condition of require() is not met

I tried to run the following code to check the error message when the condition of require() is not met. pragma solidity ^0.5.16; ... function addUser(string memory name) public returns (int) { ...
0
votes
2answers
25 views

How to calculate the token price of already deployed ERC20 tokens

I am creating a smart contract, so inside that I have to pass the token in contract and the value of ether will be calculate on behalf of token price please help.
1
vote
1answer
10 views

Execute transaction Approve directly against contract address (without ABI)

await this.state.currentAddress.methods.approve("0x8b4a5682189361ce56702260051900f74d76e08b", amount).send({from: this.state.accounts[0]}); I have the following line in react. It is how I think I ...
0
votes
3answers
20 views

Can an NFT (e.g. ERC721) simultaneously belong to two different entities, say an user Owner, as well as a user Custodian?

For example, on the blockchain say you own a ERC721 Car token at your wallet address, but you want to park it in the ERC998ERC721 top down composable Garage owned by your friend, while still retaining ...
0
votes
0answers
23 views

Cannot run mint function on token contract using Upgradeable Proxy Pattern

I am not able to get the mint function on my token contract to run successfully via delegatecall. I am using a simple implementation. There is a Proxy, which is Ownable and manages storage, it falls ...
0
votes
1answer
16 views

Can i disable direct transactions to smart contract address?

I wanna use rewardsAmount variable to calculate my rewards: uint rewardsAmount = 0; // Only here i can withdraw rewards function withdrawRewards() onlyOwner external { require(rewardsAmount != ...
0
votes
1answer
13 views

How to diagnose a “Error: Transaction has been reverted by the EVM”?

This the error intercepted from my javascript, using web3.js Error: Transaction has been reverted by the EVM: { "blockHash": "...
2
votes
1answer
17 views

How to check if a mapping has not been written yet?

I have this mapping: mapping (uint256 => string ) private storedData; I am trying to do this: modifier dataNotStored(uint256 _index) { require( keccak256(abi.encodePacked(storedData[...
0
votes
1answer
20 views

send erc 20 tokens with full code example

I apologize for posting another question. Here I'm giving the full example code which is giving me the respond: "txHash undefined" when I try to send erc20. I want to fix this code. If you have even ...
0
votes
0answers
18 views

Error: connection not open on send()

I'm using "web3": "^1.2.4" This is how I connect to 'wss://kovan.infura.io/ws' const web3 = new Web3(new Web3.providers.WebsocketProvider('wss://kovan.infura.io/ws')) instance = new web3.eth....
0
votes
2answers
15 views

Tokens & Smart Contract “Upgrade”

I'm not very technical, but I have a question. Supposing that a Smart Contract is being upgraded to a new one, would it be possible in the new contract to not send new tokens to certain wallets? So ...
0
votes
1answer
15 views

GasPrice: is dipendent by the moment of the call and/or the network?

I'm testing a system to store a small amount of data on the blockchain using a contract. So I've some js using web3.js to make a call to a contract function that mutates states. I obtained, using ...
0
votes
2answers
20 views

Project ID is required

I got an error at sendSignedTransaction is : Project ID is required. Can you please let me know that what is the actual problem? This is my code: try { const ethereumUri = 'https://ropsten....
1
vote
2answers
114 views

How is authorization handled in smart contracts

I have deployed a Quorum network on Azure Block chain service to be used by specific invited members of a consortium. I have not yet explored the privacy features provided by Quorum on top of Ethereum....
0
votes
0answers
17 views

Unfulfilled Promise From A Metamask Transaction

I'm having a problem with my JS code pausing on the let result line. Metamask prompts me to approve the transaction initiated in the line (which I do), but then doesn't proceed any further. As the ...
0
votes
1answer
18 views

How to resolve this error in solidity “The constructor should be payable if you send value.”?

In this solidity code the finalizeRequest() is giving a run-time error. Here is the error : Campaign.finalizeRequest(uint256) 0x692...77b3a transact to Campaign.finalizeRequest errored: VM error: ...
0
votes
2answers
9 views

What is the privatekey to be used to sign web3.js transactions?

I created an account on metamask, and downloaded the json of my wallet. It's on rinkeby. The structure of the json is { "version":3," id":"...", "address":"....", "crypto": {...
0
votes
2answers
17 views

Sending data outside the blockchain

Once a transaction is committed to the blockchain is there a way to let an entity outside the blockchain (i.e. An entity that is not a node in the blockchain) know that a particular transaction has ...
0
votes
1answer
21 views

Calculate most frequent value in a array in solidity

I have an array something like [0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2]. I want to find the most frequent value. If two are more are having highest frequency, the first occurance should be the result. ...
0
votes
1answer
7 views

Truffle test: “Cannot read property 'gasUsed' of null” error. Truffle migrate works fine

Whenever I try and do truffle test I get the error Cannot read property 'gasUsed' of null But truffle migrate --reset works fine More confusingly, to rule out something in one of my tests that is ...
0
votes
0answers
10 views

Can we use geth for production?

Is geth ready and stable to be used for production? Can we install using --fast switch if we will use main net? How many GB will require? I ask becase we are planning to develop a DApp and we ...
0
votes
0answers
21 views

Not able to call the solidity function through App.js? Anyone know how to call a solidity function?

I'm trying to call a Solidity function from App.js, but I'm unsuccessful even after a number of tries. Its a very simple function betOnTeam(). Inside this function I just want to check condition and ...
0
votes
0answers
5 views

Cannot convert truffle-contract.min.js:1 undefined or null to object

I got this error in the chrome comsole while i do npm run dev for my fornt-end of smart contact. And also, page stuck in the my loading commnad. All of my code is in the link app.js truffle-...
0
votes
0answers
17 views

Error => invalid address, on passing arguments to function

so I created a function but then I needed to make it dynamic so that I will be able to call the same function body just bypassing the arguments on click of a button I am fetching the values from HTML ...
0
votes
1answer
18 views

Problem with understanding Buyer address

My account address on Remix IDE is 0xCA3…a733c and wallet address is 0x147…C160C. Following is my code obtained from Solidity Tutorial. In this code, buyer address is passed as an argument. I have got ...
0
votes
1answer
12 views

Problem with understanding Ether log

Is transaction log also called trnsaction receipt? My account address on Remix IDE is 0xCA3…a733c and wallet address is 0x147…C160C. Following is my code obtained from Solidity Tutorial pragma ...
0
votes
1answer
9 views

Difference between account, wallet and deployed addresses: Remix IDE & Code

When I am executing the program on the remix IDE (got from internet), it asks me the address, _wallet, which I am passing in the constructor. Remix IDE shows me 3 addresses: Account, Deploy _wallet ...
0
votes
2answers
19 views

Trying to reference function from parent contract - Member “xxx” not found or not visible after argument-dependent lookup in address

I am trying to make a parent contract which deploys a child-contract for each unique caller (which does not inherit from parent contract, but calls one of the parent's functions). I have looked up ...
0
votes
1answer
20 views

Fire transaction from contract

I have a contract holding a mapping like this: mapping (address => User) users. How can I get the contract to automatically fire a transaction/event when a certain condition is met? For example, ...
0
votes
2answers
30 views

Invalid opcode exception when trying to resize a storage array

I wrote this function: function removeClaim(uint256 _claimId) public returns (bool success) { require(msg.sender == owner || msg.sender == claims[_claimId].issuer); // Emit event and store ...
0
votes
0answers
12 views

MetaMask - RPC Error: JsonRpcEngine: Response has no error or result for request

I am running a Truffle react box and encounter the following error when I try to confirm a transaction via Metamask: MetaMask - RPC Error: JsonRpcEngine: Response has no error or result for request: ...
2
votes
4answers
41 views

ABI and Bytecode stored inside Contract

I was scrolling around Ethereum StackExchange and I came across with an interesting thought that I have never read or seen anyone talk about. I'm perfectly aware of how contracts work and are ...
0
votes
1answer
14 views

web3.php - How to call a contract function that mutates states?

I'm creating web3 instance $web3 = new Web3( new HttpProvider( new HttpRequestManager( config('infura....
0
votes
1answer
24 views

Truffle- how to deploy ERC20 on local, but not public network, without the error “X is an abstract contract or an interface and cannot be deployed”?

So, I have a contract, let's call it contract A, that needs to make call to the Dai contract (referred to as Cash). This contract already exists on Kovan, so in 2deploy_contracts.js I simply set its ...
0
votes
1answer
18 views

How to call such a function? (pass argument)

For example, here is the code What will the best code practice, either to repeat the code inside two different functions or what can I do? OraclizeContract.deployed().then(function(instance) { ...
1
vote
1answer
18 views

How to send transaction using web3 contract instance from address which is not a node's account

I succeeded creating transaction from node's account(created by ganache) to a contract using web3.js . const contract = new web3.eth.Contract(abi, contractAddress, { from: from, gasPrice: ...
0
votes
1answer
21 views

Which Pattern to follow to create contract?

I have an ad campaign and I want to store data(like campId, number of impressions, start date, end date etc.) of each campaign on blockchain. Also, whenever I will pass campId, I should be able to ...
0
votes
1answer
12 views

Why geth switch to full node when starting

I start my geth with --syncmode "fast" but I get this warning: WARN [01-21|14:47:59.148] Switch sync mode from fast sync to full sync And my geth will start with full sync mode with this warning. ...
1
vote
1answer
23 views

callback vs on function in sendsignedtransaction

I am deploying a smart contract using web3js and it works perfectly. But i was made aware of my incorrect use of callbacks. I got some basic understanding of promievents from https://web3js....
1
vote
2answers
21 views

Node JS problem Interacting with Ethereum Smart Contract

I'm having only partial success with a Node.js script I wrote that interacts with one of my Ethereum Smart Contracts. Here's what's working: -I'm able to call methods in the Smart Contract from my ...
0
votes
1answer
26 views

how to transfer a specific balance from a smart contract?

Whenever someone buys a smart-contract the amount (in Wei) get stored in SC(Smart Contract) address(this) += msg.value. Now I am trying to create a function to redeem the balance of the SC ...
0
votes
1answer
13 views

Wrong version of web3.js

$ npm show web3 web3@1.2.5-rc.0 | LGPL-3.0 | deps: 8 | versions: 115 Ethereum JavaScript API https://github.com/ethereum/web3.js#readme ... $ node app/test.js VERSION { api: '0.18.4', node: [...
1
vote
1answer
15 views

Simulate how a transaction will affect state before it is mined

My program needs to know how the transactions in the mempool will affect the state when mined. Does anyone know of any tools to help with this? I know I can do it manually with ganache --fork, but I ...

15 30 50 per page