All Questions

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

“Out of Gas” while transferring ethereum from account to contract

I am using ganache to create 10 ethereum accounts. I want to transfer ethereum from one account to a smart contract. I am doing this by writing two following smart contracts in solidity; pragma ...
0
votes
1answer
9 views

How to validate proper implementation of ERC-1155 contract?

I want to implement an ERC-1155 contract. Using TDD we would first write a test. Which begs the question of is there a way to validate that your contract properly implements ERC-1155?
0
votes
1answer
9 views

Error: Explicit type conversion not allowed from “int_const 11111” to “bytes32”

I have the following code snippet: pragma solidity ^0.5.1; contract Puzzle { address payable public owner ; bool public locked ; uint public reward ; bytes32 public diff ; ...
1
vote
3answers
57 views

How does solidity handle mod 0?

Imagine you have a function like this: function compute(uint256 a, uint256 b) external pure returns (uint256) { return a % b; } Does it revert in solidity when b is 0?
1
vote
0answers
11 views

How does getDefaultProvider work in ethers.js?

From the docs: This creates a FallbackProvider backed by multiple backends (INFURA and Etherscan). This is the recommended method of connecting to the Ethereum network if you are not running ...
1
vote
0answers
22 views

Help hacking this contract

This is a very simple contract that I can't hack and I'm stuck, I need some help to get the concepts right. pragma solidity ^0.4.10; contract SimpleToken { mapping(address => uint) public ...
2
votes
1answer
18 views

Is it possible to disable “Stack too deep” errors while in development?

I know about the Stack too deep error and the workarounds for it, but I was wondering whether it's possible to disable it while in development. Is there a pragma experimental flag for this, similar ...
0
votes
1answer
16 views

Web3 - how to add WEI and ETH values correctly

I'm working on an auction feature in my DApp and having problems correctly adding together two WEI values. The contract stores two important values: 1. A minBidIncrement variable - which I've set to ...
0
votes
1answer
12 views

Storing a monero address in smart contracts?

Assuming I would have to store Monero addresses or any cryptonote based coins addresses in a smart contract, would there be any issues? Consider that those addresses are as long as this random ...
0
votes
0answers
8 views

Feeding a contract address to echidna

Simple question: Can I use echidna on a contract address? Like in mythril the command I use is myth -v4 analyze -1 -a 0xec410f642db4a2bcc4d7a69bc13b1165ebad3cea. I don't see any supporting ...
0
votes
0answers
6 views

Getting null on eth_call JSON-RPC for ERC20 transfer function

I'm doing an experiment on checking the transfer(address,uint256) result against the BNB ERC20 token contract 0xb8c77482e45f1f44de1745f52c74426c631bdd52. Assumption: the data field value is ...
0
votes
1answer
7 views

Cannot call functions from another deployed contract that inherits yet another contract

I am just trying this using Remix editor. I am able to call functions from another deployed contract(plain as simple) but when that another deployed contract inherits yet another contract, Now the ...
0
votes
1answer
15 views

How to get absolute value in solidity?

In JavaScript, there is "Math.abs": Is there a similar function in solidity itself or some other popular library such as SafeMath?
-1
votes
0answers
17 views

How to avoid getting zero as random number?

I am generating random number using both oraclize and blocktimestamp, I want to avoid getting zero as random number, I want to set minimum number to 1 instead of 0. How can I do that? Following are ...
0
votes
0answers
4 views

sender account not recognized error when using “WrestlingInstance.registerAsAnOpponent({from: account1}) ”

I'm following the ethereum walkthrough at: https://hackernoon.com/ethereum-development-walkthrough-part-2-truffle-ganache-geth-and-mist-8d6320e12269 I got stuck at account0 = web3.eth.accounts[0]. ...
1
vote
1answer
24 views

What are the steps of deploying a smart contract to the blockchain?

Are the above steps correct for deploying a smart contract to the blockchain: A node creates a smart contract The smart contract is converted to byte code The node creates a block out of the byte ...
0
votes
0answers
19 views

send().catch() doesn't give me the error message anymore

I'm using Truffle/Drizzle/MetaMask and calling methods with send() and using .then() and .catch() and I rely on getting the error message send to .catch() e.g. contract.methods['hello'](arg).send({ ...
0
votes
1answer
16 views

Risk of Messages Not Having a Signature

As per my understanding transactions are signed before sending to Ethereum. Else, no transfer of Ether will happen. However, messages sent to Smart Contracts (SC) aren't signed (e.g., using methods....
0
votes
0answers
7 views

Ethers.js [4.x]: How to estimate gas limit of contract factory deployment?

In ethers.js 4.x there is the ability to estimate the needed gas limit for calling contract functions. E.g.: const estimatedLimit = await contract.estimate.function(parameter) overrides = { ...
0
votes
0answers
7 views

Language on react-native-bip39 seed phrase generate

I had added a chinese simplified and traditional json to wordlist folder, how can I tell it to generate seed phrase with specific language ? https://github.com/novalabio/react-native-bip39 ...
2
votes
1answer
28 views

ecrecover in c++

can anyone spot what I am doing wrong? I am trying to recover the public address from data signed by web3.personal.sign in Metamask and with this code the public address comes out wrong. Hash and hex/...
0
votes
2answers
14 views

How are Ethereum smart contracts deployed?

Im a little confused on how Smart contracts work on the Ethereum blockchain and with DApps. I'm confused with the structure of DApps using Ethereum smart contracts. Is just one contract created when ...
0
votes
0answers
7 views

How will shards be organised after sharding?

Will They be organised to similar shards (gambling shard, Defi shard) by an algorithm or will they be sorted by the market? Will reach shard have an equal limit or will Thier size flactuate and grow ...
2
votes
1answer
34 views

Why Ethereum sets user balance to MaxBig256 whenever a contract query is performed?

There is a strange behaviour on user wallet balances when performing a contract call (that is supposed to have no cost). Balance is right (expected value) until a free call is requested to a contract. ...
0
votes
0answers
9 views

ethereum whisper's method 'addPrivateKey' returning different keyid pair for same private key

Can somebody please explain why running this code produces different key-id pair each time? Is it not supposed to be unique for a given pvt key? web3.shh.addPrivateKey('...
0
votes
0answers
22 views

Getting empty events in response of receipt. I am using Infura+web3.js+ropsten

JS code contract.methods .myFunction( "data1", 1568545262, 1568631662, 1568718062, "0xD4496dA2a4b376fC8s4d786EB6B71483436077c4" ) .send({ from: "...
5
votes
2answers
29 views

Pros and Cons of smart contract upgradable patterns

There have been quite many arguments around how to achieve smart contract updates like Upgradeable smart contracts. I feel Proxycontract with Delegate-call is currently the most famous one. But aside ...
0
votes
1answer
14 views

Error : migrate kovan

From : truffle migrate --network kovan >> ProviderError: VM Exception while processing transaction: revert >truffle migrate --reset --network kovan Warning: Both truffle-config.js and ...
1
vote
1answer
10 views

How to verify the sha256 result of integer 5 in the Zokrates tutorial?

The Zokrates tutorial here starts with calculating the SHA256 hash of (the number) 5. The hex representation of the result is shown at the bottom here: However, I could not reproduce this on my ...
0
votes
0answers
11 views

what to sign to close the contract on JVM?

Full Contract I cannot sign the message correctly thus failing to close the contract.
0
votes
2answers
34 views

How to save an array of address?

I wrote a smart contract PersonalInfo.sol. In this smart contract, I want to save an array of address. Each address is the place where smart contract were deployed. However, each time I deployed the ...
0
votes
1answer
16 views

How DApp actually talks to Ganache ethereum node?

Both Metamask and web3.js seems to be enabling a DApp communicates to a remote ethereum node. There are a few different aspects to developing blockchain applications with Ethereum: Smart ...
1
vote
0answers
17 views

How to allow mobile wallets to sign and access to my dapp

I'm building a dapp application on Ethereum using React & Web3js. As usual the dapp will get the injected provider from Window.web3 (MetaMask), perhaps. The problem that I'm facing now is how can ...
0
votes
0answers
21 views

Why my geth fast node suddenly stopped running?

Fatal: Error starting protocol stack: gap (#3) in the chain between ancients and leveldb when I run geth node for ropsten by : geth --testnet --syncmode "fast" --cache=512 --rpc --ws --shh console ...
0
votes
0answers
18 views

contract not deployed

I am getting this error in the browser console and dont what to do please help... ERROR Error: Uncaught (in promise): Error: Contract has not been deployed to detected network (network/artifact ...
0
votes
0answers
5 views

I need to transfer my ETH from JAXX to Coinbase [on hold]

I have 0.15260000 ETH in JAXX, which I want to transfer to my Coinbase account. I have the original QR code in JAXX and the 'current etherium address' as a screen shot that Jaxx generated when I ...
0
votes
1answer
46 views

Web3-core-helpers error: Uncaught (in promise) Error: Provided address “undefined” is invalid,

When I launch the app with with react.. this error occur when my exchange contract is loaded.. Here is the code i wrote to talk to the blockchain: export const loadBalances = async (dispatch, web3, ...
0
votes
0answers
15 views

how to deploy usdt contract through remix browser [on hold]

pragma solidity ^0.4.11; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b);...
1
vote
1answer
20 views

Useful resources to help understand go-ethereum source code

I am new to ethereum community and I want to study the implementation of Ethereum (e.g. geth) and contribute to the go-ethereum project. However, I find the source code hard to understand by only ...
0
votes
0answers
30 views

What is the difference between calling this two function from another contract by interface? [on hold]

interface ERC20Interface { function transfer(address _to, uint256 _value) external; // <---- A function transfer(address _to, uint256 _value) public returns (bool success); // <---- B ...
0
votes
1answer
22 views

MetaMask listed as “web wallet” on official Ethereum website

MetaMask is listed only in the "web wallets" section of the official Ethereum wallet guide. Obviously, MetaMask is written in Javascript and runs in a web browser. But this is also true of the ...
0
votes
0answers
8 views

How to setup clef signer with clef --stdio-ui

I have geth running on rinkeby network and successfully used clef as a signer using command. clef --keystore ~/.ethereum/rinkeby/keystore --chainid 4 --stdio-ui Also started geth with clef as ...
1
vote
0answers
7 views

fail for read ethereum node base on leveldb.py

I installed leveldb base on python3.6.but when I using leveldb.LevelDB import path for files to be read. a error occered "leveldb.LevelDBError: Corruption: 3 missing files; e.g.: D:/downloads_by_geth/...
0
votes
1answer
29 views

Detect failed token transfer via RPC

It seems like Etherscan can detect failed token transfer even though the transaction itself is successful and the gas isn't used completely. Like in this transfer of Huobi Tokens Is there a way to ...
0
votes
1answer
16 views

Coinbase to Bittrex deposit gone awry? Eth vanished despite being sent to correct address [on hold]

Can somebody help me figure this out? I sent ~1.258 Eth from Coinbase to my Bittrex wallet address a couple hours ago and, despite being confirmed and sent to the correct address, it seems to have ...
0
votes
1answer
24 views

How to access Struct field dynamically

I have a struct struct lineItem { string idNo; string date; string code; string docCode; string vendorNumber; string invoiceDate; string ...
0
votes
0answers
53 views
+50

Remix never returns a transaction - but everything works - why?

This code supposedly works. Its supposed to let the owner withdrawal collected ERC20 tokens in a contract. It calls the balanceOf() for the erc20, then calls transfer(). Only have this error when ...
0
votes
1answer
39 views

MetaMask - RPC Error: Internal JSON-RPC error

I am getting this error when i trying to use metamask on my local for a simple transaction from one account(say A) to another (say B). code: -32603 data: {originalError: {…}} message: "Internal ...
0
votes
1answer
30 views

Ethereum Smart contract calling a function in another smart contract that has a address payable return value give error

I am new to solidity. Anyway, I have written the following smart contract: pragma solidity >=0.4.22 <0.7.0; contract SP { address BlockAddress; bytes32 _Mhash; function ...
0
votes
1answer
21 views

How it manage private keys truffle?

I'm trying send tokens in mi custom contract which is deployed in ropsten. Also, I'm working with truffle and truffle-contract 1.1.11 library. My doubt is, how should I sign transactions inside the ...

15 30 50 per page