All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
21 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
53 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
31 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
22 views

This declaration shadows an existing declaration(problem with compile) [closed]

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
22 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/...
1
vote
1answer
25 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
20 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
44 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
21 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
39 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 ...
-1
votes
0answers
12 views

Failing in my first blockchain [closed]

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
10 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
20 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
60 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
32 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
1answer
17 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
31 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 ...
1
vote
1answer
17 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; ...
0
votes
0answers
26 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
18 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
19 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
21 views

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

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

Using Drizzle w/ React Native for User Login [closed]

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
9 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?
2
votes
0answers
19 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
15 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 ...
5
votes
1answer
97 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
22 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
211 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
11 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
35 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
23 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
23 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
14 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
11 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
16 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
21 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
12 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
11 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
22 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
17 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
14 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
12 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?
0
votes
1answer
31 views

How can we lock ETH in user wallet without escrow contract?

I know the logic of using an escrow contract in which 2 or more users send their wagered ETH to a smart contract acting as escrow proxy, and then after some decision contract executes we release the ...
1
vote
0answers
16 views

Sharing an event between a contract and a library

I've a contract that uses an event and I want to share it with a library without having a duplicated definition. The event is in the library, and contract uses it from the library. It works but the ...
1
vote
1answer
32 views

Is a Hash Function really useful in a Smart Contract Election?

Noob here. Was reading this: https://karl.tech/learning-solidity-part-2-voting/ From my basic understanding, a hash function: Receives an input (like x) and spits some result (like y) y is ...
0
votes
0answers
12 views

Error: CompileError: InternalCompilerError: Stack too deep, try removing local variables

Hello everyone please kindly help me out. I have researched on the error above associated with this block of code. But please is there a way to revise this code so that i can get all the data of a ...
0
votes
1answer
74 views

Swap ether to tokens on Uniswap V2 Router 02 fails

I am trying to buy DAI tokens from my smart contract using IUniswapV2Router02 contract BuyExample{ IUniswapV2Router02 usi = IUniswapV2Router02(...
0
votes
1answer
27 views

deploy contract with ether.js

Im trying to figure out the best way to deploy a contract programatically using ethers.js with web3 I can just do: const contractInstance = new this.web3.eth.Contract(contractObject.abi) var ...
1
vote
0answers
12 views

BlockNumber stuck on 0 while a private network node is looking for peers

I'm extremely new to Blockchain and mining, and I've followed this tutorial to create my first private blockchain. I am stuck when it comes to mining and I'm afraid I'm quite lost. Afte I've started ...

15 30 50 per page