All Questions

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

Whats the cheapest/most gas efficient way of converting bytes32 to uint24?

I have an array of bytes32 with various pieces of information at various byte positions in it, and 2nd 3 bytes are a number, which I convert to uint24 like so: function setData(bytes32[] memory data) ...
0
votes
0answers
4 views

How to create blockchain nodes locally

For educational purposes I am implementing a blockchain from scratch without the use of any frameworks. How would I go about testing my blockchain using multiple nodes when I only have access to one ...
0
votes
2answers
17 views

Order of transactions in the same block

I am writing a Medium blog post about front-running and can't seem to find information about the order of the transactions in the same block. I have executed two trades, one with the lower fee, call ...
0
votes
0answers
8 views

web3.js - Subscribe multiple addresses and new coming address

I build ETH wallet app by using web3.js. My concept is the new ETH address will generate when user is registered on my app and when they send ETH from other address on another app or whatever to the ...
1
vote
0answers
13 views

exponential function with fractional numbers

With solidity, we cannot directly calculate 0.1 or 0.001. We usually use decimal multiplier and divisor integer to calculate those numbers like this 0.01 = 1 / 100 When the number is more than 1, it ...
0
votes
0answers
5 views

Unable to render inside (callback function) using react for web3.eth.subscribe

import React from 'react'; import ReactDOM from 'react-dom'; import Web3 from 'web3'; class App extends React.Component { componentWillMount() { this.loadBlockchainData() } ...
0
votes
0answers
7 views

PoA network confusion resolving using geth

I am planning to move from PoW to PoA consensus (clique) using geth. But I am confused of some of the topics - 1) Empty blocks are created periodically? What is the size of an empty block? 2) Is it ...
0
votes
0answers
24 views

Cannot create contract from another contract - truffle and ganache

I'm trying to write a test with ganache and truffle to create a contract instance from another contract. Everything works in Remix but it doesn't in ganache. This is the code const assert = require('...
0
votes
0answers
7 views

MultiSigWallet issue

I need to implement a token that´s minted by a process verified by 4 peers, for that I´m going to use MultiSigWallet code (GitHub) and I´ve do some changes to adapt it but the modifier "notExecuted" ...
0
votes
0answers
10 views

Accessing Ethereum network via JSON RPC from wallet balance/transactions

sorry if the question is silly.... I am tying to build a simple app that checks ETH wallet addresses balances and transactions (for both ETH and Tokens). As far as my knowledge goes, I think that I ...
0
votes
1answer
15 views

How do I prompt metamask to open?

I'm using react and javascript. For whatever reason, I've tried a few methods and it doesn't seem to be opening metamask. await window.ethereum.enable(); and window.web3 = new Web3(web3....
1
vote
1answer
17 views

Use a token for two use cases

So I've created a token for my Dapp. I want to have users buy tokens to vote in my app and "elect" people. I also want to use them agin in a court like system. Essentially, I want token holders to be ...
0
votes
0answers
12 views

How to detect Solidity library from bytecode?

Can I tell just from the bytecode if the contract at a specific address is a library. The use case can be if I want to use an external contract with delegate call but I don't have the contract code or ...
2
votes
0answers
20 views

Solidity Contract and Library difference

I am learning to program Solidity and just playing around with it in remix. I am creating compiling the following code in Solidity: pragma solidity >=0.4.22 <0.6.0; contract Ballot { ...
0
votes
2answers
12 views

How to use sendSignedTransaction without waiting for confirmation?

I am sending ether to multiple accounts and I want to send them without delay or waiting for confirmation of previous transaction. const fs = require("fs"); const os = require("os"); const Web3 = ...
0
votes
2answers
19 views

Sending ether from list of addresses with web3.js

I would like to read the csv text file and make a transaction via web3.js like what I did with web3.py Here is my python code #!/usr/bin/python3.7 import os import time import pandas as pd from ...
0
votes
0answers
15 views

How to run some mine testing locally?

So I'm looking at this example. And they the following example for how to make a PoW function. bytes32 public currentChallenge; // The coin starts with a challenge uint public timeOfLastProof; // ...
0
votes
0answers
16 views

Difference between method id, event id and ABI signature for event

I am confused as to what is the difference between method id, event id and abi signature. I got the abi signature of a token transfer function according to the following web3js function const ...
0
votes
0answers
13 views

Truffle contract bytecode not updating with library address

After deploying a library using truffle, I want to compile a contract and use the library address inside its generated bytecode. Now inside the contract bytecode I get something like _DateTime______. ...
1
vote
0answers
15 views

Retrieve block number from geth and display it on my webpage

I am running geth using this command: geth -testnet --syncmode light console and I am trying to retrieve the block number from geth and display it on my web app. In geth when I type: eth....
0
votes
0answers
23 views

I'm super new to all this Ethereum stuff. Can anyone suggest me a place to learn how it works?

I've been tasked with writing a blockchain-based application (probably written in JS) that can be used to certify documents. I've done some research into where I can get stuff hosted (Infura looks the ...
0
votes
0answers
17 views

ParserError: Expected token Semicolon got 'Return'

The error pops up whenever I try to compile through truffle, not able to figure out a solution any help is highly appreciated. Here is the error Compiling your contracts... ==========================...
0
votes
1answer
16 views

How do i keep a contract's value changed by another one constant?

There are 3 contracts; A, B, and C. C has a state variable that initialized null. A changes that state variable to Yerevan. After that, B sees that variable. Evaluating by A is successfull but B sees ...
0
votes
0answers
20 views

Migrating 2 contracts in one Contract.sol script using 'truffle migrate'

I have 2 contracts in 1 .sol file and when I run 'truffle migrate', it tells me that it has deployed 1 of the contracts and given me an additional error: Blockquote Invalid number of parameters ...
0
votes
1answer
27 views

How to estimate gas in an address with no ETH at all

Say I have received an ERC20 token in my address. Such address has no ETH and no other tokens except the one I just received. If I try to estimate the gas cost of sending the token from that address, ...
1
vote
0answers
7 views

What are the differences between Drizzle and the Truffle React box?

Truffle has many "boxes", two of which are: truffle unbox react And: truffle unbox drizzle They both seem to be focused on frontend development. Other than Drizzle being based on a Redux store, ...
0
votes
0answers
11 views

Automatically set app instance in Truffle console

Is there a way to load the truffle console with the following variables without having to do manual type-ins on every test? let app = await MyContract.deployed(); let accounts = web3.eth.getAccounts()...
1
vote
1answer
36 views

How to kill a contract in ethereum?

I'm trying to kill this contract /** *Submitted for verification at Etherscan.io on 2016-08-31 */ //sol Wallet // Multi-sig, daily-limited account proxy/wallet. // @authors: // Gav Wood <g@...
0
votes
0answers
22 views

Solidity - can I predict reverts?

I have a voting system and admin groups contracts. Each admin group (it contains array of addresses allowed to vote) can grab a voting contract and vote for changing code in my contracts environment. ...
0
votes
1answer
18 views

Not able to add 'replayPastTransactionsFlowable' transaction logs result into an collection List object using Web3j java?

I'm trying to create an api where i have to provide transaction logs in json objects but im unable to add result of replayPastTransactionsFlowable into an collection object @GetMapping("/test") ...
0
votes
1answer
23 views

Why Remix IDE asks for CallData and what value we have to give?

In my several programs which I ran through remix IDE, I got a CallData text box. I don't know what value I have to give to this Calldata text box. I tried the following: from: address : "...
0
votes
1answer
19 views

Importing OpenZeppelin loads all node_modules contracts into Ganache

I install OpenZeppelin's contracts npm install @openzeppelin/contracts Create a contract: pragma solidity ^0.5.0; import "@openzeppelin/contracts/token/ERC20/ERC20Mintable.sol"; contract NewCoin ...
0
votes
0answers
13 views

How to customize my own 0x exchange

I would like to know how my custom ERC721 0x marketplace can be customized. I know the FAQ has a walkthrough and I already found out how to inject my custom ERC20 token address, symbols etc. but I ...
0
votes
1answer
26 views

How to pass parameters into test script

I have a voting solidity file here: pragma solidity >=0.4.21 <0.7.0; // We have to specify what version of compiler this code will compile with contract Votingapp{ /* mapping field below is ...
0
votes
0answers
10 views

How can I retrieve the ETH stored in the contract for a now invalid ENS domain name?

A couple years ago, I bid on a domain name through the Ethereum Name Service (ENS) that is not valid, as it is considered a subdomain. For example, something like "apple.uk.eth" which should not be ...
0
votes
1answer
19 views

How to replace specific bytes at an index in a bytes32?

I have a bytes32 that I plan to pack with 10 bytes3 at specific indexes without affecting the other bytes already set. So for instance if I had a bytes3 of 0xABCDEF into bytes32 at the index 3, it ...
0
votes
0answers
29 views

Gas required exceedes allowance when invoking a pure function

So, I got a problem when interacting with a smart contract in geth. I have this very simple contract: pragma solidity^0.6.1; contract Simple{ uint256 public number = 1; constructor() public { ...
0
votes
1answer
27 views

Can I make an ethereum token that runs a certain function every 15 seconds?

I have a rinkeby token, and I wanted to add "merged mining" when someone mines a block, they get awarded 0.25 of that token. function issueBlockReward() { balanceOf[block.coinbase] += 0.25; The code ...
0
votes
0answers
18 views

Access to smart contract's value in Browser

My Truffle project is this contract that just shows Yerevan is love: pragma solidity ^0.5.12; contract TEST{ string public note="Yerevan is love"; function rep() public view returns(string memory){ ...
0
votes
0answers
14 views

Reading all ERC20 token balances

I am aware that the ERC20 balance is easily obtained in web3js by calling token.methods.balanceOf(ADDRESS); However, I was wondering if there are any new developments or API that can now be used ...
0
votes
0answers
7 views

How to update Data on UI

I have a UI thats connected to metamask The UI updates all the Info now on address change and when metamask is enabled How can i make my UI update every second? so it always shows accurate stats on ...
0
votes
1answer
32 views

how to send erc20 token without using smart contract abi?

How to transfer erc20 token without using contract or contract abi? The below script i have used to create Signed Raw Transaction to send Ether(ETH). How can i create Signed Raw Transaction to send ...
0
votes
0answers
31 views

How to get Ethereum transaction list by address in java web3j quickly?

Im trying to fetch transaction logs from ganache using web3j library to send it as an api ,is there any way where i can get all transactions from ganache quickly? @GetMapping("/test") public List&...
0
votes
1answer
32 views

Explicit type conversion not allowed from “bytes32” to “address”

I am using solidity 0.5.0 when i compile code i am throwing exception as Explicit type conversion not allowed from "bytes32" to "address". code is working fine in remix IDE and my code is as ...
0
votes
1answer
20 views

Does metamask uses web3?

I was curious if metamask uses web3 for communication with eth node ? I tried google for it; showed bunch of other results but didn't precisely answered my question. Indepth answer on how metamask ...
0
votes
1answer
18 views

Help on recovering wallet through brute force or from extension data (Bounty on recovery)

I know 10 of 64 characters (hex) of my ethereum private key unencrypted and their positions. I also know the corresponding wallet address. Is a brute-force possible? What I am thinking of is ...
0
votes
1answer
25 views

Transfer money between accounts in solidity

I am writing a contract where I want to transfer money (present in the contract owners account and not the contract) to an account address passed to a function in the contract. for some reason this ...
0
votes
0answers
10 views

Conditionally Return Content Based On Wallet Tokens

Hi all– new to building dapps. I'm working on a little web game that returns content based on what tokens you hold in your wallet. I'm used to building web apps and mobile apps, but I've never worked ...
0
votes
0answers
11 views

All tokens created on ethereum use (ETH) gas to pay for the transaction fee. What about other currency like Waves?

I just wonder to know if other crypto platform (like Waves) use its main currency (eg.waves) to pay for transaction fee when a user transfer his own-created Token to other user's address (like what ...
0
votes
0answers
10 views

Borrow Maker DAI or Exchange

Why would one borrow Dai instead of buying from exchange ? if i have $150 worth ether i can borrow $100 worth Dai. With 8% stability fee basically at 8% interest rate. On the other hand i can just ...

15 30 50 per page
1 2 3 4 5 560