All Questions

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

Solidity ^0.6.10 returnBalance() returns “VM Exception while processing transaction: invalid opcode”

I am using Ganache and Truffle console. I compile and migrate the following contract: // SPDX-License-Identifier: MIT pragma solidity ^0.6.10; contract EthReceiver { address payable private owner;...
0
votes
0answers
10 views

Fast sync ain't fast enough

I'm running geth with --syncmode=fast --cache=4096 --maxpeers=50 My laptop runs like crazy, but it's never able to reach the top of the chain (blocks are at the moment been created ~ once every 14 ...
0
votes
0answers
6 views

Is there a way to get revert message by my client?

I have a smart contract with this simple function: function addUser( string memory _username, string memory _nome, string memory _cognome, string memory _email) public isOwner() { require(bytes(...
0
votes
1answer
12 views

In MetaMask (web3.js 0.20.x) how to get events happened during a transaction?

In MetaMask (web3.js 0.20.7) I send a contract method with .sendTransaction(). Now I need to check the values of arguments of UpdateItem event created by this contract during the call of this method. ...
0
votes
0answers
16 views

Is there a tool to add SafeMath to production code?

There are a lot of tools to prepare JavaScript/CSS code for production, e.g. to minimize, to convert ES8 code to ES5. Is there a tool to automatically apply SafeMath library to a .sol file? The ...
0
votes
0answers
25 views

How do i withdraw Eth from a contract i created

New to blockchain.. havent a clue.. I managed to create a new contract with Eth. I moved money from MyEtherum Wallet to Metamask and into a contract, somehow? I have no coding experience but need ...
0
votes
1answer
19 views

Weird exchange rate when buying DAI with Ether

I wrote code to buy DAI using ETH on Uniswap V2 as follows: function buyCryptoOnUniswap(uint256 etherCost , address cryptoToken) public payable returns(uint256){ //address cryptoToken = ...
-1
votes
0answers
16 views

This declaration shadows an existing declaration(problem with compile)

function isOwner(address _owner) public view returns (bool isOwner) { return owners[_owner]; } function isOwnerChoice(address _owner, address _newOwner) public view returns (bool ...
0
votes
1answer
15 views

Compilation Error

Hi guys I got this error when I try to compile using truffle develop. truffle(develop)> compile Compiling your contracts... Compiling ./contracts/StarNotary.sol /mnt/d/Blockchain/...
0
votes
1answer
13 views

How to install solc of a specific version?

I want to install solc 0.4.24 but the commands given below installs the new version. sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc Or sudo snap install ...
0
votes
1answer
16 views

Finality in blockchain consensus

Is Absolute/ Immediate Finality a goal in blockchain consensus or does some areas work better under probabilistic finality such as Ethereum's Pow and to be PoS? (I know that some networks using BFT ...
0
votes
1answer
36 views

In Solidity, what's the difference between funtion type and funtion? [closed]

In Solidity, what's the difference between funtion type and funtion? And what can they be used for and how respectively? Thanks!
0
votes
1answer
14 views

How to implement “Mint” and “Own” in an ERC20 Token

So, I recently created a standard ERC20 token but I need to implement "mint" and "owner" functionality. I see that in older implementations but openzeppelin no longer has contracts ...
0
votes
1answer
30 views

Solidity Smart Contract withdrawal ETH with amount from contract address does not work

I have below smart contract and a test program to test transfer ETH out of contract address, but contract’s ETH balance not changed. I tested withdrawAmount(uint256 amount) but the assertion error ...
0
votes
0answers
21 views

Types in Solidity [closed]

I have uint256 number. I need transform this number in binary or string format for my goal. What is restrictions in transfor and work with present formats exist in Solidity? What is the libraries ...
-1
votes
0answers
10 views

Failing in my first blockchain

I am learning blockchain, but it has been impossible to pass from this error: Fatal:account unlock with HTTP access is forbidden. I am using Ubuntu in a virtual machine. Please help me
1
vote
1answer
7 views

Security of Exclusively using MetaMask's Account as a Login Process

I am currently developing a Dapp in vue.js/node.js which will use MetaMask to interact with the Ethereum Network. I have the following code implemented in a JavaScript module. import web3 from 'web3';...
1
vote
1answer
12 views

method like fallback function for ERC20 tokens?

I want to write a contract that uses USDT (Tether) for payment. How can I use the ERC20 token as an ERC777 token, for example: Use a fallback function that executes when we receive USDT token. Or use ...
0
votes
0answers
19 views

Get the txHash,but on etherscan I get “Sorry, We are unable to locate this TxnHash”?

So Im having some trouble with sending ETH from one account to another trough web3 with an erc20 smart contract and I`m using Infura RPC. So, my process is to send 0.2 ETH from account 1 to account 2 ...
0
votes
0answers
18 views

Encrypted information

First of all, excuse me if this is not the section to ask. I'm trying to find out what information can be encrypted inside the blockchain, i.e. should all the information written in the blocks be (...
0
votes
0answers
11 views

How is the volume for the currency pair accounted for on chainlink's reference data feed?

https://feeds.chain.link/ - link for reference. Let's take the LINK/USD feed for example: From my understanding, the aggregation contract fetches the price of LINK in USD from the node operators who ...
0
votes
1answer
26 views

How can a smart contract determine the address sending ETH to it?

I'm learning how to build a smart contract that is able to receive ETH and, if certain conditions are met, send ETH back to the address from which it received it. My understanding currently is that a ...
0
votes
0answers
13 views

using mappings inside structs

I'm trying to use a mapping inside a struct: struct PoolStruct { uint currentUserID; uint activeUserID; uint price; uint minimalReferrals; mapping(uint => address) poolUserList; ...
-1
votes
0answers
11 views

Function call detection in Metamask

For quite a while I studying how Ethereum and Bitcoin network works and other information related to it. When it comes to DAPP development on the Ethereum network, we cannot ignore Metamask as a ...
0
votes
0answers
18 views

Exchanging tokens to ETH using Uniswap (v1)

I am trying to create a simple function that buys a token from uniswap (v1) and then immediately sells the token back to ether. I am able to buy successfully but when adding the calls to the sell ...
0
votes
0answers
16 views

Why do solc v0.4.17 and v0.4.18 behave differently with the allow-paths primitive?

Here's an example contract: Nobody.sol pragma solidity ^0.4.17; contract Nobody { function die() public { selfdestruct(msg.sender); } } The solc JSON specification to compile the ...
0
votes
0answers
14 views

How to backup and restore a Geth server in full mode?

I had the experience of losing a Geth server due to some unknown software issues and whatever I could do for that time was moving keystore files to a new server. But it was a Geth server in fast mode. ...
0
votes
1answer
16 views

Error: while migrating Event: invalid address (arg=“benificiaryAddress”, coderType=“address”, value=undefined)

let Event = artifacts.require("./Event.sol"); const field= { nameOfEvent : "Music", ticketCount : 100, ticketCharge :10000, durationInMinute :1200 } module....
0
votes
0answers
7 views

Using Drizzle w/ React Native for User Login

Making a react native app and I'm using drizzle. I'd like to instantiate the Drizzle object with the logged in user's accounts. Currently it's taking the accounts from my ganache testchain described ...
0
votes
0answers
8 views

DAO tokens from ether wallet [duplicate]

I just got access to a old ether wallet with all my DAO tokens. Is it too late, no way to convert them back to Ether? any way at all?
1
vote
0answers
14 views

How does chainlink solve the oracle problem? [closed]

I've heard a lot about Chainlink recently -- how Synthetix, Aave and other top Defipulse projects are using them. How exactly does Chainlink solve the oracle problem from a technical perspective?
1
vote
1answer
11 views

WalletConnect w/ react-native

Anybody used WalletConnect in react-native? How do you genreate a topic and key for the URI? From the docs: Android has the easiest integration as it's operating system is designed to handle multiple ...
4
votes
1answer
31 views

Why do I need decentralized oracles?

I've been reading a lot about how smart contracts work, and I'm a little new to the area, but why do we need decentralized oracles? It feels like I can just make an API call from wherever and it's OK?
0
votes
1answer
21 views

Why does Remix's jsVM show incorrect gas?

I tested the gas consumption of a contract in the jsVM, which showed consistent outputs. I then deployed it to mainnet, and the function calls consume much different amounts of gas. Is the jsVM ...
0
votes
2answers
60 views

Swap tokens back to ether on Uniswap V2 Router 02 (Sell tokens)

I am trying to do the reverse action of what I did in this question: Basically sell/swap some arbitrary token and receive ether on Uniswap V2 using IUniswapV2Router02. Here is what I have done: ...
0
votes
0answers
10 views

Data storage : mapping vs sub contract deployment

I read over few website, tutorials and answered question here on SE. There is a huge warning about deploying new contract just to store datas. i.e. : bad uint256 public amount; bool public isAdmin;...
0
votes
1answer
20 views

I am getting Error: Project ID is required deploying to ropsten in truffle

I am getting the following error: Error: PollingBlockTracker - encountered an error while attempting to update latest block: Error: project ID is required at C:\Users\myuser\Code Projects\sdfsd\...
0
votes
1answer
14 views

Passing storage of one library to another library

I have two libraries: A and B as well as contract C using them. Library B, in one of its functions, needs to call a couple of functions defined for A.Storage. The code below compiles, tests are ...
0
votes
0answers
10 views

Geth Fatal: Error starting protocol stack: gap in the chain between ancients and leveldb

I'm running a Geth mainnet node. As the size of chaindata is rapidly rising, I moved ancient to an auxiliary HDD plugged in to the same system. Some time afterwards (not sure when, maybe days?) I ...
0
votes
0answers
7 views

Detecting dropped and replaced transactions web3.py

I am using web3.py. Given a transaction hash, is there any way to determine if a transaction was dropped and replaced by another transaction with the same nonce? Currently i am looping w3.eth....
0
votes
0answers
7 views

Getting txpool with python web3 and infura

I am trying to monitor pending transactions with python web3 and an infura node. I am currently using web3.eth.getBlock(block_identifier='pending', full_transactions=True) on a loop to fetch pending ...
0
votes
0answers
14 views

Error: The send transactions “from” field must be defined!

I get this error, even though I do specify the transaction sender.Here is my code: for(let a=1; a<TEST_ORACLES_COUNT; a++) { await config.flightSuretyApp.registerOracle({from: accounts[a], ...
0
votes
1answer
17 views

Invisible transaction

I work in a Ropsten testnet. I have a Python application that sends a transaction and returns the transaction's txHash. It is possible to send a maximum of 500 transactions in one request. The ...
0
votes
1answer
9 views

MetaMask custom RPC connection error with private ganache-cli, EC2

Currently I am trying to build private dapp using ganache-cli as a blockchain backend with aws ec2 instance. I get the expected result when ssh from another shell. request: curl -X POST --data '{"...
0
votes
0answers
9 views

Dynamic two-dimensional array initialisation

I want to initialise a two-dimensional dynamic array. For a one-dimensional array it looks like that: function verify(uint[50] memory input){ uint[] memory input_values = new uint[](input.length); ...
0
votes
1answer
15 views

Token addresses for DAI , USDC and WBTC for IUniswapV2Router02

I have searched a lot but maybe I am looking in the wrong places. Please how can I get the token addresses for USDC , WBTC and DAI that work with Uniswap Router02 on mainnet and kovan. Thanks
1
vote
1answer
13 views

Save stack traces while syncing

I have been working on a project, where I would like to trace all transactions from a block and for this reason I have been using a fast-syncing node. It works well, the only issue is that querying ...
0
votes
0answers
13 views

Error while calling a function,

I created a Factory Contract which can create new ERC20 tokens with the parameters passed to it. Address of the contract: (Goerli Testnet) 0x482829Ba989fBC368F9A89dFf56cdF4036F39F28 I tested the ...
0
votes
0answers
13 views

How to implement full node in Ethereum2.0?

I have been running a full GETH node with Ethereum. When the Ethereum updates to Ethereum2.0 will the same node work or do I need to redo the whole process again? Also do I need to stake ethereum for ...
0
votes
0answers
10 views

How did Ethereum prevent 51% attack in the initial stage?

As far as I've known, Ethereum used Proof of Work as its consensus protocol. In the initial stage, the hash power of the Ethereum Network was small, so how Ethereum prevented 51% attack at that time?

15 30 50 per page
1
2 3 4 5
588